| Commit message (Collapse) | Author | Age |
|
|
|
|
|
| |
The issue was introduced in 6335367 (0.7.0).
This fixes #530 issue on Github.
|
|
|
|
|
|
|
|
|
| |
Previously, njs_promise_resolve() might return njs_object_t instead of
njs_promise_t. Later an instance of njs_object_t was put into a
NJS_PROMISE value. Whereas njs_promise_t is always expected to be inside
of a NJS_PROMISE value.
This closes #813 issue on Github.
|
| |
|
|
|
|
| |
Avoid using "crypto" module, which unnessesary complicates the test.
|
|
|
|
| |
Relative importing is again supported.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, when a module was imported with a relative path
it was looked for first in the directory of the importing context
(global, or a module).
For example when:
main.js:
import libs/lib1.js;
libs/lib1.js:
import lib2.js;
lib2.js was looked for first in libs/.
Now, it is only looked for in directories speficied with js_path
and a directory of nginx configuration file.
|
|
|
|
| |
The issue was introduced in dffdf7c50dfc (not released yet).
|
|
|
|
| |
This fixes #624 issue on Github.
|
|
|
|
| |
This fixes #533, #546, #579 issues on Github.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, a direct pointer to the first element of an array of
rejected promise values was used to convert that element to a string.
This is not correct because that pointer may become invalid if rejected
promise values array is resized between invocation of "toString" and
"valueOf" methods which are called while converting the element to a
string.
The fix is to ensure that the rejected promise value is never changed.
This closes #580 issue on Github.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, while interpreting a user function, njs_vmcode_interpreter()
might return prematurely when an error happens in await instruction.
This is not correct because the current frame has to be unwound (or
exception caught) first.
The fix is to exit through only 5 appropriate exit points to ensure
proper unwinding.
The patch correctly fixes issue reported in 07ef6c1f04f1 (0.7.3).
This closes #506 issue on Github.
|
|
|
|
| |
This closes #500 issue on Github.
|
|
|
|
| |
The issue was introduced in 77c398f26d7e (not released yet).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
njs_function_frame_save() is used to save the awaited frame when "await"
instruction is encountered. The saving was done as a memcpy() of
existing runtime frame.
njs_function_frame_alloc() is used to alloc a new function frame, this
function tries to use a spare preallocated memory from the previous
frame first. Previously, this function might result in "use-after-free"
when invoked from a restored frame saved with njs_function_frame_save().
Because njs_function_frame_save() left pointers to the spare memory of
the original frame which may be already free when saved frame is
restored.
The fix is to erase fields for the spare memory from the saved frame.
This closes #469 issue on Github.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, user modules were compiled as as anonymous functions in a
global scope. This is incorrect, because modules should be compiled
in their own scope.
In addition, this patch introduces HostResolveImportedModule support.
When vm->options.ops->module_loader is provided, a module lookup
and compilation is delegated to this callback.
This closes #443 issue on Github.
|
| |
|
|
|
|
|
|
|
|
|
| |
Previously, njs_builtin_match_native_function(), which is used to build a
backtrace for an exception, assumed that user modules always return
object values, which is not the case. As a result, njs_object_traverse()
may receive incorrect pointer.
This fix is to only traverse object values.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, PromiseCapability record was stored (function->context)
directly in function object during a function invocation. This is
not correct, because PromiseCapability record should be linked to
current execution context. As a result, function->context is
overwritten with consecutive recursive calls which results in
use-after-free.
This closes #451 issue on Github.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, the internal function njs_promise_perform_then() which
implements PerformPromiseThen() expects its first argument to always be
a promise instance. This assertion might be invalid because the
functions corresponding to Promise.prototype.then() and
Promise.resolve() incorrectly verified their arguments.
Specifically, the functions recognized their first argument as promise
if it was an object which was an Promise or had Promise object in its
prototype chain. The later condition is not correct because internal
slots are not inherited according to the spec.
This closes #447 issue in Github.
|
|
|
|
| |
The bug was introduced in 92d10cd761e2 (0.7.0).
|
|
|
|
| |
The bug was introduced in 92d10cd761e2 (0.7.0).
|
| |
|
|
|
|
|
|
| |
A generic runner test/run is introduced. It runs all available tests
in test/ directory. JavaScript files are expected to be compliant with
Test262.
|
| |
|
|
|
|
| |
This closes #423 issue on GitHub.
|
|
|
|
| |
The bug was introduced in 92d10cd761e2.
|
|
|
|
| |
The bug was introduced in 92d10cd761e2.
|
|
|
|
| |
This closes #419 issue on GitHub.
|
|
|
|
|
| |
The following methods were added: Promise.all(), Promise.allSettled(),
Promise.any(), Promise.race().
|
| |
|
|
|
|
|
|
|
|
| |
By default, promises should finish processing normally for .then(),
.catch(), .finally() and so on. The patch adds the ability to report
unhandled exception from promises to the user.
This closes #346 issue on GitHub.
|
|
|
|
|
|
|
| |
By spec, the catch handler for the .finally() should always return an
exception.
The issue was introduced in 61bf7a31e685.
|
|
|
|
|
|
|
|
|
|
| |
fs.writeFile(), fs.appendFile() and friends may accept an instance of
Buffer as an argument.
Also, fs.readFile() and friends now return an instance of Buffer instead of
Byte-string when encoding is not provided.
Added Buffer encoding for fs.readdir(), fs.realpath() and friends.
|
| |
|
| |
|
|
|
|
| |
This closes #254 issue on Github.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
Implemented according to the specification without: Promise.all(),
Promise.allSettled(), Promise.race().
This closes #39 issue on GitHub.
|