aboutsummaryrefslogtreecommitdiff
path: root/test/js
Commit message (Collapse)AuthorAge
* Fixed frame saving for awaited function with closures.Dmitry Volyntsev2025-06-16
| | | | | | The issue was introduced in 6335367 (0.7.0). This fixes #530 issue on Github.
* Fixed resolving when Promise is inherited.Dmitry Volyntsev2024-11-08
| | | | | | | | | 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.
* Test262: fix import_global_ref_var.t.js.Dmitry Volyntsev2024-02-07
|
* Test262: simplified import_chain.t.js.Dmitry Volyntsev2024-02-07
| | | | Avoid using "crypto" module, which unnessesary complicates the test.
* Reverted changes introduced in 7eaaa7d57636 (not released) back.Dmitry Volyntsev2024-02-06
| | | | Relative importing is again supported.
* Change: imported modules are not resolved relative to current dir.Dmitry Volyntsev2024-01-23
| | | | | | | | | | | | | | | | | | 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.
* Shell: fixed unhandled rejected promises handling.Dmitry Volyntsev2024-01-23
| | | | The issue was introduced in dffdf7c50dfc (not released yet).
* Added support for export {name as default} statement.Vadim Zhestikov2023-03-20
| | | | This fixes #624 issue on Github.
* Refactored bound function calls according to the spec.Dmitry Volyntsev2022-10-10
| | | | This fixes #533, #546, #579 issues on Github.
* Fixed handling of unhandled promise rejection.Dmitry Volyntsev2022-09-27
| | | | | | | | | | | | | 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.
* Fixed njs_vmcode_interpreter() when await fails.Dmitry Volyntsev2022-06-02
| | | | | | | | | | | | | | 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.
* Fixed catching of the exception thrown from an awaited function.Dmitry Volyntsev2022-05-31
| | | | This closes #500 issue on Github.
* Fixed typo while calculating module path length.Dmitry Volyntsev2022-04-11
| | | | The issue was introduced in 77c398f26d7e (not released yet).
* Fixed frame allocation from an awaited frame.Dmitry Volyntsev2022-02-21
| | | | | | | | | | | | | | | | | | 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.
* Refactoring of user modules importing.Dmitry Volyntsev2022-02-21
| | | | | | | | | | | | 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.
* Tests: splitting large import tests into several simple ones.Dmitry Volyntsev2022-02-15
|
* Fixed backtraces while traversing imported user modules.Dmitry Volyntsev2022-02-14
| | | | | | | | | 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.
* Tests: refactored modules tests using test262 test suite.Dmitry Volyntsev2022-01-27
|
* Fixed recursive async function calls.Dmitry Volyntsev2022-01-21
| | | | | | | | | | | 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.
* Fixed type confusion bug while resolving promises.Dmitry Volyntsev2022-01-19
| | | | | | | | | | | | | | | 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.
* Fixed execution of async function in synchronous context.Dmitry Volyntsev2021-12-03
| | | | The bug was introduced in 92d10cd761e2 (0.7.0).
* Fixed catching of exception thrown in try block of async function.Dmitry Volyntsev2021-11-30
| | | | The bug was introduced in 92d10cd761e2 (0.7.0).
* Tests: making async/await test filenames shorter.Dmitry Volyntsev2021-11-29
|
* Tests: refactored JavaScript tests.Dmitry Volyntsev2021-11-29
| | | | | | A generic runner test/run is introduced. It runs all available tests in test/ directory. JavaScript files are expected to be compliant with Test262.
* Tests: refactored "fs" module tests.Dmitry Volyntsev2021-11-02
|
* Fixed unhandled promise rejection in handle events.Alexander Borisov2021-10-08
| | | | This closes #423 issue on GitHub.
* Fixed async ctx erasing when a function is called multiple times.Alexander Borisov2021-09-02
| | | | The bug was introduced in 92d10cd761e2.
* Fixed order of code execution after await in try block.Alexander Borisov2021-09-01
| | | | The bug was introduced in 92d10cd761e2.
* Introduced Async/Await implementation.Alexander Borisov2021-09-01
| | | | This closes #419 issue on GitHub.
* Added remaining Promise constructor methods.Alexander Borisov2021-08-11
| | | | | The following methods were added: Promise.all(), Promise.allSettled(), Promise.any(), Promise.race().
* Fixed resolve/reject callback for Promise.prototype.finally().Alexander Borisov2021-08-11
|
* Promise: tracking unhandled promise rejection.Alexander Borisov2020-11-03
| | | | | | | | 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.
* Promise: fixed the catch handler for Promise.prototype.finally().Alexander Borisov2020-11-03
| | | | | | | By spec, the catch handler for the .finally() should always return an exception. The issue was introduced in 61bf7a31e685.
* Adding support for Buffer objects in "fs" methods.Dmitry Volyntsev2020-09-28
| | | | | | | | | | 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.
* Improved fs.rmdir() to support recursive directory removal.Artem S. Povalyukhin2020-07-25
|
* Improved fs.mkdir() to support recursive directory creation.Artem S. Povalyukhin2020-07-15
|
* Added fs.Dirent, fs.readdir() and friends.Artem S. Povalyukhin2020-05-31
| | | | This closes #254 issue on Github.
* Added friends functions to fs.renameSync().Dmitry Volyntsev2020-05-26
|
* Added fs.mkdir(), fs.rmdir() and friends.Artem S. Povalyukhin2020-05-12
|
* Introduced fs.Error.code.Artem S. Povalyukhin2020-05-11
|
* Added fs.symlink(), fs.unlink(), fs.realpath() and friends.Artem S. Povalyukhin2020-02-11
|
* Introduced fs.access and friends.Artem S. Povalyukhin2020-01-26
|
* Introduced fs.promises API.Artem S. Povalyukhin2020-01-25
|
* Introduced the Promise object.Alexander Borisov2019-12-17
Implemented according to the specification without: Promise.all(), Promise.allSettled(), Promise.race(). This closes #39 issue on GitHub.