-
Notifications
You must be signed in to change notification settings - Fork 475
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
228851f
commit 37d5f8e
Showing
85 changed files
with
3,328 additions
and
0 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
test/language/expressions/class/accessor-name-inst-computed-err-evaluation.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,38 @@ | ||
// This file was procedurally generated from the following sources: | ||
// - src/accessor-names/computed-err-evaluation.case | ||
// - src/accessor-names/error/cls-expr-inst.template | ||
/*--- | ||
description: Abrupt completion when evaluating expression (Class expression, instance method) | ||
esid: sec-runtime-semantics-classdefinitionevaluation | ||
es6id: 14.5.14 | ||
flags: [generated] | ||
info: | | ||
[...] | ||
21. For each ClassElement m in order from methods | ||
a. If IsStatic of m is false, then | ||
i. Let status be the result of performing PropertyDefinitionEvaluation | ||
for m with arguments proto and false. | ||
12.2.6.7 Runtime Semantics: Evaluation | ||
ComputedPropertyName : [ AssignmentExpression ] | ||
1. Let exprValue be the result of evaluating AssignmentExpression. | ||
2. Let propName be ? GetValue(exprValue). | ||
---*/ | ||
var thrower = function() { | ||
throw new Test262Error(); | ||
}; | ||
|
||
|
||
assert.throws(Test262Error, function() { | ||
0, class { | ||
get [thrower()]() {} | ||
}; | ||
}, '`get` accessor'); | ||
|
||
assert.throws(Test262Error, function() { | ||
0, class { | ||
set [thrower()](_) {} | ||
}; | ||
}, '`set` accessor'); |
54 changes: 54 additions & 0 deletions
54
test/language/expressions/class/accessor-name-inst-computed-err-to-prop-key.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,54 @@ | ||
// This file was procedurally generated from the following sources: | ||
// - src/accessor-names/computed-err-to-prop-key.case | ||
// - src/accessor-names/error/cls-expr-inst.template | ||
/*--- | ||
description: Abrupt completion when coercing to property key value (Class expression, instance method) | ||
esid: sec-runtime-semantics-classdefinitionevaluation | ||
es6id: 14.5.14 | ||
flags: [generated] | ||
info: | | ||
[...] | ||
21. For each ClassElement m in order from methods | ||
a. If IsStatic of m is false, then | ||
i. Let status be the result of performing PropertyDefinitionEvaluation | ||
for m with arguments proto and false. | ||
12.2.6.7 Runtime Semantics: Evaluation | ||
[...] | ||
ComputedPropertyName : [ AssignmentExpression ] | ||
1. Let exprValue be the result of evaluating AssignmentExpression. | ||
2. Let propName be ? GetValue(exprValue). | ||
3. Return ? ToPropertyKey(propName). | ||
7.1.14 ToPropertyKey | ||
1. Let key be ? ToPrimitive(argument, hint String). | ||
7.1.1 ToPrimitive | ||
[...] | ||
7. Return ? OrdinaryToPrimitive(input, hint). | ||
7.1.1.1 OrdinaryToPrimitive | ||
5. For each name in methodNames in List order, do | ||
[...] | ||
6. Throw a TypeError exception. | ||
---*/ | ||
var badKey = Object.create(null); | ||
|
||
|
||
assert.throws(TypeError, function() { | ||
0, class { | ||
get [badKey]() {} | ||
}; | ||
}, '`get` accessor'); | ||
|
||
assert.throws(TypeError, function() { | ||
0, class { | ||
set [badKey](_) {} | ||
}; | ||
}, '`set` accessor'); |
36 changes: 36 additions & 0 deletions
36
test/language/expressions/class/accessor-name-inst-computed-err-unresolvable.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,36 @@ | ||
// This file was procedurally generated from the following sources: | ||
// - src/accessor-names/computed-err-unresolvable.case | ||
// - src/accessor-names/error/cls-expr-inst.template | ||
/*--- | ||
description: Abrupt completion when resolving reference value (Class expression, instance method) | ||
esid: sec-runtime-semantics-classdefinitionevaluation | ||
es6id: 14.5.14 | ||
flags: [generated] | ||
info: | | ||
[...] | ||
21. For each ClassElement m in order from methods | ||
a. If IsStatic of m is false, then | ||
i. Let status be the result of performing PropertyDefinitionEvaluation | ||
for m with arguments proto and false. | ||
12.2.6.7 Runtime Semantics: Evaluation | ||
[...] | ||
ComputedPropertyName : [ AssignmentExpression ] | ||
1. Let exprValue be the result of evaluating AssignmentExpression. | ||
2. Let propName be ? GetValue(exprValue). | ||
---*/ | ||
|
||
assert.throws(ReferenceError, function() { | ||
0, class { | ||
get [test262unresolvable]() {} | ||
}; | ||
}, '`get` accessor'); | ||
|
||
assert.throws(ReferenceError, function() { | ||
0, class { | ||
set [test262unresolvable](_) {} | ||
}; | ||
}, '`set` accessor'); |
39 changes: 39 additions & 0 deletions
39
test/language/expressions/class/accessor-name-inst-computed.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,39 @@ | ||
// This file was procedurally generated from the following sources: | ||
// - src/accessor-names/computed.case | ||
// - src/accessor-names/default/cls-expr-inst.template | ||
/*--- | ||
description: Computed values as accessor property names (AssignmentExpression) (Class expression, instance method) | ||
esid: sec-runtime-semantics-classdefinitionevaluation | ||
es6id: 14.5.14 | ||
flags: [generated] | ||
info: | | ||
[...] | ||
21. For each ClassElement m in order from methods | ||
a. If IsStatic of m is false, then | ||
i. Let status be the result of performing PropertyDefinitionEvaluation | ||
for m with arguments proto and false. | ||
12.2.6.7 Runtime Semantics: Evaluation | ||
[...] | ||
ComputedPropertyName : [ AssignmentExpression ] | ||
1. Let exprValue be the result of evaluating AssignmentExpression. | ||
2. Let propName be ? GetValue(exprValue). | ||
3. Return ? ToPropertyKey(propName). | ||
---*/ | ||
var _; | ||
|
||
|
||
var stringSet; | ||
|
||
var C = class { | ||
get [_ = 'str' + 'ing']() { return 'get string'; } | ||
set [_ = 'str' + 'ing'](param) { stringSet = param; } | ||
}; | ||
|
||
assert.sameValue(C.prototype['string'], 'get string'); | ||
|
||
C.prototype['string'] = 'set string'; | ||
assert.sameValue(stringSet, 'set string'); |
37 changes: 37 additions & 0 deletions
37
test/language/expressions/class/accessor-name-inst-literal-numeric-binary.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,37 @@ | ||
// This file was procedurally generated from the following sources: | ||
// - src/accessor-names/literal-numeric-binary.case | ||
// - src/accessor-names/default/cls-expr-inst.template | ||
/*--- | ||
description: Computed values as accessor property names (numeric literal in binary notation) (Class expression, instance method) | ||
esid: sec-runtime-semantics-classdefinitionevaluation | ||
es6id: 14.5.14 | ||
flags: [generated] | ||
info: | | ||
[...] | ||
21. For each ClassElement m in order from methods | ||
a. If IsStatic of m is false, then | ||
i. Let status be the result of performing PropertyDefinitionEvaluation | ||
for m with arguments proto and false. | ||
12.2.6.7 Runtime Semantics: Evaluation | ||
[...] | ||
ComputedPropertyName : [ AssignmentExpression ] | ||
1. Let exprValue be the result of evaluating AssignmentExpression. | ||
2. Let propName be ? GetValue(exprValue). | ||
3. Return ? ToPropertyKey(propName). | ||
---*/ | ||
|
||
var stringSet; | ||
|
||
var C = class { | ||
get 0b10() { return 'get string'; } | ||
set 0b10(param) { stringSet = param; } | ||
}; | ||
|
||
assert.sameValue(C.prototype['2'], 'get string'); | ||
|
||
C.prototype['2'] = 'set string'; | ||
assert.sameValue(stringSet, 'set string'); |
37 changes: 37 additions & 0 deletions
37
test/language/expressions/class/accessor-name-inst-literal-numeric-exponent.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,37 @@ | ||
// This file was procedurally generated from the following sources: | ||
// - src/accessor-names/literal-numeric-exponent.case | ||
// - src/accessor-names/default/cls-expr-inst.template | ||
/*--- | ||
description: Computed values as accessor property names (numeric literal in exponent notation) (Class expression, instance method) | ||
esid: sec-runtime-semantics-classdefinitionevaluation | ||
es6id: 14.5.14 | ||
flags: [generated] | ||
info: | | ||
[...] | ||
21. For each ClassElement m in order from methods | ||
a. If IsStatic of m is false, then | ||
i. Let status be the result of performing PropertyDefinitionEvaluation | ||
for m with arguments proto and false. | ||
12.2.6.7 Runtime Semantics: Evaluation | ||
[...] | ||
ComputedPropertyName : [ AssignmentExpression ] | ||
1. Let exprValue be the result of evaluating AssignmentExpression. | ||
2. Let propName be ? GetValue(exprValue). | ||
3. Return ? ToPropertyKey(propName). | ||
---*/ | ||
|
||
var stringSet; | ||
|
||
var C = class { | ||
get 1E+9() { return 'get string'; } | ||
set 1E+9(param) { stringSet = param; } | ||
}; | ||
|
||
assert.sameValue(C.prototype['1000000000'], 'get string'); | ||
|
||
C.prototype['1000000000'] = 'set string'; | ||
assert.sameValue(stringSet, 'set string'); |
37 changes: 37 additions & 0 deletions
37
test/language/expressions/class/accessor-name-inst-literal-numeric-hex.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,37 @@ | ||
// This file was procedurally generated from the following sources: | ||
// - src/accessor-names/literal-numeric-hex.case | ||
// - src/accessor-names/default/cls-expr-inst.template | ||
/*--- | ||
description: Computed values as accessor property names (numeric literal in hexadecimal notation) (Class expression, instance method) | ||
esid: sec-runtime-semantics-classdefinitionevaluation | ||
es6id: 14.5.14 | ||
flags: [generated] | ||
info: | | ||
[...] | ||
21. For each ClassElement m in order from methods | ||
a. If IsStatic of m is false, then | ||
i. Let status be the result of performing PropertyDefinitionEvaluation | ||
for m with arguments proto and false. | ||
12.2.6.7 Runtime Semantics: Evaluation | ||
[...] | ||
ComputedPropertyName : [ AssignmentExpression ] | ||
1. Let exprValue be the result of evaluating AssignmentExpression. | ||
2. Let propName be ? GetValue(exprValue). | ||
3. Return ? ToPropertyKey(propName). | ||
---*/ | ||
|
||
var stringSet; | ||
|
||
var C = class { | ||
get 0x10() { return 'get string'; } | ||
set 0x10(param) { stringSet = param; } | ||
}; | ||
|
||
assert.sameValue(C.prototype['16'], 'get string'); | ||
|
||
C.prototype['16'] = 'set string'; | ||
assert.sameValue(stringSet, 'set string'); |
37 changes: 37 additions & 0 deletions
37
test/language/expressions/class/accessor-name-inst-literal-numeric-leading-decimal.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,37 @@ | ||
// This file was procedurally generated from the following sources: | ||
// - src/accessor-names/literal-numeric-leading-decimal.case | ||
// - src/accessor-names/default/cls-expr-inst.template | ||
/*--- | ||
description: Computed values as accessor property names (numeric literal with leading decimal point) (Class expression, instance method) | ||
esid: sec-runtime-semantics-classdefinitionevaluation | ||
es6id: 14.5.14 | ||
flags: [generated] | ||
info: | | ||
[...] | ||
21. For each ClassElement m in order from methods | ||
a. If IsStatic of m is false, then | ||
i. Let status be the result of performing PropertyDefinitionEvaluation | ||
for m with arguments proto and false. | ||
12.2.6.7 Runtime Semantics: Evaluation | ||
[...] | ||
ComputedPropertyName : [ AssignmentExpression ] | ||
1. Let exprValue be the result of evaluating AssignmentExpression. | ||
2. Let propName be ? GetValue(exprValue). | ||
3. Return ? ToPropertyKey(propName). | ||
---*/ | ||
|
||
var stringSet; | ||
|
||
var C = class { | ||
get .1() { return 'get string'; } | ||
set .1(param) { stringSet = param; } | ||
}; | ||
|
||
assert.sameValue(C.prototype['0.1'], 'get string'); | ||
|
||
C.prototype['0.1'] = 'set string'; | ||
assert.sameValue(stringSet, 'set string'); |
37 changes: 37 additions & 0 deletions
37
test/language/expressions/class/accessor-name-inst-literal-numeric-non-canonical.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,37 @@ | ||
// This file was procedurally generated from the following sources: | ||
// - src/accessor-names/literal-numeric-non-canonical.case | ||
// - src/accessor-names/default/cls-expr-inst.template | ||
/*--- | ||
description: Computed values as accessor property names (numeric literal with non-canonical representation) (Class expression, instance method) | ||
esid: sec-runtime-semantics-classdefinitionevaluation | ||
es6id: 14.5.14 | ||
flags: [generated] | ||
info: | | ||
[...] | ||
21. For each ClassElement m in order from methods | ||
a. If IsStatic of m is false, then | ||
i. Let status be the result of performing PropertyDefinitionEvaluation | ||
for m with arguments proto and false. | ||
12.2.6.7 Runtime Semantics: Evaluation | ||
[...] | ||
ComputedPropertyName : [ AssignmentExpression ] | ||
1. Let exprValue be the result of evaluating AssignmentExpression. | ||
2. Let propName be ? GetValue(exprValue). | ||
3. Return ? ToPropertyKey(propName). | ||
---*/ | ||
|
||
var stringSet; | ||
|
||
var C = class { | ||
get 0.0000001() { return 'get string'; } | ||
set 0.0000001(param) { stringSet = param; } | ||
}; | ||
|
||
assert.sameValue(C.prototype['1e-7'], 'get string'); | ||
|
||
C.prototype['1e-7'] = 'set string'; | ||
assert.sameValue(stringSet, 'set string'); |
37 changes: 37 additions & 0 deletions
37
test/language/expressions/class/accessor-name-inst-literal-numeric-octal.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,37 @@ | ||
// This file was procedurally generated from the following sources: | ||
// - src/accessor-names/literal-numeric-octal.case | ||
// - src/accessor-names/default/cls-expr-inst.template | ||
/*--- | ||
description: Computed values as accessor property names (numeric literal in octal notation) (Class expression, instance method) | ||
esid: sec-runtime-semantics-classdefinitionevaluation | ||
es6id: 14.5.14 | ||
flags: [generated] | ||
info: | | ||
[...] | ||
21. For each ClassElement m in order from methods | ||
a. If IsStatic of m is false, then | ||
i. Let status be the result of performing PropertyDefinitionEvaluation | ||
for m with arguments proto and false. | ||
12.2.6.7 Runtime Semantics: Evaluation | ||
[...] | ||
ComputedPropertyName : [ AssignmentExpression ] | ||
1. Let exprValue be the result of evaluating AssignmentExpression. | ||
2. Let propName be ? GetValue(exprValue). | ||
3. Return ? ToPropertyKey(propName). | ||
---*/ | ||
|
||
var stringSet; | ||
|
||
var C = class { | ||
get 0o10() { return 'get string'; } | ||
set 0o10(param) { stringSet = param; } | ||
}; | ||
|
||
assert.sameValue(C.prototype['8'], 'get string'); | ||
|
||
C.prototype['8'] = 'set string'; | ||
assert.sameValue(stringSet, 'set string'); |
Oops, something went wrong.