Replace runTestCase with assert.throws [test/language/expressions]

This commit is contained in:
André Bargull 2015-08-11 17:42:41 +02:00
parent 9cb89a4e3c
commit 3de484fe83
122 changed files with 336 additions and 1172 deletions

View File

@ -7,17 +7,9 @@ es5id: 11.13.1-1-1
description: > description: >
simple assignment throws ReferenceError if LeftHandSide is not a simple assignment throws ReferenceError if LeftHandSide is not a
reference (number) reference (number)
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
try { assert.throws(ReferenceError, function() {
eval("42 = 42"); eval("42 = 42");
} });
catch (e) {
if (e instanceof ReferenceError) {
return true;
}
}
}
runTestCase(testcase);

View File

@ -7,17 +7,9 @@ es5id: 11.13.1-1-2
description: > description: >
simple assignment throws ReferenceError if LeftHandSide is not a simple assignment throws ReferenceError if LeftHandSide is not a
reference (string) reference (string)
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
try { assert.throws(ReferenceError, function() {
eval("'x' = 42"); eval("'x' = 42");
} });
catch (e) {
if (e instanceof ReferenceError) {
return true;
}
}
}
runTestCase(testcase);

View File

@ -7,17 +7,9 @@ es5id: 11.13.1-1-3
description: > description: >
simple assignment throws ReferenceError if LeftHandSide is not a simple assignment throws ReferenceError if LeftHandSide is not a
reference (boolean) reference (boolean)
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
try { assert.throws(ReferenceError, function() {
eval("true = 42"); eval("true = 42");
} });
catch (e) {
if (e instanceof ReferenceError) {
return true;
}
}
}
runTestCase(testcase);

View File

@ -7,17 +7,9 @@ es5id: 11.13.1-1-4
description: > description: >
simple assignment throws ReferenceError if LeftHandSide is not a simple assignment throws ReferenceError if LeftHandSide is not a
reference (null) reference (null)
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
try { assert.throws(ReferenceError, function() {
eval("null = 42"); eval("null = 42");
} });
catch (e) {
if (e instanceof ReferenceError) {
return true;
}
}
}
runTestCase(testcase);

View File

@ -7,17 +7,9 @@ es5id: 11.13.1-1-6-s
description: > description: >
simple assignment throws ReferenceError if LeftHandSide is an simple assignment throws ReferenceError if LeftHandSide is an
unresolvable reference (base obj undefined) unresolvable reference (base obj undefined)
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
try { assert.throws(ReferenceError, function() {
__ES3_1_test_suite_test_11_13_1_unique_id_0__.x = 42; __ES3_1_test_suite_test_11_13_1_unique_id_0__.x = 42;
return false; });
}
catch (e) {
return (e instanceof ReferenceError);
}
}
runTestCase(testcase);

View File

