Merge pull request #416 from anba/remove-runTestCase-language-rest

Replace runTestCase in test/language (part 2)
This commit is contained in:
Rick Waldron 2015-09-04 15:18:40 -04:00
commit 2bfe4a4716
342 changed files with 750 additions and 2468 deletions

View File

@ -5,16 +5,9 @@
es5id: 10.6-12-1
description: Accessing callee property of Arguments object is allowed
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
try
{
arguments.callee;
return true;
}
catch (e) {
}
}
runTestCase(testcase);
testcase();

View File

@ -5,17 +5,15 @@
es5id: 10.6-12-2
description: arguments.callee has correct attributes
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var desc = Object.getOwnPropertyDescriptor(arguments,"callee");
if(desc.configurable === true &&
desc.enumerable === false &&
desc.writable === true &&
desc.hasOwnProperty('get') == false &&
desc.hasOwnProperty('put') == false)
return true;
assert.sameValue(desc.configurable, true, 'desc.configurable');
assert.sameValue(desc.enumerable, false, 'desc.enumerable');
assert.sameValue(desc.writable, true, 'desc.writable');
assert.sameValue(desc.hasOwnProperty('get'), false, 'desc.hasOwnProperty("get")');
assert.sameValue(desc.hasOwnProperty('set'), false, 'desc.hasOwnProperty("set")');
}
runTestCase(testcase);
testcase();

View File

@ -5,16 +5,9 @@
es5id: 10.6-13-1
description: Accessing caller property of Arguments object is allowed
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
try
{
arguments.caller;
return true;
}
catch (e) {
}
}
runTestCase(testcase);
testcase();

View File

@ -5,11 +5,10 @@
es5id: 10.6-13-b-2-s
description: arguments.caller exists in strict mode
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var desc = Object.getOwnPropertyDescriptor(arguments,"caller");
return desc!== undefined;
assert.notSameValue(desc, undefined);
}
runTestCase(testcase);
testcase();

View File

@ -5,18 +5,16 @@
es5id: 10.6-13-b-3-s
description: arguments.caller is non-configurable in strict mode
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var desc = Object.getOwnPropertyDescriptor(arguments,"caller");
return (desc.configurable === false &&
desc.enumerable === false &&
desc.hasOwnProperty('value') == false &&
desc.hasOwnProperty('writable') == false &&
desc.hasOwnProperty('get') == true &&
desc.hasOwnProperty('set') == true);
assert.sameValue(desc.configurable, false, 'desc.configurable');
assert.sameValue(desc.enumerable, false, 'desc.enumerable');
assert.sameValue(desc.hasOwnProperty('value'), false, 'desc.hasOwnProperty("value")');
assert.sameValue(desc.hasOwnProperty('writable'), false, 'desc.hasOwnProperty("writable")');
assert.sameValue(desc.hasOwnProperty('get'), true, 'desc.hasOwnProperty("get")');
assert.sameValue(desc.hasOwnProperty('set'), true, 'desc.hasOwnProperty("set")');
}
runTestCase(testcase);
testcase();

View File

@ -4,11 +4,10 @@
/*---
es5id: 10.6-13-c-2-s
description: arguments.callee is exists
includes: [runTestCase.js]
---*/
function testcase() {
var desc = Object.getOwnPropertyDescriptor(arguments,"callee");
return desc !== undefined;
assert.notSameValue(desc, undefined);
}
runTestCase(testcase);
testcase();

View File

@ -5,16 +5,16 @@
es5id: 10.6-13-c-3-s
description: arguments.callee is non-configurable in strict mode
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var desc = Object.getOwnPropertyDescriptor(arguments,"callee");
return (desc.configurable === false &&
desc.enumerable === false &&
desc.hasOwnProperty('value') == false &&
desc.hasOwnProperty('writable') == false &&
desc.hasOwnProperty('get') == true &&
desc.hasOwnProperty('set') == true);
assert.sameValue(desc.configurable, false, 'desc.configurable');
assert.sameValue(desc.enumerable, false, 'desc.enumerable');
assert.sameValue(desc.hasOwnProperty('value'), false, 'desc.hasOwnProperty("value")');
assert.sameValue(desc.hasOwnProperty('writable'), false, 'desc.hasOwnProperty("writable")');
assert.sameValue(desc.hasOwnProperty('get'), true, 'desc.hasOwnProperty("get")');
assert.sameValue(desc.hasOwnProperty('set'), true, 'desc.hasOwnProperty("set")');
}
runTestCase(testcase);
testcase();

View File

@ -6,11 +6,9 @@ es5id: 10.6-5-1
description: >
[[Prototype]] property of Arguments is set to Object prototype
object
includes: [runTestCase.js]
---*/
function testcase() {
if(Object.getPrototypeOf(arguments) === Object.getPrototypeOf({}))
return true;
assert.sameValue(Object.getPrototypeOf(arguments), Object.getPrototypeOf({}));
}
runTestCase(testcase);
testcase();

View File

