Merge pull request #1334 from anba/test-issues

Fix multiple test issues
This commit is contained in:
Leo Balter 2017-11-01 13:42:58 -04:00 committed by GitHub
commit 27e2c28d13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
57 changed files with 325 additions and 193 deletions

View File

@ -115,6 +115,7 @@ template
TypedArray TypedArray
u180e u180e
Uint8Array Uint8Array
Uint16Array
WeakMap WeakMap
WeakSet WeakSet

View File

@ -18,7 +18,7 @@ info: |
... ...
For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
features: [class-fields] features: [class-fields]
template: initializer-eval template: initializer-eval-arguments
---*/ ---*/
//- initializer //- initializer

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
desc: error if `new.call` in StatementList of eval desc: error if `new.target` in StatementList of eval
info: | info: |
Additional Early Error Rules for Eval Inside Initializer Additional Early Error Rules for Eval Inside Initializer
These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
@ -17,12 +17,8 @@ info: |
It is a Syntax Error if StatementList Contains NewTarget. It is a Syntax Error if StatementList Contains NewTarget.
features: [class-fields] features: [class-fields]
template: initializer-eval template: initializer-eval-newtarget
---*/ ---*/
//- initializer //- initializer
new.call new.target
//- earlyerror
SyntaxError
//- executionerror
SyntaxError

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
desc: error if `super()` in StatementList of eval desc: error if `super()['x']` in StatementList of eval
info: | info: |
Additional Early Error Rules for Eval Inside Initializer Additional Early Error Rules for Eval Inside Initializer
These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
@ -17,12 +17,8 @@ info: |
It is a Syntax Error if StatementList Contains SuperCall. It is a Syntax Error if StatementList Contains SuperCall.
features: [class-fields] features: [class-fields]
template: initializer-eval-super template: initializer-eval-super-call
---*/ ---*/
//- initializer //- initializer
super() super()['x']
//- earlyerror
SyntaxError
//- executionerror
SyntaxError

View File

@ -11,18 +11,14 @@ info: |
... ...
The remaining eval rules apply as outside a constructor, inside a method, and inside a function. The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
Additional Early Error Rules for Eval Outside Methods Additional Early Error Rules for Eval Outside Constructor Methods
These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
ScriptBody:StatementList ScriptBody:StatementList
It is a Syntax Error if StatementList Contains SuperCall. It is a Syntax Error if StatementList Contains SuperCall.
features: [class-fields] features: [class-fields]
template: initializer-eval-super template: initializer-eval-super-call
---*/ ---*/
//- initializer //- initializer
super().x super().x
//- earlyerror
SyntaxError
//- executionerror
SyntaxError

View File

@ -17,12 +17,8 @@ info: |
It is a Syntax Error if StatementList Contains SuperCall. It is a Syntax Error if StatementList Contains SuperCall.
features: [class-fields] features: [class-fields]
template: initializer-eval-super template: initializer-eval-super-call
---*/ ---*/
//- initializer //- initializer
super() super()
//- earlyerror
SyntaxError
//- executionerror
SyntaxError

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
desc: error if `super().x` in StatementList of eval desc: error if `super.x` in StatementList of eval
info: | info: |
Additional Early Error Rules for Eval Inside Initializer Additional Early Error Rules for Eval Inside Initializer
These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
@ -17,12 +17,8 @@ info: |
It is a Syntax Error if StatementList Contains SuperProperty. It is a Syntax Error if StatementList Contains SuperProperty.
features: [class-fields] features: [class-fields]
template: initializer-eval-super template: initializer-eval-super-property
---*/ ---*/
//- initializer //- initializer
super.x super.x
//- earlyerror
SyntaxError
//- executionerror
SyntaxError

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
desc: error if `super().x` in StatementList of eval desc: error if `super['x']` in StatementList of eval
info: | info: |
Additional Early Error Rules for Eval Inside Initializer Additional Early Error Rules for Eval Inside Initializer
These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
@ -17,12 +17,8 @@ info: |
It is a Syntax Error if StatementList Contains SuperProperty. It is a Syntax Error if StatementList Contains SuperProperty.
features: [class-fields] features: [class-fields]
template: initializer-eval-super template: initializer-eval-super-property
---*/ ---*/
//- initializer //- initializer
super['x'] super['x']
//- earlyerror
SyntaxError
//- executionerror
SyntaxError

View File

@ -8,7 +8,7 @@ name: direct eval
---*/ ---*/
var executed = false; var executed = false;
class C = { class C {
x = eval('executed = true; /*{ initializer }*/;'); x = eval('executed = true; /*{ initializer }*/;');
} }

View File

@ -8,7 +8,7 @@ name: indirect eval
---*/ ---*/
var executed = false; var executed = false;
class C = { class C {
x = (0, eval)('executed = true; /*{ initializer }*/;'); x = (0, eval)('executed = true; /*{ initializer }*/;');
} }

View File

@ -0,0 +1,18 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performeval-rules-in-initializer
path: language/statements/class/fields-direct-
name: direct eval
---*/
var executed = false;
class C {
x = eval('executed = true; /*{ initializer }*/;');
}
var c = new C();
assert.sameValue(executed, true);
assert.sameValue(c.x, undefined);

