Skip to content

Commit 07b0250

Browse files
committed
Add constants for ES2021 in ESVersion and LinkingInfo.ESVersion.
ECMAScript 2021, the 12th edition, was published in June 2021.
1 parent 907d052 commit 07b0250

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

Jenkinsfile

+1
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,7 @@ def allESVersions = [
443443
"ES2018",
444444
// "ES2019", // We do not use anything specifically from ES2019
445445
"ES2020"
446+
// "ES2021", // We do not use anything specifically from ES2021
446447
]
447448

448449
// The 'quick' matrix

library/src/main/scala/scala/scalajs/LinkingInfo.scala

+10
Original file line numberDiff line numberDiff line change
@@ -281,5 +281,15 @@ object LinkingInfo {
281281
* - `import.meta`
282282
*/
283283
final val ES2020 = 11
284+
285+
/** ECMAScript 2021 (12th edition).
286+
*
287+
* Contains the following notable features:
288+
*
289+
* - `WeakRef` and `FinalizationRegistry`
290+
* - `AggregateError`
291+
* - Separators for numeric literals (e.g., `1_000`)
292+
*/
293+
final val ES2021 = 12
284294
}
285295
}

linker-interface/shared/src/main/scala/org/scalajs/linker/interface/ESVersion.scala

+10
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,16 @@ object ESVersion {
8686
*/
8787
val ES2020: ESVersion = new ESVersion(11, "ECMAScript 2020")
8888

89+
/** ECMAScript 2021 (12th edition).
90+
*
91+
* Contains the following notable features:
92+
*
93+
* - `WeakRef` and `FinalizationRegistry`
94+
* - `AggregateError`
95+
* - Separators for numeric literals (e.g., `1_000`)
96+
*/
97+
val ES2021: ESVersion = new ESVersion(12, "ECMAScript 2021")
98+
8999
private[interface] implicit object ESVersionFingerprint
90100
extends Fingerprint[ESVersion] {
91101

test-suite/js/src/test/scala/org/scalajs/testsuite/library/LinkingInfoTest.scala

+1
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,6 @@ class LinkingInfoTest {
4545
assertEquals(9, ESVersion.ES2018)
4646
assertEquals(10, ESVersion.ES2019)
4747
assertEquals(11, ESVersion.ES2020)
48+
assertEquals(12, ESVersion.ES2021)
4849
}
4950
}

0 commit comments

Comments
 (0)