Skip to content

Commit c958028

Browse files
committed
make js.foreign-object-prototype a stable option
1 parent cc0b43d commit c958028

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,11 +370,15 @@ public Map<String, String> apply(String value) {
370370
public static final OptionKey<Boolean> SCRIPT_ENGINE_GLOBAL_SCOPE_IMPORT = new OptionKey<>(false);
371371
@CompilationFinal private boolean scriptEngineGlobalScopeImport;
372372

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

378+
public static final String EXPERIMENTAL_FOREIGN_OBJECT_PROTOTYPE_NAME = JS_OPTION_PREFIX + "experimental-foreign-object-prototype";
379+
@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.") //
380+
protected static final OptionKey<Boolean> EXPERIMENTAL_FOREIGN_OBJECT_PROTOTYPE = new OptionKey<>(false);
381+
378382
// limit originally from TestV8 regress-1122.js, regress-605470.js
379383
public static final String FUNCTION_ARGUMENTS_LIMIT_NAME = JS_OPTION_PREFIX + "function-arguments-limit";
380384
@Option(name = FUNCTION_ARGUMENTS_LIMIT_NAME, category = OptionCategory.EXPERT, help = "Maximum number of arguments for functions.") //
@@ -542,7 +546,7 @@ private void cacheOptions() {
542546
this.regexStepExecution = readBooleanOption(REGEX_STEP_EXECUTION);
543547
this.regexAlwaysEager = readBooleanOption(REGEX_ALWAYS_EAGER);
544548
this.scriptEngineGlobalScopeImport = readBooleanOption(SCRIPT_ENGINE_GLOBAL_SCOPE_IMPORT);
545-
this.hasForeignObjectPrototype = readBooleanOption(FOREIGN_OBJECT_PROTOTYPE);
549+
this.hasForeignObjectPrototype = readBooleanOption(FOREIGN_OBJECT_PROTOTYPE) || readBooleanOption(EXPERIMENTAL_FOREIGN_OBJECT_PROTOTYPE);
546550
this.functionArgumentsLimit = readLongOption(FUNCTION_ARGUMENTS_LIMIT);
547551
this.test262Mode = readBooleanOption(TEST262_MODE);
548552
this.testV8Mode = readBooleanOption(TESTV8_MODE);

0 commit comments

Comments
 (0)