@ -4,12 +4,11 @@
/*---
es5id: 10.6-6-1
description: "'length property of arguments object exists"
includes: [runTestCase.js]
---*/
function testcase() {
var desc = Object.getOwnPropertyDescriptor(arguments,"length");
return desc !== undefined
assert.notSameValue(desc, undefined);
}
runTestCase(testcase);
testcase();

View File

@ -4,15 +4,13 @@
/*---
es5id: 10.6-6-2
description: "'length' property of arguments object has correct attributes"
includes: [runTestCase.js]
---*/
function testcase() {
var desc = Object.getOwnPropertyDescriptor(arguments,"length");
if(desc.configurable === true &&
desc.enumerable === false &&
desc.writable === true )
return true;
assert.sameValue(desc.configurable, true, 'desc.configurable');
assert.sameValue(desc.enumerable, false, 'desc.enumerable');
assert.sameValue(desc.writable, true, 'desc.writable');
}
runTestCase(testcase);
testcase();

View File

@ -6,10 +6,9 @@ es5id: 10.6-6-3
description: >
'length' property of arguments object for 0 argument function
exists
includes: [runTestCase.js]
---*/
function testcase() {
return (function () {return arguments.length !== undefined})();
assert.sameValue(arguments.length, 0);
}
runTestCase(testcase);
testcase();

View File

@ -7,11 +7,10 @@ description: >
'length' property of arguments object for 0 argument function
exists
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var arguments= undefined;
return (function () {return arguments.length !== undefined})();
(function () { assert.sameValue(arguments.length, 0); })();
}
runTestCase(testcase);
testcase();

View File

@ -6,10 +6,9 @@ es5id: 10.6-6-4
description: >
'length' property of arguments object for 0 argument function call
is 0 even with formal parameters
includes: [runTestCase.js]
---*/
function testcase() {
return (function (a,b,c) {return arguments.length === 0})();
function testcase(a,b,c) {
assert.sameValue(arguments.length, 0);
}
runTestCase(testcase);
testcase();

View File

@ -7,11 +7,10 @@ description: >
'length' property of arguments object for 0 argument function call
is 0 even with formal parameters
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var arguments= undefined;
return (function (a,b,c) {return arguments.length === 0})();
(function (a,b,c) { assert.sameValue(arguments.length, 0); })();
}
runTestCase(testcase);
testcase();

View File

@ -7,12 +7,12 @@ description: >
Strict Mode - Use Strict Directive Prologue is 'use strict';
which contains two space between 'use' and 'strict'
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
"use strict";
var public = 1;
return public === 1;
assert.sameValue(public, 1);
}
runTestCase(testcase);
testcase();

View File

@ -7,12 +7,12 @@ description: >
Strict Mode - Use Strict Directive Prologue is ''USE STRICT';' in
which all characters are uppercase
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
"USE STRICT";
var public = 1;
return public === 1;
assert.sameValue(public, 1);
}
runTestCase(testcase);
testcase();

View File

@ -7,17 +7,16 @@ description: >
Strict Mode - Eval code is strict code with a Use Strict Directive
at the beginning of the block
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var err = null;
try {
eval("'use strict'; var public = 1; var anotherVariableNotReserveWord = 2;");
return false;
} catch (e) {
return e instanceof SyntaxError && typeof public === "undefined" &&
typeof anotherVariableNotReserveWord === "undefined";
err = e;
}
}
runTestCase(testcase);
assert(err instanceof SyntaxError, 'err instanceof SyntaxError');
assert.sameValue(typeof public, "undefined", 'typeof public');
assert.sameValue(typeof anotherVariableNotReserveWord, "undefined", 'typeof anotherVariableNotReserveWord');

View File

@ -7,11 +7,9 @@ description: >
Strict Mode - Eval code is strict eval code with a Use Strict
Directive in the middle of the block
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
eval("var public = 1; 'use strict'; var anotherVariableNotReserveWord = 2;");
return public === 1 && anotherVariableNotReserveWord === 2;
}
runTestCase(testcase);
assert.sameValue(public, 1, 'public');
assert.sameValue(anotherVariableNotReserveWord, 2, 'anotherVariableNotReserveWord');

View File

@ -7,11 +7,9 @@ description: >
Strict Mode - Eval code is strict eval code with a Use Strict
Directive at the end of the block
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
eval("var public = 1; var anotherVariableNotReserveWord = 2; 'use strict';");
return public === 1 && anotherVariableNotReserveWord === 2;
}
runTestCase(testcase);
assert.sameValue(public, 1, 'public');
assert.sameValue(anotherVariableNotReserveWord, 2, 'anotherVariableNotReserveWord');

View File

@ -7,16 +7,10 @@ description: >
Strict Mode - The call to eval function is contained in a Strict
Mode block
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
assert.throws(SyntaxError, function() {
'use strict';
try {
eval("var public = 1;");
return false;
} catch (e) {
return true;
}
}
runTestCase(testcase);
});

View File

