Skip to content
Snippets Groups Projects
Commit 0dbafac5 authored by André Bargull's avatar André Bargull Committed by Brian Terlson
Browse files

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.
parent 0ceb428e
No related branches found
No related tags found
No related merge requests found
Showing
with 37 additions and 3 deletions
...@@ -184,7 +184,7 @@ var currencyDigits = { ...@@ -184,7 +184,7 @@ var currencyDigits = {
Object.getOwnPropertyNames(currencyDigits).forEach(function (currency) { Object.getOwnPropertyNames(currencyDigits).forEach(function (currency) {
var digits = currencyDigits[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 min = format.resolvedOptions().minimumFractionDigits;
var max = format.resolvedOptions().maximumFractionDigits; var max = format.resolvedOptions().maximumFractionDigits;
if (min !== digits) { if (min !== digits) {
......
...@@ -7,7 +7,7 @@ es5id: 11.2.4_A1.2_T1 ...@@ -7,7 +7,7 @@ es5id: 11.2.4_A1.2_T1
description: Function is declared with no FormalParameterList description: Function is declared with no FormalParameterList
---*/ ---*/
f_arg = function() { var f_arg = function() {
return arguments; return arguments;
} }
......
...@@ -7,7 +7,7 @@ es5id: 11.2.4_A1.2_T2 ...@@ -7,7 +7,7 @@ es5id: 11.2.4_A1.2_T2
description: Function is declared with FormalParameterList description: Function is declared with FormalParameterList
---*/ ---*/
f_arg = function(x,y) { var f_arg = function(x,y) {
return arguments; return arguments;
} }
......
...@@ -9,6 +9,8 @@ es5id: 11.13.2_A1_T1 ...@@ -9,6 +9,8 @@ es5id: 11.13.2_A1_T1
description: Checking by using eval, check operator is x *= y description: Checking by using eval, check operator is x *= y
---*/ ---*/
var x;
//CHECK#1 //CHECK#1
x = -1; x = -1;
if ((eval("x\u0009*=\u0009-1")) !== 1) { if ((eval("x\u0009*=\u0009-1")) !== 1) {
......
...@@ -9,6 +9,8 @@ es5id: 11.13.2_A1_T10 ...@@ -9,6 +9,8 @@ es5id: 11.13.2_A1_T10
description: Checking by using eval, check operator is x ^= y description: Checking by using eval, check operator is x ^= y
---*/ ---*/
var x;
//CHECK#1 //CHECK#1
x = 1; x = 1;
if ((eval("x\u0009^=\u00091")) !== 0) { if ((eval("x\u0009^=\u00091")) !== 0) {
......
...@@ -9,6 +9,8 @@ es5id: 11.13.2_A1_T11 ...@@ -9,6 +9,8 @@ es5id: 11.13.2_A1_T11
description: Checking by using eval, check operator is x |= y description: Checking by using eval, check operator is x |= y
---*/ ---*/
var x;
//CHECK#1 //CHECK#1
x = 0; x = 0;
if ((eval("x\u0009|=\u00091")) !== 1) { if ((eval("x\u0009|=\u00091")) !== 1) {
......
...@@ -9,6 +9,8 @@ es5id: 11.13.2_A1_T2 ...@@ -9,6 +9,8 @@ es5id: 11.13.2_A1_T2
description: Checking by using eval, check operator is x /= y description: Checking by using eval, check operator is x /= y
---*/ ---*/
var x;
//CHECK#1 //CHECK#1
x = -1; x = -1;
if ((eval("x\u0009/=\u0009-1")) !== 1) { if ((eval("x\u0009/=\u0009-1")) !== 1) {
......
...@@ -9,6 +9,8 @@ es5id: 11.13.2_A1_T3 ...@@ -9,6 +9,8 @@ es5id: 11.13.2_A1_T3
description: Checking by using eval, check operator is x %= y description: Checking by using eval, check operator is x %= y
---*/ ---*/
var x;
//CHECK#1 //CHECK#1
x = -1; x = -1;
if ((eval("x\u0009%=\u0009-1")) !== 0) { if ((eval("x\u0009%=\u0009-1")) !== 0) {
......
...@@ -9,6 +9,8 @@ es5id: 11.13.2_A1_T4 ...@@ -9,6 +9,8 @@ es5id: 11.13.2_A1_T4
description: Checking by using eval, check operator is x += y description: Checking by using eval, check operator is x += y
---*/ ---*/
var x;
//CHECK#1 //CHECK#1
x = -1; x = -1;
if ((eval("x\u0009+=\u0009-1")) !== -2) { if ((eval("x\u0009+=\u0009-1")) !== -2) {
......
...@@ -9,6 +9,8 @@ es5id: 11.13.2_A1_T5 ...@@ -9,6 +9,8 @@ es5id: 11.13.2_A1_T5
description: Checking by using eval, check operator is x -= y description: Checking by using eval, check operator is x -= y
---*/ ---*/
var x;
//CHECK#1 //CHECK#1
x = -1; x = -1;
if ((eval("x\u0009-=\u00091")) !== -2) { if ((eval("x\u0009-=\u00091")) !== -2) {
......
...@@ -9,6 +9,8 @@ es5id: 11.13.2_A1_T6 ...@@ -9,6 +9,8 @@ es5id: 11.13.2_A1_T6
description: Checking by using eval, check operator is x <<= y description: Checking by using eval, check operator is x <<= y
---*/ ---*/
var x;
//CHECK#1 //CHECK#1
x = 1; x = 1;
if ((eval("x\u0009<<=\u00091")) !== 2) { if ((eval("x\u0009<<=\u00091")) !== 2) {
......
...@@ -9,6 +9,8 @@ es5id: 11.13.2_A1_T7 ...@@ -9,6 +9,8 @@ es5id: 11.13.2_A1_T7
description: Checking by using eval, check operator is x >>= y description: Checking by using eval, check operator is x >>= y
---*/ ---*/
var x;
//CHECK#1 //CHECK#1
x = 1; x = 1;
if ((eval("x\u0009>>=\u00091")) !== 0) { if ((eval("x\u0009>>=\u00091")) !== 0) {
......
...@@ -9,6 +9,8 @@ es5id: 11.13.2_A1_T8 ...@@ -9,6 +9,8 @@ es5id: 11.13.2_A1_T8
description: Checking by using eval, check operator is x >>>= y description: Checking by using eval, check operator is x >>>= y
---*/ ---*/
var x;
//CHECK#1 //CHECK#1
x = 1; x = 1;
if ((eval("x\u0009>>>=\u00091")) !== 0) { if ((eval("x\u0009>>>=\u00091")) !== 0) {
......
...@@ -9,6 +9,8 @@ es5id: 11.13.2_A1_T9 ...@@ -9,6 +9,8 @@ es5id: 11.13.2_A1_T9
description: Checking by using eval, check operator is x &= y description: Checking by using eval, check operator is x &= y
---*/ ---*/
var x;
//CHECK#1 //CHECK#1
x = 1; x = 1;
if ((eval("x\u0009&=\u00091")) !== 1) { if ((eval("x\u0009&=\u00091")) !== 1) {
......
...@@ -9,6 +9,8 @@ description: > ...@@ -9,6 +9,8 @@ description: >
object object
---*/ ---*/
var x;
//CHECK#1 //CHECK#1
x = true; x = true;
x ^= true; x ^= true;
......
...@@ -7,6 +7,8 @@ es5id: 11.13.2_A4.10_T1.2 ...@@ -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 description: Type(x) and Type(y) vary between primitive number and Number object
---*/ ---*/
var x;
//CHECK#1 //CHECK#1
x = 1; x = 1;
x ^= 1; x ^= 1;
......
...@@ -7,6 +7,8 @@ es5id: 11.13.2_A4.10_T1.3 ...@@ -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 description: Type(x) and Type(y) vary between primitive string and String object
---*/ ---*/
var x;
//CHECK#1 //CHECK#1
x = "1"; x = "1";
x ^= "1"; x ^= "1";
......
...@@ -7,6 +7,8 @@ es5id: 11.13.2_A4.10_T1.4 ...@@ -7,6 +7,8 @@ es5id: 11.13.2_A4.10_T1.4
description: Type(x) and Type(y) vary between Null and Undefined description: Type(x) and Type(y) vary between Null and Undefined
---*/ ---*/
var x;
//CHECK#1 //CHECK#1
x = null; x = null;
x ^= undefined; x ^= undefined;
......
...@@ -9,6 +9,8 @@ description: > ...@@ -9,6 +9,8 @@ description: >
Number (primitive or object) and Boolean (primitive and object) Number (primitive or object) and Boolean (primitive and object)
---*/ ---*/
var x;
//CHECK#1 //CHECK#1
x = true; x = true;
x ^= 1; x ^= 1;
......
...@@ -9,6 +9,8 @@ description: > ...@@ -9,6 +9,8 @@ description: >
Number (primitive or object) and String (primitive and object) Number (primitive or object) and String (primitive and object)
---*/ ---*/
var x;
//CHECK#1 //CHECK#1
x = "1"; x = "1";
x ^= 1; x ^= 1;
......
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