Skip to content

Commit 7f4bbb6

Browse files
committed
enable foreign-object-prototype by default, remove deprecated experimental option
1 parent fa1737a commit 7f4bbb6

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ See [version roadmap](https://www.graalvm.org/release-notes/version-roadmap/) fo
77

88
## Version 22.2.0
99
* GraalVM JavaScript is now an installable component of GraalVM. It can be installed with `gu install js`.
10+
* Enabled option `js.foreign-object-prototype` by default. Polyglot Interop objects now get a fitting JavaScript prototype assigned unless explicitly turned off using this flag.
11+
* Removed deprecated experimental option `experimental-foreign-object-prototype`.
1012
* Removed experimental option `commonjs-global-properties`. The same functionality can be achieved in user code with a direct call to `require()` after context creation.
1113
* Added an experimental option `--js.zone-rules-based-time-zones` that allows to use timezone-related data from `ZoneRulesProvider` (instead of ICU4J data files).
1214
* Temporal objects can be converted to compatible Java objects when possible, using the `Value` API's methods like `asDate()`.

graal-js/src/com.oracle.truffle.js/src/com/oracle/truffle/js/runtime/JSContextOptions.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -382,13 +382,9 @@ public Map<String, String> apply(String value) {
382382

383383
public static final String FOREIGN_OBJECT_PROTOTYPE_NAME = JS_OPTION_PREFIX + "foreign-object-prototype";
384384
@Option(name = FOREIGN_OBJECT_PROTOTYPE_NAME, category = OptionCategory.EXPERT, stability = OptionStability.STABLE, help = "Non-JS objects have prototype (Object/Function/Array.prototype) set.") //
385-
public static final OptionKey<Boolean> FOREIGN_OBJECT_PROTOTYPE = new OptionKey<>(false);
385+
public static final OptionKey<Boolean> FOREIGN_OBJECT_PROTOTYPE = new OptionKey<>(true);
386386
@CompilationFinal private boolean hasForeignObjectPrototype;
387387

388-
public static final String EXPERIMENTAL_FOREIGN_OBJECT_PROTOTYPE_NAME = JS_OPTION_PREFIX + "experimental-foreign-object-prototype";
389-
@Option(name = EXPERIMENTAL_FOREIGN_OBJECT_PROTOTYPE_NAME, category = OptionCategory.EXPERT, deprecated = true, help = "Non-JS objects have prototype (Object/Function/Array.prototype) set; deprecated old name.") //
390-
protected static final OptionKey<Boolean> EXPERIMENTAL_FOREIGN_OBJECT_PROTOTYPE = new OptionKey<>(false);
391-
392388
public static final String FOREIGN_HASH_PROPERTIES_NAME = JS_OPTION_PREFIX + "foreign-hash-properties";
393389
@Option(name = FOREIGN_HASH_PROPERTIES_NAME, category = OptionCategory.EXPERT, help = "Allow getting/setting non-JS hash entries using the `[]` and `.` operators.") //
394390
public static final OptionKey<Boolean> FOREIGN_HASH_PROPERTIES = new OptionKey<>(true);
@@ -685,7 +681,7 @@ private void cacheOptions() {
685681
this.regexStepExecution = readBooleanOption(REGEX_STEP_EXECUTION);
686682
this.regexAlwaysEager = readBooleanOption(REGEX_ALWAYS_EAGER);
687683
this.scriptEngineGlobalScopeImport = readBooleanOption(SCRIPT_ENGINE_GLOBAL_SCOPE_IMPORT);
688-
this.hasForeignObjectPrototype = readBooleanOption(FOREIGN_OBJECT_PROTOTYPE) || readBooleanOption(EXPERIMENTAL_FOREIGN_OBJECT_PROTOTYPE);
684+
this.hasForeignObjectPrototype = readBooleanOption(FOREIGN_OBJECT_PROTOTYPE);
689685
this.hasForeignHashProperties = readBooleanOption(FOREIGN_HASH_PROPERTIES);
690686
this.functionArgumentsLimit = readLongOption(FUNCTION_ARGUMENTS_LIMIT);
691687
this.test262Mode = readBooleanOption(TEST262_MODE);

0 commit comments

Comments
 (0)