@ -8,20 +8,16 @@ description: >
is strict function code if FunctionDeclaration is contained in use
strict
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
"use strict";
function fun() {
try {
eval("var public = 1;");
return false;
} catch (e) {
return e instanceof SyntaxError;
}
eval("var public = 1;");
}
return fun();
assert.throws(SyntaxError, function() {
fun();
});
}
runTestCase(testcase);
testcase();

View File

@ -8,18 +8,13 @@ description: >
is strict function code if FunctionExpression is contained in use
strict
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
"use strict";
return function () {
try {
assert.throws(SyntaxError, function() {
eval("var public = 1;");
return false;
} catch (e) {
return e instanceof SyntaxError;
}
} ();
});
}
runTestCase(testcase);
testcase();

View File

@ -8,12 +8,10 @@ description: >
PropertyAssignment is in Strict Mode if Accessor
PropertyAssignment is contained in use strict(getter)
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
assert.throws(SyntaxError, function() {
"use strict";
try {
var obj = {};
Object.defineProperty(obj, "accProperty", {
get: function () {
@ -23,9 +21,4 @@ function testcase() {
});
var temp = obj.accProperty === 11;
return false;
} catch (e) {
return e instanceof SyntaxError;
}
}
runTestCase(testcase);
});

View File

@ -8,14 +8,14 @@ description: >
PropertyAssignment is in Strict Mode if Accessor
PropertyAssignment is contained in use strict(setter)
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var data = "data";
assert.throws(SyntaxError, function() {
"use strict";
try {
var obj = {};
var data = "data";
Object.defineProperty(obj, "accProperty", {
set: function (value) {
eval("var public = 1;");
@ -24,9 +24,6 @@ function testcase() {
});
obj.accProperty = "overrideData";
return false;
} catch (e) {
return e instanceof SyntaxError && data === "data";
}
}
runTestCase(testcase);
});
assert.sameValue(data, "data", 'data unchanged');

View File

@ -7,19 +7,14 @@ description: >
Strict Mode - Function code of a FunctionDeclaration contains Use
Strict Directive which appears at the start of the block
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
function fun() {
"use strict";
try {
eval("var public = 1;");
return false;
} catch (e) {
return e instanceof SyntaxError;
}
}
return fun();
}
runTestCase(testcase);
assert.throws(SyntaxError, function() {
fun();
});

View File

@ -7,17 +7,10 @@ description: >
Strict Mode - Use Strict Directive Prologue is ''use strict''
which lost the last character ';'
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
assert.throws(SyntaxError, function() {
"use strict"
try {
eval("var public = 1;");
return false;
} catch (e) {
return e instanceof SyntaxError;
}
}
runTestCase(testcase);
eval("var public = 1;");
});

View File

@ -7,15 +7,11 @@ description: >
Strict Mode - Function code of a FunctionDeclaration contains Use
Strict Directive which appears in the middle of the block
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
function fun() {
eval("var public = 1;");
"use strict";
return public === 1;
assert.sameValue(public, 1);
}
return fun();
}
runTestCase(testcase);
fun();

View File

@ -7,15 +7,10 @@ description: >
Strict Mode - Function code of a FunctionDeclaration contains Use
Strict Directive which appears at the end of the block
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
function fun() {
eval("var public = 1;");
return public === 1;
assert.sameValue(public, 1);
"use strict";
}
return fun();
}
runTestCase(testcase);
fun();

View File

@ -7,18 +7,10 @@ description: >
Strict Mode - Function code of a FunctionExpression contains Use
Strict Directive which appears at the start of the block
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
return function () {
assert.throws(SyntaxError, function () {
"use strict";
try {
eval("var public = 1;");
return false;
} catch (e) {
return e instanceof SyntaxError;
}
} ();
}
runTestCase(testcase);
});

View File

@ -7,14 +7,10 @@ description: >
Strict Mode - Function code of a FunctionExpression contains Use
Strict Directive which appears in the middle of the block
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
return function () {
(function () {
eval("var public = 1;");
return public === 1;
assert.sameValue(public, 1);
"use strict";
} ();
}
runTestCase(testcase);
}) ();

View File

@ -7,14 +7,11 @@ description: >
Strict Mode - Function code of a FunctionExpression contains Use
Strict Directive which appears at the end of the block
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
return function () {
(function () {
eval("var public = 1;");
"use strict";
return public === 1;
} ();
}
runTestCase(testcase);
assert.sameValue(public, 1);
}) ();

View File

@ -8,13 +8,12 @@ description: >
contains Use Strict Directive which appears at the start of the
block(setter)
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
try {
var data = "data";
assert.throws(SyntaxError, function() {
var obj = {};
var data = "data";
Object.defineProperty(obj, "accProperty", {
set: function (value) {
"use strict";
@ -24,10 +23,6 @@ function testcase() {
});
obj.accProperty = "overrideData";
});
return false;
} catch (e) {
return e instanceof SyntaxError && data === "data";
}
}
runTestCase(testcase);
assert.sameValue(data, "data", 'data unchanged');

View File

@ -8,10 +8,8 @@ description: >
contains Use Strict Directive which appears in the middle of the
block(getter)
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
Object.defineProperty(obj, "accProperty", {
get: function () {
@ -20,6 +18,6 @@ function testcase() {
return 11;
}
});
return obj.accProperty === 11 && public === 1;
}
runTestCase(testcase);
assert.sameValue(obj.accProperty, 11, 'obj.accProperty');
assert.sameValue(public, 1, 'public');

View File

@ -8,10 +8,8 @@ description: >
contains Use Strict Directive which appears at the end of the
block(setter)
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {};
var data;
@ -23,6 +21,5 @@ function testcase() {
}
});
obj.accProperty = "overrideData";
return data==="overrideData";
}
runTestCase(testcase);
assert.sameValue(data, "overrideData", 'data');

