mirror of https://github.com/tc39/test262.git
Merge pull request #140 from anba/issue-35/expressions
Fix strict mode errors in language/expressions
This commit is contained in:
commit
d075338699
|
@ -17,8 +17,3 @@ catch (e) {
|
||||||
$ERROR('#1.2: x + (x = 1) throw ReferenceError. Actual: ' + (e));
|
$ERROR('#1.2: x + (x = 1) throw ReferenceError. Actual: ' + (e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
|
||||||
if ((y = 1) + y !== 2) {
|
|
||||||
$ERROR('#2: (y = 1) + y === 2. Actual: ' + ((y = 1) + y));
|
|
||||||
}
|
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
info: First expression is evaluated first, and then second expression
|
||||||
|
es5id: 11.6.1_A2.4_T4
|
||||||
|
description: Checking with undeclarated variables
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//CHECK#1
|
||||||
|
if ((y = 1) + y !== 2) {
|
||||||
|
$ERROR('#1: (y = 1) + y === 2. Actual: ' + ((y = 1) + y));
|
||||||
|
}
|
|
@ -10,6 +10,7 @@ es5id: 11.13.1-4-1
|
||||||
description: >
|
description: >
|
||||||
simple assignment creates property on the global object if
|
simple assignment creates property on the global object if
|
||||||
LeftHandSide is an unresolvable reference
|
LeftHandSide is an unresolvable reference
|
||||||
|
flags: [noStrict]
|
||||||
includes:
|
includes:
|
||||||
- runTestCase.js
|
- runTestCase.js
|
||||||
- fnGlobalObject.js
|
- fnGlobalObject.js
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
/*---
|
/*---
|
||||||
es5id: 8.14.4-8-b_1
|
es5id: 8.14.4-8-b_1
|
||||||
description: Non-writable property on a prototype written to.
|
description: Non-writable property on a prototype written to.
|
||||||
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ if (x !== 1) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
//CHECK#2
|
||||||
y = 1;
|
x = 1;
|
||||||
if (y !== 1) {
|
if (x !== 1) {
|
||||||
$ERROR('#2: y = 1; y === 1. Actual: ' + (y));
|
$ERROR('#2: x = 1; x === 1. Actual: ' + (x));
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ description: Syntax check
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
|
var x;
|
||||||
x = x = 1;
|
x = x = 1;
|
||||||
if (x !== 1) {
|
if (x !== 1) {
|
||||||
$ERROR('#1: The expression x = x = 1 is the same x = (x = 1), not (x = x) = 1. Actual: ' + (x));
|
$ERROR('#1: The expression x = x = 1 is the same x = (x = 1), not (x = x) = 1. Actual: ' + (x));
|
||||||
|
|
|
@ -19,7 +19,7 @@ function testcase() {
|
||||||
var o = { };
|
var o = { };
|
||||||
try {
|
try {
|
||||||
o.bar( foo() );
|
o.bar( foo() );
|
||||||
throw new Exception("o.bar does not exist!");
|
$ERROR("o.bar does not exist!");
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
return (e instanceof TypeError) && (fooCalled===true);
|
return (e instanceof TypeError) && (fooCalled===true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ function testcase() {
|
||||||
var o = { };
|
var o = { };
|
||||||
try {
|
try {
|
||||||
o.bar( foo() );
|
o.bar( foo() );
|
||||||
throw new Exception("o.bar does not exist!");
|
$ERROR("o.bar does not exist!");
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
return (e instanceof TypeError) && (fooCalled===true);
|
return (e instanceof TypeError) && (fooCalled===true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ function testcase() {
|
||||||
var o = { };
|
var o = { };
|
||||||
try {
|
try {
|
||||||
o.bar.gar( foo() );
|
o.bar.gar( foo() );
|
||||||
throw new Exception("o.bar does not exist!");
|
$ERROR("o.bar does not exist!");
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
return (e instanceof TypeError) && (fooCalled===false);
|
return (e instanceof TypeError) && (fooCalled===false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ function testcase() {
|
||||||
set: function(x) {this.barSetter = true; }});
|
set: function(x) {this.barSetter = true; }});
|
||||||
try {
|
try {
|
||||||
o.bar( foo() );
|
o.bar( foo() );
|
||||||
throw new Exception("o.bar does not exist!");
|
$ERROR("o.bar does not exist!");
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
return (e instanceof TypeError) && (fooCalled===true) && (o.barGetter===true) && (o.barSetter===undefined);
|
return (e instanceof TypeError) && (fooCalled===true) && (o.barGetter===true) && (o.barSetter===undefined);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ function testcase() {
|
||||||
var o = { };
|
var o = { };
|
||||||
try {
|
try {
|
||||||
eval("o.bar( foo() );");
|
eval("o.bar( foo() );");
|
||||||
throw new Exception("o.bar does not exist!");
|
$ERROR("o.bar does not exist!");
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
return (e instanceof TypeError) && (fooCalled===true);
|
return (e instanceof TypeError) && (fooCalled===true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ function testcase() {
|
||||||
set: function(x) {this.barSetter = true; }});
|
set: function(x) {this.barSetter = true; }});
|
||||||
try {
|
try {
|
||||||
o.foo( o.bar );
|
o.foo( o.bar );
|
||||||
throw new Exception("o.foo does not exist!");
|
$ERROR("o.foo does not exist!");
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
return (e instanceof TypeError) && (o.barGetter===true) && (o.barSetter===undefined);
|
return (e instanceof TypeError) && (o.barGetter===true) && (o.barSetter===undefined);
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ function testcase() {
|
||||||
set: function(x) {this.barSetter = true; }});
|
set: function(x) {this.barSetter = true; }});
|
||||||
try {
|
try {
|
||||||
o.foo( o["bar"] );
|
o.foo( o["bar"] );
|
||||||
throw new Exception("o.foo does not exist!");
|
$ERROR("o.foo does not exist!");
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
return (e instanceof TypeError) && (o.barGetter===true) && (o.barSetter===undefined);
|
return (e instanceof TypeError) && (o.barGetter===true) && (o.barSetter===undefined);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,22 +9,18 @@ es5id: 11.2.3-3_8
|
||||||
description: >
|
description: >
|
||||||
Call arguments are evaluated before the check is made to see if
|
Call arguments are evaluated before the check is made to see if
|
||||||
the object is actually callable (global object)
|
the object is actually callable (global object)
|
||||||
|
flags: [noStrict]
|
||||||
includes:
|
includes:
|
||||||
- runTestCase.js
|
- runTestCase.js
|
||||||
- fnGlobalObject.js
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
if (this!==fnGlobalObject()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var fooCalled = false;
|
var fooCalled = false;
|
||||||
function foo(){ fooCalled = true; }
|
function foo(){ fooCalled = true; }
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.bar( foo() );
|
this.bar( foo() );
|
||||||
throw new Exception("this.bar does not exist!");
|
$ERROR("this.bar does not exist!");
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
return (e instanceof TypeError) && (fooCalled===true);
|
return (e instanceof TypeError) && (fooCalled===true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ description: >
|
||||||
ArgumentList, in order, followed at the end by
|
ArgumentList, in order, followed at the end by
|
||||||
GetValue(AssignmentExpression), which is the last item of the new
|
GetValue(AssignmentExpression), which is the last item of the new
|
||||||
list
|
list
|
||||||
|
flags: [noStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function f_arg() {
|
function f_arg() {
|
||||||
|
|
|
@ -10,6 +10,7 @@ description: >
|
||||||
ArgumentList, in order, followed at the end by
|
ArgumentList, in order, followed at the end by
|
||||||
GetValue(AssignmentExpression), which is the last item of the new
|
GetValue(AssignmentExpression), which is the last item of the new
|
||||||
list
|
list
|
||||||
|
flags: [noStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function f_arg(x,y,z) {
|
function f_arg(x,y,z) {
|
||||||
|
|
|
@ -15,6 +15,7 @@ if (x !== -1) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
//CHECK#2
|
||||||
|
var y;
|
||||||
y = 1;
|
y = 1;
|
||||||
y *= -1;
|
y *= -1;
|
||||||
if (y !== -1) {
|
if (y !== -1) {
|
||||||
|
|
|
@ -15,6 +15,7 @@ if (x !== 1) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
//CHECK#2
|
||||||
|
var y;
|
||||||
y = 1;
|
y = 1;
|
||||||
y ^= 0;
|
y ^= 0;
|
||||||
if (y !== 1) {
|
if (y !== 1) {
|
||||||
|
|
|
@ -15,6 +15,7 @@ if (x !== 1) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
//CHECK#2
|
||||||
|
var y;
|
||||||
y = 1;
|
y = 1;
|
||||||
y |= 0;
|
y |= 0;
|
||||||
if (y !== 1) {
|
if (y !== 1) {
|
||||||
|
|
|
@ -15,6 +15,7 @@ if (x !== -1) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
//CHECK#2
|
||||||
|
var y;
|
||||||
y = 1;
|
y = 1;
|
||||||
y /= -1;
|
y /= -1;
|
||||||
if (y !== -1) {
|
if (y !== -1) {
|
||||||
|
|
|
@ -15,6 +15,7 @@ if (x !== -1) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
//CHECK#2
|
||||||
|
var y;
|
||||||
y = -1;
|
y = -1;
|
||||||
y %= 2;
|
y %= 2;
|
||||||
if (y !== -1) {
|
if (y !== -1) {
|
||||||
|
|
|
@ -15,6 +15,7 @@ if (x !== 2) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
//CHECK#2
|
||||||
|
var y;
|
||||||
y = 1;
|
y = 1;
|
||||||
y += 1;
|
y += 1;
|
||||||
if (y !== 2) {
|
if (y !== 2) {
|
||||||
|
|
|
@ -15,6 +15,7 @@ if (x !== -2) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
//CHECK#2
|
||||||
|
var y;
|
||||||
y = -1;
|
y = -1;
|
||||||
y -= 1;
|
y -= 1;
|
||||||
if (y !== -2) {
|
if (y !== -2) {
|
||||||
|
|
|
@ -15,6 +15,7 @@ if (x !== 2) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
//CHECK#2
|
||||||
|
var y;
|
||||||
y = 1;
|
y = 1;
|
||||||
y <<= 1;
|
y <<= 1;
|
||||||
if (y !== 2) {
|
if (y !== 2) {
|
||||||
|
|
|
@ -15,6 +15,7 @@ if (x !== 2) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
//CHECK#2
|
||||||
|
var y;
|
||||||
y = 4;
|
y = 4;
|
||||||
y >>= 1;
|
y >>= 1;
|
||||||
if (y !== 2) {
|
if (y !== 2) {
|
||||||
|
|
|
@ -15,6 +15,7 @@ if (x !== 2) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
//CHECK#2
|
||||||
|
var y;
|
||||||
y = 4;
|
y = 4;
|
||||||
y >>>= 1;
|
y >>>= 1;
|
||||||
if (y !== 2) {
|
if (y !== 2) {
|
||||||
|
|
|
@ -15,6 +15,7 @@ if (x !== 1) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
//CHECK#2
|
||||||
|
var y;
|
||||||
y = 1;
|
y = 1;
|
||||||
y &= 1;
|
y &= 1;
|
||||||
if (y !== 1) {
|
if (y !== 1) {
|
||||||
|
|
|
@ -15,6 +15,8 @@ if (x1 !== -1) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
//CHECK#2
|
||||||
|
var y;
|
||||||
|
var y1;
|
||||||
y = 1;
|
y = 1;
|
||||||
y1 = (y *= -1);
|
y1 = (y *= -1);
|
||||||
if (y1 !== -1) {
|
if (y1 !== -1) {
|
||||||
|
|
|
@ -15,6 +15,8 @@ if (x1 !== 1) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
//CHECK#2
|
||||||
|
var y;
|
||||||
|
var y1;
|
||||||
y = 1;
|
y = 1;
|
||||||
y1 = (y ^= 0);
|
y1 = (y ^= 0);
|
||||||
if (y1 !== 1) {
|
if (y1 !== 1) {
|
||||||
|
|
|
@ -15,6 +15,8 @@ if (x1 !== 1) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
//CHECK#2
|
||||||
|
var y;
|
||||||
|
var y1;
|
||||||
y = 1;
|
y = 1;
|
||||||
y1 = (y |= 0);
|
y1 = (y |= 0);
|
||||||
if (y1 !== 1) {
|
if (y1 !== 1) {
|
||||||
|
|
|
@ -15,6 +15,8 @@ if (x1 !== -1) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
//CHECK#2
|
||||||
|
var y;
|
||||||
|
var y1;
|
||||||
y = 1;
|
y = 1;
|
||||||
y1 = (y /= -1);
|
y1 = (y /= -1);
|
||||||
if (y1 !== -1) {
|
if (y1 !== -1) {
|
||||||
|
|
|
@ -15,6 +15,8 @@ if (x1 !== -1) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
//CHECK#2
|
||||||
|
var y;
|
||||||
|
var y1;
|
||||||
y = -1;
|
y = -1;
|
||||||
y1 = (y %= 2);
|
y1 = (y %= 2);
|
||||||
if (y1 !== -1) {
|
if (y1 !== -1) {
|
||||||
|
|
|
@ -15,6 +15,8 @@ if (x1 !== 2) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
//CHECK#2
|
||||||
|
var y;
|
||||||
|
var y1;
|
||||||
y = 1;
|
y = 1;
|
||||||
y1 = (y += 1);
|
y1 = (y += 1);
|
||||||
if (y1 !== 2) {
|
if (y1 !== 2) {
|
||||||
|
|
|
@ -15,6 +15,8 @@ if (x1 !== -2) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
//CHECK#2
|
||||||
|
var y;
|
||||||
|
var y1;
|
||||||
y = -1;
|
y = -1;
|
||||||
y1 = (y -= 1);
|
y1 = (y -= 1);
|
||||||
if (y1 !== -2) {
|
if (y1 !== -2) {
|
||||||
|
|
|
@ -15,6 +15,8 @@ if (x1 !== 2) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
//CHECK#2
|
||||||
|
var y;
|
||||||
|
var y1;
|
||||||
y = 1;
|
y = 1;
|
||||||
y1 = (y <<= 1);
|
y1 = (y <<= 1);
|
||||||
if (y1 !== 2) {
|
if (y1 !== 2) {
|
||||||
|
|
|
@ -15,6 +15,8 @@ if (x1 !== 2) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
//CHECK#2
|
||||||
|
var y;
|
||||||
|
var y1;
|
||||||
y = 4;
|
y = 4;
|
||||||
y1 = (y >>= 1);
|
y1 = (y >>= 1);
|
||||||
if (y1 !== 2) {
|
if (y1 !== 2) {
|
||||||
|
|
|
@ -15,6 +15,8 @@ if (x1 !== 2) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
//CHECK#2
|
||||||
|
var y;
|
||||||
|
var y1;
|
||||||
y = 4;
|
y = 4;
|
||||||
y1 = (y >>>= 1);
|
y1 = (y >>>= 1);
|
||||||
if (y1 !== 2) {
|
if (y1 !== 2) {
|
||||||
|
|
|
@ -15,6 +15,8 @@ if (x1 !== 1) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
//CHECK#2
|
||||||
|
var y;
|
||||||
|
var y1;
|
||||||
y = 1;
|
y = 1;
|
||||||
y1 = (y &= 1);
|
y1 = (y &= 1);
|
||||||
if (y1 !== 1) {
|
if (y1 !== 1) {
|
||||||
|
|
|
@ -10,6 +10,7 @@ info: >
|
||||||
language provides no way to directly exercise [[Delete]], the tests are placed here.
|
language provides no way to directly exercise [[Delete]], the tests are placed here.
|
||||||
es5id: 11.4.1-0-1
|
es5id: 11.4.1-0-1
|
||||||
description: delete operator as UnaryExpression
|
description: delete operator as UnaryExpression
|
||||||
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ es5id: 11.4.1-3-1
|
||||||
description: >
|
description: >
|
||||||
delete operator returns true when deleting an unresolvable
|
delete operator returns true when deleting an unresolvable
|
||||||
reference
|
reference
|
||||||
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ es5id: 11.4.1-4.a-11
|
||||||
description: >
|
description: >
|
||||||
delete operator returns true on deleting arguments
|
delete operator returns true on deleting arguments
|
||||||
propterties(arguments.callee)
|
propterties(arguments.callee)
|
||||||
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ info: >
|
||||||
language provides no way to directly exercise [[Delete]], the tests are placed here.
|
language provides no way to directly exercise [[Delete]], the tests are placed here.
|
||||||
es5id: 11.4.1-4.a-12
|
es5id: 11.4.1-4.a-12
|
||||||
description: delete operator returns false when deleting a property(length)
|
description: delete operator returns false when deleting a property(length)
|
||||||
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ info: >
|
||||||
language provides no way to directly exercise [[Delete]], the tests are placed here.
|
language provides no way to directly exercise [[Delete]], the tests are placed here.
|
||||||
es5id: 11.4.1-4.a-13
|
es5id: 11.4.1-4.a-13
|
||||||
description: delete operator returns false when deleting Array object
|
description: delete operator returns false when deleting Array object
|
||||||
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ info: >
|
||||||
language provides no way to directly exercise [[Delete]], the tests are placed here.
|
language provides no way to directly exercise [[Delete]], the tests are placed here.
|
||||||
es5id: 11.4.1-4.a-16
|
es5id: 11.4.1-4.a-16
|
||||||
description: delete operator returns false on deleting arguments object
|
description: delete operator returns false on deleting arguments object
|
||||||
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ es5id: 11.4.1-4.a-3
|
||||||
description: >
|
description: >
|
||||||
delete operator returns false when deleting a non-configurable
|
delete operator returns false when deleting a non-configurable
|
||||||
data property
|
data property
|
||||||
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ es5id: 11.4.1-4.a-4
|
||||||
description: >
|
description: >
|
||||||
delete operator returns false when deleting a non-configurable
|
delete operator returns false when deleting a non-configurable
|
||||||
data property (NaN)
|
data property (NaN)
|
||||||
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ es5id: 11.4.1-4.a-5
|
||||||
description: >
|
description: >
|
||||||
delete operator returns false when deleting the environment object
|
delete operator returns false when deleting the environment object
|
||||||
inside 'with'
|
inside 'with'
|
||||||
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ info: >
|
||||||
language provides no way to directly exercise [[Delete]], the tests are placed here.
|
language provides no way to directly exercise [[Delete]], the tests are placed here.
|
||||||
es5id: 11.4.1-4.a-6
|
es5id: 11.4.1-4.a-6
|
||||||
description: delete operator returns true when deleting a property inside 'with'
|
description: delete operator returns true when deleting a property inside 'with'
|
||||||
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ info: >
|
||||||
language provides no way to directly exercise [[Delete]], the tests are placed here.
|
language provides no way to directly exercise [[Delete]], the tests are placed here.
|
||||||
es5id: 11.4.1-4.a-7
|
es5id: 11.4.1-4.a-7
|
||||||
description: delete operator inside 'eval'
|
description: delete operator inside 'eval'
|
||||||
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ info: >
|
||||||
language provides no way to directly exercise [[Delete]], the tests are placed here.
|
language provides no way to directly exercise [[Delete]], the tests are placed here.
|
||||||
es5id: 11.4.1-4.a-8
|
es5id: 11.4.1-4.a-8
|
||||||
description: delete operator returns true for built-in objects (JSON)
|
description: delete operator returns true for built-in objects (JSON)
|
||||||
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ es5id: 11.4.1-4.a-9
|
||||||
description: >
|
description: >
|
||||||
delete operator returns false when deleting a non-configurable
|
delete operator returns false when deleting a non-configurable
|
||||||
data property (Math.LN2)
|
data property (Math.LN2)
|
||||||
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ es5id: 11.4.1-5-1
|
||||||
description: >
|
description: >
|
||||||
delete operator returns false when deleting a direct reference to
|
delete operator returns false when deleting a direct reference to
|
||||||
a var
|
a var
|
||||||
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ es5id: 11.4.1-5-2
|
||||||
description: >
|
description: >
|
||||||
delete operator returns false when deleting a direct reference to
|
delete operator returns false when deleting a direct reference to
|
||||||
a function argument
|
a function argument
|
||||||
|
flags: [noStrict]
|
||||||
includes: [runTestCase.js]
|
includes: [runTestCase.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ es5id: 11.4.1-5-3
|
||||||
description: >
|
description: >
|
||||||
delete operator returns false when deleting a direct reference to
|
delete operator returns false when deleting a direct reference to
|
||||||
a function name
|
a function name
|
||||||
|
flags: [noStrict]
|
||||||
includes:
|
includes:
|
||||||
- runTestCase.js
|
- runTestCase.js
|
||||||
- fnExists.js
|
- fnExists.js
|
||||||
|
|
|
@ -5,14 +5,10 @@
|
||||||
info: If GetBase(x) doesn't have a property GetPropertyName(x), return true
|
info: If GetBase(x) doesn't have a property GetPropertyName(x), return true
|
||||||
es5id: 11.4.1_A2.2_T1
|
es5id: 11.4.1_A2.2_T1
|
||||||
description: Checking undeclared variable case
|
description: Checking undeclared variable case
|
||||||
|
flags: [noStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
if (delete x !== true) {
|
if (delete x !== true) {
|
||||||
$ERROR('#1: delete x === true');
|
$ERROR('#1: delete x === true');
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
|
||||||
if (delete this.x !== true) {
|
|
||||||
$ERROR('#2: delete this.x === true');
|
|
||||||
}
|
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
info: If GetBase(x) doesn't have a property GetPropertyName(x), return true
|
||||||
|
es5id: 11.4.1_A2.2_T3
|
||||||
|
description: Checking undeclared variable case
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//CHECK#1
|
||||||
|
if (delete this.x !== true) {
|
||||||
|
$ERROR('#1: delete this.x === true');
|
||||||
|
}
|
|
@ -5,6 +5,7 @@
|
||||||
info: If the property has the DontDelete attribute, return false
|
info: If the property has the DontDelete attribute, return false
|
||||||
es5id: 11.4.1_A3.1
|
es5id: 11.4.1_A3.1
|
||||||
description: Checking declared variable
|
description: Checking declared variable
|
||||||
|
flags: [noStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
info: If the property doesn't have the DontDelete attribute, return true
|
||||||
|
es5id: 11.4.1_A3.2_T1
|
||||||
|
description: Checking declared variable
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//CHECK#1
|
||||||
|
x = 1;
|
||||||
|
if (delete x !== true) {
|
||||||
|
$ERROR('#1: x = 1; delete x === true');
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
info: If the property doesn't have the DontDelete attribute, return true
|
||||||
|
es5id: 11.4.1_A3.2_T2
|
||||||
|
description: Checking declared variable
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//CHECK#1
|
||||||
|
function MyFunction(){};
|
||||||
|
MyFunction.prop = 1;
|
||||||
|
if (delete MyFunction.prop !== true) {
|
||||||
|
$ERROR('#1: function MyFunction(){}; MyFunction.prop = 1; delete MyFunction.prop === true');
|
||||||
|
}
|
|
@ -3,27 +3,14 @@
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: If the property doesn't have the DontDelete attribute, return true
|
info: If the property doesn't have the DontDelete attribute, return true
|
||||||
es5id: 11.4.1_A3.2
|
es5id: 11.4.1_A3.2_T3
|
||||||
description: Checking declared variable
|
description: Checking declared variable
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
x = 1;
|
|
||||||
if (delete x !== true) {
|
|
||||||
$ERROR('#1: x = 1; delete x === true');
|
|
||||||
}
|
|
||||||
|
|
||||||
//CHECK#2
|
|
||||||
function MyFunction(){};
|
|
||||||
MyFunction.prop = 1;
|
|
||||||
if (delete MyFunction.prop !== true) {
|
|
||||||
$ERROR('#2: function MyFunction(){}; MyFunction.prop = 1; delete MyFunction.prop === true');
|
|
||||||
}
|
|
||||||
|
|
||||||
//CHECK#3
|
|
||||||
function MyFunction(){};
|
function MyFunction(){};
|
||||||
var MyObject = new MyFunction();
|
var MyObject = new MyFunction();
|
||||||
MyObject.prop = 1;
|
MyObject.prop = 1;
|
||||||
if (delete MyObject.prop !== true) {
|
if (delete MyObject.prop !== true) {
|
||||||
$ERROR('#3: function MyFunction(){}; var MyObject = new MyFunction(); MyFunction.prop = 1; delete MyObject.prop === true');
|
$ERROR('#1: function MyFunction(){}; var MyObject = new MyFunction(); MyFunction.prop = 1; delete MyObject.prop === true');
|
||||||
}
|
}
|
|
@ -1,58 +0,0 @@
|
||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
|
||||||
|
|
||||||
/*---
|
|
||||||
info: If the property doesn't have the DontDelete attribute, remove the property
|
|
||||||
es5id: 11.4.1_A3.3
|
|
||||||
description: Checking declared variable
|
|
||||||
---*/
|
|
||||||
|
|
||||||
//CHECK#1
|
|
||||||
try {
|
|
||||||
x = 1;
|
|
||||||
delete x;
|
|
||||||
x;
|
|
||||||
$ERROR('#1: x = 1; delete x; x is not exist');
|
|
||||||
} catch (e) {
|
|
||||||
if (e instanceof ReferenceError !== true) {
|
|
||||||
$ERROR('#1: x = 1; delete x; x is not exist');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//CHECK#2
|
|
||||||
function MyFunction(){};
|
|
||||||
MyFunction.prop = 1;
|
|
||||||
delete MyFunction.prop;
|
|
||||||
if (MyFunction.prop !== undefined) {
|
|
||||||
$ERROR('#2: function MyFunction(){}; MyFunction.prop = 1; delete MyFunction.prop; MyFunction.prop === undefined. Actual: ' + (MyFunction.prop));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//CHECK#3
|
|
||||||
function MyFunction(){};
|
|
||||||
var MyObjectVar = new MyFunction();
|
|
||||||
MyObjectVar.prop = 1;
|
|
||||||
delete MyObjectVar.prop;
|
|
||||||
if (MyObjectVar.prop !== undefined) {
|
|
||||||
$ERROR('#3: function MyFunction(){}; var MyObjectVar = new MyFunction(); MyFunction.prop = 1; delete MyObjectVar.prop; MyObjectVar.prop === undefined. Actual: ' + (MyObjectVar.prop));
|
|
||||||
}
|
|
||||||
|
|
||||||
//CHECK#4
|
|
||||||
if (delete MyObjectVar !== false) {
|
|
||||||
$ERROR('#4: function MyFunction(){}; var MyObjectVar = new MyFunction(); delete MyObjectVar === false');
|
|
||||||
}
|
|
||||||
|
|
||||||
//CHECK#5
|
|
||||||
function MyFunction(){};
|
|
||||||
MyObjectNotVar = new MyFunction();
|
|
||||||
MyObjectNotVar.prop = 1;
|
|
||||||
delete MyObjectNotVar.prop;
|
|
||||||
if (MyObjectNotVar.prop !== undefined) {
|
|
||||||
$ERROR('#5: function MyFunction(){}; MyObjectNotVar = new MyFunction(); MyFunction.prop = 1; delete MyObjectNotVar.prop; MyObjectNotVar.prop === undefined. Actual: ' + (MyObjectNotVar.prop));
|
|
||||||
}
|
|
||||||
|
|
||||||
//CHECK#6
|
|
||||||
if (delete MyObjectNotVar !== true) {
|
|
||||||
$ERROR('#6: function MyFunction(){}; var MyObjectNotVar = new MyFunction(); delete MyObjectNotVar === true');
|
|
||||||
}
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
info: If the property doesn't have the DontDelete attribute, remove the property
|
||||||
|
es5id: 11.4.1_A3.3_T1
|
||||||
|
description: Checking declared variable
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//CHECK#1
|
||||||
|
try {
|
||||||
|
x = 1;
|
||||||
|
delete x;
|
||||||
|
x;
|
||||||
|
$ERROR('#1: x = 1; delete x; x is not exist');
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof ReferenceError !== true) {
|
||||||
|
$ERROR('#1: x = 1; delete x; x is not exist');
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
info: If the property doesn't have the DontDelete attribute, remove the property
|
||||||
|
es5id: 11.4.1_A3.3_T2
|
||||||
|
description: Checking declared variable
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//CHECK#1
|
||||||
|
function MyFunction(){};
|
||||||
|
MyFunction.prop = 1;
|
||||||
|
delete MyFunction.prop;
|
||||||
|
if (MyFunction.prop !== undefined) {
|
||||||
|
$ERROR('#1: function MyFunction(){}; MyFunction.prop = 1; delete MyFunction.prop; MyFunction.prop === undefined. Actual: ' + (MyFunction.prop));
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
info: If the property doesn't have the DontDelete attribute, remove the property
|
||||||
|
es5id: 11.4.1_A3.3_T3
|
||||||
|
description: Checking declared variable
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//CHECK#1
|
||||||
|
function MyFunction(){};
|
||||||
|
var MyObjectVar = new MyFunction();
|
||||||
|
MyObjectVar.prop = 1;
|
||||||
|
delete MyObjectVar.prop;
|
||||||
|
if (MyObjectVar.prop !== undefined) {
|
||||||
|
$ERROR('#1: function MyFunction(){}; var MyObjectVar = new MyFunction(); MyFunction.prop = 1; delete MyObjectVar.prop; MyObjectVar.prop === undefined. Actual: ' + (MyObjectVar.prop));
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
info: If the property doesn't have the DontDelete attribute, remove the property
|
||||||
|
es5id: 11.4.1_A3.3_T4
|
||||||
|
description: Checking declared variable
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//CHECK#1
|
||||||
|
function MyFunction(){};
|
||||||
|
var MyObjectVar = new MyFunction();
|
||||||
|
if (delete MyObjectVar !== false) {
|
||||||
|
$ERROR('#1: function MyFunction(){}; var MyObjectVar = new MyFunction(); delete MyObjectVar === false');
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
info: If the property doesn't have the DontDelete attribute, remove the property
|
||||||
|
es5id: 11.4.1_A3.3_T5
|
||||||
|
description: Checking declared variable
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//CHECK#1
|
||||||
|
function MyFunction(){};
|
||||||
|
MyObjectNotVar = new MyFunction();
|
||||||
|
MyObjectNotVar.prop = 1;
|
||||||
|
delete MyObjectNotVar.prop;
|
||||||
|
if (MyObjectNotVar.prop !== undefined) {
|
||||||
|
$ERROR('#1: function MyFunction(){}; MyObjectNotVar = new MyFunction(); MyFunction.prop = 1; delete MyObjectNotVar.prop; MyObjectNotVar.prop === undefined. Actual: ' + (MyObjectNotVar.prop));
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
info: If the property doesn't have the DontDelete attribute, remove the property
|
||||||
|
es5id: 11.4.1_A3.3_T6
|
||||||
|
description: Checking declared variable
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//CHECK#1
|
||||||
|
function MyFunction(){};
|
||||||
|
var MyObjectVar = new MyFunction();
|
||||||
|
if (delete MyObjectNotVar !== true) {
|
||||||
|
$ERROR('#1: function MyFunction(){}; var MyObjectNotVar = new MyFunction(); delete MyObjectNotVar === true');
|
||||||
|
}
|
|
@ -7,6 +7,7 @@ info: >
|
||||||
the object
|
the object
|
||||||
es5id: 11.4.1_A4
|
es5id: 11.4.1_A4
|
||||||
description: Checking two reference by one object
|
description: Checking two reference by one object
|
||||||
|
flags: [noStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
|
|
|
@ -17,8 +17,3 @@ catch (e) {
|
||||||
$ERROR('#1.2: x / (x = 1) throw ReferenceError. Actual: ' + (e));
|
$ERROR('#1.2: x / (x = 1) throw ReferenceError. Actual: ' + (e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
|
||||||
if ((y = 1) / y !== 1) {
|
|
||||||
$ERROR('#2: (y = 1) / y === 1. Actual: ' + ((y = 1) / y));
|
|
||||||
}
|
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
info: First expression is evaluated first, and then second expression
|
||||||
|
es5id: 11.5.2_A2.4_T4
|
||||||
|
description: Checking with undeclarated variables
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//CHECK#1
|
||||||
|
if ((y = 1) / y !== 1) {
|
||||||
|
$ERROR('#1: (y = 1) / y === 1. Actual: ' + ((y = 1) / y));
|
||||||
|
}
|
|
@ -17,8 +17,3 @@ catch (e) {
|
||||||
$ERROR('#1.2: x != (x = 1) throw ReferenceError. Actual: ' + (e));
|
$ERROR('#1.2: x != (x = 1) throw ReferenceError. Actual: ' + (e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
|
||||||
if (((y = 1) != y) !== false) {
|
|
||||||
$ERROR('#2: ((y = 1) != y) === false');
|
|
||||||
}
|
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
info: First expression is evaluated first, and then second expression
|
||||||
|
es5id: 11.9.2_A2.4_T4
|
||||||
|
description: Checking with undeclarated variables
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//CHECK#1
|
||||||
|
if (((y = 1) != y) !== false) {
|
||||||
|
$ERROR('#1: ((y = 1) != y) === false');
|
||||||
|
}
|
|
@ -17,8 +17,3 @@ catch (e) {
|
||||||
$ERROR('#1.2: x == (x = 1) throw ReferenceError. Actual: ' + (e));
|
$ERROR('#1.2: x == (x = 1) throw ReferenceError. Actual: ' + (e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
|
||||||
if (((y = 1) == y) !== true) {
|
|
||||||
$ERROR('#2: ((y = 1) == y) === true');
|
|
||||||
}
|
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
info: First expression is evaluated first, and then second expression
|
||||||
|
es5id: 11.9.1_A2.4_T4
|
||||||
|
description: Checking with undeclarated variables
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//CHECK#1
|
||||||
|
if (((y = 1) == y) !== true) {
|
||||||
|
$ERROR('#1: ((y = 1) == y) === true');
|
||||||
|
}
|
|
@ -17,8 +17,3 @@ catch (e) {
|
||||||
$ERROR('#1.2: x >= (x = 1) throw ReferenceError. Actual: ' + (e));
|
$ERROR('#1.2: x >= (x = 1) throw ReferenceError. Actual: ' + (e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
|
||||||
if ((y = 1) >= y !== true) {
|
|
||||||
$ERROR('#2: (y = 1) >= y === true');
|
|
||||||
}
|
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
info: First expression is evaluated first, and then second expression
|
||||||
|
es5id: 11.8.4_A2.4_T4
|
||||||
|
description: Checking with undeclarated variables
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//CHECK#1
|
||||||
|
if ((y = 1) >= y !== true) {
|
||||||
|
$ERROR('#1: (y = 1) >= y === true');
|
||||||
|
}
|
|
@ -17,8 +17,3 @@ catch (e) {
|
||||||
$ERROR('#1.2: x > (x = 1) throw ReferenceError. Actual: ' + (e));
|
$ERROR('#1.2: x > (x = 1) throw ReferenceError. Actual: ' + (e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
|
||||||
if ((y = 1) > y !== false) {
|
|
||||||
$ERROR('#2: (y = 1) > y === false');
|
|
||||||
}
|
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
info: First expression is evaluated first, and then second expression
|
||||||
|
es5id: 11.8.2_A2.4_T4
|
||||||
|
description: Checking with undeclarated variables
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//CHECK#1
|
||||||
|
if ((y = 1) > y !== false) {
|
||||||
|
$ERROR('#1: (y = 1) > y === false');
|
||||||
|
}
|
17
test/language/expressions/grouping/S11.1.6_A2.js → test/language/expressions/grouping/S11.1.6_A2_T1.js
Normal file → Executable file
17
test/language/expressions/grouping/S11.1.6_A2.js → test/language/expressions/grouping/S11.1.6_A2_T1.js
Normal file → Executable file
|
@ -5,29 +5,24 @@
|
||||||
info: >
|
info: >
|
||||||
"This" operator doesn't use GetValue. The operators "delete" and "typeof"
|
"This" operator doesn't use GetValue. The operators "delete" and "typeof"
|
||||||
can be applied to parenthesised expressions
|
can be applied to parenthesised expressions
|
||||||
es5id: 11.1.6_A2
|
es5id: 11.1.6_A2_T1
|
||||||
description: >
|
description: >
|
||||||
Applying "delete" and "typeof" operators to an undefined variable
|
Applying "delete" and "typeof" operators to an undefined variable
|
||||||
and a property of an object
|
and a property of an object
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
if (delete (x) !== true) {
|
|
||||||
$ERROR('#1: delete (x) === true');
|
|
||||||
}
|
|
||||||
|
|
||||||
//CHECK#2
|
|
||||||
if (typeof (x) !== "undefined") {
|
if (typeof (x) !== "undefined") {
|
||||||
$ERROR('#2: typeof (x) === "undefined". Actual: ' + (typeof (x)));
|
$ERROR('#1: typeof (x) === "undefined". Actual: ' + (typeof (x)));
|
||||||
}
|
}
|
||||||
|
|
||||||
var object = {};
|
var object = {};
|
||||||
//CHECK#3
|
//CHECK#2
|
||||||
if (delete (object.prop) !== true) {
|
if (delete (object.prop) !== true) {
|
||||||
$ERROR('#3: var object = {}; delete (object.prop) === true');
|
$ERROR('#2: var object = {}; delete (object.prop) === true');
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#4
|
//CHECK#3
|
||||||
if (typeof (object.prop) !== "undefined") {
|
if (typeof (object.prop) !== "undefined") {
|
||||||
$ERROR('#4: var object = {}; typeof (object.prop) === "undefined". Actual: ' + (typeof (object.prop)));
|
$ERROR('#3: var object = {}; typeof (object.prop) === "undefined". Actual: ' + (typeof (object.prop)));
|
||||||
}
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
info: >
|
||||||
|
"This" operator doesn't use GetValue. The operators "delete" and "typeof"
|
||||||
|
can be applied to parenthesised expressions
|
||||||
|
es5id: 11.1.6_A2_T2
|
||||||
|
description: >
|
||||||
|
Applying "delete" operator to an undefined variable
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//CHECK#1
|
||||||
|
if (delete (x) !== true) {
|
||||||
|
$ERROR('#1: delete (x) === true');
|
||||||
|
}
|
|
@ -8,6 +8,7 @@ description: Using grouping operator in declaration of variables
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
|
var x;
|
||||||
(x) = 1;
|
(x) = 1;
|
||||||
if (x !== 1) {
|
if (x !== 1) {
|
||||||
$ERROR('#1: (x) = 1; x === 1. Actual: ' + (x));
|
$ERROR('#1: (x) = 1; x === 1. Actual: ' + (x));
|
||||||
|
|
|
@ -4,15 +4,11 @@
|
||||||
/*---
|
/*---
|
||||||
info: "\"This\" operator only evaluates Expression"
|
info: "\"This\" operator only evaluates Expression"
|
||||||
es5id: 11.1.6_A3_T6
|
es5id: 11.1.6_A3_T6
|
||||||
description: Applying grouping operator to delete and typeof operators
|
description: Applying grouping operator to delete operator
|
||||||
|
flags: [noStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
if (delete (x) !== true) {
|
if (delete (x) !== true) {
|
||||||
$ERROR('#1: delete (x) === true');
|
$ERROR('#1: delete (x) === true');
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
|
||||||
if (typeof (x) !== "undefined") {
|
|
||||||
$ERROR('#2: typeof (x) === "undefined". Actual: ' + (typeof (x)));
|
|
||||||
}
|
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
info: "\"This\" operator only evaluates Expression"
|
||||||
|
es5id: 11.1.6_A3_T7
|
||||||
|
description: Applying grouping operator to typeof operator
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//CHECK#1
|
||||||
|
if (typeof (x) !== "undefined") {
|
||||||
|
$ERROR('#1: typeof (x) === "undefined". Actual: ' + (typeof (x)));
|
||||||
|
}
|
|
@ -17,8 +17,3 @@ catch (e) {
|
||||||
$ERROR('#1.2: max_value in (max_value = "MAX_VALUE", Number) throw ReferenceError. Actual: ' + (e));
|
$ERROR('#1.2: max_value in (max_value = "MAX_VALUE", Number) throw ReferenceError. Actual: ' + (e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
|
||||||
if ((NUMBER = Number, "MAX_VALUE") in NUMBER !== true) {
|
|
||||||
$ERROR('#2: (NUMBER = Number, "MAX_VALUE") in NUMBER !== true');
|
|
||||||
}
|
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
info: First expression is evaluated first, and then second expression
|
||||||
|
es5id: 11.8.7_A2.4_T4
|
||||||
|
description: Checking with undeclarated variables
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//CHECK#1
|
||||||
|
if ((NUMBER = Number, "MAX_VALUE") in NUMBER !== true) {
|
||||||
|
$ERROR('#1: (NUMBER = Number, "MAX_VALUE") in NUMBER !== true');
|
||||||
|
}
|
|
@ -17,8 +17,3 @@ catch (e) {
|
||||||
$ERROR('#1.2: object instanceof (object = {}, Object) throw ReferenceError. Actual: ' + (e));
|
$ERROR('#1.2: object instanceof (object = {}, Object) throw ReferenceError. Actual: ' + (e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
|
||||||
if ((OBJECT = Object, {}) instanceof OBJECT !== true) {
|
|
||||||
$ERROR('#2: (OBJECT = Object, {}) instanceof OBJECT !== true');
|
|
||||||
}
|
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
info: First expression is evaluated first, and then second expression
|
||||||
|
es5id: 11.8.6_A2.4_T4
|
||||||
|
description: Checking with undeclarated variables
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//CHECK#1
|
||||||
|
if ((OBJECT = Object, {}) instanceof OBJECT !== true) {
|
||||||
|
$ERROR('#1: (OBJECT = Object, {}) instanceof OBJECT !== true');
|
||||||
|
}
|
|
@ -10,6 +10,7 @@ es5id: 15.3.5.3_A1_T1
|
||||||
description: V is number
|
description: V is number
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
var FACTORY;
|
||||||
FACTORY = Function("name","this.name=name;");
|
FACTORY = Function("name","this.name=name;");
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
|
|
|
@ -10,6 +10,7 @@ es5id: 15.3.5.3_A1_T2
|
||||||
description: V is string
|
description: V is string
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
var FACTORY;
|
||||||
FACTORY = Function("name","this.name=name;");
|
FACTORY = Function("name","this.name=name;");
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
|
|
|
@ -10,6 +10,7 @@ es5id: 15.3.5.3_A1_T3
|
||||||
description: V is boolean true
|
description: V is boolean true
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
var FACTORY;
|
||||||
FACTORY = Function("name","this.name=name;");
|
FACTORY = Function("name","this.name=name;");
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
|
|
|
@ -10,6 +10,7 @@ es5id: 15.3.5.3_A1_T4
|
||||||
description: V is boolean false
|
description: V is boolean false
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
var FACTORY;
|
||||||
FACTORY = Function("name","this.name=name;");
|
FACTORY = Function("name","this.name=name;");
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
|
|
|
@ -10,6 +10,7 @@ es5id: 15.3.5.3_A1_T5
|
||||||
description: V is void 0
|
description: V is void 0
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
var FACTORY;
|
||||||
FACTORY = Function("name","this.name=name;");
|
FACTORY = Function("name","this.name=name;");
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
|
|
|
@ -10,6 +10,7 @@ es5id: 15.3.5.3_A1_T6
|
||||||
description: V is null
|
description: V is null
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
var FACTORY;
|
||||||
FACTORY = Function("name","this.name=name;");
|
FACTORY = Function("name","this.name=name;");
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
|
|
|
@ -10,6 +10,7 @@ es5id: 15.3.5.3_A1_T7
|
||||||
description: V is undefined
|
description: V is undefined
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
var FACTORY;
|
||||||
FACTORY = Function("name","this.name=name;");
|
FACTORY = Function("name","this.name=name;");
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
|
|
|
@ -10,6 +10,7 @@ es5id: 15.3.5.3_A1_T8
|
||||||
description: V is undefined variable
|
description: V is undefined variable
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
var FACTORY;
|
||||||
FACTORY = Function("name","this.name=name;");
|
FACTORY = Function("name","this.name=name;");
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
|
|
|
@ -12,10 +12,12 @@ description: F.prototype is undefined, and V is empty object
|
||||||
includes: [$FAIL.js]
|
includes: [$FAIL.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
var FACTORY;
|
||||||
FACTORY = new Function;
|
FACTORY = new Function;
|
||||||
|
|
||||||
FACTORY.prototype = undefined;
|
FACTORY.prototype = undefined;
|
||||||
|
|
||||||
|
var obj;
|
||||||
obj={};
|
obj={};
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
|
|
|
@ -13,10 +13,12 @@ description: F.prototype is void 0, and V is new F
|
||||||
includes: [$FAIL.js]
|
includes: [$FAIL.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
var FACTORY;
|
||||||
FACTORY = Function("this.prop=1;");
|
FACTORY = Function("this.prop=1;");
|
||||||
|
|
||||||
FACTORY.prototype.name = "fairy";
|
FACTORY.prototype.name = "fairy";
|
||||||
|
|
||||||
|
var instance;
|
||||||
instance = new FACTORY;
|
instance = new FACTORY;
|
||||||
|
|
||||||
FACTORY.prototype = void 0;
|
FACTORY.prototype = void 0;
|
||||||
|
|
|
@ -13,6 +13,7 @@ description: F.prototype is string, and V is function
|
||||||
includes: [$FAIL.js]
|
includes: [$FAIL.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
var FACTORY;
|
||||||
FACTORY = new Function;
|
FACTORY = new Function;
|
||||||
|
|
||||||
FACTORY.prototype = "error";
|
FACTORY.prototype = "error";
|
||||||
|
|
|
@ -14,10 +14,12 @@ es5id: 15.3.5.3_A3_T1
|
||||||
description: F.prototype.type is 1, and V is new F
|
description: F.prototype.type is 1, and V is new F
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
var FACTORY;
|
||||||
FACTORY = Function("this.name=\"root\"");
|
FACTORY = Function("this.name=\"root\"");
|
||||||
|
|
||||||
FACTORY.prototype.type=1;
|
FACTORY.prototype.type=1;
|
||||||
|
|
||||||
|
var instance;
|
||||||
instance = new FACTORY;
|
instance = new FACTORY;
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
|
|
|
@ -14,8 +14,10 @@ es5id: 15.3.5.3_A3_T2
|
||||||
description: F.prototype is Object.prototype, and V is empty object
|
description: F.prototype is Object.prototype, and V is empty object
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
var FAKEFACTORY;
|
||||||
FAKEFACTORY = Function();
|
FAKEFACTORY = Function();
|
||||||
|
|
||||||
|
var fakeinstance;
|
||||||
fakeinstance = {};
|
fakeinstance = {};
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue