Merge pull request #140 from anba/issue-35/expressions

Fix strict mode errors in language/expressions
This commit is contained in:
Brian Terlson 2014-12-13 11:36:24 -08:00
commit d075338699
120 changed files with 527 additions and 201 deletions

View File

@ -17,8 +17,3 @@ catch (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));
}

View File

@ -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));
}

View File

@ -10,6 +10,7 @@ es5id: 11.13.1-4-1
description: >
simple assignment creates property on the global object if
LeftHandSide is an unresolvable reference
flags: [noStrict]
includes:
- runTestCase.js
- fnGlobalObject.js

View File

@ -7,6 +7,7 @@
/*---
es5id: 8.14.4-8-b_1
description: Non-writable property on a prototype written to.
flags: [noStrict]
includes: [runTestCase.js]
---*/

View File

@ -14,7 +14,7 @@ if (x !== 1) {
}
//CHECK#2
y = 1;
if (y !== 1) {
$ERROR('#2: y = 1; y === 1. Actual: ' + (y));
x = 1;
if (x !== 1) {
$ERROR('#2: x = 1; x === 1. Actual: ' + (x));
}

View File

@ -8,6 +8,7 @@ description: Syntax check
---*/
//CHECK#1
var x;
x = x = 1;
if (x !== 1) {
$ERROR('#1: The expression x = x = 1 is the same x = (x = 1), not (x = x) = 1. Actual: ' + (x));

View File

@ -19,7 +19,7 @@ function testcase() {
var o = { };
try {
o.bar( foo() );
throw new Exception("o.bar does not exist!");
$ERROR("o.bar does not exist!");
} catch(e) {
return (e instanceof TypeError) && (fooCalled===true);
}

View File

@ -19,7 +19,7 @@ function testcase() {
var o = { };
try {
o.bar( foo() );
throw new Exception("o.bar does not exist!");
$ERROR("o.bar does not exist!");
} catch(e) {
return (e instanceof TypeError) && (fooCalled===true);
}

View File

@ -19,7 +19,7 @@ function testcase() {
var o = { };
try {
o.bar.gar( foo() );
throw new Exception("o.bar does not exist!");
$ERROR("o.bar does not exist!");
} catch(e) {
return (e instanceof TypeError) && (fooCalled===false);
}

View File

@ -21,7 +21,7 @@ function testcase() {
set: function(x) {this.barSetter = true; }});
try {
o.bar( foo() );
throw new Exception("o.bar does not exist!");
$ERROR("o.bar does not exist!");
} catch(e) {
return (e instanceof TypeError) && (fooCalled===true) && (o.barGetter===true) && (o.barSetter===undefined);
}

View File

@ -19,7 +19,7 @@ function testcase() {
var o = { };
try {
eval("o.bar( foo() );");
throw new Exception("o.bar does not exist!");
$ERROR("o.bar does not exist!");
} catch(e) {
return (e instanceof TypeError) && (fooCalled===true);
}

View File

@ -18,7 +18,7 @@ function testcase() {
set: function(x) {this.barSetter = true; }});
try {
o.foo( o.bar );
throw new Exception("o.foo does not exist!");
$ERROR("o.foo does not exist!");
} catch(e) {
return (e instanceof TypeError) && (o.barGetter===true) && (o.barSetter===undefined);
}

View File

@ -18,7 +18,7 @@ function testcase() {
set: function(x) {this.barSetter = true; }});
try {
o.foo( o["bar"] );
throw new Exception("o.foo does not exist!");
$ERROR("o.foo does not exist!");
} catch(e) {
return (e instanceof TypeError) && (o.barGetter===true) && (o.barSetter===undefined);
}

View File

@ -9,22 +9,18 @@ es5id: 11.2.3-3_8
description: >
Call arguments are evaluated before the check is made to see if
the object is actually callable (global object)
flags: [noStrict]
includes:
- runTestCase.js
- fnGlobalObject.js
---*/
function testcase() {
if (this!==fnGlobalObject()) {
return;
}
var fooCalled = false;
function foo(){ fooCalled = true; }
try {
this.bar( foo() );
throw new Exception("this.bar does not exist!");
$ERROR("this.bar does not exist!");
} catch(e) {
return (e instanceof TypeError) && (fooCalled===true);
}

View File

@ -10,6 +10,7 @@ description: >
ArgumentList, in order, followed at the end by
GetValue(AssignmentExpression), which is the last item of the new
list
flags: [noStrict]
---*/
function f_arg() {

View File

@ -10,6 +10,7 @@ description: >
ArgumentList, in order, followed at the end by
GetValue(AssignmentExpression), which is the last item of the new
list
flags: [noStrict]
---*/
function f_arg(x,y,z) {

View File

@ -15,6 +15,7 @@ if (x !== -1) {
}
//CHECK#2
var y;
y = 1;
y *= -1;
if (y !== -1) {

View File

@ -15,6 +15,7 @@ if (x !== 1) {
}
//CHECK#2
var y;
y = 1;
y ^= 0;
if (y !== 1) {

View File

@ -15,6 +15,7 @@ if (x !== 1) {
}
//CHECK#2
var y;
y = 1;
y |= 0;
if (y !== 1) {

View File

@ -15,6 +15,7 @@ if (x !== -1) {
}
//CHECK#2
var y;
y = 1;
y /= -1;
if (y !== -1) {

View File

@ -15,6 +15,7 @@ if (x !== -1) {
}
//CHECK#2
var y;
y = -1;
y %= 2;
if (y !== -1) {

View File

@ -15,6 +15,7 @@ if (x !== 2) {
}
//CHECK#2
var y;
y = 1;
y += 1;
if (y !== 2) {

View File

@ -15,6 +15,7 @@ if (x !== -2) {
}
//CHECK#2
var y;
y = -1;
y -= 1;
if (y !== -2) {

View File

@ -15,6 +15,7 @@ if (x !== 2) {
}
//CHECK#2
var y;
y = 1;
y <<= 1;
if (y !== 2) {

View File

@ -15,6 +15,7 @@ if (x !== 2) {
}
//CHECK#2
var y;
y = 4;
y >>= 1;
if (y !== 2) {

View File

@ -15,6 +15,7 @@ if (x !== 2) {
}
//CHECK#2
var y;
y = 4;
y >>>= 1;
if (y !== 2) {

View File

@ -15,6 +15,7 @@ if (x !== 1) {
}
//CHECK#2
var y;
y = 1;
y &= 1;
if (y !== 1) {

View File

@ -15,6 +15,8 @@ if (x1 !== -1) {
}
//CHECK#2
var y;
var y1;
y = 1;
y1 = (y *= -1);
if (y1 !== -1) {

View File

@ -15,6 +15,8 @@ if (x1 !== 1) {
}
//CHECK#2
var y;
var y1;
y = 1;
y1 = (y ^= 0);
if (y1 !== 1) {

View File

@ -15,6 +15,8 @@ if (x1 !== 1) {
}
//CHECK#2
var y;
var y1;
y = 1;
y1 = (y |= 0);
if (y1 !== 1) {

View File

@ -15,6 +15,8 @@ if (x1 !== -1) {
}
//CHECK#2
var y;
var y1;
y = 1;
y1 = (y /= -1);
if (y1 !== -1) {

View File

@ -15,6 +15,8 @@ if (x1 !== -1) {
}
//CHECK#2
var y;
var y1;
y = -1;
y1 = (y %= 2);
if (y1 !== -1) {

View File

@ -15,6 +15,8 @@ if (x1 !== 2) {
}
//CHECK#2
var y;
var y1;
y = 1;
y1 = (y += 1);
if (y1 !== 2) {

View File

@ -15,6 +15,8 @@ if (x1 !== -2) {
}
//CHECK#2
var y;
var y1;
y = -1;
y1 = (y -= 1);
if (y1 !== -2) {

View File

@ -15,6 +15,8 @@ if (x1 !== 2) {
}
//CHECK#2
var y;
var y1;
y = 1;
y1 = (y <<= 1);
if (y1 !== 2) {

View File

@ -15,6 +15,8 @@ if (x1 !== 2) {
}
//CHECK#2
var y;
var y1;
y = 4;
y1 = (y >>= 1);
if (y1 !== 2) {

View File

@ -15,6 +15,8 @@ if (x1 !== 2) {
}
//CHECK#2
var y;
var y1;
y = 4;
y1 = (y >>>= 1);
if (y1 !== 2) {

View File

@ -15,6 +15,8 @@ if (x1 !== 1) {
}
//CHECK#2
var y;
var y1;
y = 1;
y1 = (y &= 1);
if (y1 !== 1) {

View File

@ -10,6 +10,7 @@ info: >
language provides no way to directly exercise [[Delete]], the tests are placed here.
es5id: 11.4.1-0-1
description: delete operator as UnaryExpression
flags: [noStrict]
includes: [runTestCase.js]
---*/

View File

@ -9,6 +9,7 @@ es5id: 11.4.1-3-1
description: >
delete operator returns true when deleting an unresolvable
reference
flags: [noStrict]
includes: [runTestCase.js]
---*/

View File

@ -12,6 +12,7 @@ es5id: 11.4.1-4.a-11
description: >
delete operator returns true on deleting arguments
propterties(arguments.callee)
flags: [noStrict]
includes: [runTestCase.js]
---*/

View File

@ -10,6 +10,7 @@ info: >
language provides no way to directly exercise [[Delete]], the tests are placed here.
es5id: 11.4.1-4.a-12
description: delete operator returns false when deleting a property(length)
flags: [noStrict]
includes: [runTestCase.js]
---*/

View File

@ -10,6 +10,7 @@ info: >
language provides no way to directly exercise [[Delete]], the tests are placed here.
es5id: 11.4.1-4.a-13
description: delete operator returns false when deleting Array object
flags: [noStrict]
includes: [runTestCase.js]
---*/

View File

@ -10,6 +10,7 @@ info: >
language provides no way to directly exercise [[Delete]], the tests are placed here.
es5id: 11.4.1-4.a-16
description: delete operator returns false on deleting arguments object
flags: [noStrict]
includes: [runTestCase.js]
---*/

View File

@ -12,6 +12,7 @@ es5id: 11.4.1-4.a-3
description: >
delete operator returns false when deleting a non-configurable
data property
flags: [noStrict]
includes: [runTestCase.js]
---*/

View File

@ -12,6 +12,7 @@ es5id: 11.4.1-4.a-4
description: >
delete operator returns false when deleting a non-configurable
data property (NaN)
flags: [noStrict]
includes: [runTestCase.js]
---*/

View File

@ -12,6 +12,7 @@ es5id: 11.4.1-4.a-5
description: >
delete operator returns false when deleting the environment object
inside 'with'
flags: [noStrict]
includes: [runTestCase.js]
---*/

View File

@ -10,6 +10,7 @@ info: >
language provides no way to directly exercise [[Delete]], the tests are placed here.
es5id: 11.4.1-4.a-6
description: delete operator returns true when deleting a property inside 'with'
flags: [noStrict]
includes: [runTestCase.js]
---*/

View File

@ -10,6 +10,7 @@ info: >
language provides no way to directly exercise [[Delete]], the tests are placed here.
es5id: 11.4.1-4.a-7
description: delete operator inside 'eval'
flags: [noStrict]
includes: [runTestCase.js]
---*/

View File

@ -10,6 +10,7 @@ info: >
language provides no way to directly exercise [[Delete]], the tests are placed here.
es5id: 11.4.1-4.a-8
description: delete operator returns true for built-in objects (JSON)
flags: [noStrict]
includes: [runTestCase.js]
---*/

View File

@ -12,6 +12,7 @@ es5id: 11.4.1-4.a-9
description: >
delete operator returns false when deleting a non-configurable
data property (Math.LN2)
flags: [noStrict]
includes: [runTestCase.js]
---*/

View File

@ -9,6 +9,7 @@ es5id: 11.4.1-5-1
description: >
delete operator returns false when deleting a direct reference to
a var
flags: [noStrict]
includes: [runTestCase.js]
---*/

View File

@ -9,6 +9,7 @@ es5id: 11.4.1-5-2
description: >
delete operator returns false when deleting a direct reference to
a function argument
flags: [noStrict]
includes: [runTestCase.js]
---*/

View File

@ -9,6 +9,7 @@ es5id: 11.4.1-5-3
description: >
delete operator returns false when deleting a direct reference to
a function name
flags: [noStrict]
includes:
- runTestCase.js
- fnExists.js

View File

@ -5,14 +5,10 @@
info: If GetBase(x) doesn't have a property GetPropertyName(x), return true
es5id: 11.4.1_A2.2_T1
description: Checking undeclared variable case
flags: [noStrict]
---*/
//CHECK#1
if (delete x !== true) {
$ERROR('#1: delete x === true');
}
//CHECK#2
if (delete this.x !== true) {
$ERROR('#2: delete this.x === true');
}

View File

@ -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');
}

View File

@ -5,6 +5,7 @@
info: If the property has the DontDelete attribute, return false
es5id: 11.4.1_A3.1
description: Checking declared variable
flags: [noStrict]
---*/
//CHECK#1

View File

@ -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');
}

View File

@ -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');
}

View File

@ -3,27 +3,14 @@
/*---
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
---*/
//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(){};
var MyObject = new MyFunction();
MyObject.prop = 1;
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');
}

View File

@ -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');
}

View File

@ -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');
}
}

View File

@ -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));
}

View File

@ -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));
}

View File

@ -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');
}

View File

@ -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));
}

View File

@ -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');
}

View File

@ -7,6 +7,7 @@ info: >
the object
es5id: 11.4.1_A4
description: Checking two reference by one object
flags: [noStrict]
---*/
//CHECK#1

View File

@ -17,8 +17,3 @@ catch (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));
}

View File

@ -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));
}

View File

@ -17,8 +17,3 @@ catch (e) {
$ERROR('#1.2: x != (x = 1) throw ReferenceError. Actual: ' + (e));
}
}
//CHECK#2
if (((y = 1) != y) !== false) {
$ERROR('#2: ((y = 1) != y) === false');
}

View File

@ -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');
}

View File

@ -17,8 +17,3 @@ catch (e) {
$ERROR('#1.2: x == (x = 1) throw ReferenceError. Actual: ' + (e));
}
}
//CHECK#2
if (((y = 1) == y) !== true) {
$ERROR('#2: ((y = 1) == y) === true');
}

View File

@ -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');
}

View File

@ -17,8 +17,3 @@ catch (e) {
$ERROR('#1.2: x >= (x = 1) throw ReferenceError. Actual: ' + (e));
}
}
//CHECK#2
if ((y = 1) >= y !== true) {
$ERROR('#2: (y = 1) >= y === true');
}

