This changelog summarizes major changes between GraalVM versions of the GraalVM JavaScript (ECMAScript) language runtime. The main focus is on user-observable behavior of the engine.
- Implemented the Private Fields in
inproposal. It is available behind the experimental option--js.private-fields-in. - Implemented the JavaScript BigInt to WebAssembly i64 integration proposal. It can be disabled using the
--js.wasm-bigint=falseoption. - Updated Node.js to version 14.17.6.
- Implemented the Error Cause proposal. It is available behind the experimental option
--js.error-cause. - Implemented the Import Assertions proposal. It is available behind the experimental option
--js.import-assertions. - Added support for
collationoption ofIntl.Collator. - Added support for
dayPeriodandfractionalSecondDigitsoptions ofIntl.DateTimeFormat. - Changed foreign hash map access using
map[key]syntax to convert the key to a string or symbol. - Implemented
Object.hasOwn(Accessible Object.hasOwnProperty proposal). It is available in ECMAScript 2022 (--js.ecmascript-version=2022). - Implemented class static initialization blocks proposal. It is available in ECMAScript 2022 (
--js.ecmascript-version=2022). - Added experimental Polyglot
Contextoption--js.esm-eval-returns-exports. When enabled,eval()of an ES module will return a PolyglotValuecontaining the ES module exported namespace object. The option is disabled by default.
- Graal.js now prints a warning when runtime compilation is not supported. This warning can be disabled using the '--engine.WarnInterpreterOnly=false' option or the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property.
- Added the
js.unhandled-rejectionsoption to track unhandled promise rejections in a polyglotContext. By default, the option is set tonone, and unhandled promise rejections are not tracked. - Implemented the New Set Methods proposal. It is available behind an experimental flag (
--js.new-set-methods). - Implemented experimental operator overloading support. Use the experimental option
--js.operator-overloadingto enable it and consult the documentation. - Updated RegExp Match Indices proposal with opt-in using the
dflag. Available in ECMAScript 2022 (--js.ecmascript-version=2022). Deprecated--js.regexp-match-indicesoption. - Nashorn compatibility mode now defaults to compatiblity with ECMAScript version 5, unless another version is explicitly selected.
Date.prototypebuilt-ins use ICU (not JDK) algorithms and data (like timezone data) by now (in order to reduce inconsistencies betweenDateandIntl.DateTimeFormat).- Updated ICU4J library to version 69.1.
- Updated Node.js to version 14.16.1.
- Prototype of WebAssembly JavaScript Interface implemented. It is available behind the
--js.webassemblyflag. - Implemented iterator interop support, enabling foreign objects that have an iterator to be used where JS expects iterables, as well as JS iterables to be used in other languages and via the Value API.
- Adopted new buffer interop support, allowing foreign buffers to be used with typed arrays and
DataView, without copying. Likewise enablesArrayBufferto be used in other languages. - Experimental option
js.array-sort-inheritedwas removed. Values visible through holes in array(-like) object are always sorted according to the latest version of ECMAScript specification. - Updated ICU4J library to version 68.2.
- Implemented the Atomics.waitAsync proposal. It is available in ECMAScript 2022 mode (
--js.ecmascript-version=2022). - Implemented hash map interop support. Allows foreign hash maps to be iterated using
for in/ofloops,new Map(hash),Array.from(hash), etc. If the--js.foreign-hash-propertiesoption is enabled (default), foreign hash maps can also be accessed usinghash[key],hash.key, and used in{...hash}. If the--js.foreign-object-prototypeoption is enabled, foreign hash maps also haveMap.prototypemethods. - Moved GraalVM-Node.js to a separate installable component. In a GraalVM distribution it needs to be manually installed with
$GRAALVM/bin/gu install nodejs.
- ECMAScript 2021 mode/features enabled by default.
- Updated Node.js to version 12.20.1.
- Adopted new interop exception handling and made JS exceptions extend
AbstractTruffleException. - Implemented interop identity messages.
- Expose
Graal.versionECMAScriptinstead ofGraal.versionJS. - Implemented the relative indexing method proposal. It is available in ECMAScript 2022 mode (
--js.ecmascript-version=2022).
- Updated Node.js to version 12.18.4.
- Fixed field/getter/setter access order in nashorn-compat mode, see issue #343.
- ScriptEngine: Fixed "Multiple applicable overloads found" error in nashorn-compat mode, see issue #286.
- ScriptEngine: Enabled low precedence lossy number, string-to-boolean, and number-to-boolean conversions in nashorn-compat mode.
- Fixed
Java.extendto respectHostAccess.Builder.allowImplementations, see issue #294. - Added Java host interop support for mapping JS objects to abstract classes (if
HostAccessallows it). js.foreign-object-prototypeis a supported option to set JavaScript prototypes for foreign objects mimicing JavaScript types. It was renamed fromjs.experimental-foreign-object-prototype.- Changed
ToPrimitiveabstract operation to follow the specification for foreign objects.InteropLibrary.toDisplayStringis not used byToPrimitive/ToStringconversions anymore.
- Implemented the Intl.NumberFormat Unified API proposal.
- Implemented the Logical Assignment Operators proposal.
- Implemented the Top-level Await proposal.
- Implemented the Promise.any proposal. It is available in ECMAScript 2021 mode (
--js.ecmascript-version=2021). - Implemented support for async stack traces.
- Removed deprecation warning for flags previously passed via system properties.
- Updated Node.js to version 12.18.0.
- Updated ICU4J library to version 67.1
- Fixed
Date.toLocaleStringandIntl.DateTimeFormatto use the context's default time zone rather than the system default if no explicit time zone is requested. - Improved
js.timezoneoption to validate the time zone ID and support zone offsets like "-07:00". - Changed the
===operator to treat foreign null values the same as JSnulland useInteropLibrary.isIdenticalfor foreign objects. - Unified JSON parsing, providing more compatible error messages.
- ECMAScript 2020 mode/features enabled by default.
- Implemented the Intl.DateTimeFormat dateStyle & timeStyle proposal.
- Implemented the Intl.DisplayNames proposal.
- Implemented the Intl.Locale proposal.
- Implemented support for
export * as ns from "mod". It is available in ECMAScript 2020 or later. - Implemented support for optional chaining (
a?.b,a?.[b],a?.()). It is available in ECMAScript 2020 or later. - Implemented Nashorn extension
Object.bindProperties(). It is available in Nashorn compatibility mode (--js.nashorn-compat). - Changed
Polyglot.eval[File]to propagate syntax errors from the source language. - Changed
Polyglot.importto returnundefinedfor missing polyglot bindings. - Added
npx(annpmpackage runner) into GraalVM. - Implemented the RegExp Match Indices proposal. It is available behind the
--js.regexp-match-indicesflag. - Removed the JOni RegExp-engine and the "use-tregex" option.
- Implemented support for private class methods; available behind the
--js.ecmascript-version=2021flag. - Implemented the FinalizationRegistry proposal. It is available behind the
--js.ecmascript-version=2021flag. - Enabled the Hashbang Grammar proposal, by enabling the
--js.shebangoption by default in ECMAScript 2020 or later. - Updated ICU4J library to version 66.1.
- Moved
String.prototype.replaceAllto ECMAScript version 2021 (--js.ecmascript-version=2021). - Removed SIMD.js implementation.
- Implemented support for public and private class fields, both instance and static (based on the class fields and static class features proposals). This feature is available by default in Node.js and can be enabled using the experimental option
js.class-fields. - Added option
js.global-arguments(default: true) for the non-standardargumentsglobal property (disabled in Node.js). - Updated Node.js to version 12.15.0.
- Added
nameproperty to anonymous functions. String.prototype.matchAllis available in ECMAScript 2020 mode (--js.ecmascript-version=2020) only.- Implemented the String.prototype.replaceAll proposal. It is available in ECMAScript 2020 mode (
--js.ecmascript-version=2020). - Added
js.load-from-classpathoption to allow loading files from the classpath viaclasspath:pseudo URLs (disabled by default). Do not use with untrusted code. - Added option
js.bind-member-functionsfor the implicit binding of unbound functions returned by Value.getMember to the receiver. The preferred way of calling members is using Value.invokeMember. - Added option
js.commonjs-requireto load Npm-compatible CommonJS modules from plain JavaScript. This is an experimental feature. See NodeJSVSJavaScriptContext.md for details.
- Implemented the Promise.allSettled proposal. It is available in ECMAScript 2020 mode (
--js.ecmascript-version=2020). - Implemented the nullish coalescing proposal. It is available in ECMAScript 2020 mode (
--js.ecmascript-version=2020). - Updated ICU4J library to version 64.2.
- Updated ASM library to version 7.1.
- Updated Node.js to version 12.10.0.
- Disabled the non-standard
globalglobal property by default, which has been superseded byglobalThis; use optionjs.global-propertyto reenable. - Disabled the non-standard
performanceglobal property by default except for thejslauncher; use optionjs.performanceto reenable. - Disabled the non-standard
printandprintErrfunctions in Node.js; use optionjs.printto reenable.
- Added support for date and time interop.
- Added support for setting the time zone via
Context.Builder.timeZone. - Implemented Numeric separators proposal. It is available in ECMAScript 2020 mode (
--js.ecmascript-version=2020). - Moved ICU data previously distributed as separate files into the native image.
- Added
import.meta.urlproperty.
- Added (experimental) option
js.localeto set the default locale for locale-sensitive operations. - Allow making evaluated sources internal using the
sourceURLdirective by prefixing the URL withinternal:, e.g.//# sourceURL=internal:myname.js. - Object.getOwnPropertyDescriptor(s) supported for non-JavaScript objects as well.
- Enabled code sharing across threads using
ContextPolicy.SHARED.
- Various bugfixes for compilation problems.
- provide
js.load-from-urlto allow loading from a URL. - provide
js.bigintoption to enable the BigInt proposal, available only in ECMAScript 2019 or later (enabled by default for those version, set tofalseto disable).
- Removed non-standard
String.prototype.contains; useincludesinstead. - ScriptEngine: security-relevant Context-options are now disabled by default.
- Migrated to Truffle Libraries for interop.
Polyglotbuiltin enabled based onContext.Builder.allowPolyglotAccess().- Added object rest and spread properties support for foreign objects.
- Option
js.function-arguments-limitto set an upper bound for function arguments and argument spreading (default: 65535). - Support for HTML-like comments added.
- Option
js.experimental-array-prototypehas been renamed tojs.experimental-foreign-object-prototype. In addition to setting the prototype of array-like non-JS objects toArray.prototypeit sets the prototype of executable non-JS objects toFunction.prototypeand the prototype of all other non-JS objects toObject.prototype. --jvm.*and--native.*command line options are deprecated and replaced by--vm.*options- Implemented JSON superset proposal.
- Made Java interop available in native images. Note that you have to configure the accessible classes and methods at native image build time (see reflection configuration).
- Removed deprecated experimental
Java.WorkerAPI. Node.js Workers should be used instead. - Removed deprecated
NashornJavaInteropmode. - Object.fromEntries proposal implemented.
- Implemented import() proposal.
- Updated Node.js to version 10.15.2.
- Added option
js.experimental-array-prototypethat sets prototype of array-like non-JS objects (likeProxyArrayor JavaList) toArray.prototype. It is possible to use functions likemaporforEachon these objects directly then. - Updated Node.js to version 10.15.0.
- Added mime type
application/javascript+modulefor ES module sources. - Changed the option name for the non-standard
globalproperty tojs.global-property.
- Graal.js only supports ECMAScript 5 (ES5) and newer, and enforces that rule.
- Added option
js.disable-evalto enable eval() and similar methods of dynamic code evaluation (enabled by default, set tofalseto disable). - Added option
js.disable-withto enable the with statement (enabled by default, set tofalseto disable). - Instrumentation: Extended inline parsing to support statements.
- Added support for sharing Java objects using the experimental Node.js Worker Threads API.
- Added support for ScriptEngine
GLOBAL_SCOPEbindings. - Made
Bindingscreated byScriptEngine#createBindings()implementAutoCloseableto allow closing the underlyingContext. - Do not provide
Javabuiltin object when Java interop is disabled. - Added option
js.printto enable theprintandprintErrbuiltins (enabled by default, set tofalseto disable). - Added option
js.loadto enable theloadandloadWithNewGlobalbuiltins (enabled by default, set tofalseto disable). - Added option
js.polyglot-builtinto enable thePolyglotbuiltins (enabled by default, set tofalseto disable).
- Added support for
Array.prototype.{flat,flatMap}, a Stage 3 proposal. Atomics.wakeavailable under its new name (Atomics.notify) as well.- Well-formed JSON.stringify proposal implemented.
- globalThis proposal implemented.
- Added
Java.addToClasspath(path)for adding jar files and directories to the host classpath dynamically. - Disabled non-standard global functions
quit,read,readbuffer, andreadlineby default, except for thejslauncher (js.shelloption). - Disabled non-standard global functions
readFullyandreadLineby default, now available only in Nashorn scripting mode (--js.scripting). - Disabled Nashorn syntax extensions by default (
js.syntax-extensionsoption), barringScriptEngine. - Note: As a result,
evalrequires function expressions to be parenthesized, e.g.:eval("(function(){...})")(noteval("function(){...}")).
- Provide simplified implementations for methods of the global
consoleobject even outside Node.js mode. - Updated Node.js to version 10.9.0.
- Fix: Can construct
Proxy(JavaType)and correctly reports as typefunction. Github #60.
- Improved support for sharing of shapes between Contexts with the same Engine.
- Provide support for BigInteger TypedArrays, cf. ECMAScript BigInt proposal.
- Extended instrumentation support to more types of interpreter nodes.
- Serialization API of v8/Node.js implemented.
- Update version of Unicode to 11 in
RegExpandIntl. - Implement Truffle file virtualization for JavaScript.
- Support polyglot Truffle objects in
Array.prototype.mapet al andArray.prototype.sort. - Support for fuzzy time in
performance.now()andDate.
- Add support for
Symbol.prototype.description, a Stage 3 proposal. - Add support for
String.prototype.matchAll, a Stage 3 proposal. - Implement optional catch binding proposal, targeted for ES2019.
- Removed legacy
NashornExtensionsoption, use--js.nashorn-compatinstead. - Provide Java package globals by default.
- Added stack trace limit option (--js.stack-trace-limit).
- Enable SharedArrayBuffers by default.
- Provide $EXEC for Nashorn compatibility in scripting mode.
- Provide Java.isScriptFunction, Java.isScriptObject, Java.isJavaMethod, and Java.isJavaFunction in Nashorn compatibility mode.
- Provide support to access getters and setters like a field, in Nashorn compatibility mode.
- Provide top-level package globals in Nashorn compatibility mode:
java,javafx,javax,com,org,edu. - Provide Java.extend, Java.super, and
new Interface|AbstractClass(fn|obj)in Nashorn compatibility mode. - Provide
java.lang.Stringmethods on string values, in Nashorn compatibility mode. - Provide
JavaImporterclass in Nashorn compatibility mode. - Provide
JSAdapterclass only in Nashorn compatibility mode.
- Added support for BigInt arithmetic expressions.
- Provide a flag for a Nashorn compatibility mode (--js.nashorn-compat).
- Rename flag for V8 compatibility mode (to --js.v8-compat).
- Enabled code sharing between Contexts with the same Engine.
- Updated Node.js to version 8.11.1.
- LICENSE set to The Universal Permissive License (UPL), Version 1.0.
- Added object rest/spread support.
- Added support for async generators.
- Unified Polyglot primitives across all Truffle languages; e.g., rename
Interopbuiltin toPolyglot.