View File

@ -7,13 +7,11 @@ description: >
Strict Mode - The built-in Function constructor is contained in
use strict code
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
"use strict";
var funObj = new Function("a", "eval('public = 1;');");
funObj();
return true;
}
runTestCase(testcase);
testcase();

View File

@ -7,13 +7,12 @@ description: >
Strict Mode - Use Strict Directive Prologue is '' use strict';'
which the first character is space
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
" use strict";
var public = 1;
return public === 1;
assert.sameValue(public, 1);
}
runTestCase(testcase);
testcase();

View File

@ -8,12 +8,11 @@ description: >
contains Use Strict Directive which appears in the middle of the
block
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var funObj = new Function("a", "eval('public = 1;'); 'use strict'; anotherVariable = 2;");
funObj();
return public === 1 && anotherVariable === 2;
}
runTestCase(testcase);
assert.sameValue(public, 1, 'public');
assert.sameValue(anotherVariable, 2, 'anotherVariable');

View File

@ -7,12 +7,11 @@ description: >
Strict Mode - Function code of built-in Function constructor
contains Use Strict Directive which appears at the end of the block
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var funObj = new Function("a", "eval('public = 1;'); anotherVariable = 2; 'use strict';");
funObj();
return public === 1 && anotherVariable === 2;
}
runTestCase(testcase);
assert.sameValue(public, 1, 'public');
assert.sameValue(anotherVariable, 2, 'anotherVariable');

View File

@ -7,12 +7,12 @@ description: >
Strict Mode - Use Strict Directive Prologue is ''use strict ';'
which the last character is space
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
"use strict ";
var public = 1;
return public === 1;
assert.sameValue(public, 1);
}
runTestCase(testcase);
testcase();

View File

@ -7,17 +7,10 @@ description: >
Strict Mode - Use Strict Directive Prologue is ''use strict';'
which appears at the beginning of the block
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
assert.throws(SyntaxError, function() {
"use strict";
try {
eval("var public = 1;");
return false;
} catch (e) {
return e instanceof SyntaxError;
}
}
runTestCase(testcase);
eval("var public = 1;");
});

View File

@ -7,13 +7,14 @@ description: >
Strict Mode - Use Strict Directive Prologue is ''use strict';'
which appears in the middle of the block
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var interface = 2;
"use strict";
var public = 1;
return public === 1 && interface === 2;
assert.sameValue(public, 1, 'public');
assert.sameValue(interface, 2, 'interface');
}
runTestCase(testcase);
testcase();

View File

@ -7,12 +7,11 @@ description: >
Strict Mode - Use Strict Directive Prologue is ''use strict';'
which appears at the end of the block
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var public = 1;
return public === 1;
assert.sameValue(public, 1);
"use strict";
}
runTestCase(testcase);
testcase();

View File

@ -7,17 +7,11 @@ description: >
Strict Mode - Use Strict Directive Prologue is ''use strict';'
which appears twice in the directive prologue
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
assert.throws(SyntaxError, function() {
"use strict";
"use strict";
try {
eval("var public = 1;");
return false;
} catch (e) {
return e instanceof SyntaxError;
}
}
runTestCase(testcase);
});

View File

@ -7,12 +7,11 @@ description: >
Strict Mode - Use Strict Directive Prologue is ''Use strict';' in
which the first character is uppercase
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
"Use strict";
var public = 1;
return public === 1;
assert.sameValue(public, 1);
}
runTestCase(testcase);
testcase();

View File

@ -5,17 +5,12 @@
es5id: 14.1-1-s
description: "'use strict' directive - correct usage"
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
function foo()
{
'use strict';
return(this === undefined);
}
return foo.call(undefined);
}
runTestCase(testcase);
assert(foo.call(undefined));

View File

@ -5,11 +5,8 @@
es5id: 14.1-10-s
description: other directives - may follow 'use strict' directive
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
function foo()
{
"use strict";
@ -17,6 +14,4 @@ function testcase() {
return (this === undefined);
}
return foo.call(undefined);
}
runTestCase(testcase);
assert(foo.call(undefined));

View File

@ -5,11 +5,8 @@
es5id: 14.1-11-s
description: comments may preceed 'use strict' directive
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
function foo()
{
// comment
@ -19,6 +16,4 @@ function testcase() {
}
return foo.call(undefined);
}
runTestCase(testcase);
assert(foo.call(undefined));

View File