@ -8,10 +8,8 @@ description: >
reference to a data property with the attribute value reference to a data property with the attribute value
{[[Writable]]:false} under strict mode {[[Writable]]:false} under strict mode
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.defineProperty(obj, "prop", { Object.defineProperty(obj, "prop", {
value: 10, value: 10,
@ -19,12 +17,7 @@ function testcase() {
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
assert.throws(TypeError, function() {
try {
obj.prop = 20; obj.prop = 20;
return false; });
} catch (e) { assert.sameValue(obj.prop, 10, 'obj.prop');
return e instanceof TypeError && obj.prop === 10;
}
}
runTestCase(testcase);

View File

@ -8,10 +8,8 @@ description: >
reference to an accessor property with the attribute value reference to an accessor property with the attribute value
{[[Set]]:undefined} under strict mode {[[Set]]:undefined} under strict mode
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.defineProperty(obj, "prop", { Object.defineProperty(obj, "prop", {
get: function () { get: function () {
@ -21,12 +19,7 @@ function testcase() {
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
assert.throws(TypeError, function() {
try {
obj.prop = 20; obj.prop = 20;
return false; });
} catch (e) { assert.sameValue(obj.prop, 11, 'obj.prop');
return e instanceof TypeError && obj.prop === 11;
}
}
runTestCase(testcase);

View File

@ -9,18 +9,10 @@ description: >
[[Extensible]] internal property has the value false under strict [[Extensible]] internal property has the value false under strict
mode mode
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.preventExtensions(obj); Object.preventExtensions(obj);
assert.throws(TypeError, function() {
try {
obj.len = 10; obj.len = 10;
return false; });
} catch (e) {
return e instanceof TypeError;
}
}
runTestCase(testcase);

View File

@ -7,16 +7,9 @@ description: >
simple assignment throws TypeError if LeftHandSide is a readonly simple assignment throws TypeError if LeftHandSide is a readonly
property in strict mode (Number.MAX_VALUE) property in strict mode (Number.MAX_VALUE)
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
try { assert.throws(TypeError, function() {
Number.MAX_VALUE = 42; Number.MAX_VALUE = 42;
return false; });
}
catch (e) {
return (e instanceof TypeError);
}
}
runTestCase(testcase);

View File

@ -7,18 +7,10 @@ description: >
simple assignment throws TypeError if LeftHandSide is a readonly simple assignment throws TypeError if LeftHandSide is a readonly
property in strict mode (Global.Infinity) property in strict mode (Global.Infinity)
flags: [onlyStrict] flags: [onlyStrict]
includes: includes: [fnGlobalObject.js]
- runTestCase.js
- fnGlobalObject.js
---*/ ---*/
function testcase() {
try { assert.throws(TypeError, function() {
fnGlobalObject().Infinity = 42; fnGlobalObject().Infinity = 42;
return false; });
}
catch (e) {
return (e instanceof TypeError);
}
}
runTestCase(testcase);

View File

@ -8,16 +8,10 @@ description: >
appears as the LeftHandSideExpression (PrimaryExpression) of appears as the LeftHandSideExpression (PrimaryExpression) of
simple assignment(=) under strict mode simple assignment(=) under strict mode
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var blah = eval; var blah = eval;
try { assert.throws(SyntaxError, function() {
eval("(eval) = 20;"); eval("(eval) = 20;");
return false; });
} catch (e) { assert.sameValue(blah, eval, 'blah');
return e instanceof SyntaxError && blah === eval;
}
}
runTestCase(testcase);

View File

@ -7,16 +7,9 @@ description: >
simple assignment throws TypeError if LeftHandSide is a readonly simple assignment throws TypeError if LeftHandSide is a readonly
property in strict mode (Function.length) property in strict mode (Function.length)
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
try { assert.throws(TypeError, function() {
Function.length = 42; Function.length = 42;
return false; });
}
catch (e) {
return (e instanceof TypeError);
}
}
runTestCase(testcase);

View File

@ -5,19 +5,13 @@
es5id: 8.14.4-8-b_2 es5id: 8.14.4-8-b_2
description: Non-writable property on a prototype written to in strict mode. description: Non-writable property on a prototype written to in strict mode.
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
function foo() {}; function foo() {};
Object.defineProperty(foo.prototype, "bar", {value: "unwritable"}); Object.defineProperty(foo.prototype, "bar", {value: "unwritable"});
var o = new foo(); var o = new foo();
try { assert.throws(TypeError, function() {
o.bar = "overridden"; o.bar = "overridden";
return false; });
} catch(e) { assert.sameValue(o.bar, "unwritable", 'o.bar');
return (e instanceof TypeError) && (o.bar==="unwritable");
}
}
runTestCase(testcase);

View File

@ -6,19 +6,14 @@ es5id: 11.2.3-3_1
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 (FunctionDeclaration) the object is actually callable (FunctionDeclaration)
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var fooCalled = false; var fooCalled = false;
function foo(){ fooCalled = true; } function foo(){ fooCalled = true; }
var o = { }; var o = { };
try { assert.throws(TypeError, function() {
o.bar( foo() ); o.bar( foo() );
$ERROR("o.bar does not exist!"); $ERROR("o.bar does not exist!");
} catch(e) { });
return (e instanceof TypeError) && (fooCalled===true); assert.sameValue(fooCalled, true, 'fooCalled');
}
}
runTestCase(testcase);

View File

@ -6,19 +6,14 @@ es5id: 11.2.3-3_2
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 (FunctionExpression) the object is actually callable (FunctionExpression)
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var fooCalled = false; var fooCalled = false;
var foo = function (){ fooCalled = true; } var foo = function (){ fooCalled = true; }
var o = { }; var o = { };
try { assert.throws(TypeError, function() {
o.bar( foo() ); o.bar( foo() );
$ERROR("o.bar does not exist!"); $ERROR("o.bar does not exist!");
} catch(e) { });
return (e instanceof TypeError) && (fooCalled===true); assert.sameValue(fooCalled, true, 'fooCalled');
}
}
runTestCase(testcase);

View File

@ -6,19 +6,14 @@ es5id: 11.2.3-3_3
description: > description: >
Call arguments are not evaluated before the check is made to see Call arguments are not evaluated before the check is made to see
if the object is actually callable (undefined member) if the object is actually callable (undefined member)
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var fooCalled = false; var fooCalled = false;
function foo(){ fooCalled = true; } function foo(){ fooCalled = true; }
var o = { }; var o = { };
try { assert.throws(TypeError, function() {
o.bar.gar( foo() ); o.bar.gar( foo() );
$ERROR("o.bar does not exist!"); $ERROR("o.bar does not exist!");
} catch(e) { });
return (e instanceof TypeError) && (fooCalled===false); assert.sameValue(fooCalled, false, 'fooCalled');
}
}
runTestCase(testcase);

View File

@ -6,21 +6,18 @@ es5id: 11.2.3-3_4
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 (property) the object is actually callable (property)
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var fooCalled = false; var fooCalled = false;
function foo(){ fooCalled = true; } function foo(){ fooCalled = true; }
var o = { }; var o = { };
Object.defineProperty(o, "bar", {get: function() {this.barGetter = true; return 42;}, Object.defineProperty(o, "bar", {get: function() {this.barGetter = true; return 42;},
set: function(x) {this.barSetter = true; }}); set: function(x) {this.barSetter = true; }});
try { assert.throws(TypeError, function() {
o.bar( foo() ); o.bar( foo() );
$ERROR("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); assert.sameValue(fooCalled, true, 'fooCalled');
} assert.sameValue(o.barGetter, true, 'o.barGetter');
} assert.sameValue(o.barSetter, undefined, 'o.barSetter');
runTestCase(testcase);

View File

@ -6,19 +6,14 @@ es5id: 11.2.3-3_5
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 (eval'ed) the object is actually callable (eval'ed)
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var fooCalled = false; var fooCalled = false;
function foo(){ fooCalled = true; } function foo(){ fooCalled = true; }
var o = { }; var o = { };
try { assert.throws(TypeError, function() {
eval("o.bar( foo() );"); eval("o.bar( foo() );");
$ERROR("o.bar does not exist!"); $ERROR("o.bar does not exist!");
} catch(e) { });
return (e instanceof TypeError) && (fooCalled===true); assert.sameValue(fooCalled, true, 'fooCalled');
}
}
runTestCase(testcase);

View File

@ -6,18 +6,14 @@ es5id: 11.2.3-3_6
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 (getter called) the object is actually callable (getter called)
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var o = { }; var o = { };
Object.defineProperty(o, "bar", {get: function() {this.barGetter = true; return 42;}, Object.defineProperty(o, "bar", {get: function() {this.barGetter = true; return 42;},
set: function(x) {this.barSetter = true; }}); set: function(x) {this.barSetter = true; }});
try { assert.throws(TypeError, function() {
o.foo( o.bar ); o.foo( o.bar );
$ERROR("o.foo does not exist!"); $ERROR("o.foo does not exist!");
} catch(e) { });
return (e instanceof TypeError) && (o.barGetter===true) && (o.barSetter===undefined); assert.sameValue(o.barGetter, true, 'o.barGetter');
} assert.sameValue(o.barSetter, undefined, 'o.barSetter');
}
runTestCase(testcase);

View File

@ -6,18 +6,14 @@ es5id: 11.2.3-3_7
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 (getter called as indexed property) the object is actually callable (getter called as indexed property)
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var o = { }; var o = { };
Object.defineProperty(o, "bar", {get: function() {this.barGetter = true; return 42;}, Object.defineProperty(o, "bar", {get: function() {this.barGetter = true; return 42;},
set: function(x) {this.barSetter = true; }}); set: function(x) {this.barSetter = true; }});
try { assert.throws(TypeError, function() {
o.foo( o["bar"] ); o.foo( o["bar"] );
$ERROR("o.foo does not exist!"); $ERROR("o.foo does not exist!");
} catch(e) { });
return (e instanceof TypeError) && (o.barGetter===true) && (o.barSetter===undefined); assert.sameValue(o.barGetter, true, 'o.barGetter');
} assert.sameValue(o.barSetter, undefined, 'o.barSetter');
}
runTestCase(testcase);

View File

@ -7,19 +7,12 @@ 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] flags: [noStrict]
includes:
- runTestCase.js
---*/ ---*/
function testcase() {
var fooCalled = false; var fooCalled = false;
function foo(){ fooCalled = true; } function foo(){ fooCalled = true; }
assert.throws(TypeError, function() {
try {
this.bar( foo() ); this.bar( foo() );
$ERROR("this.bar does not exist!"); $ERROR("this.bar does not exist!");
} catch(e) { });
return (e instanceof TypeError) && (fooCalled===true); assert.sameValue(fooCalled, true, 'fooCalled');
}
}
runTestCase(testcase);

View File

@ -6,15 +6,9 @@ es5id: 11.13.2-1-s
description: > description: >
ReferenceError is thrown if the LeftHandSideExpression of a Compound ReferenceError is thrown if the LeftHandSideExpression of a Compound
Assignment operator(*=) evaluates to an unresolvable reference Assignment operator(*=) evaluates to an unresolvable reference
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
try { assert.throws(ReferenceError, function() {
eval("_11_13_2_1 *= 1;"); eval("_11_13_2_1 *= 1;");
return false; });
} catch (e) {
return e instanceof ReferenceError;
}
}
runTestCase(testcase);

View File

@ -6,15 +6,9 @@ es5id: 11.13.2-10-s
description: > description: >
ReferenceError is thrown if the LeftHandSideExpression of a Compound ReferenceError is thrown if the LeftHandSideExpression of a Compound
Assignment operator(^=) evaluates to an unresolvable reference Assignment operator(^=) evaluates to an unresolvable reference
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
try { assert.throws(ReferenceError, function() {
eval("_11_13_2_10 ^= 1;"); eval("_11_13_2_10 ^= 1;");
return false; });
} catch (e) {
return e instanceof ReferenceError;
}
}
runTestCase(testcase);

