mirror of https://github.com/tc39/test262.git
Rename and update assignment early error tests
This commit is contained in:
parent
4d95f88c08
commit
4494db10b7
|
@ -1,15 +0,0 @@
|
||||||
// Copyright (c) 2012 Ecma International. All rights reserved.
|
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
|
||||||
|
|
||||||
/*---
|
|
||||||
info: PutValue operates only on references (see step 1)
|
|
||||||
es5id: 11.13.1-1-1
|
|
||||||
description: >
|
|
||||||
simple assignment throws ReferenceError if LeftHandSide is not a
|
|
||||||
reference (number)
|
|
||||||
---*/
|
|
||||||
|
|
||||||
|
|
||||||
assert.throws(ReferenceError, function() {
|
|
||||||
eval("42 = 42");
|
|
||||||
});
|
|
|
@ -1,15 +0,0 @@
|
||||||
// Copyright (c) 2012 Ecma International. All rights reserved.
|
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
|
||||||
|
|
||||||
/*---
|
|
||||||
info: PutValue operates only on references (see step 1).
|
|
||||||
es5id: 11.13.1-1-2
|
|
||||||
description: >
|
|
||||||
simple assignment throws ReferenceError if LeftHandSide is not a
|
|
||||||
reference (string)
|
|
||||||
---*/
|
|
||||||
|
|
||||||
|
|
||||||
assert.throws(ReferenceError, function() {
|
|
||||||
eval("'x' = 42");
|
|
||||||
});
|
|
|
@ -1,15 +0,0 @@
|
||||||
// Copyright (c) 2012 Ecma International. All rights reserved.
|
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
|
||||||
|
|
||||||
/*---
|
|
||||||
info: PutValue operates only on references (see step 1).
|
|
||||||
es5id: 11.13.1-1-3
|
|
||||||
description: >
|
|
||||||
simple assignment throws ReferenceError if LeftHandSide is not a
|
|
||||||
reference (boolean)
|
|
||||||
---*/
|
|
||||||
|
|
||||||
|
|
||||||
assert.throws(ReferenceError, function() {
|
|
||||||
eval("true = 42");
|
|
||||||
});
|
|
|
@ -1,15 +0,0 @@
|
||||||
// Copyright (c) 2012 Ecma International. All rights reserved.
|
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
|
||||||
|
|
||||||
/*---
|
|
||||||
info: PutValue operates only on references (see step 1).
|
|
||||||
es5id: 11.13.1-1-4
|
|
||||||
description: >
|
|
||||||
simple assignment throws ReferenceError if LeftHandSide is not a
|
|
||||||
reference (null)
|
|
||||||
---*/
|
|
||||||
|
|
||||||
|
|
||||||
assert.throws(ReferenceError, function() {
|
|
||||||
eval("null = 42");
|
|
||||||
});
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-assignment-operators-static-semantics-early-errors
|
||||||
|
es5id: 11.13.1-1-3
|
||||||
|
description: >
|
||||||
|
simple assignment throws ReferenceError if LeftHandSide is not a
|
||||||
|
reference (boolean)
|
||||||
|
info: |
|
||||||
|
AssignmentExpression : LeftHandSideExpression = AssignmentExpression
|
||||||
|
|
||||||
|
It is an early Reference Error if LeftHandSideExpression is neither an
|
||||||
|
ObjectLiteral nor an ArrayLiteral and IsValidSimpleAssignmentTarget of
|
||||||
|
LeftHandSideExpression is false.
|
||||||
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: ReferenceError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
true = 42;
|
|
@ -0,0 +1,21 @@
|
||||||
|
// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-assignment-operators-static-semantics-early-errors
|
||||||
|
es5id: 11.13.1-1-4
|
||||||
|
description: >
|
||||||
|
simple assignment throws ReferenceError if LeftHandSide is not a
|
||||||
|
reference (null)
|
||||||
|
info: |
|
||||||
|
AssignmentExpression : LeftHandSideExpression = AssignmentExpression
|
||||||
|
|
||||||
|
It is an early Reference Error if LeftHandSideExpression is neither an
|
||||||
|
ObjectLiteral nor an ArrayLiteral and IsValidSimpleAssignmentTarget of
|
||||||
|
LeftHandSideExpression is false.
|
||||||
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: ReferenceError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
null = 42;
|
|
@ -0,0 +1,21 @@
|
||||||
|
// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-assignment-operators-static-semantics-early-errors
|
||||||
|
es5id: 11.13.1-1-1
|
||||||
|
description: >
|
||||||
|
simple assignment throws ReferenceError if LeftHandSide is not a
|
||||||
|
reference (number)
|
||||||
|
info: |
|
||||||
|
AssignmentExpression : LeftHandSideExpression = AssignmentExpression
|
||||||
|
|
||||||
|
It is an early Reference Error if LeftHandSideExpression is neither an
|
||||||
|
ObjectLiteral nor an ArrayLiteral and IsValidSimpleAssignmentTarget of
|
||||||
|
LeftHandSideExpression is false.
|
||||||
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: ReferenceError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
42 = 42;
|
|
@ -0,0 +1,21 @@
|
||||||
|
// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-assignment-operators-static-semantics-early-errors
|
||||||
|
es5id: 11.13.1-1-2
|
||||||
|
description: >
|
||||||
|
simple assignment throws ReferenceError if LeftHandSide is not a
|
||||||
|
reference (string)
|
||||||
|
info: |
|
||||||
|
AssignmentExpression : LeftHandSideExpression = AssignmentExpression
|
||||||
|
|
||||||
|
It is an early Reference Error if LeftHandSideExpression is neither an
|
||||||
|
ObjectLiteral nor an ArrayLiteral and IsValidSimpleAssignmentTarget of
|
||||||
|
LeftHandSideExpression is false.
|
||||||
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: ReferenceError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
'x' = 42;
|
Loading…
Reference in New Issue