@ -5,11 +5,8 @@
es5id: 14.1-12-s
description: comments may follow 'use strict' directive
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
function foo()
{
"use strict"; /* comment */ // comment
@ -17,6 +14,4 @@ function testcase() {
return (this === undefined);
}
return foo.call(undefined);
}
runTestCase(testcase);
assert(foo.call(undefined));

View File

@ -5,17 +5,12 @@
es5id: 14.1-13-s
description: semicolon insertion works for'use strict' directive
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
function foo()
{
"use strict"
return (this === undefined);
}
return foo.call(undefined);
}
runTestCase(testcase);
assert(foo.call(undefined));

View File

@ -5,11 +5,8 @@
es5id: 14.1-14-s
description: semicolon insertion may come before 'use strict' directive
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
function foo()
{
"another directive"
@ -17,6 +14,4 @@ function testcase() {
return (this === undefined);
}
return foo.call(undefined);
}
runTestCase(testcase);
assert(foo.call(undefined));

View File

@ -5,11 +5,8 @@
es5id: 14.1-15-s
description: blank lines may come before 'use strict' directive
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
function foo()
{
@ -22,6 +19,4 @@ function testcase() {
return (this === undefined);
}
return foo.call(undefined);
}
runTestCase(testcase);
assert(foo.call(undefined));

View File

@ -7,17 +7,12 @@ description: >
'use strict' directive - not recognized if it follow an empty
statement
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
function foo()
{
; 'use strict';
return (this !== undefined);
}
return foo.call(undefined);
}
runTestCase(testcase);
assert(foo.call(undefined));

View File

@ -7,11 +7,8 @@ description: >
'use strict' directive - not recognized if it follow some other
statment empty statement
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
function foo()
{
var x;
@ -19,6 +16,4 @@ function testcase() {
return (this !== undefined);
}
return foo.call(undefined);
}
runTestCase(testcase);
assert(foo.call(undefined));

View File

@ -5,17 +5,12 @@
es5id: 14.1-2-s
description: "\"use strict\" directive - correct usage double quotes"
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
function foo()
{
"use strict";
return (this === undefined);
}
return foo.call(undefined);
}
runTestCase(testcase);
assert(foo.call(undefined));

View File

@ -7,17 +7,12 @@ description: >
'use strict' directive - not recognized if it contains extra
whitespace
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
function foo()
{
' use strict ';
return (this !== undefined);
}
return foo.call(undefined);
}
runTestCase(testcase);
assert(foo.call(undefined));

View File

@ -7,11 +7,8 @@ description: >
'use strict' directive - not recognized if contains Line
Continuation
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
function foo()
{
'use str\
@ -19,6 +16,4 @@ ict';
return (this !== undefined);
}
return foo.call(undefined);
}
runTestCase(testcase);
assert(foo.call(undefined));

View File

@ -7,17 +7,12 @@ description: >
'use strict' directive - not recognized if contains a
EscapeSequence
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
function foo()
{
'use\u0020strict';
return(this !== undefined);
}
return foo.call(undefined);
}
runTestCase(testcase);
assert(foo.call(undefined));

View File

@ -7,17 +7,12 @@ description: >
'use strict' directive - not recognized if contains a <TAB>
instead of a space
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
function foo()
{
'use strict';
return (this !== undefined);
}
return foo.call(undefined);
}
runTestCase(testcase);
assert(foo.call(undefined));

View File

@ -5,17 +5,12 @@
es5id: 14.1-7-s
description: "'use strict' directive - not recognized if upper case"
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
function foo()
{
'Use Strict';
return (this !== undefined);
}
return foo.call(undefined);
}
runTestCase(testcase);
assert(foo.call(undefined));

View File

@ -5,11 +5,8 @@
es5id: 14.1-8-s
description: "'use strict' directive - may follow other directives"
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
function foo()
{
"bogus directive";
@ -17,6 +14,4 @@ function testcase() {
return (this === undefined);
}
return foo.call(undefined);
}
runTestCase(testcase);
assert(foo.call(undefined));

View File

@ -5,11 +5,8 @@
es5id: 14.1-9-s
description: "'use strict' directive - may occur multiple times"
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
function foo()
{
'use strict';
@ -17,6 +14,4 @@ function testcase() {
return (this === undefined);
}
return foo.call(undefined);
}
runTestCase(testcase);
assert(foo.call(undefined));

View File

@ -4,17 +4,13 @@
/*---
es5id: 10.4.2-1-1
description: Indirect call to eval has context set to global context
includes: [runTestCase.js]
---*/
var __10_4_2_1_1_1 = "str";
function testcase() {
var _eval = eval;
var __10_4_2_1_1_1 = "str1";
if(_eval("\'str\' === __10_4_2_1_1_1") === true && // indirect eval
eval("\'str1\' === __10_4_2_1_1_1") === true) { // direct eval
return true;
}
return false;
assert(_eval("\'str\' === __10_4_2_1_1_1"), 'indirect eval');
assert(eval("\'str1\' === __10_4_2_1_1_1"), 'direct eval');
}
runTestCase(testcase);
testcase();