View File

@ -0,0 +1,19 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performeval-rules-in-initializer
path: language/statements/class/fields-indirect-
name: indirect eval
---*/
var executed = false;
class C {
x = (0, eval)('executed = true; /*{ initializer }*/;');
}
assert.throws(SyntaxError, function() {
new C();
});
assert.sameValue(executed, false);

View File

@ -0,0 +1,18 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performeval-rules-in-initializer
path: language/expressions/class/fields-direct-
name: direct eval
---*/
var executed = false;
var C = class {
x = eval('executed = true; /*{ initializer }*/;');
}
var c = new C();
assert.sameValue(executed, true);
assert.sameValue(c.x, undefined);

View File

@ -0,0 +1,19 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performeval-rules-in-initializer
path: language/expressions/class/fields-indirect-
name: indirect eval
---*/
var executed = false;
var C = class {
x = (0, eval)('executed = true; /*{ initializer }*/;');
}
assert.throws(SyntaxError, function() {
new C();
});
assert.sameValue(executed, false);

View File

@ -7,14 +7,14 @@ path: language/statements/class/fields-derived-cls-direct-
name: direct eval name: direct eval
---*/ ---*/
class A = {} class A {}
var executed = false; var executed = false;
class C extends A = { class C extends A {
x = eval('executed = true; /*{ initializer }*/;'); x = eval('executed = true; /*{ initializer }*/;');
} }
assert.throws(/*{ earlyerror }*/, function() { assert.throws(SyntaxError, function() {
new C(); new C();
}); });

View File

@ -7,15 +7,15 @@ path: language/statements/class/fields-derived-cls-indirect-
name: indirect eval name: indirect eval
---*/ ---*/
class A = {} class A {}
var executed = false; var executed = false;
class C extends A = { class C extends A {
x = (0, eval)('executed = true; /*{ initializer }*/;'); x = (0, eval)('executed = true; /*{ initializer }*/;');
} }
assert.throws(/*{ executionerror }*/, function() { assert.throws(SyntaxError, function() {
new C(); new C();
}); });
assert.sameValue(executed, true); assert.sameValue(executed, false);

View File

@ -14,7 +14,7 @@ var C = class extends A {
x = eval('executed = true; /*{ initializer }*/;'); x = eval('executed = true; /*{ initializer }*/;');
} }
assert.throws(/*{ earlyerror }*/, function() { assert.throws(SyntaxError, function() {
new C(); new C();
}); });

View File

@ -14,8 +14,8 @@ var C = class extends A {
x = (0, eval)('executed = true; /*{ initializer }*/;'); x = (0, eval)('executed = true; /*{ initializer }*/;');
} }
assert.throws(/*{ executionerror }*/, function() { assert.throws(SyntaxError, function() {
new C(); new C();
}); });
assert.sameValue(executed, true); assert.sameValue(executed, false);

View File

@ -0,0 +1,19 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performeval-rules-in-initializer
path: language/statements/class/fields-derived-cls-direct-
name: direct eval
---*/
class A {}
var executed = false;
class C extends A {
x = eval('executed = true; /*{ initializer }*/;');
}
new C();
assert.sameValue(executed, true);

View File

@ -0,0 +1,21 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performeval-rules-in-initializer
path: language/statements/class/fields-derived-cls-indirect-
name: indirect eval
---*/
class A {}
var executed = false;
class C extends A {
x = (0, eval)('executed = true; /*{ initializer }*/;');
}
assert.throws(SyntaxError, function() {
new C();
});
assert.sameValue(executed, false);

View File

@ -0,0 +1,19 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performeval-rules-in-initializer
path: language/expressions/class/fields-derived-cls-direct-
name: direct eval
---*/
var A = class {}
var executed = false;
var C = class extends A {
x = eval('executed = true; /*{ initializer }*/;');
}
new C();
assert.sameValue(executed, true);

View File

@ -0,0 +1,21 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performeval-rules-in-initializer
path: language/expressions/class/fields-derived-cls-indirect-
name: indirect eval
---*/
var A = class {}
var executed = false;
var C = class extends A {
x = (0, eval)('executed = true; /*{ initializer }*/;');
}
assert.throws(SyntaxError, function() {
new C();
});
assert.sameValue(executed, false);

View File

