-
-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
it was copied from test262 refs: tc39/test262@afe217b
- Loading branch information
1 parent
54ed0c0
commit 496b091
Showing
63 changed files
with
624 additions
and
0 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
...ersion/13/class-static-blocks/expressions-arrow-function-static-init-await-binding.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class C { | ||
static { | ||
(await => 0); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
...sion/13/class-static-blocks/expressions-arrow-function-static-init-await-reference.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class C { | ||
static { | ||
((x = await) => 0); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
...es/ecma-version/13/class-static-blocks/expressions-class-static-init-await-binding.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class C { | ||
static { | ||
(class await {}); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
.../ecma-version/13/class-static-blocks/expressions-class-static-init-await-reference.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
|
||
var await = 0; | ||
var fromParam, fromBody; | ||
|
||
class C { | ||
static { | ||
new (class { | ||
constructor(x = fromParam = await) { | ||
fromBody = await; | ||
} | ||
}); | ||
} | ||
} | ||
|
||
assert.sameValue(fromParam, 0, 'from parameter'); | ||
assert.sameValue(fromBody, 0, 'from body'); |
7 changes: 7 additions & 0 deletions
7
...ecma-version/13/class-static-blocks/expressions-function-static-init-await-binding.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
|
||
class C { | ||
static { | ||
(function await(await) {}); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...ma-version/13/class-static-blocks/expressions-function-static-init-await-reference.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
|
||
var await = 0; | ||
var fromParam, fromBody; | ||
|
||
class C { | ||
static { | ||
(function (x = fromParam = await) { | ||
fromBody = await; | ||
})(); | ||
} | ||
} | ||
|
||
assert.sameValue(fromParam, 0, 'from parameter'); | ||
assert.sameValue(fromBody, 0, 'from body'); |
7 changes: 7 additions & 0 deletions
7
...ma-version/13/class-static-blocks/expressions-generators-static-init-await-binding.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
|
||
class C { | ||
static { | ||
(function * await (await) {}); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...-version/13/class-static-blocks/expressions-generators-static-init-await-reference.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
|
||
var await = 0; | ||
var fromParam, fromBody; | ||
|
||
class C { | ||
static { | ||
(function * (x = fromParam = await) { | ||
fromBody = await; | ||
})().next(); | ||
} | ||
} | ||
|
||
assert.sameValue(fromParam, 0, 'from parameter'); | ||
assert.sameValue(fromBody, 0, 'from body'); |
8 changes: 8 additions & 0 deletions
8
...ss-static-blocks/expressions-object-ident-name-prop-name-literal-await-static-init.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
|
||
class C { | ||
static { | ||
({ await: 0 }); | ||
} | ||
} | ||
|
6 changes: 6 additions & 0 deletions
6
...ss-static-blocks/expressions-object-identifier-shorthand-static-init-await-invalid.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class C { | ||
static { | ||
({ await }); | ||
} | ||
} | ||
|
7 changes: 7 additions & 0 deletions
7
...lass-static-blocks/expressions-object-identifier-shorthand-static-init-await-valid.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
|
||
class C { | ||
static { | ||
(() => ({ await })); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...tic-blocks/expressions-object-method-definition-static-init-await-binding-accessor.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
|
||
class C { | ||
static { | ||
({set accessor(await) {}}); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...ic-blocks/expressions-object-method-definition-static-init-await-binding-generator.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
|
||
class C { | ||
static { | ||
({*method(await) {}}); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...tatic-blocks/expressions-object-method-definition-static-init-await-binding-normal.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
|
||
class C { | ||
static { | ||
({method(await) {}}); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...c-blocks/expressions-object-method-definition-static-init-await-reference-accessor.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
|
||
var await = 0; | ||
var fromParam, fromBody; | ||
|
||
class C { | ||
static { | ||
({ | ||
set accessor(x = fromParam = await) { | ||
fromBody = await; | ||
} | ||
}).accessor = undefined; | ||
} | ||
} | ||
|
||
assert.sameValue(fromParam, 0, 'from parameter'); | ||
assert.sameValue(fromBody, 0, 'from body'); |
17 changes: 17 additions & 0 deletions
17
...-blocks/expressions-object-method-definition-static-init-await-reference-generator.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
|
||
var await = 0; | ||
var fromParam, fromBody; | ||
|
||
class C { | ||
static { | ||
({ | ||
*method(x = fromParam = await) { | ||
fromBody = await; | ||
} | ||
}).method().next(); | ||
} | ||
} | ||
|
||
assert.sameValue(fromParam, 0, 'from parameter'); | ||
assert.sameValue(fromBody, 0, 'from body'); |
17 changes: 17 additions & 0 deletions
17
...tic-blocks/expressions-object-method-definition-static-init-await-reference-normal.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
|
||
var await = 0; | ||
var fromParam, fromBody; | ||
|
||
class C { | ||
static { | ||
({ | ||
method(x = fromParam = await) { | ||
fromBody = await; | ||
} | ||
}).method(); | ||
} | ||
} | ||
|
||
assert.sameValue(fromParam, 0, 'from parameter'); | ||
assert.sameValue(fromBody, 0, 'from body'); |
5 changes: 5 additions & 0 deletions
5
...cma-version/13/class-static-blocks/identifier-resolution-static-init-invalid-await.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class C { | ||
static { | ||
await; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...res/ecma-version/13/class-static-blocks/statements-break-static-init-without-label.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
label: while(false) { | ||
class C { | ||
static { | ||
break; | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
...s/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-abrupt.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
|
||
var thrown = new Test262Error(); | ||
var caught; | ||
var sameBlock = false; | ||
var subsequentField = false; | ||
var subsequentBlock = false; | ||
|
||
try { | ||
class C { | ||
static { | ||
throw thrown; | ||
sameBlock = true; | ||
} | ||
static x = subsequentField = true; | ||
static { | ||
subsequentBlock = true; | ||
} | ||
} | ||
} catch (error) { | ||
caught = error; | ||
} | ||
|
||
assert.sameValue(caught, thrown); | ||
assert.sameValue(sameBlock, false, 'same block'); | ||
assert.sameValue(subsequentField, false, 'subsequent field'); | ||
assert.sameValue(subsequentBlock, false, 'subsequent block'); |
28 changes: 28 additions & 0 deletions
28
...ma-version/13/class-static-blocks/statements-class-static-init-arguments-functions.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
|
||
var fn, fnParam; | ||
var gen, genParam; | ||
var asyncFn, asyncFnParam; | ||
|
||
class C { | ||
static { | ||
(function({test262 = fnParam = arguments}) { | ||
fn = arguments; | ||
})('function'); | ||
|
||
(function * ({test262 = genParam = arguments}) { | ||
gen = arguments; | ||
})('generator function').next(); | ||
|
||
(async function ({test262 = asyncFnParam = arguments}) { | ||
asyncFn = arguments; | ||
})('async function'); | ||
} | ||
} | ||
|
||
assert(compareArray(['function'], fn), 'body'); | ||
assert(compareArray(['function'], fnParam), 'parameter'); | ||
assert(compareArray(['generator function'], gen), 'body'); | ||
assert(compareArray(['generator function'], genParam), 'parameter'); | ||
assert(compareArray(['async function'], asyncFn), 'body'); | ||
assert(compareArray(['async function'], asyncFnParam), 'parameter'); |
46 changes: 46 additions & 0 deletions
46
...ecma-version/13/class-static-blocks/statements-class-static-init-arguments-methods.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
|
||
|
||
var instance; | ||
var method, methodParam; | ||
var getter; | ||
var setter, setterParam; | ||
var genMethod, genMethodParam; | ||
var asyncMethod, asyncMethodParam; | ||
|
||
class C { | ||
static { | ||
instance = new class { | ||
method({test262 = methodParam = arguments}) { | ||
method = arguments; | ||
} | ||
get accessor() { | ||
getter = arguments; | ||
} | ||
set accessor({test262 = setterParam = arguments}) { | ||
setter = arguments; | ||
} | ||
*gen({test262 = genMethodParam = arguments}) { | ||
genMethod = arguments; | ||
} | ||
async async({test262 = asyncMethodParam = arguments}) { | ||
asyncMethod = arguments; | ||
} | ||
}(); | ||
} | ||
} | ||
|
||
instance.method('method'); | ||
instance.accessor; | ||
instance.accessor = 'setter'; | ||
instance.gen('generator method').next(); | ||
instance.async('async method'); | ||
|
||
assert(compareArray(['method'], method), 'body'); | ||
assert(compareArray(['method'], methodParam), 'parameter'); | ||
assert(compareArray([], getter), 'body'); | ||
assert(compareArray(['setter'], setter), 'body'); | ||
assert(compareArray(['setter'], setterParam), 'parameter'); | ||
assert(compareArray(['generator method'], genMethod), 'body'); | ||
assert(compareArray(['generator method'], genMethodParam), 'parameter'); | ||
assert(compareArray(['async method'], asyncMethod), 'body'); | ||
assert(compareArray(['async method'], asyncMethodParam), 'parameter'); |
5 changes: 5 additions & 0 deletions
5
...-version/13/class-static-blocks/statements-class-static-init-await-binding-invalid.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class C { | ||
static { | ||
class await {} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...ma-version/13/class-static-blocks/statements-class-static-init-await-binding-valid.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
|
||
class C { | ||
static { | ||
(() => { class await {} }); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...s/ecma-version/13/class-static-blocks/statements-class-static-init-expr-new-target.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
|
||
var value = null; | ||
|
||
class C { | ||
static { | ||
value = new.target; | ||
} | ||
} | ||
|
||
assert.sameValue(value, undefined); |
11 changes: 11 additions & 0 deletions
11
...ixtures/ecma-version/13/class-static-blocks/statements-class-static-init-expr-this.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
|
||
var value; | ||
|
||
class C { | ||
static { | ||
value = this; | ||
} | ||
} | ||
|
||
assert.sameValue(value, C); |
5 changes: 5 additions & 0 deletions
5
...ecma-version/13/class-static-blocks/statements-class-static-init-invalid-arguments.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class C { | ||
static { | ||
(class { [argument\u0073]() {} }); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...res/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-await.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
async function f() { | ||
class C { | ||
static { | ||
await 0; | ||
} | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
...ecma-version/13/class-static-blocks/statements-class-static-init-invalid-label-dup.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class C { | ||
static { | ||
x: x: 0; | ||
} | ||
} | ||
|
6 changes: 6 additions & 0 deletions
6
...s/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-lex-dup.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class C { | ||
static { | ||
let x; | ||
let x; | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
...s/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-lex-var.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class C { | ||
static { | ||
let x; | ||
var x; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...es/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-return.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
function f() { | ||
class C { | ||
static { | ||
return; | ||
} | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
...cma-version/13/class-static-blocks/statements-class-static-init-invalid-super-call.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class C { | ||
static { | ||
super(); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...13/class-static-blocks/statements-class-static-init-invalid-undefined-break-target.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class C { | ||
static { | ||
x: while (false) { | ||
break y; | ||
} | ||
} | ||
} |
Oops, something went wrong.