View File

@ -6,7 +6,6 @@ es5id: 10.4.2-1-2
description: >
Indirect call to eval has context set to global context (nested
function)
includes: [runTestCase.js]
---*/
var __10_4_2_1_2 = "str";
@ -15,13 +14,9 @@ function testcase() {
var __10_4_2_1_2 = "str1";
function foo() {
var __10_4_2_1_2 = "str2";
if(_eval("\'str\' === __10_4_2_1_2") === true && // indirect eval
eval("\'str2\' === __10_4_2_1_2") === true) { // direct eval
return true;
} else {
return false;
}
assert(_eval("\'str\' === __10_4_2_1_2"), 'indirect eval');
assert(eval("\'str2\' === __10_4_2_1_2"), 'direct eval');
}
return foo();
foo();
}
runTestCase(testcase);
testcase();

View File

@ -6,7 +6,6 @@ es5id: 10.4.2-1-3
description: >
Indirect call to eval has context set to global context (catch
block)
includes: [runTestCase.js]
---*/
var __10_4_2_1_3 = "str";
@ -18,12 +17,8 @@ function testcase() {
}
catch (e) {
var __10_4_2_1_3 = "str2";
if (_eval("\'str\' === __10_4_2_1_3") === true && // indirect eval
eval("\'str2\' === __10_4_2_1_3") === true) { // direct eval
return true;
} else {
return false;
}
assert(_eval("\'str\' === __10_4_2_1_3"), 'indirect eval');
assert(eval("\'str2\' === __10_4_2_1_3"), 'direct eval');
}
}
runTestCase(testcase);
testcase();

View File

@ -7,7 +7,6 @@ description: >
Indirect call to eval has context set to global context (with
block)
flags: [noStrict]
includes: [runTestCase.js]
---*/
var __10_4_2_1_4 = "str";
@ -17,11 +16,8 @@ function testcase() {
var _eval = eval;
var __10_4_2_1_4 = "str1";
with (o) {
if (_eval("\'str\' === __10_4_2_1_4") === true && // indirect eval
eval("\'str2\' === __10_4_2_1_4") === true) { // direct eval
return true;
}
assert(_eval("\'str\' === __10_4_2_1_4"), 'indirect eval');
assert(eval("\'str2\' === __10_4_2_1_4"), 'direct eval');
}
return false;
}
runTestCase(testcase);
testcase();

View File

@ -6,7 +6,6 @@ es5id: 10.4.2-1-5
description: >
Indirect call to eval has context set to global context (inside
another eval)
includes: [runTestCase.js]
---*/
var __10_4_2_1_5 = "str";
@ -18,6 +17,6 @@ function testcase() {
_eval(\"\'str\' === __10_4_2_1_5 \") && \
eval(\"\'str2\' === __10_4_2_1_5\")\
");
return r;
assert(r);
}
runTestCase(testcase);
testcase();

View File

@ -7,15 +7,14 @@ description: >
Direct val code in non-strict mode - can instantiate variable in
calling context
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var x = 0;
return function inner() {
function inner() {
eval("var x = 1");
if (x === 1)
return true;
} ();
}
runTestCase(testcase);
assert.sameValue(x, 1, "x");
}
inner();
}
testcase();

View File

@ -7,11 +7,10 @@ description: >
Strict Mode - Strict mode eval code cannot instantiate functions
in the variable environment of the caller to eval
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
eval("function fun(x){ return x }");
return typeof (fun) === "undefined";
assert.sameValue(typeof (fun), "undefined");
}
runTestCase(testcase);
testcase();

View File

@ -6,15 +6,14 @@ es5id: 10.4.2-3-c-1-s
description: >
Direct eval code in strict mode - cannot instantiate variable in
the variable environment of the calling context
includes: [runTestCase.js]
---*/
function testcase() {
var _10_4_2_3_c_1_s = 0;
function _10_4_2_3_c_1_sFunc() {
eval("'use strict';var _10_4_2_3_c_1_s = 1");
return _10_4_2_3_c_1_s===0;
assert.sameValue(_10_4_2_3_c_1_s, 0);
}
return _10_4_2_3_c_1_sFunc();
_10_4_2_3_c_1_sFunc();
}
runTestCase(testcase);
testcase();

View File

@ -7,15 +7,14 @@ description: >
Calling code in strict mode - eval cannot instantiate variable in
the variable environment of the calling context
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var _10_4_2_3_c_2_s = 0;
function _10_4_2_3_c_2_sFunc() {
eval("var _10_4_2_3_c_2_s = 1");
return _10_4_2_3_c_2_s===0;
assert.sameValue(_10_4_2_3_c_2_s, 0);
}
return _10_4_2_3_c_2_sFunc();
_10_4_2_3_c_2_sFunc();
}
runTestCase(testcase);
testcase();

View File