@ -13,7 +13,7 @@ features: [BigInt]
---*/ ---*/
verifyProperty(BigInt.prototype.toString, "length", { verifyProperty(BigInt.prototype.toString, "length", {
value: 1, value: 0,
writable: false, writable: false,
enumerable: false, enumerable: false,
configurable: true configurable: true

View File

@ -5,7 +5,6 @@
esid: sec-tostring-applied-to-the-bigint-type esid: sec-tostring-applied-to-the-bigint-type
description: BigInt .toString() returns only decimal digits, does not include BigIntLiteralSuffix description: BigInt .toString() returns only decimal digits, does not include BigIntLiteralSuffix
info: | info: |
ToString Applied to the BigInt Type ToString Applied to the BigInt Type
The abstract operation ToString converts a BigInt i to String format as follows: The abstract operation ToString converts a BigInt i to String format as follows:

View File

@ -19,7 +19,7 @@ info: |
9.1.6.1 OrdinaryDefineOwnProperty 9.1.6.1 OrdinaryDefineOwnProperty
1. Let current be ? O.[[GetOwnProperty]](P). 1. Let current be ? O.[[GetOwnProperty]](P).
2. Let extensible be the value of the [[Extensible]] internal slot of O. 2. Let extensible be O.[[Extensible]].
3. Return ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, 3. Return ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc,
current). current).
@ -28,27 +28,34 @@ info: |
[...] [...]
7. Else if IsDataDescriptor(current) and IsDataDescriptor(Desc) are both true, 7. Else if IsDataDescriptor(current) and IsDataDescriptor(Desc) are both true,
then then
a. If the [[Configurable]] field of current is false, then a. If current.[[Configurable]] is false and current.[[Writable]] is false,
then
[...] [...]
b. Else the [[Configurable]] field of current is true, so any change is
acceptable.
[...] [...]
9. If O is not undefined, then 9. If O is not undefined, then
a. For each field of Desc that is present, set the corresponding attribute a. For each field of Desc that is present, set the corresponding attribute
of the property named P of object O to the value of the field. of the property named P of object O to the value of the field.
10. Return true. 10. Return true.
features: [Float64Array, Uint8Array] features: [Float64Array, Uint8Array, Uint16Array]
includes: [nans.js] includes: [nans.js]
---*/ ---*/
var isLittleEndian = new Uint8Array(new Uint16Array([1]).buffer)[0] !== 0;
var float = new Float64Array(1); var float = new Float64Array(1);
var ints = new Uint8Array(float.buffer); var ints = new Uint8Array(float.buffer);
var len = distinctNaNs.length; var len = distinctNaNs.length;
var idx, jdx, subject, first, second;
function byteValue(value) { function byteValue(value) {
float[0] = value; float[0] = value;
return ints[0] + (ints[1] << 8) + (ints[2] << 16) + (ints[3] << 32) +
(ints[4] << 64) + (ints[5] << 64) + (ints[6] << 128) + (ints[7] << 256); var hex = "0123456789ABCDEF";
var s = "";
for (var i = 0; i < 8; ++i) {
var v = ints[isLittleEndian ? 7 - i : i];
s += hex[(v >> 4) & 0xf] + hex[v & 0xf];
}
return s;
} }
/** /**
@ -57,21 +64,23 @@ function byteValue(value) {
* cannot be verified and this test is expected to pass without evaluating any * cannot be verified and this test is expected to pass without evaluating any
* assertions. * assertions.
*/ */
for (idx = 0; idx < len; ++idx) { for (var idx = 0; idx < len; ++idx) {
for (jdx = 0 ; jdx < len; ++jdx) { for (var jdx = 0; jdx < len; ++jdx) {
first = distinctNaNs[idx]; // NB: Don't store the distinct NaN values as global variables, because
second = distinctNaNs[jdx]; // global variables are properties of the global object. And in this test
if (byteValue(first) === byteValue(second)) { // we want to ensure NaN-valued properties in objects are properly handled,
// so storing NaN values in the (global) object defeats the purpose.
if (byteValue(distinctNaNs[idx]) === byteValue(distinctNaNs[jdx])) {
continue; continue;
} }
subject = {}; var subject = {};
subject.prop = first; subject.prop = distinctNaNs[idx];
subject.prop = second; subject.prop = distinctNaNs[jdx];
assert.sameValue( assert.sameValue(
byteValue(subject.prop), byteValue(subject.prop),
byteValue(second), byteValue(distinctNaNs[jdx]),
'Property value was re-set' 'Property value was re-set'
); );
} }

View File

@ -1,8 +1,8 @@
// This file was procedurally generated from the following sources: // This file was procedurally generated from the following sources:
// - src/class-fields/eval-err-contains-supercall-1.case // - src/class-fields/eval-err-contains-supercall-1.case
// - src/class-fields/initializer-eval-super/cls-expr-fields-eval.template // - src/class-fields/initializer-eval-super-call/cls-expr-fields-eval.template
/*--- /*---
description: error if `super()` in StatementList of eval (direct eval) description: error if `super()['x']` in StatementList of eval (direct eval)
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer
features: [class-fields] features: [class-fields]
flags: [generated] flags: [generated]
@ -27,7 +27,7 @@ var A = class {}
var executed = false; var executed = false;
var C = class extends A { var C = class extends A {
x = eval('executed = true; super();'); x = eval('executed = true; super()["x"];');
} }
assert.throws(SyntaxError, function() { assert.throws(SyntaxError, function() {

View File

@ -1,6 +1,6 @@
// This file was procedurally generated from the following sources: // This file was procedurally generated from the following sources:
// - src/class-fields/eval-err-contains-supercall-2.case // - src/class-fields/eval-err-contains-supercall-2.case
// - src/class-fields/initializer-eval-super/cls-expr-fields-eval.template // - src/class-fields/initializer-eval-super-call/cls-expr-fields-eval.template
/*--- /*---
description: error if `super().x` in StatementList of eval (direct eval) description: error if `super().x` in StatementList of eval (direct eval)
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer
@ -14,8 +14,8 @@ info: |
... ...
The remaining eval rules apply as outside a constructor, inside a method, and inside a function. The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
Additional Early Error Rules for Eval Outside Methods Additional Early Error Rules for Eval Outside Constructor Methods
These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
ScriptBody:StatementList ScriptBody:StatementList
It is a Syntax Error if StatementList Contains SuperCall. It is a Syntax Error if StatementList Contains SuperCall.

View File

@ -1,6 +1,6 @@
// This file was procedurally generated from the following sources: // This file was procedurally generated from the following sources:
// - src/class-fields/eval-err-contains-supercall.case // - src/class-fields/eval-err-contains-supercall.case
// - src/class-fields/initializer-eval-super/cls-expr-fields-eval.template // - src/class-fields/initializer-eval-super-call/cls-expr-fields-eval.template
/*--- /*---
description: error if `super()` in StatementList of eval (direct eval) description: error if `super()` in StatementList of eval (direct eval)
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer

View File

@ -1,8 +1,8 @@
// This file was procedurally generated from the following sources: // This file was procedurally generated from the following sources:
// - src/class-fields/eval-err-contains-superproperty-1.case // - src/class-fields/eval-err-contains-superproperty-1.case
// - src/class-fields/initializer-eval-super/cls-expr-fields-eval.template // - src/class-fields/initializer-eval-super-property/cls-expr-fields-eval.template
/*--- /*---
description: error if `super().x` in StatementList of eval (direct eval) description: error if `super.x` in StatementList of eval (direct eval)
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer
features: [class-fields] features: [class-fields]
flags: [generated] flags: [generated]
@ -30,8 +30,6 @@ var C = class extends A {
x = eval('executed = true; super.x;'); x = eval('executed = true; super.x;');
} }
assert.throws(SyntaxError, function() {
new C(); new C();
});
assert.sameValue(executed, false); assert.sameValue(executed, true);

View File

@ -1,8 +1,8 @@
// This file was procedurally generated from the following sources: // This file was procedurally generated from the following sources:
// - src/class-fields/eval-err-contains-superproperty-2.case // - src/class-fields/eval-err-contains-superproperty-2.case
// - src/class-fields/initializer-eval-super/cls-expr-fields-eval.template // - src/class-fields/initializer-eval-super-property/cls-expr-fields-eval.template
/*--- /*---
description: error if `super().x` in StatementList of eval (direct eval) description: error if `super['x']` in StatementList of eval (direct eval)
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer
features: [class-fields] features: [class-fields]
flags: [generated] flags: [generated]
@ -30,8 +30,6 @@ var C = class extends A {
x = eval('executed = true; super["x"];'); x = eval('executed = true; super["x"];');
} }
assert.throws(SyntaxError, function() {
new C(); new C();
});
assert.sameValue(executed, false); assert.sameValue(executed, true);

View File

@ -1,8 +1,8 @@
// This file was procedurally generated from the following sources: // This file was procedurally generated from the following sources:
// - src/class-fields/eval-err-contains-supercall-1.case // - src/class-fields/eval-err-contains-supercall-1.case
// - src/class-fields/initializer-eval-super/cls-expr-fields-indirect-eval.template // - src/class-fields/initializer-eval-super-call/cls-expr-fields-indirect-eval.template
/*--- /*---
description: error if `super()` in StatementList of eval (indirect eval) description: error if `super()['x']` in StatementList of eval (indirect eval)
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer
features: [class-fields] features: [class-fields]
flags: [generated] flags: [generated]
@ -27,11 +27,11 @@ var A = class {}
var executed = false; var executed = false;
var C = class extends A { var C = class extends A {
x = (0, eval)('executed = true; super();'); x = (0, eval)('executed = true; super()["x"];');
} }
assert.throws(SyntaxError, function() { assert.throws(SyntaxError, function() {
new C(); new C();
}); });
assert.sameValue(executed, true); assert.sameValue(executed, false);

View File

@ -1,6 +1,6 @@
// This file was procedurally generated from the following sources: // This file was procedurally generated from the following sources:
// - src/class-fields/eval-err-contains-supercall-2.case // - src/class-fields/eval-err-contains-supercall-2.case
// - src/class-fields/initializer-eval-super/cls-expr-fields-indirect-eval.template // - src/class-fields/initializer-eval-super-call/cls-expr-fields-indirect-eval.template
/*--- /*---
description: error if `super().x` in StatementList of eval (indirect eval) description: error if `super().x` in StatementList of eval (indirect eval)
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer
@ -14,8 +14,8 @@ info: |
... ...
The remaining eval rules apply as outside a constructor, inside a method, and inside a function. The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
Additional Early Error Rules for Eval Outside Methods Additional Early Error Rules for Eval Outside Constructor Methods
These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
ScriptBody:StatementList ScriptBody:StatementList
It is a Syntax Error if StatementList Contains SuperCall. It is a Syntax Error if StatementList Contains SuperCall.
@ -34,4 +34,4 @@ assert.throws(SyntaxError, function() {
new C(); new C();
}); });
assert.sameValue(executed, true); assert.sameValue(executed, false);

View File

@ -1,6 +1,6 @@
// This file was procedurally generated from the following sources: // This file was procedurally generated from the following sources:
// - src/class-fields/eval-err-contains-supercall.case // - src/class-fields/eval-err-contains-supercall.case
// - src/class-fields/initializer-eval-super/cls-expr-fields-indirect-eval.template // - src/class-fields/initializer-eval-super-call/cls-expr-fields-indirect-eval.template
/*--- /*---
description: error if `super()` in StatementList of eval (indirect eval) description: error if `super()` in StatementList of eval (indirect eval)
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer
@ -34,4 +34,4 @@ assert.throws(SyntaxError, function() {
new C(); new C();
}); });
assert.sameValue(executed, true); assert.sameValue(executed, false);

View File

@ -1,8 +1,8 @@
// This file was procedurally generated from the following sources: // This file was procedurally generated from the following sources:
// - src/class-fields/eval-err-contains-superproperty-1.case // - src/class-fields/eval-err-contains-superproperty-1.case
// - src/class-fields/initializer-eval-super/cls-expr-fields-indirect-eval.template // - src/class-fields/initializer-eval-super-property/cls-expr-fields-indirect-eval.template
/*--- /*---
description: error if `super().x` in StatementList of eval (indirect eval) description: error if `super.x` in StatementList of eval (indirect eval)
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer
features: [class-fields] features: [class-fields]
flags: [generated] flags: [generated]
@ -34,4 +34,4 @@ assert.throws(SyntaxError, function() {
new C(); new C();
}); });
assert.sameValue(executed, true); assert.sameValue(executed, false);

View File

@ -1,8 +1,8 @@
// This file was procedurally generated from the following sources: // This file was procedurally generated from the following sources:
// - src/class-fields/eval-err-contains-superproperty-2.case // - src/class-fields/eval-err-contains-superproperty-2.case
// - src/class-fields/initializer-eval-super/cls-expr-fields-indirect-eval.template // - src/class-fields/initializer-eval-super-property/cls-expr-fields-indirect-eval.template
/*--- /*---
description: error if `super().x` in StatementList of eval (indirect eval) description: error if `super['x']` in StatementList of eval (indirect eval)
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer
features: [class-fields] features: [class-fields]
flags: [generated] flags: [generated]
@ -34,4 +34,4 @@ assert.throws(SyntaxError, function() {
new C(); new C();
}); });
assert.sameValue(executed, true); assert.sameValue(executed, false);

View File

@ -1,6 +1,6 @@
// This file was procedurally generated from the following sources: // This file was procedurally generated from the following sources:
// - src/class-fields/eval-err-contains-arguments.case // - src/class-fields/eval-err-contains-arguments.case
// - src/class-fields/initializer-eval/cls-expr-fields-eval.template // - src/class-fields/initializer-eval-arguments/cls-expr-fields-eval.template
/*--- /*---
description: error if `arguments` in StatementList of eval (direct eval) description: error if `arguments` in StatementList of eval (direct eval)
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer

View File

@ -1,8 +1,8 @@
// This file was procedurally generated from the following sources: // This file was procedurally generated from the following sources:
// - src/class-fields/eval-err-contains-newcall.case // - src/class-fields/eval-err-contains-newtarget.case
// - src/class-fields/initializer-eval/cls-expr-fields-indirect-eval.template // - src/class-fields/initializer-eval-newtarget/cls-expr-fields-eval.template
/*--- /*---
description: error if `new.call` in StatementList of eval (indirect eval) description: error if `new.target` in StatementList of eval (direct eval)
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer
features: [class-fields] features: [class-fields]
flags: [generated] flags: [generated]
@ -25,11 +25,10 @@ info: |
var executed = false; var executed = false;
var C = class { var C = class {
x = (0, eval)('executed = true; new.call;'); x = eval('executed = true; new.target;');
} }
assert.throws(SyntaxError, function() { var c = new C();
new C();
});
assert.sameValue(executed, true); assert.sameValue(executed, true);
assert.sameValue(c.x, undefined);

View File

@ -1,6 +1,6 @@
// This file was procedurally generated from the following sources: // This file was procedurally generated from the following sources:
// - src/class-fields/eval-err-contains-arguments.case // - src/class-fields/eval-err-contains-arguments.case
// - src/class-fields/initializer-eval/cls-expr-fields-indirect-eval.template // - src/class-fields/initializer-eval-arguments/cls-expr-fields-indirect-eval.template
/*--- /*---
description: error if `arguments` in StatementList of eval (indirect eval) description: error if `arguments` in StatementList of eval (indirect eval)
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer

View File

@ -1,8 +1,8 @@
// This file was procedurally generated from the following sources: // This file was procedurally generated from the following sources:
// - src/class-fields/eval-err-contains-newcall.case // - src/class-fields/eval-err-contains-newtarget.case
// - src/class-fields/initializer-eval/cls-expr-fields-eval.template // - src/class-fields/initializer-eval-newtarget/cls-expr-fields-indirect-eval.template
/*--- /*---
description: error if `new.call` in StatementList of eval (direct eval) description: error if `new.target` in StatementList of eval (indirect eval)
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer
features: [class-fields] features: [class-fields]
flags: [generated] flags: [generated]
@ -25,7 +25,7 @@ info: |
var executed = false; var executed = false;
var C = class { var C = class {
x = eval('executed = true; new.call;'); x = (0, eval)('executed = true; new.target;');
} }
assert.throws(SyntaxError, function() { assert.throws(SyntaxError, function() {

View File

@ -37,15 +37,18 @@ class B {
assert.sameValue(typeof B.name, 'function'); assert.sameValue(typeof B.name, 'function');
var isDefined = false;
class C { class C {
static get name() { static get name() {
if (isDefined) {
return 'pass';
}
$ERROR('Static `get` accessor should not be executed during definition'); $ERROR('Static `get` accessor should not be executed during definition');
} }
} }
assert.throws(Test262Error, function() { isDefined = true;
C.name; assert.sameValue(C.name, 'pass');
});
class D { class D {
static set name(_) { static set name(_) {

View File

@ -1,8 +1,8 @@
// This file was procedurally generated from the following sources: // This file was procedurally generated from the following sources:
// - src/class-fields/eval-err-contains-supercall-1.case // - src/class-fields/eval-err-contains-supercall-1.case
// - src/class-fields/initializer-eval-super/cls-decl-fields-eval.template // - src/class-fields/initializer-eval-super-call/cls-decl-fields-eval.template
/*--- /*---
description: error if `super()` in StatementList of eval (direct eval) description: error if `super()['x']` in StatementList of eval (direct eval)
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer
features: [class-fields] features: [class-fields]
flags: [generated] flags: [generated]
@ -23,11 +23,11 @@ info: |
---*/ ---*/
class A = {} class A {}
var executed = false; var executed = false;
class C extends A = { class C extends A {
x = eval('executed = true; super();'); x = eval('executed = true; super()["x"];');
} }
assert.throws(SyntaxError, function() { assert.throws(SyntaxError, function() {

View File

@ -1,6 +1,6 @@
// This file was procedurally generated from the following sources: // This file was procedurally generated from the following sources:
// - src/class-fields/eval-err-contains-supercall-2.case // - src/class-fields/eval-err-contains-supercall-2.case
// - src/class-fields/initializer-eval-super/cls-decl-fields-eval.template // - src/class-fields/initializer-eval-super-call/cls-decl-fields-eval.template
/*--- /*---
description: error if `super().x` in StatementList of eval (direct eval) description: error if `super().x` in StatementList of eval (direct eval)
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer
@ -14,8 +14,8 @@ info: |
... ...
The remaining eval rules apply as outside a constructor, inside a method, and inside a function. The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
Additional Early Error Rules for Eval Outside Methods Additional Early Error Rules for Eval Outside Constructor Methods
These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
ScriptBody:StatementList ScriptBody:StatementList
It is a Syntax Error if StatementList Contains SuperCall. It is a Syntax Error if StatementList Contains SuperCall.
@ -23,10 +23,10 @@ info: |
---*/ ---*/
class A = {} class A {}
var executed = false; var executed = false;
class C extends A = { class C extends A {
x = eval('executed = true; super().x;'); x = eval('executed = true; super().x;');
} }

View File

@ -1,6 +1,6 @@
// This file was procedurally generated from the following sources: // This file was procedurally generated from the following sources:
// - src/class-fields/eval-err-contains-supercall.case // - src/class-fields/eval-err-contains-supercall.case
// - src/class-fields/initializer-eval-super/cls-decl-fields-eval.template // - src/class-fields/initializer-eval-super-call/cls-decl-fields-eval.template
/*--- /*---
description: error if `super()` in StatementList of eval (direct eval) description: error if `super()` in StatementList of eval (direct eval)
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer
@ -23,10 +23,10 @@ info: |
---*/ ---*/
class A = {} class A {}
var executed = false; var executed = false;
class C extends A = { class C extends A {
x = eval('executed = true; super();'); x = eval('executed = true; super();');
} }

View File

@ -1,8 +1,8 @@
// This file was procedurally generated from the following sources: // This file was procedurally generated from the following sources:
// - src/class-fields/eval-err-contains-superproperty-1.case // - src/class-fields/eval-err-contains-superproperty-1.case
// - src/class-fields/initializer-eval-super/cls-decl-fields-eval.template // - src/class-fields/initializer-eval-super-property/cls-decl-fields-eval.template
/*--- /*---
description: error if `super().x` in StatementList of eval (direct eval) description: error if `super.x` in StatementList of eval (direct eval)
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer
features: [class-fields] features: [class-fields]
flags: [generated] flags: [generated]
@ -23,15 +23,13 @@ info: |
---*/ ---*/
class A = {} class A {}
var executed = false; var executed = false;
class C extends A = { class C extends A {
x = eval('executed = true; super.x;'); x = eval('executed = true; super.x;');
} }
assert.throws(SyntaxError, function() {
new C(); new C();
});
assert.sameValue(executed, false); assert.sameValue(executed, true);

View File

@ -1,8 +1,8 @@
// This file was procedurally generated from the following sources: // This file was procedurally generated from the following sources:
// - src/class-fields/eval-err-contains-superproperty-2.case // - src/class-fields/eval-err-contains-superproperty-2.case
// - src/class-fields/initializer-eval-super/cls-decl-fields-eval.template // - src/class-fields/initializer-eval-super-property/cls-decl-fields-eval.template
/*--- /*---
description: error if `super().x` in StatementList of eval (direct eval) description: error if `super['x']` in StatementList of eval (direct eval)
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer
features: [class-fields] features: [class-fields]
flags: [generated] flags: [generated]
@ -23,15 +23,13 @@ info: |
---*/ ---*/
class A = {} class A {}
var executed = false; var executed = false;
class C extends A = { class C extends A {
x = eval('executed = true; super["x"];'); x = eval('executed = true; super["x"];');
} }
assert.throws(SyntaxError, function() {
new C(); new C();
});
assert.sameValue(executed, false); assert.sameValue(executed, true);

View File

@ -1,8 +1,8 @@
// This file was procedurally generated from the following sources: // This file was procedurally generated from the following sources:
// - src/class-fields/eval-err-contains-supercall-1.case // - src/class-fields/eval-err-contains-supercall-1.case
// - src/class-fields/initializer-eval-super/cls-decl-fields-indirect-eval.template // - src/class-fields/initializer-eval-super-call/cls-decl-fields-indirect-eval.template
/*--- /*---
description: error if `super()` in StatementList of eval (indirect eval) description: error if `super()['x']` in StatementList of eval (indirect eval)
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer
features: [class-fields] features: [class-fields]
flags: [generated] flags: [generated]
@ -23,15 +23,15 @@ info: |
---*/ ---*/
class A = {} class A {}
var executed = false; var executed = false;
class C extends A = { class C extends A {
x = (0, eval)('executed = true; super();'); x = (0, eval)('executed = true; super()["x"];');
} }
assert.throws(SyntaxError, function() { assert.throws(SyntaxError, function() {
new C(); new C();
}); });
assert.sameValue(executed, true); assert.sameValue(executed, false);

View File

@ -1,6 +1,6 @@
// This file was procedurally generated from the following sources: // This file was procedurally generated from the following sources:
// - src/class-fields/eval-err-contains-supercall-2.case // - src/class-fields/eval-err-contains-supercall-2.case
// - src/class-fields/initializer-eval-super/cls-decl-fields-indirect-eval.template // - src/class-fields/initializer-eval-super-call/cls-decl-fields-indirect-eval.template
/*--- /*---
description: error if `super().x` in StatementList of eval (indirect eval) description: error if `super().x` in StatementList of eval (indirect eval)
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer
@ -14,8 +14,8 @@ info: |
... ...
The remaining eval rules apply as outside a constructor, inside a method, and inside a function. The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
Additional Early Error Rules for Eval Outside Methods Additional Early Error Rules for Eval Outside Constructor Methods
These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
ScriptBody:StatementList ScriptBody:StatementList
It is a Syntax Error if StatementList Contains SuperCall. It is a Syntax Error if StatementList Contains SuperCall.
@ -23,10 +23,10 @@ info: |
---*/ ---*/
class A = {} class A {}
var executed = false; var executed = false;
class C extends A = { class C extends A {
x = (0, eval)('executed = true; super().x;'); x = (0, eval)('executed = true; super().x;');
} }
@ -34,4 +34,4 @@ assert.throws(SyntaxError, function() {
new C(); new C();
}); });
assert.sameValue(executed, true); assert.sameValue(executed, false);

View File

@ -1,6 +1,6 @@
// This file was procedurally generated from the following sources: // This file was procedurally generated from the following sources:
// - src/class-fields/eval-err-contains-supercall.case // - src/class-fields/eval-err-contains-supercall.case
// - src/class-fields/initializer-eval-super/cls-decl-fields-indirect-eval.template // - src/class-fields/initializer-eval-super-call/cls-decl-fields-indirect-eval.template
/*--- /*---
description: error if `super()` in StatementList of eval (indirect eval) description: error if `super()` in StatementList of eval (indirect eval)
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer
@ -23,10 +23,10 @@ info: |
---*/ ---*/
class A = {} class A {}
var executed = false; var executed = false;
class C extends A = { class C extends A {
x = (0, eval)('executed = true; super();'); x = (0, eval)('executed = true; super();');
} }
@ -34,4 +34,4 @@ assert.throws(SyntaxError, function() {
new C(); new C();
}); });
assert.sameValue(executed, true); assert.sameValue(executed, false);

View File

@ -1,8 +1,8 @@
// This file was procedurally generated from the following sources: // This file was procedurally generated from the following sources:
// - src/class-fields/eval-err-contains-superproperty-1.case // - src/class-fields/eval-err-contains-superproperty-1.case
// - src/class-fields/initializer-eval-super/cls-decl-fields-indirect-eval.template // - src/class-fields/initializer-eval-super-property/cls-decl-fields-indirect-eval.template
/*--- /*---
description: error if `super().x` in StatementList of eval (indirect eval) description: error if `super.x` in StatementList of eval (indirect eval)
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer
features: [class-fields] features: [class-fields]
flags: [generated] flags: [generated]
@ -23,10 +23,10 @@ info: |
---*/ ---*/
class A = {} class A {}
var executed = false; var executed = false;
class C extends A = { class C extends A {
x = (0, eval)('executed = true; super.x;'); x = (0, eval)('executed = true; super.x;');
} }
@ -34,4 +34,4 @@ assert.throws(SyntaxError, function() {
new C(); new C();
}); });
assert.sameValue(executed, true); assert.sameValue(executed, false);

View File

@ -1,8 +1,8 @@
// This file was procedurally generated from the following sources: // This file was procedurally generated from the following sources:
// - src/class-fields/eval-err-contains-superproperty-2.case // - src/class-fields/eval-err-contains-superproperty-2.case
// - src/class-fields/initializer-eval-super/cls-decl-fields-indirect-eval.template // - src/class-fields/initializer-eval-super-property/cls-decl-fields-indirect-eval.template
/*--- /*---
description: error if `super().x` in StatementList of eval (indirect eval) description: error if `super['x']` in StatementList of eval (indirect eval)
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer
features: [class-fields] features: [class-fields]
flags: [generated] flags: [generated]
@ -23,10 +23,10 @@ info: |
---*/ ---*/
class A = {} class A {}
var executed = false; var executed = false;
class C extends A = { class C extends A {
x = (0, eval)('executed = true; super["x"];'); x = (0, eval)('executed = true; super["x"];');
} }
@ -34,4 +34,4 @@ assert.throws(SyntaxError, function() {
new C(); new C();
}); });
assert.sameValue(executed, true); assert.sameValue(executed, false);

