Skip to content

Commit 69fc7bb

Browse files
wirthielkorchi
authored andcommitted
[GR-63339] Backport to 24.2: Make option js.text-encoding stable and allowed in SandboxPolicy.CONSTRAINED.
PullRequest: js/3465
2 parents 3eaed56 + 10a8b04 commit 69fc7bb

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ The main focus is on user-observable behavior of the engine.
55
Changelog may include unreleased versions.
66
See [release calendar](https://www.graalvm.org/release-calendar/) for release dates.
77

8+
## Version 24.2.1
9+
* Made option `js.text-encoding` stable and allowed in `SandboxPolicy.CONSTRAINED`.
10+
811
## Version 24.2.0
912
* Updated Node.js to version 22.13.1.
1013
* Implemented the [`Error.isError`](https://github.com/tc39/proposal-is-error) proposal. It is available in ECMAScript staging mode (`--js.ecmascript-version=staging`).

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

Lines changed: 4 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 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
@@ -722,7 +722,7 @@ public String apply(String name) {
722722
@CompilationFinal private short frequencyBasedPropertyCacheLimit;
723723

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

0 commit comments

Comments
 (0)