View File

@ -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');
}

View File

@ -17,8 +17,3 @@ catch (e) {
$ERROR('#1.2: x > (x = 1) throw ReferenceError. Actual: ' + (e));
}
}
//CHECK#2
if ((y = 1) > y !== false) {
$ERROR('#2: (y = 1) > y === false');
}

View File

@ -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');
}

View File

@ -5,29 +5,24 @@
info: >
"This" operator doesn't use GetValue. The operators "delete" and "typeof"
can be applied to parenthesised expressions
es5id: 11.1.6_A2
es5id: 11.1.6_A2_T1
description: >
Applying "delete" and "typeof" operators to an undefined variable
and a property of an object
---*/
//CHECK#1
if (delete (x) !== true) {
$ERROR('#1: delete (x) === true');
}
//CHECK#2
if (typeof (x) !== "undefined") {
$ERROR('#2: typeof (x) === "undefined". Actual: ' + (typeof (x)));
$ERROR('#1: typeof (x) === "undefined". Actual: ' + (typeof (x)));
}
var object = {};
//CHECK#3
//CHECK#2
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") {
$ERROR('#4: var object = {}; typeof (object.prop) === "undefined". Actual: ' + (typeof (object.prop)));
$ERROR('#3: var object = {}; typeof (object.prop) === "undefined". Actual: ' + (typeof (object.prop)));
}