View File

@ -1,6 +1,6 @@
// This file was procedurally generated from the following sources: // This file was procedurally generated from the following sources:
// - src/class-fields/eval-err-contains-arguments.case // - src/class-fields/eval-err-contains-arguments.case
// - src/class-fields/initializer-eval/cls-decl-fields-eval.template // - src/class-fields/initializer-eval-arguments/cls-decl-fields-eval.template
/*--- /*---
description: error if `arguments` in StatementList of eval (direct eval) description: error if `arguments` in StatementList of eval (direct eval)
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer
@ -25,7 +25,7 @@ info: |
var executed = false; var executed = false;
class C = { class C {
x = eval('executed = true; arguments;'); x = eval('executed = true; arguments;');
} }

View File

@ -1,8 +1,8 @@
// This file was procedurally generated from the following sources: // This file was procedurally generated from the following sources:
// - src/class-fields/eval-err-contains-newcall.case // - src/class-fields/eval-err-contains-newtarget.case
// - src/class-fields/initializer-eval/cls-decl-fields-indirect-eval.template // - src/class-fields/initializer-eval-newtarget/cls-decl-fields-eval.template
/*--- /*---
description: error if `new.call` in StatementList of eval (indirect eval) description: error if `new.target` in StatementList of eval (direct eval)
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer
features: [class-fields] features: [class-fields]
flags: [generated] flags: [generated]
@ -24,12 +24,11 @@ info: |
var executed = false; var executed = false;
class C = { class C {
x = (0, eval)('executed = true; new.call;'); x = eval('executed = true; new.target;');
} }
assert.throws(SyntaxError, function() { var c = new C();
new C();
});
assert.sameValue(executed, true); assert.sameValue(executed, true);
assert.sameValue(c.x, undefined);

View File

@ -1,6 +1,6 @@
// This file was procedurally generated from the following sources: // This file was procedurally generated from the following sources:
// - src/class-fields/eval-err-contains-arguments.case // - src/class-fields/eval-err-contains-arguments.case
// - src/class-fields/initializer-eval/cls-decl-fields-indirect-eval.template // - src/class-fields/initializer-eval-arguments/cls-decl-fields-indirect-eval.template
/*--- /*---
description: error if `arguments` in StatementList of eval (indirect eval) description: error if `arguments` in StatementList of eval (indirect eval)
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer
@ -25,7 +25,7 @@ info: |
var executed = false; var executed = false;
class C = { class C {
x = (0, eval)('executed = true; arguments;'); x = (0, eval)('executed = true; arguments;');
} }

View File

@ -1,8 +1,8 @@
// This file was procedurally generated from the following sources: // This file was procedurally generated from the following sources:
// - src/class-fields/eval-err-contains-newcall.case // - src/class-fields/eval-err-contains-newtarget.case
// - src/class-fields/initializer-eval/cls-decl-fields-eval.template // - src/class-fields/initializer-eval-newtarget/cls-decl-fields-indirect-eval.template
/*--- /*---
description: error if `new.call` in StatementList of eval (direct eval) description: error if `new.target` in StatementList of eval (indirect eval)
esid: sec-performeval-rules-in-initializer esid: sec-performeval-rules-in-initializer
features: [class-fields] features: [class-fields]
flags: [generated] flags: [generated]
@ -24,8 +24,8 @@ info: |
var executed = false; var executed = false;
class C = { class C {
x = eval('executed = true; new.call;'); x = (0, eval)('executed = true; new.target;');
} }
assert.throws(SyntaxError, function() { assert.throws(SyntaxError, function() {