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: >
simple assignment throws ReferenceError if LeftHandSide is not a
reference (number)
includes: [runTestCase.js]
---*/
function testcase() {
try {
assert.throws(ReferenceError, function() {
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: >
simple assignment throws ReferenceError if LeftHandSide is not a
reference (string)
includes: [runTestCase.js]
---*/
function testcase() {
try {
assert.throws(ReferenceError, function() {
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: >
simple assignment throws ReferenceError if LeftHandSide is not a
reference (boolean)
includes: [runTestCase.js]
---*/
function testcase() {
try {
assert.throws(ReferenceError, function() {
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: >
simple assignment throws ReferenceError if LeftHandSide is not a
reference (null)
includes: [runTestCase.js]
---*/
function testcase() {
try {
assert.throws(ReferenceError, function() {
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: >
simple assignment throws ReferenceError if LeftHandSide is an
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;
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
{[[Writable]]:false} under strict mode
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
Object.defineProperty(obj, "prop", {
value: 10,
@ -19,12 +17,7 @@ function testcase() {
enumerable: true,
configurable: true
});
try {
assert.throws(TypeError, function() {
obj.prop = 20;
return false;
} catch (e) {
return e instanceof TypeError && obj.prop === 10;
}
}
runTestCase(testcase);
});
assert.sameValue(obj.prop, 10, 'obj.prop');

View File

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

View File

@ -9,18 +9,10 @@ description: >
[[Extensible]] internal property has the value false under strict
mode
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
Object.preventExtensions(obj);
try {
assert.throws(TypeError, function() {
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
property in strict mode (Number.MAX_VALUE)
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
try {
assert.throws(TypeError, function() {
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
property in strict mode (Global.Infinity)
flags: [onlyStrict]
includes:
- runTestCase.js
- fnGlobalObject.js
includes: [fnGlobalObject.js]
---*/
function testcase() {
try {
assert.throws(TypeError, function() {
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
simple assignment(=) under strict mode
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var blah = eval;
try {
assert.throws(SyntaxError, function() {
eval("(eval) = 20;");
return false;
} catch (e) {
return e instanceof SyntaxError && blah === eval;
}
}
runTestCase(testcase);
});
assert.sameValue(blah, eval, 'blah');

View File

@ -7,16 +7,9 @@ description: >
simple assignment throws TypeError if LeftHandSide is a readonly
property in strict mode (Function.length)
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
try {
assert.throws(TypeError, function() {
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
description: Non-writable property on a prototype written to in strict mode.
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
function foo() {};
Object.defineProperty(foo.prototype, "bar", {value: "unwritable"});
var o = new foo();
try {
o.bar = "overridden";
return false;
} catch(e) {
return (e instanceof TypeError) && (o.bar==="unwritable");
}
}
runTestCase(testcase);
assert.throws(TypeError, function() {
o.bar = "overridden";
});
assert.sameValue(o.bar, "unwritable", 'o.bar');

View File

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

View File

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

View File

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

View File

@ -6,21 +6,18 @@ es5id: 11.2.3-3_4
description: >
Call arguments are evaluated before the check is made to see if
the object is actually callable (property)
includes: [runTestCase.js]
---*/
function testcase() {
var fooCalled = false;
function foo(){ fooCalled = true; }
var o = { };
Object.defineProperty(o, "bar", {get: function() {this.barGetter = true; return 42;},
set: function(x) {this.barSetter = true; }});
try {
assert.throws(TypeError, function() {
o.bar( foo() );
$ERROR("o.bar does not exist!");
} catch(e) {
return (e instanceof TypeError) && (fooCalled===true) && (o.barGetter===true) && (o.barSetter===undefined);
}
}
runTestCase(testcase);
});
assert.sameValue(fooCalled, true, 'fooCalled');
assert.sameValue(o.barGetter, true, 'o.barGetter');
assert.sameValue(o.barSetter, undefined, 'o.barSetter');

View File

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

View File

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

View File

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

View File

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

View File

@ -6,15 +6,9 @@ es5id: 11.13.2-1-s
description: >
ReferenceError is thrown if the LeftHandSideExpression of a Compound
Assignment operator(*=) evaluates to an unresolvable reference
includes: [runTestCase.js]
---*/
function testcase() {
try {
assert.throws(ReferenceError, function() {
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: >
ReferenceError is thrown if the LeftHandSideExpression of a Compound
Assignment operator(^=) evaluates to an unresolvable reference
includes: [runTestCase.js]
---*/
function testcase() {
try {
assert.throws(ReferenceError, function() {
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: >
ReferenceError is thrown if the LeftHandSideExpression of a Compound
Assignment operator(|=) evaluates to an unresolvable reference
includes: [runTestCase.js]
---*/
function testcase() {
try {
assert.throws(ReferenceError, function() {
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: >
Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a
Compound Assignment operator(/=) evaluates to an unresolvable reference
includes: [runTestCase.js]
---*/
function testcase() {
try {
assert.throws(ReferenceError, function() {
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
with the attribute value {[[Writable]]:false}
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
Object.defineProperty(obj, "prop", {
value: 10,
@ -19,12 +17,7 @@ function testcase() {
enumerable: true,
configurable: true
});
try {
assert.throws(TypeError, function() {
obj.prop *= 20;
return false;
} catch (e) {
return e instanceof TypeError && obj.prop === 10;
}
}
runTestCase(testcase);
});
assert.sameValue(obj.prop, 10, 'obj.prop');

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -9,18 +9,10 @@ description: >
property of an object whose [[Extensible]] internal property is
false
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
Object.preventExtensions(obj);
try {
assert.throws(TypeError, function() {
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
false
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
Object.preventExtensions(obj);
try {
assert.throws(TypeError, function() {
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
false
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
Object.preventExtensions(obj);
try {
assert.throws(TypeError, function() {
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
false
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
Object.preventExtensions(obj);
try {
assert.throws(TypeError, function() {
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
false
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
Object.preventExtensions(obj);
try {
assert.throws(TypeError, function() {
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
LeftHandSideExpression of a Compound Assignment operator(-=)
evaluates to an unresolvable reference
includes: [runTestCase.js]
---*/
function testcase() {
try {
assert.throws(ReferenceError, function() {
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
false
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
Object.preventExtensions(obj);
try {
assert.throws(TypeError, function() {
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
false
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
Object.preventExtensions(obj);
try {
assert.throws(TypeError, function() {
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
property if false
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
Object.preventExtensions(obj);
try {
assert.throws(TypeError, function() {
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
false
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
Object.preventExtensions(obj);
try {
assert.throws(TypeError, function() {
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
false
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
Object.preventExtensions(obj);
try {
assert.throws(TypeError, function() {
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
false
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
Object.preventExtensions(obj);
try {
assert.throws(TypeError, function() {
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
as the LeftHandSideExpression of a Compound Assignment operator(*=)
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var blah = eval;
try {
assert.throws(SyntaxError, function() {
eval("eval *= 20;");
return false;
} catch (e) {
return e instanceof SyntaxError && blah === eval;
}
}
runTestCase(testcase);
});
assert.sameValue(blah, eval, 'blah');

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -7,15 +7,9 @@ description: >
Strict Mode - ReferenceError is thrown if the
LeftHandSideExpression of a Compound Assignment operator(<<=)
evaluates to an unresolvable reference
includes: [runTestCase.js]
---*/
function testcase() {
try {
assert.throws(ReferenceError, function() {
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(>>=)
evaluates to an unresolvable reference
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
try {
assert.throws(ReferenceError, function() {
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
LeftHandSideExpression of a Compound Assignment operator(>>>=)
evaluates to an unresolvable reference
includes: [runTestCase.js]
---*/
function testcase() {
try {
assert.throws(ReferenceError, function() {
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
LeftHandSideExpression of a Compound Assignment operator(&=)
evaluates to an unresolvable reference
includes: [runTestCase.js]
---*/
function testcase() {
try {
assert.throws(ReferenceError, function() {
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: >
delete operator throws ReferenceError when deleting an explicitly
qualified yet unresolvable reference (base obj undefined)
includes: [runTestCase.js]
---*/
function testcase() {
// 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;
}
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
reference
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
try {
assert.throws(SyntaxError, function() {
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
data property
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
Object.defineProperty(obj, "prop", {
value: "abc",
configurable: false
});
try {
assert.throws(TypeError, function() {
delete obj.prop;
return false;
} catch (e) {
return e instanceof TypeError && obj.prop === "abc";
}
}
runTestCase(testcase);
});
assert.sameValue(obj.prop, "abc", 'obj.prop');

View File

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

View File

@ -10,21 +10,13 @@ description: >
delete operator throws TypeError when deleting a non-configurable
data property in strict mode
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var o = {};
var desc = { value : 1 }; // all other attributes default to false
Object.defineProperty(o, "foo", desc);
// Now, deleting o.foo should throw TypeError because [[Configurable]] on foo is false.
try {
assert.throws(TypeError, function() {
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
data property in strict mode
flags: [onlyStrict]
includes:
- runTestCase.js
- fnGlobalObject.js
includes: [fnGlobalObject.js]
---*/
function testcase() {
// NaN (15.1.1.1) has [[Configurable]] set to false.
try {
assert.throws(TypeError, function() {
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
data property (Math.LN2) in strict mode
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
try {
assert.throws(TypeError, function() {
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
is a primitive value type (number)
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var _11_4_1_5 = 5;
try {
assert.throws(SyntaxError, function() {
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
type Array
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var arrObj = [1,2,3];
try {
assert.throws(SyntaxError, function() {
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
type String
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var strObj = new String("abc");
try {
assert.throws(SyntaxError, function() {
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
type Boolean
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var boolObj = new Boolean(false);
try {
assert.throws(SyntaxError, function() {
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
type Number
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var numObj = new Number(0);
try {
assert.throws(SyntaxError, function() {
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
type Date
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var dateObj = new Date();
try {
assert.throws(SyntaxError, function() {
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
type RegExp
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var regObj = new RegExp();
try {
assert.throws(SyntaxError, function() {
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
type Error
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var errObj = new Error();
try {
assert.throws(SyntaxError, function() {
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
type Arguments
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
try {
eval("var argObj = (function (a, b) { delete arguments; }(1, 2));");
return false;
} catch (e) {
return e instanceof SyntaxError;
}
}
runTestCase(testcase);
assert.throws(SyntaxError, function() {
eval("var argObj = (function (a, b) { delete arguments; }(1, 2));");
});

View File

@ -7,15 +7,9 @@ description: >
Strict Mode - SyntaxError is thrown when deleting a built-in
(Object)
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
try {
assert.throws(SyntaxError, function() {
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
(Function)
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
try {
assert.throws(SyntaxError, 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
parameter
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
function funObj(x) {
eval("delete x;");
}
try {
assert.throws(SyntaxError, function() {
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
(Array)
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
try {
assert.throws(SyntaxError, function() {
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
(String)
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
try {
assert.throws(SyntaxError, function() {
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
(Boolean)
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
try {
assert.throws(SyntaxError, function() {
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
(Number)
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
try {
assert.throws(SyntaxError, function() {
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
description: Strict Mode - SyntaxError is thrown when deleting a built-in (Date)
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
try {
assert.throws(SyntaxError, function() {
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