Skip to content

Commit 02c5d72

Browse files
iamstoliswoess
authored andcommitted
[GR-54509] Enabling ECMAScript 2024 features by default.
PullRequest: js/3163
2 parents 975df75 + a1e6d45 commit 02c5d72

File tree

11 files changed

+20
-164
lines changed

11 files changed

+20
-164
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ Changelog may include unreleased versions.
66
See [release calendar](https://www.graalvm.org/release-calendar/) for release dates.
77

88
## Version 24.1.0
9+
* ECMAScript 2024 mode/features enabled by default.
910
* Implemented the [Make eval-introduced global vars redeclarable](https://github.com/tc39/proposal-redeclarable-global-eval-vars) proposal.
1011
* Implemented the [Float16Array](https://github.com/tc39/proposal-float16array) proposal. It is available in ECMAScript staging mode (`--js.ecmascript-version=staging`).
1112
* Implemented the [Array.fromAsync](https://github.com/tc39/proposal-array-from-async) proposal. It is available in ECMAScript staging mode (`--js.ecmascript-version=staging`).
12-
* Implemented the [Resizable and Growable ArrayBuffers](https://github.com/tc39/proposal-resizablearraybuffer) proposal. It is available in ECMAScript staging mode (`--js.ecmascript-version=staging`).
13+
* Implemented the [Resizable and Growable ArrayBuffers](https://github.com/tc39/proposal-resizablearraybuffer) proposal.
1314
* Updated Node.js to version 20.13.1.
1415

1516
## Version 24.0.0

graal-js/src/com.oracle.truffle.js.test.external/src/com/oracle/truffle/js/test/external/test262/Test262Runnable.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -270,19 +270,12 @@ public class Test262Runnable extends TestRunnable {
270270
});
271271
private static final Set<String> STAGING_FEATURES = featureSet(new String[]{
272272
"Array.fromAsync",
273-
"Atomics.waitAsync",
274273
"FinalizationRegistry.prototype.cleanupSome",
275274
"Float16Array",
276275
"Intl.Locale-info",
277276
"ShadowRealm",
278-
"String.prototype.isWellFormed",
279-
"String.prototype.toWellFormed",
280-
"array-grouping",
281-
"arraybuffer-transfer",
282277
"decorators",
283278
"json-parse-with-source",
284-
"promise-with-resolvers",
285-
"resizable-arraybuffer",
286279
});
287280

288281
public Test262Runnable(TestSuite suite, TestFile testFile) {

graal-js/src/com.oracle.truffle.js.test.external/src/com/oracle/truffle/js/test/external/testv8/TestV8Runnable.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,10 @@ public class TestV8Runnable extends TestRunnable {
9999
private static final Set<String> STAGING_FLAGS = featureSet(new String[]{
100100
"--harmony",
101101
"--harmony-array-from-async",
102-
"--harmony-array-grouping",
103102
"--harmony-intl-locale-info-func",
104103
"--harmony-json-parse-with-source",
105-
"--harmony-rab-gsab",
106104
"--harmony-shadow-realm",
107105
"--harmony-weak-refs-with-cleanup-some",
108-
"--js-promise-withresolvers",
109106
});
110107

111108
private static final String FLAGS_PREFIX = "// Flags: ";

graal-js/src/com.oracle.truffle.js/src/com/oracle/truffle/js/builtins/MapFunctionBuiltins.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2023, 2024, 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
@@ -85,7 +85,7 @@ public int getLength() {
8585
@Override
8686
public int getECMAScriptVersion() {
8787
if (this == groupBy) {
88-
return JSConfig.StagingECMAScriptVersion;
88+
return JSConfig.ECMAScript2024;
8989
}
9090
return BuiltinEnum.super.getECMAScriptVersion();
9191
}

graal-js/src/com.oracle.truffle.js/src/com/oracle/truffle/js/builtins/ObjectFunctionBuiltins.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public int getECMAScriptVersion() {
214214
case getOwnPropertyDescriptors, values, entries -> JSConfig.ECMAScript2017;
215215
case fromEntries -> JSConfig.ECMAScript2019;
216216
case hasOwn -> JSConfig.ECMAScript2022;
217-
case groupBy -> JSConfig.StagingECMAScriptVersion;
217+
case groupBy -> JSConfig.ECMAScript2024;
218218
default -> BuiltinEnum.super.getECMAScriptVersion();
219219
};
220220
}

graal-js/src/com.oracle.truffle.js/src/com/oracle/truffle/js/builtins/PromiseFunctionBuiltins.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public int getECMAScriptVersion() {
118118
return switch (this) {
119119
case any -> JSConfig.ECMAScript2021;
120120
case allSettled -> JSConfig.ECMAScript2020;
121-
case withResolvers -> JSConfig.StagingECMAScriptVersion;
121+
case withResolvers -> JSConfig.ECMAScript2024;
122122
default -> JSConfig.ECMAScript2015;
123123
};
124124
}

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,10 @@ public final class JSConfig {
7878
public static final int ECMAScript2022 = 13;
7979
public static final int ECMAScript2023 = 14;
8080
public static final int ECMAScript2024 = 15;
81+
public static final int ECMAScript2025 = 16;
8182
public static final int ECMAScriptVersionYearDelta = 2009; // ES6==ES2015
82-
public static final int LatestECMAScriptVersion = ECMAScript2023;
83-
public static final int StagingECMAScriptVersion = ECMAScript2024;
83+
public static final int LatestECMAScriptVersion = ECMAScript2024;
84+
public static final int StagingECMAScriptVersion = ECMAScript2025;
8485
/** Enable Annex B "Additional ECMAScript Features for Web Browsers". */
8586
public static final boolean AnnexB = true;
8687

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,6 @@ private Strings() {
476476
public static final TruffleString UNKNOWN_FILENAME = constant("<unknown>");
477477
public static final TruffleString DYNAMIC_FUNCTION_NAME = constant("anonymous");
478478
public static final TruffleString ASYNC = constant("async");
479-
public static final TruffleString GROUP = constant("group");
480-
public static final TruffleString GROUP_TO_MAP = constant("groupToMap");
481479
public static final TruffleString UC_M = constant("M");
482480
public static final TruffleString UC_M0 = constant("M0");
483481
public static final TruffleString UC_Z = constant("Z");

graal-js/src/com.oracle.truffle.js/src/com/oracle/truffle/js/runtime/builtins/JSArray.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,10 +246,6 @@ private static List<TruffleString> unscopableNameList(JSContext context) {
246246
names.add(Strings.FLAT);
247247
names.add(Strings.FLAT_MAP);
248248
}
249-
if (context.getEcmaScriptVersion() >= JSConfig.StagingECMAScriptVersion) {
250-
names.add(Strings.GROUP);
251-
names.add(Strings.GROUP_TO_MAP);
252-
}
253249
if (context.getEcmaScriptVersion() >= JSConfig.ECMAScript2016) {
254250
names.add(Strings.INCLUDES);
255251
}

graal-js/test/testV8.json

Lines changed: 11 additions & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -413,12 +413,6 @@
413413
"filePath" : "mjsunit/compiler/regress-crbug-1486048.js",
414414
"status" : "FAIL",
415415
"comment" : "new failures 2023-10-09"
416-
}, {
417-
"filePath" : "mjsunit/compiler/regress-crbug-1486342.js",
418-
"ecmaVersion" : {
419-
"minVersion" : 15
420-
},
421-
"status" : "PASS"
422416
}, {
423417
"filePath" : "mjsunit/compiler/string-add-try-catch.js",
424418
"status" : "PASS",
@@ -570,7 +564,7 @@
570564
}, {
571565
"filePath" : "mjsunit/es6/proxies-json.js",
572566
"ecmaVersion" : {
573-
"minVersion" : 15
567+
"minVersion" : 16
574568
},
575569
"status" : "PASS",
576570
"comment" : "Unflagged usage of JSON parse with source"
@@ -674,95 +668,36 @@
674668
"comment" : "TODO: evaluate (V8 tests update 2017-07-07)"
675669
}, {
676670
"filePath" : "mjsunit/harmony/atomics-waitasync-1thread-2timeout.js",
677-
"ecmaVersion" : {
678-
"minVersion" : 15
679-
},
680671
"status" : "FAIL",
681-
"comment" : "Uses Atomics.waitAsync and Worker"
672+
"comment" : "Uses Worker"
682673
}, {
683674
"filePath" : "mjsunit/harmony/atomics-waitasync-1thread-buffer-out-of-scope-timeout.js",
684-
"ecmaVersion" : {
685-
"minVersion" : 15
686-
},
687675
"status" : "FAIL",
688-
"comment" : "Uses Atomics.waitAsync and Worker"
689-
}, {
690-
"filePath" : "mjsunit/harmony/atomics-waitasync-1thread-promise-out-of-scope.js",
691-
"ecmaVersion" : {
692-
"minVersion" : 15
693-
},
694-
"status" : "PASS",
695-
"comment" : "Uses Atomics.waitAsync"
676+
"comment" : "Uses Worker"
696677
}, {
697678
"filePath" : "mjsunit/harmony/atomics-waitasync-1thread-timeout.js",
698-
"ecmaVersion" : {
699-
"minVersion" : 15
700-
},
701679
"status" : "FAIL",
702-
"comment" : "Uses Atomics.waitAsync and Worker"
680+
"comment" : "Uses Worker"
703681
}, {
704682
"filePath" : "mjsunit/harmony/atomics-waitasync-1thread-timeouts-and-no-timeouts.js",
705-
"ecmaVersion" : {
706-
"minVersion" : 15
707-
},
708683
"status" : "FAIL",
709-
"comment" : "Uses Atomics.waitAsync and Worker"
710-
}, {
711-
"filePath" : "mjsunit/harmony/atomics-waitasync-1thread-wake-up-all.js",
712-
"ecmaVersion" : {
713-
"minVersion" : 15
714-
},
715-
"status" : "PASS",
716-
"comment" : "Uses Atomics.waitAsync"
717-
}, {
718-
"filePath" : "mjsunit/harmony/atomics-waitasync-1thread-wake-up-fifo.js",
719-
"ecmaVersion" : {
720-
"minVersion" : 15
721-
},
722-
"status" : "PASS",
723-
"comment" : "Uses Atomics.waitAsync"
724-
}, {
725-
"filePath" : "mjsunit/harmony/atomics-waitasync-1thread-wake-up-simple.js",
726-
"ecmaVersion" : {
727-
"minVersion" : 15
728-
},
729-
"status" : "PASS",
730-
"comment" : "Uses Atomics.waitAsync"
684+
"comment" : "Uses Worker"
731685
}, {
732686
"filePath" : "mjsunit/harmony/atomics-waitasync-worker-shutdown-before-wait-finished-2-waits.js",
733-
"ecmaVersion" : {
734-
"minVersion" : 15
735-
},
736687
"status" : "FAIL",
737-
"comment" : "Uses Atomics.waitAsync and Worker"
688+
"comment" : "Uses Worker"
738689
}, {
739690
"filePath" : "mjsunit/harmony/atomics-waitasync-worker-shutdown-before-wait-finished-2-workers.js",
740-
"ecmaVersion" : {
741-
"minVersion" : 15
742-
},
743691
"status" : "FAIL",
744-
"comment" : "Uses Atomics.waitAsync and Worker"
692+
"comment" : "Uses Worker"
745693
}, {
746694
"filePath" : "mjsunit/harmony/atomics-waitasync-worker-shutdown-before-wait-finished-no-timeout.js",
747-
"ecmaVersion" : {
748-
"minVersion" : 15
749-
},
750695
"status" : "FAIL",
751-
"comment" : "Uses Atomics.waitAsync and Worker"
696+
"comment" : "Uses Worker"
752697
}, {
753698
"filePath" : "mjsunit/harmony/atomics-waitasync-worker-shutdown-before-wait-finished-timeout.js",
754-
"ecmaVersion" : {
755-
"minVersion" : 15
756-
},
757699
"status" : "FAIL",
758-
"comment" : "Uses Atomics.waitAsync and Worker"
759-
}, {
760-
"filePath" : "mjsunit/harmony/atomics-waitasync.js",
761-
"ecmaVersion" : {
762-
"minVersion" : 15
763-
},
764-
"status" : "PASS",
765-
"comment" : "Uses Atomics.waitAsync"
700+
"comment" : "Uses Worker"
766701
}, {
767702
"filePath" : "mjsunit/harmony/bigint/regressions.js",
768703
"status" : "FAIL",
@@ -843,20 +778,6 @@
843778
"filePath" : "mjsunit/harmony/sharedarraybuffer-worker-gc-stress.js",
844779
"status" : "FAIL",
845780
"comment" : "Uses Worker"
846-
}, {
847-
"filePath" : "mjsunit/harmony/string-iswellformed-external-uncached.js",
848-
"ecmaVersion" : {
849-
"minVersion" : 15
850-
},
851-
"status" : "PASS",
852-
"comment" : "Uses String.prototype.isWellFormed()"
853-
}, {
854-
"filePath" : "mjsunit/harmony/string-iswellformed-flat-indirect.js",
855-
"ecmaVersion" : {
856-
"minVersion" : 15
857-
},
858-
"status" : "PASS",
859-
"comment" : "Uses String.prototype.isWellFormed()"
860781
}, {
861782
"filePath" : "mjsunit/harmony/suppressed-error.js",
862783
"status" : "FAIL",
@@ -1052,12 +973,6 @@
1052973
"filePath" : "mjsunit/regress-1400809.js",
1053974
"status" : "FAIL",
1054975
"comment" : "new failures 2023-10-09"
1055-
}, {
1056-
"filePath" : "mjsunit/regress/asm/regress-13967.js",
1057-
"ecmaVersion" : {
1058-
"minVersion" : 15
1059-
},
1060-
"status" : "PASS"
1061976
}, {
1062977
"filePath" : "mjsunit/regress/asm/regress-1402270.js",
1063978
"status" : "FAIL",
@@ -1134,11 +1049,8 @@
11341049
"comment" : "GR-34371: Occasional segfault on SVM; test with (expected) stack overflows"
11351050
}, {
11361051
"filePath" : "mjsunit/regress/regress-1115354.js",
1137-
"ecmaVersion" : {
1138-
"minVersion" : 15
1139-
},
11401052
"status" : "FAIL",
1141-
"comment" : "Uses Atomics.waitAsync and async_hooks"
1053+
"comment" : "Uses async_hooks"
11421054
}, {
11431055
"filePath" : "mjsunit/regress/regress-1129.js",
11441056
"status" : "SKIP",
@@ -1234,13 +1146,6 @@
12341146
"filePath" : "mjsunit/regress/regress-1394663.js",
12351147
"status" : "FAIL",
12361148
"comment" : "Uses console.profile(), console.profileEnd(), and d8.profiler.setOnProfileEndListener()"
1237-
}, {
1238-
"filePath" : "mjsunit/regress/regress-14333.js",
1239-
"ecmaVersion" : {
1240-
"minVersion" : 15
1241-
},
1242-
"status" : "PASS",
1243-
"comment" : "Uses regexp unicode sets"
12441149
}, {
12451150
"filePath" : "mjsunit/regress/regress-14433.js",
12461151
"status" : "FAIL",
@@ -1253,12 +1158,6 @@
12531158
"filePath" : "mjsunit/regress/regress-1447343.js",
12541159
"status" : "FAIL",
12551160
"comment" : "new failures 2023-10-09"
1256-
}, {
1257-
"filePath" : "mjsunit/regress/regress-1464437.js",
1258-
"ecmaVersion" : {
1259-
"minVersion" : 15
1260-
},
1261-
"status" : "PASS"
12621161
}, {
12631162
"filePath" : "mjsunit/regress/regress-148378.js",
12641163
"status" : "SKIP",
@@ -1554,11 +1453,8 @@
15541453
"comment" : "TODO: evaluate (V8 tests update 2019-10-15)"
15551454
}, {
15561455
"filePath" : "mjsunit/regress/regress-chromium-1194026.js",
1557-
"ecmaVersion" : {
1558-
"minVersion" : 15
1559-
},
15601456
"status" : "FAIL",
1561-
"comment" : "Uses Atomics.waitAsync and Worker"
1457+
"comment" : "Uses Worker"
15621458
}, {
15631459
"filePath" : "mjsunit/regress/regress-crbug-100859.js",
15641460
"runInIsolation" : true,
@@ -1726,35 +1622,18 @@
17261622
"filePath" : "mjsunit/regress/regress-crbug-1415249.js",
17271623
"status" : "FAIL",
17281624
"comment" : "new failures 2023-10-09"
1729-
}, {
1730-
"filePath" : "mjsunit/regress/regress-crbug-1416395.js",
1731-
"ecmaVersion" : {
1732-
"minVersion" : 15
1733-
},
1734-
"status" : "PASS",
1735-
"comment" : "Uses regexp unicode sets"
17361625
}, {
17371626
"filePath" : "mjsunit/regress/regress-crbug-1421198.js",
17381627
"status" : "FAIL",
17391628
"comment" : "new failures 2023-10-09"
17401629
}, {
17411630
"filePath" : "mjsunit/regress/regress-crbug-1421451.js",
1742-
"ecmaVersion" : {
1743-
"minVersion" : 15
1744-
},
17451631
"status" : "FAIL",
17461632
"comment" : "Obsolete test, fixed by https://github.com/v8/v8/commit/1f45cacc0ab05b0941c4605ef33769dc6006fa1f#diff-8b33fefec9ea50caa40be31b0829475f2e28fa86d17ba8041fe0bdbcb36649a2"
17471633
}, {
17481634
"filePath" : "mjsunit/regress/regress-crbug-1423650.js",
17491635
"status" : "FAIL",
17501636
"comment" : "new failures 2023-10-09"
1751-
}, {
1752-
"filePath" : "mjsunit/regress/regress-crbug-1437346.js",
1753-
"ecmaVersion" : {
1754-
"minVersion" : 15
1755-
},
1756-
"status" : "PASS",
1757-
"comment" : "Uses regexp unicode sets"
17581637
}, {
17591638
"filePath" : "mjsunit/regress/regress-crbug-1440685.js",
17601639
"status" : "FAIL",
@@ -1767,13 +1646,6 @@
17671646
"filePath" : "mjsunit/regress/regress-crbug-1443133.js",
17681647
"status" : "FAIL",
17691648
"comment" : "new failures 2023-10-09"
1770-
}, {
1771-
"filePath" : "mjsunit/regress/regress-crbug-1454482.js",
1772-
"ecmaVersion" : {
1773-
"minVersion" : 15
1774-
},
1775-
"status" : "PASS",
1776-
"comment" : "Uses regexp unicode sets"
17771649
}, {
17781650
"filePath" : "mjsunit/regress/regress-crbug-1459172.js",
17791651
"status" : "FAIL",

0 commit comments

Comments
 (0)