Skip to content

Commit

Permalink
Re-generate tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jugglinmike authored and leobalter committed Mar 1, 2017
1 parent 228851f commit 37d5f8e
Show file tree
Hide file tree
Showing 85 changed files with 3,328 additions and 0 deletions.
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');
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');
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 test/language/expressions/class/accessor-name-inst-computed.js
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');
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');
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');
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');
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');
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');
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');
Loading

0 comments on commit 37d5f8e

Please sign in to comment.