@ -7,15 +7,11 @@ description: >
Calling code in strict mode - eval cannot instantiate variable in
the global context
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
var _10_4_2_3_c_3_s = 0;
function testcase() {
function _10_4_2_3_c_3_sFunc() {
eval("var _10_4_2_3_c_3_s = 1");
return _10_4_2_3_c_3_s===0;
}
return _10_4_2_3_c_3_sFunc();
eval("var _10_4_2_3_c_3_s = 1");
assert.sameValue(_10_4_2_3_c_3_s, 0);
}
runTestCase(testcase);
testcase();

View File

@ -7,11 +7,10 @@ description: >
Strict Mode - Strict mode eval code cannot instantiate functions
in the variable environment of the caller to eval
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
eval("function _10_4_2_1_2_fun(){}");
return typeof _10_4_2_1_2_fun === "undefined";
assert.sameValue(typeof _10_4_2_1_2_fun, "undefined");
}
runTestCase(testcase);
testcase();

View File

@ -6,11 +6,10 @@ es5id: 10.4.2.1-4-s
description: >
Strict Mode - Strict mode eval code cannot instantiate functions
in the variable environment of the caller to eval.
includes: [runTestCase.js]
---*/
function testcase() {
eval("'use strict'; function _10_4_2_1_4_fun(){}");
return typeof _10_4_2_1_4_fun === "undefined";
assert.sameValue(typeof _10_4_2_1_4_fun, "undefined");
}
runTestCase(testcase);
testcase();

View File

@ -8,24 +8,17 @@ description: >
simple assignment creates property on the global object if
LeftHandSide is an unresolvable reference
flags: [noStrict]
includes:
- runTestCase.js
- fnGlobalObject.js
includes: [fnGlobalObject.js]
---*/
function testcase() {
function foo() {
__ES3_1_test_suite_test_11_13_1_unique_id_3__ = 42;
}
foo();
var desc = Object.getOwnPropertyDescriptor(fnGlobalObject(), '__ES3_1_test_suite_test_11_13_1_unique_id_3__');
if (desc.value === 42 &&
desc.writable === true &&
desc.enumerable === true &&
desc.configurable === true) {
delete __ES3_1_test_suite_test_11_13_1_unique_id_3__;
return true;
}
}
runTestCase(testcase);
assert.sameValue(desc.value, 42, 'desc.value');
assert.sameValue(desc.writable, true, 'desc.writable');
assert.sameValue(desc.enumerable, true, 'desc.enumerable');
assert.sameValue(desc.configurable, true, 'desc.configurable');

View File

@ -6,20 +6,10 @@ es5id: 11.13.1-4-27-s
description: >
simple assignment throws TypeError if LeftHandSide is a readonly
property in strict mode (Global.undefined)
includes:
- runTestCase.js
- fnGlobalObject.js
flags: [onlyStrict]
includes: [fnGlobalObject.js]
---*/
function testcase() {
'use strict';
try {
assert.throws(TypeError, function() {
fnGlobalObject().undefined = 42;
return false;
}
catch (e) {
return (e instanceof TypeError);
}
}
runTestCase(testcase);
});

View File

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

View File

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

View File

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

View File