View File

@ -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');
}

View File

@ -8,6 +8,7 @@ description: Using grouping operator in declaration of variables
---*/
//CHECK#1
var x;
(x) = 1;
if (x !== 1) {
$ERROR('#1: (x) = 1; x === 1. Actual: ' + (x));

View File

@ -4,15 +4,11 @@
/*---
info: "\"This\" operator only evaluates Expression"
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
if (delete (x) !== true) {
$ERROR('#1: delete (x) === true');
}
//CHECK#2
if (typeof (x) !== "undefined") {
$ERROR('#2: typeof (x) === "undefined". Actual: ' + (typeof (x)));
}

View File

@ -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)));
}

View File

@ -17,8 +17,3 @@ catch (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');
}

View File

@ -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');
}

View File

@ -17,8 +17,3 @@ catch (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');
}

View File

@ -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');
}

View File

@ -10,6 +10,7 @@ es5id: 15.3.5.3_A1_T1
description: V is number
---*/
var FACTORY;
FACTORY = Function("name","this.name=name;");
//CHECK#1

View File

@ -10,6 +10,7 @@ es5id: 15.3.5.3_A1_T2
description: V is string
---*/
var FACTORY;
FACTORY = Function("name","this.name=name;");
//CHECK#1

View File

@ -10,6 +10,7 @@ es5id: 15.3.5.3_A1_T3
description: V is boolean true
---*/
var FACTORY;
FACTORY = Function("name","this.name=name;");
//CHECK#1

View File

@ -10,6 +10,7 @@ es5id: 15.3.5.3_A1_T4
description: V is boolean false
---*/
var FACTORY;
FACTORY = Function("name","this.name=name;");
//CHECK#1

View File

@ -10,6 +10,7 @@ es5id: 15.3.5.3_A1_T5
description: V is void 0
---*/
var FACTORY;
FACTORY = Function("name","this.name=name;");
//CHECK#1

View File

@ -10,6 +10,7 @@ es5id: 15.3.5.3_A1_T6
description: V is null
---*/
var FACTORY;
FACTORY = Function("name","this.name=name;");
//CHECK#1

View File

@ -10,6 +10,7 @@ es5id: 15.3.5.3_A1_T7
description: V is undefined
---*/
var FACTORY;
FACTORY = Function("name","this.name=name;");
//CHECK#1

View File

@ -10,6 +10,7 @@ es5id: 15.3.5.3_A1_T8
description: V is undefined variable
---*/
var FACTORY;
FACTORY = Function("name","this.name=name;");
//CHECK#1

View File

@ -12,10 +12,12 @@ description: F.prototype is undefined, and V is empty object
includes: [$FAIL.js]
---*/
var FACTORY;
FACTORY = new Function;
FACTORY.prototype = undefined;
var obj;
obj={};
//CHECK#1

View File

@ -13,10 +13,12 @@ description: F.prototype is void 0, and V is new F
includes: [$FAIL.js]
---*/
var FACTORY;
FACTORY = Function("this.prop=1;");
FACTORY.prototype.name = "fairy";
var instance;
instance = new FACTORY;
FACTORY.prototype = void 0;

View File

@ -13,6 +13,7 @@ description: F.prototype is string, and V is function
includes: [$FAIL.js]
---*/
var FACTORY;
FACTORY = new Function;
FACTORY.prototype = "error";

View File

@ -14,10 +14,12 @@ es5id: 15.3.5.3_A3_T1
description: F.prototype.type is 1, and V is new F
---*/
var FACTORY;
FACTORY = Function("this.name=\"root\"");
FACTORY.prototype.type=1;
var instance;
instance = new FACTORY;
//CHECK#1

View File

@ -14,8 +14,10 @@ es5id: 15.3.5.3_A3_T2
description: F.prototype is Object.prototype, and V is empty object
---*/
var FAKEFACTORY;
FAKEFACTORY = Function();
var fakeinstance;
fakeinstance = {};
//CHECK#1

Some files were not shown because too many files have changed in this diff Show More