Skip to content
Snippets Groups Projects
Commit 89a4bb5a authored by André Bargull's avatar André Bargull
Browse files

Fix strict mode errors in language

- Add missing "var" declarations and noStrict flags
- Add strict mode tests for:
 - arguments-object/10.6-6-3 -> arguments-object/10.6-6-3-s
 - arguments-object/10.6-6-4 -> arguments-object/10.6-6-4-s
- Remove try-finally clean-up code
- Add strict mode compatible tests for eval-code/S10.4.2_A1.1_T*
  - No strict mode compatible files added for eval-code/S10.4.2_A1.2_T*, because it doesn't really make sense in this context.
  - (S10.4.2_A1.1 and S10.4.2_A1.2 should probably be removed, because the tested behaviour is not required by the spec.)
- Split S8.5_A10, S8.5_A4 and S8.1_A3 into declaration (both modes) and assignment tests (non-strict only)

Part of issue #35.
parent a66c978c
No related branches found
No related tags found
No related merge requests found
Showing
with 54 additions and 25 deletions
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
/*--- /*---
es5id: 10.6-10-c-ii-1 es5id: 10.6-10-c-ii-1
description: arguments[i] change with actual parameters description: arguments[i] change with actual parameters
flags: [noStrict]
includes: [runTestCase.js] includes: [runTestCase.js]
---*/ ---*/
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
/*--- /*---
es5id: 10.6-10-c-ii-2 es5id: 10.6-10-c-ii-2
description: arguments[i] map to actual parameter description: arguments[i] map to actual parameter
flags: [noStrict]
includes: [runTestCase.js] includes: [runTestCase.js]
---*/ ---*/
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
/*--- /*---
es5id: 10.6-12-1 es5id: 10.6-12-1
description: Accessing callee property of Arguments object is allowed description: Accessing callee property of Arguments object is allowed
flags: [noStrict]
includes: [runTestCase.js] includes: [runTestCase.js]
---*/ ---*/
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
/*--- /*---
es5id: 10.6-12-2 es5id: 10.6-12-2
description: arguments.callee has correct attributes description: arguments.callee has correct attributes
flags: [noStrict]
includes: [runTestCase.js] includes: [runTestCase.js]
---*/ ---*/
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
/*--- /*---
es5id: 10.6-13-1 es5id: 10.6-13-1
description: Accessing caller property of Arguments object is allowed description: Accessing caller property of Arguments object is allowed
flags: [noStrict]
includes: [runTestCase.js] includes: [runTestCase.js]
---*/ ---*/
......
...@@ -9,6 +9,7 @@ es5id: 10.6-13-a-1 ...@@ -9,6 +9,7 @@ es5id: 10.6-13-a-1
description: > description: >
In non-strict mode, arguments object should have its own 'callee' In non-strict mode, arguments object should have its own 'callee'
property defined (Step 13.a) property defined (Step 13.a)
flags: [noStrict]
includes: [runTestCase.js] includes: [runTestCase.js]
---*/ ---*/
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
/*--- /*---
es5id: 10.6-13-a-2 es5id: 10.6-13-a-2
description: A direct call to arguments.callee.caller should work description: A direct call to arguments.callee.caller should work
flags: [noStrict]
includes: [runTestCase.js] includes: [runTestCase.js]
---*/ ---*/
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
/*--- /*---
es5id: 10.6-13-a-3 es5id: 10.6-13-a-3
description: An indirect call to arguments.callee.caller should work description: An indirect call to arguments.callee.caller should work
flags: [noStrict]
includes: [runTestCase.js] includes: [runTestCase.js]
---*/ ---*/
......
// Copyright (c) 2012 Ecma International. All rights reserved.
// Ecma International makes this code available under the terms and conditions set
// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
// "Use Terms"). Any redistribution of this code must retain the above
// copyright and this notice and otherwise comply with the Use Terms.
/*---
es5id: 10.6-6-3
description: >
'length' property of arguments object for 0 argument function
exists
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
'use strict';
return (function () {return arguments.length !== undefined})();
}
runTestCase(testcase);
...@@ -9,6 +9,7 @@ es5id: 10.6-6-3 ...@@ -9,6 +9,7 @@ es5id: 10.6-6-3
description: > description: >
'length' property of arguments object for 0 argument function 'length' property of arguments object for 0 argument function
exists exists
flags: [noStrict]
includes: [runTestCase.js] includes: [runTestCase.js]
---*/ ---*/
......
// Copyright (c) 2012 Ecma International. All rights reserved.
// Ecma International makes this code available under the terms and conditions set
// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
// "Use Terms"). Any redistribution of this code must retain the above
// copyright and this notice and otherwise comply with the Use Terms.
/*---
es5id: 10.6-6-4
description: >
'length' property of arguments object for 0 argument function call
is 0 even with formal parameters
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
'use strict';
return (function (a,b,c) {return arguments.length === 0})();
}
runTestCase(testcase);
...@@ -9,6 +9,7 @@ es5id: 10.6-6-4 ...@@ -9,6 +9,7 @@ es5id: 10.6-6-4
description: > description: >
'length' property of arguments object for 0 argument function call 'length' property of arguments object for 0 argument function call
is 0 even with formal parameters is 0 even with formal parameters
flags: [noStrict]
includes: [runTestCase.js] includes: [runTestCase.js]
---*/ ---*/
......
...@@ -12,8 +12,6 @@ includes: [runTestCase.js] ...@@ -12,8 +12,6 @@ includes: [runTestCase.js]
var __10_4_2_1_1_1 = "str"; var __10_4_2_1_1_1 = "str";
function testcase() { function testcase() {
try {
var _eval = eval; var _eval = eval;
var __10_4_2_1_1_1 = "str1"; var __10_4_2_1_1_1 = "str1";
if(_eval("\'str\' === __10_4_2_1_1_1") === true && // indirect eval if(_eval("\'str\' === __10_4_2_1_1_1") === true && // indirect eval
...@@ -21,8 +19,5 @@ function testcase() { ...@@ -21,8 +19,5 @@ function testcase() {
return true; return true;
} }
return false; return false;
} finally {
delete this.__10_4_2_1_1_1;
}
} }
runTestCase(testcase); runTestCase(testcase);
...@@ -14,8 +14,6 @@ includes: [runTestCase.js] ...@@ -14,8 +14,6 @@ includes: [runTestCase.js]
var __10_4_2_1_2 = "str"; var __10_4_2_1_2 = "str";
function testcase() { function testcase() {
try {
var _eval = eval; var _eval = eval;
var __10_4_2_1_2 = "str1"; var __10_4_2_1_2 = "str1";
function foo() { function foo() {
...@@ -28,8 +26,5 @@ function testcase() { ...@@ -28,8 +26,5 @@ function testcase() {
} }
} }
return foo(); return foo();
} finally {
delete this.__10_4_2_1_1_2;
}
} }
runTestCase(testcase); runTestCase(testcase);
...@@ -14,9 +14,6 @@ includes: [runTestCase.js] ...@@ -14,9 +14,6 @@ includes: [runTestCase.js]
var __10_4_2_1_3 = "str"; var __10_4_2_1_3 = "str";
function testcase() { function testcase() {
try {
var _eval = eval; var _eval = eval;
var __10_4_2_1_3 = "str1"; var __10_4_2_1_3 = "str1";
try { try {
...@@ -31,8 +28,5 @@ function testcase() { ...@@ -31,8 +28,5 @@ function testcase() {
return false; return false;
} }
} }
} finally {
delete this.__10_4_2_1_3;
}
} }
runTestCase(testcase); runTestCase(testcase);
...@@ -9,12 +9,12 @@ es5id: 10.4.2-1-4 ...@@ -9,12 +9,12 @@ es5id: 10.4.2-1-4
description: > description: >
Indirect call to eval has context set to global context (with Indirect call to eval has context set to global context (with
block) block)
flags: [noStrict]
includes: [runTestCase.js] includes: [runTestCase.js]
---*/ ---*/
var __10_4_2_1_4 = "str"; var __10_4_2_1_4 = "str";
function testcase() { function testcase() {
try {
var o = new Object(); var o = new Object();
o.__10_4_2_1_4 = "str2"; o.__10_4_2_1_4 = "str2";
var _eval = eval; var _eval = eval;
...@@ -26,8 +26,5 @@ function testcase() { ...@@ -26,8 +26,5 @@ function testcase() {
} }
} }
return false; return false;
} finally {
delete this.__10_4_2_1_4;
}
} }
runTestCase(testcase); runTestCase(testcase);
...@@ -14,8 +14,6 @@ includes: [runTestCase.js] ...@@ -14,8 +14,6 @@ includes: [runTestCase.js]
var __10_4_2_1_5 = "str"; var __10_4_2_1_5 = "str";
function testcase() { function testcase() {
try {
var __10_4_2_1_5 = "str1"; var __10_4_2_1_5 = "str1";
var r = eval("\ var r = eval("\
var _eval = eval; \ var _eval = eval; \
...@@ -24,8 +22,5 @@ function testcase() { ...@@ -24,8 +22,5 @@ function testcase() {
eval(\"\'str2\' === __10_4_2_1_5\")\ eval(\"\'str2\' === __10_4_2_1_5\")\
"); ");
return r; return r;
} finally {
delete this.__10_4_2_1_5;
}
} }
runTestCase(testcase); runTestCase(testcase);
...@@ -9,6 +9,7 @@ es5id: 10.4.2-2-c-1 ...@@ -9,6 +9,7 @@ es5id: 10.4.2-2-c-1
description: > description: >
Direct val code in non-strict mode - can instantiate variable in Direct val code in non-strict mode - can instantiate variable in
calling context calling context
flags: [noStrict]
includes: [runTestCase.js] includes: [runTestCase.js]
---*/ ---*/
......
...@@ -7,6 +7,7 @@ info: > ...@@ -7,6 +7,7 @@ info: >
in the same order, as the calling context's scope chain in the same order, as the calling context's scope chain
es5id: 10.4.2_A1.1_T1 es5id: 10.4.2_A1.1_T1
description: eval within global execution context description: eval within global execution context
flags: [noStrict]
---*/ ---*/
var i; var i;
......
...@@ -7,6 +7,7 @@ info: > ...@@ -7,6 +7,7 @@ info: >
in the same order, as the calling context's scope chain in the same order, as the calling context's scope chain
es5id: 10.4.2_A1.1_T10 es5id: 10.4.2_A1.1_T10
description: eval within global execution context description: eval within global execution context
flags: [noStrict]
---*/ ---*/
var i; var i;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment