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.
- Added
name
property to anonymous functions. String.prototype.matchAll
is 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-classpath
option to allow loading files from the classpath viaclasspath:
pseudo URLs (disabled by default). Do not use with untrusted code.
- 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
global
global property by default, which has been superseded byglobalThis
; use optionjs.global-property
to reenable. - Disabled the non-standard
performance
global property by default except for thejs
launcher; use optionjs.performance
to reenable. - Disabled the non-standard
print
andprintErr
functions in Node.js; use optionjs.print
to 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.url
property.
- Added (experimental) option
js.locale
to set the default locale for locale-sensitive operations. - Allow making evaluated sources internal using the
sourceURL
directive 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-url
to allow loading from a URL. - provide
js.bigint
option to enable the BigInt proposal, available only in ECMAScript 2019 or later (enabled by default for those version, set tofalse
to disable).
- Removed non-standard
String.prototype.contains
; useincludes
instead. - ScriptEngine: security-relevant Context-options are now disabled by default.
- Migrated to Truffle Libraries for interop.
Polyglot
builtin enabled based onContext.Builder.allowPolyglotAccess()
.- Added object rest and spread properties support for foreign objects.
- Option
js.function-arguments-limit
to set an upper bound for function arguments and argument spreading (default: 65535). - Support for HTML-like comments added.
- Option
js.experimental-array-prototype
has been renamed tojs.experimental-foreign-object-prototype
. In addition to setting the prototype of array-like non-JS objects toArray.prototype
it sets the prototype of executable non-JS objects toFunction.prototype
and 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.Worker
API. Node.js Workers should be used instead. - Removed deprecated
NashornJavaInterop
mode. - Object.fromEntries proposal implemented.
- Implemented import() proposal.
- Updated Node.js to version 10.15.2.
- Added option
js.experimental-array-prototype
that sets prototype of array-like non-JS objects (likeProxyArray
or JavaList
) toArray.prototype
. It is possible to use functions likemap
orforEach
on these objects directly then. - Updated Node.js to version 10.15.0.
- Added mime type
application/javascript+module
for ES module sources. - Changed the option name for the non-standard
global
property tojs.global-property
.
- Graal.js only supports ECMAScript 5 (ES5) and newer, and enforces that rule.
- Added option
js.disable-eval
to enable eval() and similar methods of dynamic code evaluation (enabled by default, set tofalse
to disable). - Added option
js.disable-with
to enable the with statement (enabled by default, set tofalse
to 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_SCOPE
bindings. - Made
Bindings
created byScriptEngine#createBindings()
implementAutoCloseable
to allow closing the underlyingContext
. - Do not provide
Java
builtin object when Java interop is disabled. - Added option
js.print
to enable theprint
andprintErr
builtins (enabled by default, set tofalse
to disable). - Added option
js.load
to enable theload
andloadWithNewGlobal
builtins (enabled by default, set tofalse
to disable). - Added option
js.polyglot-builtin
to enable thePolyglot
builtins (enabled by default, set tofalse
to disable).
- Added support for
Array.prototype.{flat,flatMap}
, a Stage 3 proposal. Atomics.wake
available 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
, andreadline
by default, except for thejs
launcher (js.shell
option). - Disabled non-standard global functions
readFully
andreadLine
by default, now available only in Nashorn scripting mode (--js.scripting
). - Disabled Nashorn syntax extensions by default (
js.syntax-extensions
option), barringScriptEngine
. - Note: As a result,
eval
requires function expressions to be parenthesized, e.g.:eval("(function(){...})")
(noteval("function(){...}")
).
- Provide simplified implementations for methods of the global
console
object 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
RegExp
andIntl
. - Implement Truffle file virtualization for JavaScript.
- Support polyglot Truffle objects in
Array.prototype.map
et 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
NashornExtensions
option, use--js.nashorn-compat
instead. - 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.String
methods on string values, in Nashorn compatibility mode. - Provide
JavaImporter
class in Nashorn compatibility mode. - Provide
JSAdapter
class 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
Interop
builtin toPolyglot
.