@ -6,15 +6,11 @@ es5id: 8.12.5-3-b_1
description: >
Changing the value of a data property should not affect it's
non-value property descriptor attributes.
includes: [runTestCase.js]
---*/
function testcase() {
var origReduce = Array.prototype.reduce;
var origDesc = Object.getOwnPropertyDescriptor(Array.prototype, "reduce");
var newDesc;
try {
Array.prototype.reduce = function () {;};
newDesc = Object.getOwnPropertyDescriptor(Array.prototype, "reduce");
var descArray = [origDesc, newDesc];
@ -22,19 +18,10 @@ function testcase() {
for (var j in descArray) { //Ensure no attributes are magically added to newDesc
for (var i in descArray[j]) {
if (i==="value") {
if (origDesc[i]===newDesc[i]) {
return false;
}
assert.notSameValue(origDesc[i], newDesc[i], 'origDesc[i]');
}
else if (origDesc[i]!==newDesc[i]) {
return false;
else {
assert.sameValue(origDesc[i], newDesc[i], 'origDesc[i]');
}
}
}
return true;
} finally {
Array.prototype.reduce = origReduce;
}
}
runTestCase(testcase);

View File

@ -6,19 +6,15 @@ es5id: 8.12.5-3-b_2
description: >
Changing the value of a data property should not affect it's
non-value property descriptor attributes.
includes: [runTestCase.js]
---*/
function testcase() {
var tempObj = {};
Object.defineProperty(tempObj, "reduce", { value:456, enumerable:false, writable:true});
var origReduce = tempObj.reduce;
var origDesc = Object.getOwnPropertyDescriptor(tempObj, "reduce");
var newDesc;
try {
tempObj.reduce = 123;
newDesc = Object.getOwnPropertyDescriptor(tempObj, "reduce");
var descArray = [origDesc, newDesc];
@ -26,19 +22,10 @@ function testcase() {
for (var j in descArray) {
for (var i in descArray[j]) {
if (i==="value") {
if (origDesc[i]===newDesc[i]) {
return false;
}
assert.notSameValue(origDesc[i], newDesc[i], 'origDesc[i]');
}
else if (origDesc[i]!==newDesc[i]) {
return false;
else {
assert.sameValue(origDesc[i], newDesc[i], 'origDesc[i]');
}
}
}
return true;
} finally {
tempObj.reduce = origReduce;
}
}
runTestCase(testcase);

View File

@ -6,34 +6,23 @@ es5id: 8.12.5-5-b_1
description: >
Changing the value of an accessor property should not affect it's
property descriptor attributes.
includes: [runTestCase.js]
---*/
function testcase() {
var tempObj = {};
Object.defineProperty(tempObj, "reduce", { get: function() {return 456;}, enumerable:false, set: function() {;}});
var origReduce = tempObj.reduce;
var origDesc = Object.getOwnPropertyDescriptor(tempObj, "reduce");
var newDesc;
try {
tempObj.reduce = 123;
newDesc = Object.getOwnPropertyDescriptor(tempObj, "reduce");
var descArray = [origDesc, newDesc];
for (var j in descArray) {
for (var i in descArray[j]) {
if (origDesc[i]!==newDesc[i]) {
return false;
}
assert.sameValue(origDesc[i], newDesc[i], 'origDesc[i]');
}
}
return tempObj.reduce===456;
} finally {
tempObj.reduce = origReduce;
}
}
runTestCase(testcase);
assert.sameValue(tempObj.reduce, 456, 'tempObj.reduce');

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -8,18 +8,14 @@ info: >
es5id: 11.4.1-0-1
description: delete operator as UnaryExpression
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var x = 1;
var y = 2;
var z = 3;
if( (!delete x || delete y) &&
delete delete z)
{
return true;
}
assert((!delete x || delete y), '(!delete x || delete y)');
assert(delete delete z, 'delete delete z');
}
runTestCase(testcase);
testcase();

View File

@ -10,7 +10,6 @@ description: >
delete operator returns true on deleting arguments
propterties(arguments.callee)
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
@ -19,7 +18,8 @@ function testcase() {
return (delete arguments.callee);
}
var d = delete arguments.callee;
if(d === true && arguments.callee === undefined)
return true;
assert.sameValue(d, true, 'd');
assert.sameValue(arguments.callee, undefined, 'arguments.callee');
}
runTestCase(testcase);
testcase();

View File

@ -8,7 +8,6 @@ info: >
es5id: 11.4.1-4.a-13
description: delete operator returns false when deleting Array object
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
@ -18,7 +17,7 @@ function testcase() {
var d = delete a
if(d === false && Array.isArray(a) === true)
return true;
assert.sameValue(d, false, 'd');
assert.sameValue(Array.isArray(a), true, 'Array.isArray(a)');
}
runTestCase(testcase);
testcase();

View File

@ -8,12 +8,10 @@ info: >
es5id: 11.4.1-4.a-16
description: delete operator returns false on deleting arguments object
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
if(delete arguments === false && arguments !== undefined)
return true;
assert.sameValue(delete arguments, false, 'delete arguments');
assert.notSameValue(arguments, undefined, 'arguments');
}
runTestCase(testcase);
testcase();

View File

@ -10,7 +10,6 @@ description: >
delete operator returns false when deleting the declaration of the environment object
inside 'with'
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
@ -21,9 +20,9 @@ function testcase() {
{
d = delete o;
}
if (d === false && typeof(o) === 'object' && o.x === 1) {
return true;
}
return false;
assert.sameValue(d, false, 'd');
assert.sameValue(typeof(o), 'object', 'typeof(o)');
assert.sameValue(o.x, 1, 'o.x');
}
runTestCase(testcase);
testcase();

View File

@ -8,15 +8,13 @@ info: >
es5id: 11.4.1-4.a-7
description: delete operator inside 'eval'
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
var x = 1;
var d = eval("delete x");
if (d === false && x === 1) {
return true;
}
return false;
assert.sameValue(d, false, 'd');
assert.sameValue(x, 1, 'x');
}
runTestCase(testcase);
testcase();

View File

@ -7,7 +7,6 @@ description: >
delete operator returns false when deleting a direct reference to
a var
flags: [noStrict]
includes: [runTestCase.js]
---*/
function testcase() {
@ -15,7 +14,8 @@ function testcase() {
// Now, deleting 'x' directly should fail;
var d = delete x;
if(d === false && x === 1)
return true;
assert.sameValue(d, false, 'd');
assert.sameValue(x, 1, 'x');
}
runTestCase(testcase);
testcase();

View File

@ -7,8 +7,6 @@ description: >
delete operator returns false when deleting a direct reference to
a function name
flags: [noStrict]
includes:
- runTestCase.js
---*/
function testcase() {
@ -16,7 +14,8 @@ function testcase() {
// Now, deleting 'foo' directly should fail;
var d = delete foo;
if(d === false && typeof foo === 'function')
return true;
assert.sameValue(d, false, 'd');
assert.sameValue(typeof foo, 'function', 'typeof foo');
}
runTestCase(testcase);
testcase();

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