Add 'var' declarations for strict mode

This change adds 'var' declarations for global variables to allow the tests to run in strict mode (see issue #35).
Extra care was taken to ensure the changes do not alter the test behavior, for example when implicit creation of global variables are part of the test.
Note: The change does not fix all strict mode errors due to missing 'var' declarations.
This commit is contained in:
André Bargull 2014-08-05 17:38:52 +02:00 committed by Brian Terlson
parent 0ceb428ec9
commit 0dbafac5a6
211 changed files with 394 additions and 24 deletions

View File

@ -184,7 +184,7 @@ var currencyDigits = {
Object.getOwnPropertyNames(currencyDigits).forEach(function (currency) {
var digits = currencyDigits[currency];
format = Intl.NumberFormat([], {style: "currency", currency: currency});
var format = Intl.NumberFormat([], {style: "currency", currency: currency});
var min = format.resolvedOptions().minimumFractionDigits;
var max = format.resolvedOptions().maximumFractionDigits;
if (min !== digits) {

View File

@ -7,7 +7,7 @@ es5id: 11.2.4_A1.2_T1
description: Function is declared with no FormalParameterList
---*/
f_arg = function() {
var f_arg = function() {
return arguments;
}

View File

@ -7,7 +7,7 @@ es5id: 11.2.4_A1.2_T2
description: Function is declared with FormalParameterList
---*/
f_arg = function(x,y) {
var f_arg = function(x,y) {
return arguments;
}

View File

@ -9,6 +9,8 @@ es5id: 11.13.2_A1_T1
description: Checking by using eval, check operator is x *= y
---*/
var x;
//CHECK#1
x = -1;
if ((eval("x\u0009*=\u0009-1")) !== 1) {

View File

@ -9,6 +9,8 @@ es5id: 11.13.2_A1_T10
description: Checking by using eval, check operator is x ^= y
---*/
var x;
//CHECK#1
x = 1;
if ((eval("x\u0009^=\u00091")) !== 0) {

View File

@ -9,6 +9,8 @@ es5id: 11.13.2_A1_T11
description: Checking by using eval, check operator is x |= y
---*/
var x;
//CHECK#1
x = 0;
if ((eval("x\u0009|=\u00091")) !== 1) {

View File

@ -9,6 +9,8 @@ es5id: 11.13.2_A1_T2
description: Checking by using eval, check operator is x /= y
---*/
var x;
//CHECK#1
x = -1;
if ((eval("x\u0009/=\u0009-1")) !== 1) {

View File

@ -9,6 +9,8 @@ es5id: 11.13.2_A1_T3
description: Checking by using eval, check operator is x %= y
---*/
var x;
//CHECK#1
x = -1;
if ((eval("x\u0009%=\u0009-1")) !== 0) {

View File

@ -9,6 +9,8 @@ es5id: 11.13.2_A1_T4
description: Checking by using eval, check operator is x += y
---*/
var x;
//CHECK#1
x = -1;
if ((eval("x\u0009+=\u0009-1")) !== -2) {

View File

@ -9,6 +9,8 @@ es5id: 11.13.2_A1_T5
description: Checking by using eval, check operator is x -= y
---*/
var x;
//CHECK#1
x = -1;
if ((eval("x\u0009-=\u00091")) !== -2) {

View File

@ -9,6 +9,8 @@ es5id: 11.13.2_A1_T6
description: Checking by using eval, check operator is x <<= y
---*/
var x;
//CHECK#1
x = 1;
if ((eval("x\u0009<<=\u00091")) !== 2) {

View File

@ -9,6 +9,8 @@ es5id: 11.13.2_A1_T7
description: Checking by using eval, check operator is x >>= y
---*/
var x;
//CHECK#1
x = 1;
if ((eval("x\u0009>>=\u00091")) !== 0) {

View File

@ -9,6 +9,8 @@ es5id: 11.13.2_A1_T8
description: Checking by using eval, check operator is x >>>= y
---*/
var x;
//CHECK#1
x = 1;
if ((eval("x\u0009>>>=\u00091")) !== 0) {

View File

@ -9,6 +9,8 @@ es5id: 11.13.2_A1_T9
description: Checking by using eval, check operator is x &= y
---*/
var x;
//CHECK#1
x = 1;
if ((eval("x\u0009&=\u00091")) !== 1) {

View File

@ -9,6 +9,8 @@ description: >
object
---*/
var x;
//CHECK#1
x = true;
x ^= true;

View File

@ -7,6 +7,8 @@ es5id: 11.13.2_A4.10_T1.2
description: Type(x) and Type(y) vary between primitive number and Number object
---*/
var x;
//CHECK#1
x = 1;
x ^= 1;

View File

@ -7,6 +7,8 @@ es5id: 11.13.2_A4.10_T1.3
description: Type(x) and Type(y) vary between primitive string and String object
---*/
var x;
//CHECK#1
x = "1";
x ^= "1";

View File

@ -7,6 +7,8 @@ es5id: 11.13.2_A4.10_T1.4
description: Type(x) and Type(y) vary between Null and Undefined
---*/
var x;
//CHECK#1
x = null;
x ^= undefined;

View File

@ -9,6 +9,8 @@ description: >
Number (primitive or object) and Boolean (primitive and object)
---*/
var x;
//CHECK#1
x = true;
x ^= 1;

View File

@ -9,6 +9,8 @@ description: >
Number (primitive or object) and String (primitive and object)
---*/
var x;
//CHECK#1
x = "1";
x ^= 1;

View File

@ -9,6 +9,8 @@ description: >
Number (primitive or object) and Null
---*/
var x;
//CHECK#1
x = 1;
x ^= null;

View File

@ -9,6 +9,8 @@ description: >
Number (primitive or object) and Undefined
---*/
var x;
//CHECK#1
x = 1;
x ^= undefined;

View File

@ -9,6 +9,8 @@ description: >
String (primitive or object) and Boolean (primitive and object)
---*/
var x;
//CHECK#1
x = true;
x ^= "1";

View File

@ -9,6 +9,8 @@ description: >
String (primitive or object) and Undefined
---*/
var x;
//CHECK#1
x = "1";
x ^= undefined;

View File

@ -9,6 +9,8 @@ description: >
String (primitive or object) and Null
---*/
var x;
//CHECK#1
x = "1";
x ^= null;

View File

@ -9,6 +9,8 @@ description: >
Boolean (primitive or object) and Undefined
---*/
var x;
//CHECK#1
x = true;
x ^= undefined;

View File

@ -9,6 +9,8 @@ description: >
Boolean (primitive or object) and Null
---*/
var x;
//CHECK#1
x = true;
x ^= null;

View File

@ -9,6 +9,8 @@ description: >
object
---*/
var x;
//CHECK#1
x = true;
x |= true;

View File

@ -7,6 +7,8 @@ es5id: 11.13.2_A4.11_T1.2
description: Type(x) and Type(y) vary between primitive number and Number object
---*/
var x;
//CHECK#1
x = 1;
x |= 1;

View File

@ -7,6 +7,8 @@ es5id: 11.13.2_A4.11_T1.3
description: Type(x) and Type(y) vary between primitive string and String object
---*/
var x;
//CHECK#1
x = "1";
x |= "1";

View File

@ -7,6 +7,8 @@ es5id: 11.13.2_A4.11_T1.4
description: Type(x) and Type(y) vary between Null and Undefined
---*/
var x;
//CHECK#1
x = null;
x |= undefined;

View File

@ -9,6 +9,8 @@ description: >
Number (primitive or object) and Boolean (primitive and object)
---*/
var x;
//CHECK#1
x = true;
x |= 1;

View File

@ -9,6 +9,8 @@ description: >
Number (primitive or object) and String (primitive and object)
---*/
var x;
//CHECK#1
x = "1";
x |= 1;

View File

@ -9,6 +9,8 @@ description: >
Number (primitive or object) and Null
---*/
var x;
//CHECK#1
x = 1;
x |= null;

View File

@ -9,6 +9,8 @@ description: >
Number (primitive or object) and Undefined
---*/
var x;
//CHECK#1
x = 1;
x |= undefined;

View File

@ -9,6 +9,8 @@ description: >
String (primitive or object) and Boolean (primitive and object)
---*/
var x;
//CHECK#1
x = true;
x |= "1";

View File

@ -9,6 +9,8 @@ description: >
String (primitive or object) and Undefined
---*/
var x;
//CHECK#1
x = "1";
x |= undefined;

View File

@ -9,6 +9,8 @@ description: >
String (primitive or object) and Null
---*/
var x;
//CHECK#1
x = "1";
x |= null;

View File

@ -9,6 +9,8 @@ description: >
Boolean (primitive or object) and Undefined
---*/
var x;
//CHECK#1
x = true;
x |= undefined;

View File

@ -9,6 +9,8 @@ description: >
Boolean (primitive or object) and Null
---*/
var x;
//CHECK#1
x = true;
x |= null;

View File

@ -9,6 +9,8 @@ description: >
object
---*/
var x;
//CHECK#1
x = true;
x *= true;

View File

@ -7,6 +7,8 @@ es5id: 11.13.2_A4.1_T1.2
description: Type(x) and Type(y) vary between primitive number and Number object
---*/
var x;
//CHECK#1
x = 1;
x *= 1;

View File

@ -7,6 +7,8 @@ es5id: 11.13.2_A4.1_T1.3
description: Type(x) and Type(y) vary between primitive string and String object
---*/
var x;
//CHECK#1
x = "1";
x *= "1";

View File

@ -7,6 +7,8 @@ es5id: 11.13.2_A4.1_T1.4
description: Type(x) and Type(y) vary between Null and Undefined
---*/
var x;
//CHECK#1
x = null;
x *= undefined;

View File

@ -9,6 +9,8 @@ description: >
Boolean (primitive or object) and Number (primitive and object)
---*/
var x;
//CHECK#1
x = true;
x *= 1;

View File

@ -9,6 +9,8 @@ description: >
Number (primitive or object) and String (primitive and object)
---*/
var x;
//CHECK#1
x = "1";
x *= 1;

View File

@ -9,6 +9,8 @@ description: >
Number (primitive or object) and Null
---*/
var x;
//CHECK#1
x = 1;
x *= null;

View File

@ -9,6 +9,8 @@ description: >
Number (primitive or object) and Undefined
---*/
var x;
//CHECK#1
x = 1;
x *= undefined;

View File

@ -9,6 +9,8 @@ description: >
String (primitive or object) amd Boolean (primitive and object)
---*/
var x;
//CHECK#1
x = true;
x *= "1";

View File

@ -9,6 +9,8 @@ description: >
primitive String (primitive or object) and Undefined
---*/
var x;
//CHECK#1
x = "1";
x *= undefined;

View File

@ -9,6 +9,8 @@ description: >
String (primitive or object) and Null
---*/
var x;
//CHECK#1
x = "1";
x *= null;

View File

@ -9,6 +9,8 @@ description: >
Boolean (primitive or object) and Undefined
---*/
var x;
//CHECK#1
x = true;
x *= undefined;

View File

@ -9,6 +9,8 @@ description: >
Boolean (primitive or object) and Null
---*/
var x;
//CHECK#1
x = true;
x *= null;

View File

@ -9,6 +9,8 @@ description: >
object
---*/
var x;
//CHECK#1
x = true;
x /= true;

View File

@ -7,6 +7,8 @@ es5id: 11.13.2_A4.2_T1.2
description: Type(x) and Type(y) vary between primitive number and Number object
---*/
var x;
//CHECK#1
x = 1;
x /= 1;

View File

@ -7,6 +7,8 @@ es5id: 11.13.2_A4.2_T1.3
description: Type(x) and Type(y) vary between primitive string and String object
---*/
var x;
//CHECK#1
x = "1";
x /= "1";

View File

@ -7,6 +7,8 @@ es5id: 11.13.2_A4.2_T1.4
description: Type(x) and Type(y) vary between Null and Undefined
---*/
var x;
//CHECK#1
x = null;
x /= undefined;

View File

@ -9,6 +9,8 @@ description: >
Number (primitive or object) and Boolean (primitive and object)
---*/
var x;
//CHECK#1
x = true;
x /= 1;

View File

@ -9,6 +9,8 @@ description: >
Number (primitive or object) and String (primitive and object)
---*/
var x;
//CHECK#1
x = "1";
x /= 1;

View File

@ -9,6 +9,8 @@ description: >
Number (primitive or object) and Null
---*/
var x;
//CHECK#1
x = 1;
x /= null;

View File

@ -9,6 +9,8 @@ description: >
Number (primitive or object) and Undefined
---*/
var x;
//CHECK#1
x = 1;
x /= undefined;

View File

@ -9,6 +9,8 @@ description: >
String (primitive or object) and Boolean (primitive and object)
---*/
var x;
//CHECK#1
x = true;
x /= "1";

View File

@ -9,6 +9,8 @@ description: >
String (primitive or object) and Undefined
---*/
var x;
//CHECK#1
x = "1";
x /= undefined;

View File

@ -9,6 +9,8 @@ description: >
String (primitive or object) and Null
---*/
var x;
//CHECK#1
x = "1";
x /= null;

View File

@ -9,6 +9,8 @@ description: >
Boolean (primitive or object) and Undefined
---*/
var x;
//CHECK#1
x = true;
x /= undefined;

View File

@ -9,6 +9,8 @@ description: >
Boolean (primitive or object) and Null
---*/
var x;
//CHECK#1
x = true;
x /= null;

View File

@ -9,6 +9,8 @@ description: >
object
---*/
var x;
//CHECK#1
x = true;
x %= true;

View File

@ -7,6 +7,8 @@ es5id: 11.13.2_A4.3_T1.2
description: Type(x) and Type(y) vary between primitive number and Number object
---*/
var x;
//CHECK#1
x = 1;
x %= 1;

View File

@ -7,6 +7,8 @@ es5id: 11.13.2_A4.3_T1.3
description: Type(x) and Type(y) vary between primitive string and String object
---*/
var x;
//CHECK#1
x = "1";
x %= "1";

View File

@ -7,6 +7,8 @@ es5id: 11.13.2_A4.3_T1.4
description: Type(x) and Type(y) vary between Null and Undefined
---*/
var x;
//CHECK#1
x = null;
x %= undefined;

View File

@ -9,6 +9,8 @@ description: >
Number (primitive or object) and Boolean (primitive and object)
---*/
var x;
//CHECK#1
x = true;
x %= 1;

View File

@ -9,6 +9,8 @@ description: >
Number (primitive or object) and String (primitive and object)
---*/
var x;
//CHECK#1
x = "1";
x %= 1;

View File

@ -9,6 +9,8 @@ description: >
Number (primitive or object) and Null
---*/
var x;
//CHECK#1
x = 1;
x %= null;

View File

@ -9,6 +9,8 @@ description: >
Number (primitive or object) and Undefined
---*/
var x;
//CHECK#1
x = 1;
x %= undefined;

View File

@ -9,6 +9,8 @@ description: >
String (primitive or object) and Boolean (primitive and object)
---*/
var x;
//CHECK#1
x = true;
x %= "1";

View File

@ -9,6 +9,8 @@ description: >
String (primitive or object) and Undefined
---*/
var x;
//CHECK#1
x = "1";
x %= undefined;

View File

@ -9,6 +9,8 @@ description: >
String (primitive or object) and Null
---*/
var x;
//CHECK#1
x = "1";
x %= null;

View File

@ -9,6 +9,8 @@ description: >
Boolean (primitive or object) and Undefined
---*/
var x;
//CHECK#1
x = true;
x %= undefined;

View File

@ -9,6 +9,8 @@ description: >
Boolean (primitive or object) and Null
---*/
var x;
//CHECK#1
x = true;
x %= null;

View File

@ -9,6 +9,8 @@ description: >
object
---*/
var x;
//CHECK#1
x = true;
x += true;

View File

@ -7,6 +7,8 @@ es5id: 11.13.2_A4.4_T1.2
description: Type(x) and Type(y) vary between primitive number and Number object
---*/
var x;
//CHECK#1
x = 1;
x += 1;

View File

@ -7,6 +7,8 @@ es5id: 11.13.2_A4.4_T1.3
description: Type(x) and Type(y) vary between Null and Undefined
---*/
var x;
//CHECK#1
x = null;
x += undefined;

View File

@ -7,6 +7,8 @@ es5id: 11.13.2_A4.4_T1.4
description: Type(x) and Type(y) vary between primitive string and String object
---*/
var x;
//CHECK#1
x = "1";
x += "1";

View File

@ -9,6 +9,8 @@ description: >
Number (primitive or object) and Boolean (primitive and object)
---*/
var x;
//CHECK#1
x = true;
x += 1;

View File

@ -9,6 +9,8 @@ description: >
Number (primitive or object) and Null
---*/
var x;
//CHECK#1
x = 1;
x += null;

View File

@ -9,6 +9,8 @@ description: >
Number (primitive or object) and Undefined
---*/
var x;
//CHECK#1
x = 1;
x += undefined;

View File

@ -9,6 +9,8 @@ description: >
Boolean (primitive or object) and Undefined
---*/
var x;
//CHECK#1
x = true;
x += undefined;

View File

@ -9,6 +9,8 @@ description: >
Boolean (primitive or object) and Null
---*/
var x;
//CHECK#1
x = true;
x += null;

View File

@ -9,6 +9,8 @@ description: >
Number (primitive or object) and String (primitive and object)
---*/
var x;
//CHECK#1
x = "1";
x += 1;

View File

@ -9,6 +9,8 @@ description: >
String (primitive or object) and Boolean (primitive and object)
---*/
var x;
//CHECK#1
x = true;
x += "1";

View File

@ -9,6 +9,8 @@ description: >
String (primitive or object) and Undefined
---*/
var x;
//CHECK#1
x = "1";
x += undefined;

View File

@ -9,6 +9,8 @@ description: >
String (primitive or object) and Null
---*/
var x;
//CHECK#1
x = "1";
x += null;

View File

@ -9,6 +9,8 @@ description: >
object
---*/
var x;
//CHECK#1
x = true;
x -= true;

View File

@ -7,6 +7,8 @@ es5id: 11.13.2_A4.5_T1.2
description: Type(x) and Type(y) vary between primitive number and Number object
---*/
var x;
//CHECK#1
x = 1;
x -= 1;

View File

@ -7,6 +7,8 @@ es5id: 11.13.2_A4.5_T1.3
description: Type(x) and Type(y) vary between primitive string and String object
---*/
var x;
//CHECK#1
x = "1";
x -= "1";

View File

@ -7,6 +7,8 @@ es5id: 11.13.2_A4.5_T1.4
description: Type(x) and Type(y) vary between Null and Undefined
---*/
var x;
//CHECK#1
x = null;
x -= undefined;

View File

@ -9,6 +9,8 @@ description: >
Number (primitive or object) and Boolean (primitive and object)
---*/
var x;
//CHECK#1
x = true;
x -= 1;

View File

@ -9,6 +9,8 @@ description: >
Number (primitive or object) and String (primitive and object)
---*/
var x;
//CHECK#1
x = "1";
x -= 1;

View File

@ -9,6 +9,8 @@ description: >
Number (primitive or object) and Null
---*/
var x;
//CHECK#1
x = 1;
x -= null;

View File

@ -9,6 +9,8 @@ description: >
Number (primitive or object) and Undefined
---*/
var x;
//CHECK#1
x = 1;
x -= undefined;

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