Skip to content

Commit a074ec3

Browse files
committed
Make option js.text-encoding stable and allowed in SandboxPolicy.CONSTRAINED.
1 parent 0450e48 commit a074ec3

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

graal-js/src/com.oracle.truffle.js.test/src/com/oracle/truffle/js/test/polyglot/SandboxPolicyOptionsTest.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -89,7 +89,9 @@ public static Collection<Object[]> parameters() {
8989
new Option(JSContextOptions.ALLOW_EVAL_NAME, "true", SandboxPolicy.CONSTRAINED),
9090
new Option(JSContextOptions.ALLOW_EVAL_NAME, "false", SandboxPolicy.CONSTRAINED),
9191
new Option(JSContextOptions.UNHANDLED_REJECTIONS_NAME, "none", SandboxPolicy.CONSTRAINED),
92-
new Option(JSContextOptions.UNHANDLED_REJECTIONS_NAME, "throw", SandboxPolicy.CONSTRAINED));
92+
new Option(JSContextOptions.UNHANDLED_REJECTIONS_NAME, "throw", SandboxPolicy.CONSTRAINED),
93+
new Option(JSContextOptions.TEXT_ENCODING_NAME, "true", SandboxPolicy.CONSTRAINED),
94+
new Option(JSContextOptions.TEXT_ENCODING_NAME, "false", SandboxPolicy.CONSTRAINED));
9395
return policies.stream().flatMap(p -> options.stream().map(o -> new Object[]{p, o})).toList();
9496
}
9597

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ public String apply(String name) {
721721
@CompilationFinal private short frequencyBasedPropertyCacheLimit;
722722

723723
public static final String TEXT_ENCODING_NAME = JS_OPTION_PREFIX + "text-encoding";
724-
@Option(name = TEXT_ENCODING_NAME, category = OptionCategory.EXPERT, help = "Enable TextDecoder and TextEncoder Web APIs.") //
724+
@Option(name = TEXT_ENCODING_NAME, category = OptionCategory.USER, stability = OptionStability.STABLE, sandbox = SandboxPolicy.CONSTRAINED, help = "Enable TextDecoder and TextEncoder Web APIs.") //
725725
public static final OptionKey<Boolean> TEXT_ENCODING = new OptionKey<>(false);
726726
@CompilationFinal private boolean textEncoding;
727727

0 commit comments

Comments
 (0)