View File

@ -6,15 +6,9 @@ es5id: 11.13.2-11-s
description: > description: >
ReferenceError is thrown if the LeftHandSideExpression of a Compound ReferenceError is thrown if the LeftHandSideExpression of a Compound
Assignment operator(|=) evaluates to an unresolvable reference Assignment operator(|=) evaluates to an unresolvable reference
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
try { assert.throws(ReferenceError, function() {
eval("_11_13_2_11 |= 1;"); eval("_11_13_2_11 |= 1;");
return false; });
} catch (e) {
return e instanceof ReferenceError;
}
}
runTestCase(testcase);

View File

@ -6,15 +6,9 @@ es5id: 11.13.2-2-s
description: > description: >
Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a
Compound Assignment operator(/=) evaluates to an unresolvable reference Compound Assignment operator(/=) evaluates to an unresolvable reference
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
try { assert.throws(ReferenceError, function() {
eval("_11_13_2_2 /= 1;"); eval("_11_13_2_2 /= 1;");
return false; });
} catch (e) {
return e instanceof ReferenceError;
}
}
runTestCase(testcase);

View File

@ -8,10 +8,8 @@ description: >
Compound Assignment operator(*=) is a reference to a data property Compound Assignment operator(*=) is a reference to a data property
with the attribute value {[[Writable]]:false} with the attribute value {[[Writable]]:false}
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.defineProperty(obj, "prop", { Object.defineProperty(obj, "prop", {
value: 10, value: 10,
@ -19,12 +17,7 @@ function testcase() {
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
assert.throws(TypeError, function() {
try {
obj.prop *= 20; obj.prop *= 20;
return false; });
} catch (e) { assert.sameValue(obj.prop, 10, 'obj.prop');
return e instanceof TypeError && obj.prop === 10;
}
}
runTestCase(testcase);

View File

@ -8,10 +8,8 @@ description: >
Compound Assignment operator(/=) is a reference to a data property Compound Assignment operator(/=) is a reference to a data property
with the attribute value {[[Writable]]:false} with the attribute value {[[Writable]]:false}
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.defineProperty(obj, "prop", { Object.defineProperty(obj, "prop", {
value: 10, value: 10,
@ -19,12 +17,7 @@ function testcase() {
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
assert.throws(TypeError, function() {
try {
obj.prop /= 20; obj.prop /= 20;
return false; });
} catch (e) { assert.sameValue(obj.prop, 10, 'obj.prop');
return e instanceof TypeError && obj.prop === 10;
}
}
runTestCase(testcase);

View File

@ -8,10 +8,8 @@ description: >
Compound Assignment operator(%=) is a reference to a data property Compound Assignment operator(%=) is a reference to a data property
with the attribute value {[[Writable]]:false} with the attribute value {[[Writable]]:false}
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.defineProperty(obj, "prop", { Object.defineProperty(obj, "prop", {
value: 10, value: 10,
@ -19,12 +17,7 @@ function testcase() {
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
assert.throws(TypeError, function() {
try {
obj.prop %= 20; obj.prop %= 20;
return false; });
} catch (e) { assert.sameValue(obj.prop, 10, 'obj.prop');
return e instanceof TypeError && obj.prop === 10;
}
}
runTestCase(testcase);

View File

@ -8,10 +8,8 @@ description: >
Compound Assignment operator(+=) is a reference to a data property Compound Assignment operator(+=) is a reference to a data property
with the attribute value {[[Writable]]:false} with the attribute value {[[Writable]]:false}
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.defineProperty(obj, "prop", { Object.defineProperty(obj, "prop", {
value: 10, value: 10,
@ -19,12 +17,7 @@ function testcase() {
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
assert.throws(TypeError, function() {
try {
obj.prop += 20; obj.prop += 20;
return false; });
} catch (e) { assert.sameValue(obj.prop, 10, 'obj.prop');
return e instanceof TypeError && obj.prop === 10;
}
}
runTestCase(testcase);

View File

@ -8,10 +8,8 @@ description: >
Compound Assignment operator(-=) is a reference to a data property Compound Assignment operator(-=) is a reference to a data property
with the attribute value {[[Writable]]:false} with the attribute value {[[Writable]]:false}
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.defineProperty(obj, "prop", { Object.defineProperty(obj, "prop", {
value: 10, value: 10,
@ -19,12 +17,7 @@ function testcase() {
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
assert.throws(TypeError, function() {
try {
obj.prop -= 20; obj.prop -= 20;
return false; });
} catch (e) { assert.sameValue(obj.prop, 10, 'obj.prop');
return e instanceof TypeError && obj.prop === 10;
}
}
runTestCase(testcase);

View File

@ -8,10 +8,8 @@ description: >
Compound Assignment operator(<<=) is a reference to a data Compound Assignment operator(<<=) is a reference to a data
property with the attribute value {[[Writable]]:false} property with the attribute value {[[Writable]]:false}
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.defineProperty(obj, "prop", { Object.defineProperty(obj, "prop", {
value: 10, value: 10,
@ -19,12 +17,7 @@ function testcase() {
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
assert.throws(TypeError, function() {
try {
obj.prop <<= 20; obj.prop <<= 20;
return false; });
} catch (e) { assert.sameValue(obj.prop, 10, 'obj.prop');
return e instanceof TypeError && obj.prop === 10;
}
}
runTestCase(testcase);

View File

@ -8,10 +8,8 @@ description: >
Compound Assignment operator(>>=) is a reference to a data Compound Assignment operator(>>=) is a reference to a data
property with the attribute value {[[Writable]]:false} property with the attribute value {[[Writable]]:false}
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.defineProperty(obj, "prop", { Object.defineProperty(obj, "prop", {
value: 10, value: 10,
@ -19,12 +17,7 @@ function testcase() {
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
assert.throws(TypeError, function() {
try {
obj.prop >>= 20; obj.prop >>= 20;
return false; });
} catch (e) { assert.sameValue(obj.prop, 10, 'obj.prop');
return e instanceof TypeError && obj.prop === 10;
}
}
runTestCase(testcase);

View File

@ -8,15 +8,9 @@ description: >
LeftHandSideExpression of a Compound Assignment operator(%=) LeftHandSideExpression of a Compound Assignment operator(%=)
evaluates to an unresolvable reference evaluates to an unresolvable reference
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
try { assert.throws(ReferenceError, function() {
eval("_11_13_2_3 %= 1;"); eval("_11_13_2_3 %= 1;");
return false; });
} catch (e) {
return e instanceof ReferenceError;
}
}
runTestCase(testcase);

View File

@ -8,10 +8,8 @@ description: >
Compound Assignment operator(>>>=) is a reference to a data Compound Assignment operator(>>>=) is a reference to a data
property with the attribute value {[[Writable]]:false} property with the attribute value {[[Writable]]:false}
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.defineProperty(obj, "prop", { Object.defineProperty(obj, "prop", {
value: 10, value: 10,
@ -19,12 +17,7 @@ function testcase() {
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
assert.throws(TypeError, function() {
try {
obj.prop >>>= 20; obj.prop >>>= 20;
return false; });
} catch (e) { assert.sameValue(obj.prop, 10, 'obj.prop');
return e instanceof TypeError && obj.prop === 10;
}
}
runTestCase(testcase);

View File

@ -8,10 +8,8 @@ description: >
Compound Assignment operator(&=) is a reference to a data property Compound Assignment operator(&=) is a reference to a data property
with the attribute value {[[Writable]]:false} with the attribute value {[[Writable]]:false}
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.defineProperty(obj, "prop", { Object.defineProperty(obj, "prop", {
value: 10, value: 10,
@ -19,12 +17,7 @@ function testcase() {
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
assert.throws(TypeError, function() {
try {
obj.prop &= 20; obj.prop &= 20;
return false; });
} catch (e) { assert.sameValue(obj.prop, 10, 'obj.prop');
return e instanceof TypeError && obj.prop === 10;
}
}
runTestCase(testcase);

View File

@ -8,10 +8,8 @@ description: >
Compound Assignment operator(^=) is a reference to a data property Compound Assignment operator(^=) is a reference to a data property
with the attribute value {[[Writable]]:false} with the attribute value {[[Writable]]:false}
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.defineProperty(obj, "prop", { Object.defineProperty(obj, "prop", {
value: 10, value: 10,
@ -19,12 +17,7 @@ function testcase() {
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
assert.throws(TypeError, function() {
try {
obj.prop ^= 20; obj.prop ^= 20;
return false; });
} catch (e) { assert.sameValue(obj.prop, 10, 'obj.prop');
return e instanceof TypeError && obj.prop === 10;
}
}
runTestCase(testcase);

View File

@ -8,10 +8,8 @@ description: >
Compound Assignment operator(|=) is a reference to a data property Compound Assignment operator(|=) is a reference to a data property
with the attribute value {[[Writable]]:false} with the attribute value {[[Writable]]:false}
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.defineProperty(obj, "prop", { Object.defineProperty(obj, "prop", {
value: 10, value: 10,
@ -19,12 +17,7 @@ function testcase() {
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
assert.throws(TypeError, function() {
try {
obj.prop |= 20; obj.prop |= 20;
return false; });
} catch (e) { assert.sameValue(obj.prop, 10, 'obj.prop');
return e instanceof TypeError && obj.prop === 10;
}
}
runTestCase(testcase);

View File

@ -8,10 +8,8 @@ description: >
Compound Assignment operator(*=) is a reference to an accessor Compound Assignment operator(*=) is a reference to an accessor
property with the attribute value {[[Set]]:undefined} property with the attribute value {[[Set]]:undefined}
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.defineProperty(obj, "prop", { Object.defineProperty(obj, "prop", {
get: function () { get: function () {
@ -21,12 +19,7 @@ function testcase() {
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
assert.throws(TypeError, function() {
try {
obj.prop *= 20; obj.prop *= 20;
return false; });
} catch (e) { assert.sameValue(obj.prop, 11, 'obj.prop');
return e instanceof TypeError && obj.prop === 11;
}
}
runTestCase(testcase);

View File

@ -8,10 +8,8 @@ description: >
Compound Assignment operator(/=) is a reference to an accessor Compound Assignment operator(/=) is a reference to an accessor
property with the attribute value {[[Set]]:undefined} property with the attribute value {[[Set]]:undefined}
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.defineProperty(obj, "prop", { Object.defineProperty(obj, "prop", {
get: function () { get: function () {
@ -21,12 +19,7 @@ function testcase() {
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
assert.throws(TypeError, function() {
try {
obj.prop /= 20; obj.prop /= 20;
return false; });
} catch (e) { assert.sameValue(obj.prop, 11, 'obj.prop');
return e instanceof TypeError && obj.prop === 11;
}
}
runTestCase(testcase);

View File

@ -8,10 +8,8 @@ description: >
Compound Assignment operator(%=) is a reference to an accessor Compound Assignment operator(%=) is a reference to an accessor
property with the attribute value {[[Set]]:undefined} property with the attribute value {[[Set]]:undefined}
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.defineProperty(obj, "prop", { Object.defineProperty(obj, "prop", {
get: function () { get: function () {
@ -21,12 +19,7 @@ function testcase() {
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
assert.throws(TypeError, function() {
try {
obj.prop %= 20; obj.prop %= 20;
return false; });
} catch (e) { assert.sameValue(obj.prop, 11, 'obj.prop');
return e instanceof TypeError && obj.prop === 11;
}
}
runTestCase(testcase);

View File

@ -8,10 +8,8 @@ description: >
Compound Assignment operator(+=) is a reference to an accessor Compound Assignment operator(+=) is a reference to an accessor
property with the attribute value {[[Set]]:undefined} property with the attribute value {[[Set]]:undefined}
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.defineProperty(obj, "prop", { Object.defineProperty(obj, "prop", {
get: function () { get: function () {
@ -21,12 +19,7 @@ function testcase() {
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
assert.throws(TypeError, function() {
try {
obj.prop += 20; obj.prop += 20;
return false; });
} catch (e) { assert.sameValue(obj.prop, 11, 'obj.prop');
return e instanceof TypeError && obj.prop === 11;
}
}
runTestCase(testcase);

View File

@ -8,10 +8,8 @@ description: >
Compound Assignment operator(-=) is a reference to an accessor Compound Assignment operator(-=) is a reference to an accessor
property with the attribute value {[[Set]]:undefined} property with the attribute value {[[Set]]:undefined}
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.defineProperty(obj, "prop", { Object.defineProperty(obj, "prop", {
get: function () { get: function () {
@ -21,12 +19,7 @@ function testcase() {
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
assert.throws(TypeError, function() {
try {
obj.prop -= 20; obj.prop -= 20;
return false; });
} catch (e) { assert.sameValue(obj.prop, 11, 'obj.prop');
return e instanceof TypeError && obj.prop === 11;
}
}
runTestCase(testcase);

View File

@ -8,10 +8,8 @@ description: >
Compound Assignment operator(<<=) is a reference to an accessor Compound Assignment operator(<<=) is a reference to an accessor
property with the attribute value {[[Set]]:undefined} property with the attribute value {[[Set]]:undefined}
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.defineProperty(obj, "prop", { Object.defineProperty(obj, "prop", {
get: function () { get: function () {
@ -21,12 +19,7 @@ function testcase() {
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
assert.throws(TypeError, function() {
try {
obj.prop <<= 20; obj.prop <<= 20;
return false; });
} catch (e) { assert.sameValue(obj.prop, 11, 'obj.prop');
return e instanceof TypeError && obj.prop === 11;
}
}
runTestCase(testcase);

View File

@ -7,15 +7,9 @@ description: >
Strict Mode - ReferenceError is thrown if the Strict Mode - ReferenceError is thrown if the
LeftHandSideExpression of a Compound Assignment operator(+=) LeftHandSideExpression of a Compound Assignment operator(+=)
evaluates to an unresolvable reference evaluates to an unresolvable reference
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
try { assert.throws(ReferenceError, function() {
eval("_11_13_2_4 += 1;"); eval("_11_13_2_4 += 1;");
return false; });
} catch (e) {
return e instanceof ReferenceError;
}
}
runTestCase(testcase);

View File

@ -8,10 +8,8 @@ description: >
Compound Assignment operator(>>=) is a reference to an accessor Compound Assignment operator(>>=) is a reference to an accessor
property with the attribute value {[[Set]]:undefined} property with the attribute value {[[Set]]:undefined}
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.defineProperty(obj, "prop", { Object.defineProperty(obj, "prop", {
get: function () { get: function () {
@ -21,12 +19,7 @@ function testcase() {
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
assert.throws(TypeError, function() {
try {
obj.prop >>= 20; obj.prop >>= 20;
return false; });
} catch (e) { assert.sameValue(obj.prop, 11, 'obj.prop');
return e instanceof TypeError && obj.prop === 11;
}
}
runTestCase(testcase);

View File

@ -8,10 +8,8 @@ description: >
Compound Assignment operator(>>>=) is a reference to an accessor Compound Assignment operator(>>>=) is a reference to an accessor
property with the attribute value {[[Set]]:undefined} property with the attribute value {[[Set]]:undefined}
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.defineProperty(obj, "prop", { Object.defineProperty(obj, "prop", {
get: function () { get: function () {
@ -21,12 +19,7 @@ function testcase() {
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
assert.throws(TypeError, function() {
try {
obj.prop >>>= 20; obj.prop >>>= 20;
return false; });
} catch (e) { assert.sameValue(obj.prop, 11, 'obj.prop');
return e instanceof TypeError && obj.prop === 11;
}
}
runTestCase(testcase);

View File

@ -8,10 +8,8 @@ description: >
Compound Assignment operator(&=) is a reference to an accessor Compound Assignment operator(&=) is a reference to an accessor
property with the attribute value {[[Set]]:undefined} property with the attribute value {[[Set]]:undefined}
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.defineProperty(obj, "prop", { Object.defineProperty(obj, "prop", {
get: function () { get: function () {
@ -21,12 +19,7 @@ function testcase() {
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
assert.throws(TypeError, function() {
try {
obj.prop &= 20; obj.prop &= 20;
return false; });
} catch (e) { assert.sameValue(obj.prop, 11, 'obj.prop');
return e instanceof TypeError && obj.prop === 11;
}
}
runTestCase(testcase);

View File

@ -8,10 +8,8 @@ description: >
Compound Assignment operator(^=) is a reference to an accessor Compound Assignment operator(^=) is a reference to an accessor
property with the attribute value {[[Set]]:undefined} property with the attribute value {[[Set]]:undefined}
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.defineProperty(obj, "prop", { Object.defineProperty(obj, "prop", {
get: function () { get: function () {
@ -21,12 +19,7 @@ function testcase() {
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
assert.throws(TypeError, function() {
try {
obj.prop ^= 20; obj.prop ^= 20;
return false; });
} catch (e) { assert.sameValue(obj.prop, 11, 'obj.prop');
return e instanceof TypeError && obj.prop === 11;
}
}
runTestCase(testcase);

View File

@ -8,10 +8,8 @@ description: >
Compound Assignment operator(|=) is a reference of to an accessor Compound Assignment operator(|=) is a reference of to an accessor
property with the attribute value {[[Set]]:undefined} property with the attribute value {[[Set]]:undefined}
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.defineProperty(obj, "prop", { Object.defineProperty(obj, "prop", {
get: function () { get: function () {
@ -21,12 +19,7 @@ function testcase() {
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
assert.throws(TypeError, function() {
try {
obj.prop |= 20; obj.prop |= 20;
return false; });
} catch (e) { assert.sameValue(obj.prop, 11, 'obj.prop');
return e instanceof TypeError && obj.prop === 11;
}
}
runTestCase(testcase);

View File

@ -9,18 +9,10 @@ description: >
property of an object whose [[Extensible]] internal property is property of an object whose [[Extensible]] internal property is
false false
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.preventExtensions(obj); Object.preventExtensions(obj);
assert.throws(TypeError, function() {
try {
obj.len *= 10; obj.len *= 10;
return false; });
} catch (e) {
return e instanceof TypeError;
}
}
runTestCase(testcase);

View File

@ -9,18 +9,10 @@ description: >
property of an object whose [[Extensible]] internal property is property of an object whose [[Extensible]] internal property is
false false
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.preventExtensions(obj); Object.preventExtensions(obj);
assert.throws(TypeError, function() {
try {
obj.len /= 10; obj.len /= 10;
return false; });
} catch (e) {
return e instanceof TypeError;
}
}
runTestCase(testcase);

View File

@ -9,18 +9,10 @@ description: >
property of an object whose [[Extensible]] internal property is property of an object whose [[Extensible]] internal property is
false false
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.preventExtensions(obj); Object.preventExtensions(obj);
assert.throws(TypeError, function() {
try {
obj.len %= 10; obj.len %= 10;
return false; });
} catch (e) {
return e instanceof TypeError;
}
}
runTestCase(testcase);

View File

@ -9,18 +9,10 @@ description: >
property of an object whose [[Extensible]] internal property is property of an object whose [[Extensible]] internal property is
false false
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.preventExtensions(obj); Object.preventExtensions(obj);
assert.throws(TypeError, function() {
try {
obj.len += 10; obj.len += 10;
return false; });
} catch (e) {
return e instanceof TypeError;
}
}
runTestCase(testcase);

View File

@ -9,18 +9,10 @@ description: >
property of an object whose [[Extensible]] internal property is property of an object whose [[Extensible]] internal property is
false false
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.preventExtensions(obj); Object.preventExtensions(obj);
assert.throws(TypeError, function() {
try {
obj.len -= 10; obj.len -= 10;
return false; });
} catch (e) {
return e instanceof TypeError;
}
}
runTestCase(testcase);

View File

@ -7,15 +7,9 @@ description: >
Strict Mode - ReferenceError is thrown if the Strict Mode - ReferenceError is thrown if the
LeftHandSideExpression of a Compound Assignment operator(-=) LeftHandSideExpression of a Compound Assignment operator(-=)
evaluates to an unresolvable reference evaluates to an unresolvable reference
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
try { assert.throws(ReferenceError, function() {
eval("_11_13_2_5 -= 1;"); eval("_11_13_2_5 -= 1;");
return false; });
} catch (e) {
return e instanceof ReferenceError;
}
}
runTestCase(testcase);

View File

@ -9,18 +9,10 @@ description: >
property of an object whose [[Extensible]] internal property is property of an object whose [[Extensible]] internal property is
false false
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.preventExtensions(obj); Object.preventExtensions(obj);
assert.throws(TypeError, function() {
try {
obj.len <<= 10; obj.len <<= 10;
return false; });
} catch (e) {
return e instanceof TypeError;
}
}
runTestCase(testcase);

View File

@ -9,18 +9,10 @@ description: >
property of an object whose [[Extensible]] internal property is property of an object whose [[Extensible]] internal property is
false false
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.preventExtensions(obj); Object.preventExtensions(obj);
assert.throws(TypeError, function() {
try {
obj.len >>= 10; obj.len >>= 10;
return false; });
} catch (e) {
return e instanceof TypeError;
}
}
runTestCase(testcase);

View File

@ -9,18 +9,10 @@ description: >
non-existent property of an object whose [[Extensible]] internal non-existent property of an object whose [[Extensible]] internal
property if false property if false
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.preventExtensions(obj); Object.preventExtensions(obj);
assert.throws(TypeError, function() {
try {
obj.len >>>= 10; obj.len >>>= 10;
return false; });
} catch (e) {
return e instanceof TypeError;
}
}
runTestCase(testcase);

View File

@ -9,18 +9,10 @@ description: >
property of an object whose [[Extensible]] internal property is property of an object whose [[Extensible]] internal property is
false false
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.preventExtensions(obj); Object.preventExtensions(obj);
assert.throws(TypeError, function() {
try {
obj.len &= 10; obj.len &= 10;
return false; });
} catch (e) {
return e instanceof TypeError;
}
}
runTestCase(testcase);

View File

@ -9,18 +9,10 @@ description: >
property of an object whose [[Extensible]] internal property is property of an object whose [[Extensible]] internal property is
false false
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.preventExtensions(obj); Object.preventExtensions(obj);
assert.throws(TypeError, function() {
try {
obj.len ^= 10; obj.len ^= 10;
return false; });
} catch (e) {
return e instanceof TypeError;
}
}
runTestCase(testcase);

View File

@ -9,18 +9,10 @@ description: >
property of an object whose [[Extensible]] internal property is property of an object whose [[Extensible]] internal property is
false false
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.preventExtensions(obj); Object.preventExtensions(obj);
assert.throws(TypeError, function() {
try {
obj.len |= 10; obj.len |= 10;
return false; });
} catch (e) {
return e instanceof TypeError;
}
}
runTestCase(testcase);

View File

@ -7,16 +7,10 @@ description: >
Strict Mode - SyntaxError is thrown if the identifier eval appear Strict Mode - SyntaxError is thrown if the identifier eval appear
as the LeftHandSideExpression of a Compound Assignment operator(*=) as the LeftHandSideExpression of a Compound Assignment operator(*=)
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var blah = eval; var blah = eval;
try { assert.throws(SyntaxError, function() {
eval("eval *= 20;"); eval("eval *= 20;");
return false; });
} catch (e) { assert.sameValue(blah, eval, 'blah');
return e instanceof SyntaxError && blah === eval;
}
}
runTestCase(testcase);

View File

@ -7,16 +7,10 @@ description: >
Strict Mode - SyntaxError is thrown if the identifier eval appear Strict Mode - SyntaxError is thrown if the identifier eval appear
as the LeftHandSideExpression of a Compound Assignment operator(^=) as the LeftHandSideExpression of a Compound Assignment operator(^=)
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var blah = eval; var blah = eval;
try { assert.throws(SyntaxError, function() {
eval("eval ^= 20;"); eval("eval ^= 20;");
return false; });
} catch (e) { assert.sameValue(blah, eval, 'blah');
return e instanceof SyntaxError && blah === eval;
}
}
runTestCase(testcase);

View File

@ -7,16 +7,10 @@ description: >
Strict Mode - SyntaxError is thrown if the identifier eval appear Strict Mode - SyntaxError is thrown if the identifier eval appear
as the LeftHandSideExpression of a Compound Assignment operator(|=) as the LeftHandSideExpression of a Compound Assignment operator(|=)
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var blah = eval; var blah = eval;
try { assert.throws(SyntaxError, function() {
eval("eval |= 20;"); eval("eval |= 20;");
return false; });
} catch (e) { assert.sameValue(blah, eval, 'blah');
return e instanceof SyntaxError && blah === eval;
}
}
runTestCase(testcase);

View File

@ -7,16 +7,10 @@ description: >
Strict Mode - SyntaxError is thrown if the identifier eval appear Strict Mode - SyntaxError is thrown if the identifier eval appear
as the LeftHandSideExpression of a Compound Assignment operator(/=) as the LeftHandSideExpression of a Compound Assignment operator(/=)
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var blah = eval; var blah = eval;
try { assert.throws(SyntaxError, function() {
eval("eval /= 20;"); eval("eval /= 20;");
return false; });
} catch (e) { assert.sameValue(blah, eval, 'blah');
return e instanceof SyntaxError && blah === eval;
}
}
runTestCase(testcase);

View File

@ -7,16 +7,10 @@ description: >
Strict Mode - SyntaxError is thrown if the identifier eval appear Strict Mode - SyntaxError is thrown if the identifier eval appear
as the LeftHandSideExpression of a Compound Assignment operator(%=) as the LeftHandSideExpression of a Compound Assignment operator(%=)
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var blah = eval; var blah = eval;
try { assert.throws(SyntaxError, function() {
eval("eval %= 20;"); eval("eval %= 20;");
return false; });
} catch (e) { assert.sameValue(blah, eval, 'blah');
return e instanceof SyntaxError && blah === eval;
}
}
runTestCase(testcase);

View File

@ -7,16 +7,10 @@ description: >
Strict Mode - SyntaxError is thrown if the identifier eval appear Strict Mode - SyntaxError is thrown if the identifier eval appear
as the LeftHandSideExpression of a Compound Assignment operator(+=) as the LeftHandSideExpression of a Compound Assignment operator(+=)
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var blah = eval; var blah = eval;
try { assert.throws(SyntaxError, function() {
eval("eval += 20;"); eval("eval += 20;");
return false; });
} catch (e) { assert.sameValue(blah, eval, 'blah');
return e instanceof SyntaxError && blah === eval;
}
}
runTestCase(testcase);

View File

@ -7,16 +7,10 @@ description: >
Strict Mode - SyntaxError is thrown if the identifier eval appear Strict Mode - SyntaxError is thrown if the identifier eval appear
as the LeftHandSideExpression of a Compound Assignment operator(-=) as the LeftHandSideExpression of a Compound Assignment operator(-=)
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var blah = eval; var blah = eval;
try { assert.throws(SyntaxError, function() {
eval("eval -= 20;"); eval("eval -= 20;");
return false; });
} catch (e) { assert.sameValue(blah, eval, 'blah');
return e instanceof SyntaxError && blah === eval;
}
}
runTestCase(testcase);

View File

@ -8,16 +8,10 @@ description: >
as the LeftHandSideExpression of a Compound Assignment as the LeftHandSideExpression of a Compound Assignment
operator(<<=) operator(<<=)
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var blah = eval; var blah = eval;
try { assert.throws(SyntaxError, function() {
eval("eval <<= 20;"); eval("eval <<= 20;");
return false; });
} catch (e) { assert.sameValue(blah, eval, 'blah');
return e instanceof SyntaxError && blah === eval;
}
}
runTestCase(testcase);

View File

@ -8,16 +8,10 @@ description: >
as the LeftHandSideExpression of a Compound Assignment as the LeftHandSideExpression of a Compound Assignment
operator(>>=) operator(>>=)
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var blah = eval; var blah = eval;
try { assert.throws(SyntaxError, function() {
eval("eval >>= 20;"); eval("eval >>= 20;");
return false; });
} catch (e) { assert.sameValue(blah, eval, 'blah');
return e instanceof SyntaxError && blah === eval;
}
}
runTestCase(testcase);

View File

@ -8,16 +8,10 @@ description: >
as the LeftHandSideExpression of a Compound Assignment as the LeftHandSideExpression of a Compound Assignment
operator(>>>=) operator(>>>=)
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var blah = eval; var blah = eval;
try { assert.throws(SyntaxError, function() {
eval("eval >>>= 20;"); eval("eval >>>= 20;");
return false; });
} catch (e) { assert.sameValue(blah, eval, 'blah');
return e instanceof SyntaxError && blah === eval;
}
}
runTestCase(testcase);

View File

@ -7,16 +7,10 @@ description: >
Strict Mode - SyntaxError is thrown if the identifier eval appear Strict Mode - SyntaxError is thrown if the identifier eval appear
as the LeftHandSideExpression of a Compound Assignment operator(&=) as the LeftHandSideExpression of a Compound Assignment operator(&=)
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var blah = eval; var blah = eval;
try { assert.throws(SyntaxError, function() {
eval("eval &= 20;"); eval("eval &= 20;");
return false; });
} catch (e) { assert.sameValue(blah, eval, 'blah');
return e instanceof SyntaxError && blah === eval;
}
}
runTestCase(testcase);

View File

@ -7,15 +7,9 @@ description: >
Strict Mode - ReferenceError is thrown if the Strict Mode - ReferenceError is thrown if the
LeftHandSideExpression of a Compound Assignment operator(<<=) LeftHandSideExpression of a Compound Assignment operator(<<=)
evaluates to an unresolvable reference evaluates to an unresolvable reference
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
try { assert.throws(ReferenceError, function() {
eval("_11_13_2_6 <<= 1;"); eval("_11_13_2_6 <<= 1;");
return false; });
} catch (e) {
return e instanceof ReferenceError;
}
}
runTestCase(testcase);

View File

@ -8,15 +8,9 @@ description: >
LeftHandSideExpression of a Compound Assignment operator(>>=) LeftHandSideExpression of a Compound Assignment operator(>>=)
evaluates to an unresolvable reference evaluates to an unresolvable reference
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
try { assert.throws(ReferenceError, function() {
eval("_11_13_2_7 >>= 1;"); eval("_11_13_2_7 >>= 1;");
return false; });
} catch (e) {
return e instanceof ReferenceError;
}
}
runTestCase(testcase);

View File

@ -7,15 +7,9 @@ description: >
Strict Mode - ReferenceError is thrown if the Strict Mode - ReferenceError is thrown if the
LeftHandSideExpression of a Compound Assignment operator(>>>=) LeftHandSideExpression of a Compound Assignment operator(>>>=)
evaluates to an unresolvable reference evaluates to an unresolvable reference
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
try { assert.throws(ReferenceError, function() {
eval("_11_13_2_8 >>>= 1;"); eval("_11_13_2_8 >>>= 1;");
return false; });
} catch (e) {
return e instanceof ReferenceError;
}
}
runTestCase(testcase);

View File

@ -7,15 +7,9 @@ description: >
Strict Mode - ReferenceError is thrown if the Strict Mode - ReferenceError is thrown if the
LeftHandSideExpression of a Compound Assignment operator(&=) LeftHandSideExpression of a Compound Assignment operator(&=)
evaluates to an unresolvable reference evaluates to an unresolvable reference
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
try { assert.throws(ReferenceError, function() {
eval("_11_13_2_9 &= 1;"); eval("_11_13_2_9 &= 1;");
return false; });
} catch (e) {
return e instanceof ReferenceError;
}
}
runTestCase(testcase);

View File

@ -6,19 +6,9 @@ es5id: 11.4.1-3-2
description: > description: >
delete operator throws ReferenceError when deleting an explicitly delete operator throws ReferenceError when deleting an explicitly
qualified yet unresolvable reference (base obj undefined) qualified yet unresolvable reference (base obj undefined)
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
// just cooking up a long/veryLikely unique name // just cooking up a long/veryLikely unique name
try assert.throws(ReferenceError, function() {
{
var d = delete __ES3_1_test_suite_test_11_4_1_3_unique_id_2__.x; var d = delete __ES3_1_test_suite_test_11_4_1_3_unique_id_2__.x;
} });
catch(e)
{
if (e instanceof ReferenceError)
return true;
}
}
runTestCase(testcase);

View File

@ -7,16 +7,9 @@ description: >
Strict Mode - SyntaxError is thrown when deleting an un-resolvable Strict Mode - SyntaxError is thrown when deleting an un-resolvable
reference reference
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
try { assert.throws(SyntaxError, function() {
eval("delete obj"); eval("delete obj");
return false; });
} catch (e) {
return e instanceof SyntaxError;
}
}
runTestCase(testcase);

View File

@ -7,21 +7,14 @@ description: >
Strict Mode - TypeError is thrown when deleting non-configurable Strict Mode - TypeError is thrown when deleting non-configurable
data property data property
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.defineProperty(obj, "prop", { Object.defineProperty(obj, "prop", {
value: "abc", value: "abc",
configurable: false configurable: false
}); });
assert.throws(TypeError, function() {
try {
delete obj.prop; delete obj.prop;
return false; });
} catch (e) { assert.sameValue(obj.prop, "abc", 'obj.prop');
return e instanceof TypeError && obj.prop === "abc";
}
}
runTestCase(testcase);

View File

@ -7,10 +7,8 @@ description: >
Strict Mode - TypeError is thrown when deleting non-configurable Strict Mode - TypeError is thrown when deleting non-configurable
accessor property accessor property
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
Object.defineProperty(obj, "prop", { Object.defineProperty(obj, "prop", {
get: function () { get: function () {
@ -18,12 +16,7 @@ function testcase() {
}, },
configurable: false configurable: false
}); });
assert.throws(TypeError, function() {
try {
delete obj.prop; delete obj.prop;
return false; });
} catch (e) { assert.sameValue(obj.prop, "abc", 'obj.prop');
return e instanceof TypeError && obj.prop === "abc";
}
}
runTestCase(testcase);

View File

@ -10,21 +10,13 @@ description: >
delete operator throws TypeError when deleting a non-configurable delete operator throws TypeError when deleting a non-configurable
data property in strict mode data property in strict mode
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var o = {}; var o = {};
var desc = { value : 1 }; // all other attributes default to false var desc = { value : 1 }; // all other attributes default to false
Object.defineProperty(o, "foo", desc); Object.defineProperty(o, "foo", desc);
// Now, deleting o.foo should throw TypeError because [[Configurable]] on foo is false. // Now, deleting o.foo should throw TypeError because [[Configurable]] on foo is false.
try { assert.throws(TypeError, function() {
delete o.foo; delete o.foo;
return false; });
}
catch (e) {
return (e instanceof TypeError);
}
}
runTestCase(testcase);

View File

@ -10,19 +10,10 @@ description: >
delete operator throws TypeError when deleting a non-configurable delete operator throws TypeError when deleting a non-configurable
data property in strict mode data property in strict mode
flags: [onlyStrict] flags: [onlyStrict]
includes: includes: [fnGlobalObject.js]
- runTestCase.js
- fnGlobalObject.js
---*/ ---*/
function testcase() {
// NaN (15.1.1.1) has [[Configurable]] set to false. // NaN (15.1.1.1) has [[Configurable]] set to false.
try { assert.throws(TypeError, function() {
delete fnGlobalObject().NaN; delete fnGlobalObject().NaN;
return false; });
}
catch (e) {
return (e instanceof TypeError);
}
}
runTestCase(testcase);

View File

@ -10,16 +10,9 @@ description: >
delete operator throws TypeError when deleting a non-configurable delete operator throws TypeError when deleting a non-configurable
data property (Math.LN2) in strict mode data property (Math.LN2) in strict mode
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
try { assert.throws(TypeError, function() {
delete Math.LN2; delete Math.LN2;
return false; });
}
catch (e) {
return (e instanceof TypeError);
}
}
runTestCase(testcase);

View File

@ -7,17 +7,9 @@ description: >
Strict Mode - SyntaxError is thrown when deleting a variable which Strict Mode - SyntaxError is thrown when deleting a variable which
is a primitive value type (number) is a primitive value type (number)
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var _11_4_1_5 = 5; var _11_4_1_5 = 5;
assert.throws(SyntaxError, function() {
try {
eval("delete _11_4_1_5;"); eval("delete _11_4_1_5;");
return false; });
} catch (e) {
return e instanceof SyntaxError;
}
}
runTestCase(testcase);

View File

@ -7,17 +7,9 @@ description: >
Strict Mode - SyntaxError is thrown when deleting a variable of Strict Mode - SyntaxError is thrown when deleting a variable of
type Array type Array
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var arrObj = [1,2,3]; var arrObj = [1,2,3];
assert.throws(SyntaxError, function() {
try {
eval("delete arrObj;"); eval("delete arrObj;");
return false; });
} catch (e) {
return e instanceof SyntaxError;
}
}
runTestCase(testcase);

View File

@ -7,17 +7,9 @@ description: >
Strict Mode - SyntaxError is thrown when deleting a variable of Strict Mode - SyntaxError is thrown when deleting a variable of
type String type String
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var strObj = new String("abc"); var strObj = new String("abc");
assert.throws(SyntaxError, function() {
try {
eval("delete strObj;"); eval("delete strObj;");
return false; });
} catch (e) {
return e instanceof SyntaxError;
}
}
runTestCase(testcase);

View File

@ -7,17 +7,9 @@ description: >
Strict Mode - SyntaxError is thrown when deleting a variable of Strict Mode - SyntaxError is thrown when deleting a variable of
type Boolean type Boolean
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var boolObj = new Boolean(false); var boolObj = new Boolean(false);
assert.throws(SyntaxError, function() {
try {
eval("delete boolObj;"); eval("delete boolObj;");
return false; });
} catch (e) {
return e instanceof SyntaxError;
}
}
runTestCase(testcase);

View File

@ -7,17 +7,9 @@ description: >
Strict Mode - SyntaxError is thrown when deleting a variable of Strict Mode - SyntaxError is thrown when deleting a variable of
type Number type Number
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var numObj = new Number(0); var numObj = new Number(0);
assert.throws(SyntaxError, function() {
try {
eval("delete numObj;"); eval("delete numObj;");
return false; });
} catch (e) {
return e instanceof SyntaxError;
}
}
runTestCase(testcase);

View File

@ -7,17 +7,9 @@ description: >
Strict Mode - SyntaxError is thrown when deleting a variable of Strict Mode - SyntaxError is thrown when deleting a variable of
type Date type Date
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var dateObj = new Date(); var dateObj = new Date();
assert.throws(SyntaxError, function() {
try {
eval("delete dateObj;"); eval("delete dateObj;");
return false; });
} catch (e) {
return e instanceof SyntaxError;
}
}
runTestCase(testcase);

View File

@ -7,17 +7,9 @@ description: >
Strict Mode - SyntaxError is thrown when deleting a variable of Strict Mode - SyntaxError is thrown when deleting a variable of
type RegExp type RegExp
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var regObj = new RegExp(); var regObj = new RegExp();
assert.throws(SyntaxError, function() {
try {
eval("delete regObj;"); eval("delete regObj;");
return false; });
} catch (e) {
return e instanceof SyntaxError;
}
}
runTestCase(testcase);

View File

@ -7,17 +7,9 @@ description: >
Strict Mode - SyntaxError is thrown when deleting a variable of Strict Mode - SyntaxError is thrown when deleting a variable of
type Error type Error
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var errObj = new Error(); var errObj = new Error();
assert.throws(SyntaxError, function() {
try {
eval("delete errObj;"); eval("delete errObj;");
return false; });
} catch (e) {
return e instanceof SyntaxError;
}
}
runTestCase(testcase);

View File

@ -7,16 +7,9 @@ description: >
Strict Mode - SyntaxError is thrown when deleting a variable of Strict Mode - SyntaxError is thrown when deleting a variable of
type Arguments type Arguments
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
try {
eval("var argObj = (function (a, b) { delete arguments; }(1, 2));");
return false; assert.throws(SyntaxError, function() {
} catch (e) { eval("var argObj = (function (a, b) { delete arguments; }(1, 2));");
return e instanceof SyntaxError; });
}
}
runTestCase(testcase);

View File

@ -7,15 +7,9 @@ description: >
Strict Mode - SyntaxError is thrown when deleting a built-in Strict Mode - SyntaxError is thrown when deleting a built-in
(Object) (Object)
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
try { assert.throws(SyntaxError, function() {
eval("delete Object;"); eval("delete Object;");
return false; });
} catch (e) {
return e instanceof SyntaxError;
}
}
runTestCase(testcase);

View File

@ -7,15 +7,9 @@ description: >
Strict Mode - SyntaxError is thrown when deleting a built-in Strict Mode - SyntaxError is thrown when deleting a built-in
(Function) (Function)
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
try { assert.throws(SyntaxError, function() {
eval("delete Function;"); eval("delete Function;");
return false; });
} catch (e) {
return e instanceof SyntaxError;
}
}
runTestCase(testcase);

View File

@ -7,19 +7,11 @@ description: >
Strict Mode - SyntaxError is thrown when deleting a function Strict Mode - SyntaxError is thrown when deleting a function
parameter parameter
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
function funObj(x) { function funObj(x) {
eval("delete x;"); eval("delete x;");
} }
assert.throws(SyntaxError, function() {
try {
funObj(1); funObj(1);
return false; });
} catch (e) {
return e instanceof SyntaxError;
}
}
runTestCase(testcase);

View File

@ -7,15 +7,9 @@ description: >
Strict Mode - SyntaxError is thrown when deleting a built-in Strict Mode - SyntaxError is thrown when deleting a built-in
(Array) (Array)
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
try { assert.throws(SyntaxError, function() {
eval("delete Array;"); eval("delete Array;");
return false; });
} catch (e) {
return e instanceof SyntaxError;
}
}
runTestCase(testcase);

View File

@ -7,15 +7,9 @@ description: >
Strict Mode - SyntaxError is thrown when deleting a built-in Strict Mode - SyntaxError is thrown when deleting a built-in
(String) (String)
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
try { assert.throws(SyntaxError, function() {
eval("delete String;"); eval("delete String;");
return false; });
} catch (e) {
return e instanceof SyntaxError;
}
}
runTestCase(testcase);

View File

@ -7,15 +7,9 @@ description: >
Strict Mode - SyntaxError is thrown when deleting a built-in Strict Mode - SyntaxError is thrown when deleting a built-in
(Boolean) (Boolean)
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
try { assert.throws(SyntaxError, function() {
eval("delete Boolean;"); eval("delete Boolean;");
return false; });
} catch (e) {
return e instanceof SyntaxError;
}
}
runTestCase(testcase);

View File

@ -7,15 +7,9 @@ description: >
Strict Mode - SyntaxError is thrown when deleting a built-in Strict Mode - SyntaxError is thrown when deleting a built-in
(Number) (Number)
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
try { assert.throws(SyntaxError, function() {
eval("delete Number;"); eval("delete Number;");
return false; });
} catch (e) {
return e instanceof SyntaxError;
}
}
runTestCase(testcase);

View File

@ -5,15 +5,9 @@
es5id: 11.4.1-5-a-24-s es5id: 11.4.1-5-a-24-s
description: Strict Mode - SyntaxError is thrown when deleting a built-in (Date) description: Strict Mode - SyntaxError is thrown when deleting a built-in (Date)
flags: [onlyStrict] flags: [onlyStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
try { assert.throws(SyntaxError, function() {
eval("delete Date;"); eval("delete Date;");
return false; });
} catch (e) {
return e instanceof SyntaxError;
}
}
runTestCase(testcase);

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