diff options
Diffstat (limited to 'external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions')
33 files changed, 1182 insertions, 0 deletions
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.1_The_this_Keyword/S11.1.1_A1.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.1_The_this_Keyword/S11.1.1_A1.js new file mode 100644 index 000000000..dc790988f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.1_The_this_Keyword/S11.1.1_A1.js @@ -0,0 +1,12 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S11.1.1_A1; + * @section: 11.1.1; + * @assertion: The "this" is reserved word; + * @description: Checking if execution of "this=1" fails; + * @negative +*/ + +this = 1; diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.1_The_this_Keyword/S11.1.1_A2.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.1_The_this_Keyword/S11.1.1_A2.js new file mode 100644 index 000000000..0b8c7854d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.1_The_this_Keyword/S11.1.1_A2.js @@ -0,0 +1,19 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S11.1.1_A2; + * @section: 11.1.1; + * @assertion: Being in global code, "this" and "eval("this")" return the global object; + * @description: Checking if execution of "this" and eval("this"), which are in global code, return the global object by using toString function; +*/ + +//CHECK#1 +if (this.toString() !== toString()) { + $ERROR('#1: this.toString() === toString(). Actual: ' + (this.toString())); +} + +//CHECK#2 +if (eval("this").toString() !== toString()) { + $ERROR('#2: eval("this").toString() === toString(). Actual: ' + (this.toString())); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.1_The_this_Keyword/S11.1.1_A3.1.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.1_The_this_Keyword/S11.1.1_A3.1.js new file mode 100644 index 000000000..55b81eedc --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.1_The_this_Keyword/S11.1.1_A3.1.js @@ -0,0 +1,23 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S11.1.1_A3.1; + * @section: 11.1.1; + * @assertion: Being in function code, "this" and eval("this"), called as a functions, return the global object; + * @description: Creating function which returns "this" or eval("this"); +*/ + +//CHECK#1 +function MyFunction() {return this} +if (MyFunction() !== this) { + $ERROR('#1: function MyFunction() {return this} MyFunction() === this. Actual: ' + (MyFunction())); +} + +//CHECK#2 +function MyFunction() {return eval("this")} +if (MyFunction() !== this) { + $ERROR('#2: function MyFunction() {return eval("this")} MyFunction() === this. Actual: ' + (MyFunction())); +} + + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.1_The_this_Keyword/S11.1.1_A3.2.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.1_The_this_Keyword/S11.1.1_A3.2.js new file mode 100644 index 000000000..888489b24 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.1_The_this_Keyword/S11.1.1_A3.2.js @@ -0,0 +1,22 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S11.1.1_A3.2; + * @section: 11.1.1; + * @assertion: Being in function code, "this" and eval("this"), called as a constructors, return the object; + * @description: Create function. It have property, that returned "this"; +*/ + +//CHECK#1 +function MyFunction() {this.THIS = this} +if ((new MyFunction()).THIS.toString() !== "[object Object]") { + $ERROR('#1: function MyFunction() {this.THIS = this} (new MyFunction()).THIS.toString() !== "[object Object]". Actual: ' + ((new MyFunction()).THIS.toString())); +} + +//CHECK#2 +function MyFunction() {this.THIS = eval("this")} +if ((new MyFunction()).THIS.toString() !== "[object Object]") { + $ERROR('#2: function MyFunction() {this.THIS = eval("this")} (new MyFunction()).THIS.toString() !== "[object Object]". Actual: ' + ((new MyFunction()).THIS.toString())); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.1_The_this_Keyword/S11.1.1_A4.1.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.1_The_this_Keyword/S11.1.1_A4.1.js new file mode 100644 index 000000000..b393237f6 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.1_The_this_Keyword/S11.1.1_A4.1.js @@ -0,0 +1,23 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S11.1.1_A4.1; + * @section: 11.1.1; + * @assertion: Being in anonymous code, "this" and eval("this"), called as a function, return the global object; + * @description: Creating function with new Function() constructor; +*/ + +//CHECK#1 +var MyFunction = new Function("return this"); +if (MyFunction() !== this) { + $ERROR('#1: var MyFunction = new Function("return this"); MyFunction() === this. Actual: ' + (MyFunction())); +} + +//CHECK#2 +var MyFunction = new Function("return eval(\'this\')"); +if (MyFunction() !== this) { + $ERROR('#2: var MyFunction = new Function("return eval(\'this\')"); MyFunction() === this. Actual: ' + (MyFunction())); +} + + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.1_The_this_Keyword/S11.1.1_A4.2.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.1_The_this_Keyword/S11.1.1_A4.2.js new file mode 100644 index 000000000..ddf3f81f6 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.1_The_this_Keyword/S11.1.1_A4.2.js @@ -0,0 +1,24 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S11.1.1_A4.2; + * @section: 11.1.1; + * @assertion: Being in anonymous code, "this" and eval("this"), called as a constructor, return the object; + * @description: Creating function by using new Function() constructor. It has the property, which returns "this"; +*/ + +//CHECK#1 +var MyFunction = new Function("this.THIS = this"); +var MyObject = new MyFunction(); +if (MyObject.THIS.toString() !== "[object Object]") { + $ERROR('#1: var MyFunction = new Function("this.THIS = this"); var MyObject = new MyFunction(); MyObject.THIS.toString() === "[object Object]". Actual: ' + (MyObject.THIS.toString())); +} + +//CHECK#2 +var MyFunction = new Function("this.THIS = eval(\'this\')"); +var MyObject = new MyFunction(); +if (MyObject.THIS.toString() !== "[object Object]") { + $ERROR('#2: var MyFunction = new Function("this.THIS = eval(\'this\')"); var MyObject = new MyFunction(); MyObject.THIS.toString() === "[object Object]". Actual: ' + (MyObject.THIS.toString())); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.2_Identifier_Reference/S11.1.2_A1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.2_Identifier_Reference/S11.1.2_A1_T1.js new file mode 100644 index 000000000..259601464 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.2_Identifier_Reference/S11.1.2_A1_T1.js @@ -0,0 +1,26 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S11.1.2_A1_T1; + * @section: 11.1.2; + * @assertion: The result of evaluating an Identifier is always a value of type Reference; + * @description: Creating variables without defining it; +*/ + +//CHECK#1 +if (this.x !== undefined) { + $ERROR('#1: this.x === undefined. Actual: ' + (this.x)); +} + +//CHECK#2 +var object = new Object(); +if (object.prop !== undefined) { + $ERROR('#2: var object = new Object(); object.prop === undefined. Actual: ' + (object.prop)); +} + +//CHECK#3 +this.y++; +if (isNaN(y) !== true) { + $ERROR('#3: this.y++; y === Not-a-Number. Actual: ' + (y)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.2_Identifier_Reference/S11.1.2_A1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.2_Identifier_Reference/S11.1.2_A1_T2.js new file mode 100644 index 000000000..e64114330 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.2_Identifier_Reference/S11.1.2_A1_T2.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S11.1.2_A1_T2; + * @section: 11.1.2; + * @assertion: The result of evaluating an Identifier is always a value of type Reference; + * @description: Trying to generate ReferenceError; +*/ + +//CHECK#1 +try { + this.z; + z; + $ERROR('#1.1: this.z; z === undefined throw ReferenceError. Actual: ' + (z)); +} catch(e) { + if ((e instanceof ReferenceError) !== true) { + $ERROR('#1.2: this.z; z === undefined throw ReferenceError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.4_Array_Initialiser/S11.1.4_A1.1.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.4_Array_Initialiser/S11.1.4_A1.1.js new file mode 100644 index 000000000..1dee93826 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.4_Array_Initialiser/S11.1.4_A1.1.js @@ -0,0 +1,31 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S11.1.4_A1.1; +* @section: 11.1.4; +* @assertion: Evaluate the production ArrayLiteral: [ ]; +* @description: Checking various properties of the array defined with expression "var array = []"; +*/ + +var array = []; + +//CHECK#1 +if (typeof array !== "object") { + $ERROR('#1: var array = []; typeof array === "object". Actual: ' + (typeof array)); +} + +//CHECK#2 +if (array instanceof Array !== true) { + $ERROR('#2: var array = []; array instanceof Array === true'); +} + +//CHECK#3 +if (array.toString !== Array.prototype.toString) { + $ERROR('#3: var array = []; array.toString === Array.prototype.toString. Actual: ' + (array.toString)); +} + +//CHECK#4 +if (array.length !== 0) { + $ERROR('#4: var array = []; array.length === 0. Actual: ' + (array.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.4_Array_Initialiser/S11.1.4_A1.2.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.4_Array_Initialiser/S11.1.4_A1.2.js new file mode 100644 index 000000000..5fe58b33f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.4_Array_Initialiser/S11.1.4_A1.2.js @@ -0,0 +1,31 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S11.1.4_A1.2; +* @section: 11.1.4; +* @assertion: Evaluate the production ArrayLiteral: [ Elision ]; +* @description: Checking various properties the array defined with "var array = [,,,,,]"; +*/ + +var array = [,,,,,]; + +//CHECK#1 +if (typeof array !== "object") { + $ERROR('#1: var array = [,,,,,]; typeof array === "object". Actual: ' + (typeof array)); +} + +//CHECK#2 +if (array instanceof Array !== true) { + $ERROR('#2: var array = [,,,,,]; array instanceof Array === true'); +} + +//CHECK#3 +if (array.toString !== Array.prototype.toString) { + $ERROR('#3: var array = [,,,,,]; array.toString === Array.prototype.toString. Actual: ' + (array.toString)); +} + +//CHECK#4 +if (array.length !== 5) { + $ERROR('#4: var array = [,,,,,]; array.length === 5. Actual: ' + (array.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.4_Array_Initialiser/S11.1.4_A1.3.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.4_Array_Initialiser/S11.1.4_A1.3.js new file mode 100644 index 000000000..6f85eaac1 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.4_Array_Initialiser/S11.1.4_A1.3.js @@ -0,0 +1,56 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S11.1.4_A1.3; +* @section: 11.1.4; +* @assertion: Evaluate the production ArrayLiteral: [ AssignmentExpression ]; +* @description: Checking various properteis and contents of the array defined with "var array = [1,2,3,4,5]"; +*/ + +var array = [1,2,3,4,5]; + +//CHECK#1 +if (typeof array !== "object") { + $ERROR('#1: var array = [1,2,3,4,5]; typeof array === "object". Actual: ' + (typeof array)); +} + +//CHECK#2 +if (array instanceof Array !== true) { + $ERROR('#2: var array = [1,2,3,4,5]; array instanceof Array === true'); +} + +//CHECK#3 +if (array.toString !== Array.prototype.toString) { + $ERROR('#3: var array = [1,2,3,4,5]; array.toString === Array.prototype.toString. Actual: ' + (array.toString)); +} + +//CHECK#4 +if (array.length !== 5) { + $ERROR('#4: var array = [1,2,3,4,5]; array.length === 5. Actual: ' + (array.length)); +} + +//CHECK#5 +if (array[0] !== 1) { + $ERROR('#5: var array = [1,2,3,4,5]; array[0] === 1. Actual: ' + (array[0])); +} + +//CHECK#6 +if (array[1] !== 2) { + $ERROR('#6: var array = [1,2,3,4,5]; array[1] === 2. Actual: ' + (array[1])); +} + +//CHECK#7 +if (array[2] !== 3) { + $ERROR('#7: var array = [1,2,3,4,5]; array[2] === 3. Actual: ' + (array[2])); +} + +//CHECK#8 +if (array[3] !== 4) { + $ERROR('#8: var array = [1,2,3,4,5]; array[3] === 4. Actual: ' + (array[3])); +} + +//CHECK#9 +if (array[4] !== 5) { + $ERROR('#9: var array = [1,2,3,4,5]; array[4] === 5. Actual: ' + (array[4])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.4_Array_Initialiser/S11.1.4_A1.4.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.4_Array_Initialiser/S11.1.4_A1.4.js new file mode 100644 index 000000000..bad33531c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.4_Array_Initialiser/S11.1.4_A1.4.js @@ -0,0 +1,56 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S11.1.4_A1.4; +* @section: 11.1.4; +* @assertion: Evaluate the production ArrayLiteral: [ Elision, AssignmentExpression ]; +* @description: Checking various properteis and content of the array defined with "var array = [,,,1,2]"; +*/ + +var array = [,,,1,2]; + +//CHECK#1 +if (typeof array !== "object") { + $ERROR('#1: var array = [,,,1,2]; typeof array === "object". Actual: ' + (typeof array)); +} + +//CHECK#2 +if (array instanceof Array !== true) { + $ERROR('#2: var array = [,,,1,2]; array instanceof Array === true'); +} + +//CHECK#3 +if (array.toString !== Array.prototype.toString) { + $ERROR('#3: var array = [,,,1,2]; array.toString === Array.prototype.toString. Actual: ' + (array.toString)); +} + +//CHECK#4 +if (array.length !== 5) { + $ERROR('#4: var array = [,,,1,2]; array.length === 5. Actual: ' + (array.length)); +} + +//CHECK#5 +if (array[0] !== undefined) { + $ERROR('#5: var array = [,,,1,2]; array[0] === undefined. Actual: ' + (array[0])); +} + +//CHECK#6 +if (array[1] !== undefined) { + $ERROR('#6: var array = [,,,1,2]; array[1] === undefined. Actual: ' + (array[1])); +} + +//CHECK#7 +if (array[2] !== undefined) { + $ERROR('#7: var array = [,,,1,2]; array[2] === undefined. Actual: ' + (array[2])); +} + +//CHECK#8 +if (array[3] !== 1) { + $ERROR('#8: var array = [,,,1,2]; array[3] === 1. Actual: ' + (array[3])); +} + +//CHECK#9 +if (array[4] !== 2) { + $ERROR('#9: var array = [,,,1,2]; array[4] === 2. Actual: ' + (array[4])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.4_Array_Initialiser/S11.1.4_A1.5.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.4_Array_Initialiser/S11.1.4_A1.5.js new file mode 100644 index 000000000..78a77f9b1 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.4_Array_Initialiser/S11.1.4_A1.5.js @@ -0,0 +1,56 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S11.1.4_A1.5; +* @section: 11.1.4; +* @assertion: Evaluate the production ArrayLiteral: [ AssignmentExpression, Elision ]; +* @description: Checking various properteis and contents of the array defined with "var array = [4,5,,,,]"; +*/ + +var array = [4,5,,,,]; + +//CHECK#1 +if (typeof array !== "object") { + $ERROR('#1: var array = [4,5,,,,]; typeof array === "object". Actual: ' + (typeof array)); +} + +//CHECK#2 +if (array instanceof Array !== true) { + $ERROR('#2: var array = [4,5,,,,]; array instanceof Array === true'); +} + +//CHECK#3 +if (array.toString !== Array.prototype.toString) { + $ERROR('#3: var array = [4,5,,,,]; array.toString === Array.prototype.toString. Actual: ' + (array.toString)); +} + +//CHECK#4 +if (array.length !== 5) { + $ERROR('#4: var array = [4,5,,,,]; array.length === 5. Actual: ' + (array.length)); +} + +//CHECK#5 +if (array[0] !== 4) { + $ERROR('#5: var array = [4,5,,,,]; array[0] === 4. Actual: ' + (array[0])); +} + +//CHECK#6 +if (array[1] !== 5) { + $ERROR('#6: var array = [4,5,,,,]; array[1] === 5. Actual: ' + (array[1])); +} + +//CHECK#7 +if (array[2] !== undefined) { + $ERROR('#7: var array = [4,5,,,,]; array[2] === undefined. Actual: ' + (array[2])); +} + +//CHECK#8 +if (array[3] !== undefined) { + $ERROR('#8: var array = [4,5,,,,]; array[3] === undefined. Actual: ' + (array[3])); +} + +//CHECK#9 +if (array[4] !== undefined) { + $ERROR('#9: var array = [4,5,,,,]; array[4] === undefined. Actual: ' + (array[4])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.4_Array_Initialiser/S11.1.4_A1.6.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.4_Array_Initialiser/S11.1.4_A1.6.js new file mode 100644 index 000000000..d3bf2cbc6 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.4_Array_Initialiser/S11.1.4_A1.6.js @@ -0,0 +1,56 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S11.1.4_A1.6; +* @section: 11.1.4; +* @assertion: Evaluate the production ArrayLiteral: [ Elision, AssignmentExpression, Elision ]; +* @description: Checking various properteis and contents of the array defined with "var array = [,,3,,,]"; +*/ + +var array = [,,3,,,]; + +//CHECK#1 +if (typeof array !== "object") { + $ERROR('#1: var array = [,,3,,,]; typeof array === "object". Actual: ' + (typeof array)); +} + +//CHECK#2 +if (array instanceof Array !== true) { + $ERROR('#2: var array = [,,3,,,]; array instanceof Array === true'); +} + +//CHECK#3 +if (array.toString !== Array.prototype.toString) { + $ERROR('#3: var array = [,,3,,,]; array.toString === Array.prototype.toString. Actual: ' + (array.toString)); +} + +//CHECK#4 +if (array.length !== 5) { + $ERROR('#4: var array = [,,3,,,]; array.length === 5. Actual: ' + (array.length)); +} + +//CHECK#5 +if (array[0] !== undefined) { + $ERROR('#5: var array = [,,3,,,]; array[0] === undefined. Actual: ' + (array[0])); +} + +//CHECK#6 +if (array[1] !== undefined) { + $ERROR('#6: var array = [,,3,,,]; array[1] === undefined. Actual: ' + (array[1])); +} + +//CHECK#7 +if (array[2] !== 3) { + $ERROR('#7: var array = [,,3,,,]; array[2] === 3. Actual: ' + (array[2])); +} + +//CHECK#8 +if (array[3] !== undefined) { + $ERROR('#8: var array = [,,3,,,]; array[3] === undefined. Actual: ' + (array[3])); +} + +//CHECK#9 +if (array[4] !== undefined) { + $ERROR('#9: var array = [,,3,,,]; array[4] === undefined. Actual: ' + (array[4])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.4_Array_Initialiser/S11.1.4_A1.7.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.4_Array_Initialiser/S11.1.4_A1.7.js new file mode 100644 index 000000000..c10e2fc7a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.4_Array_Initialiser/S11.1.4_A1.7.js @@ -0,0 +1,56 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S11.1.4_A1.7; +* @section: 11.1.4; +* @assertion: Evaluate the production ArrayLiteral: [ AssignmentExpression, Elision, AssignmentExpression ]; +* @description: Checking various properteis and contents of the array defined with "var array = [1,2,,4,5]"; +*/ + +var array = [1,2,,4,5]; + +//CHECK#1 +if (typeof array !== "object") { + $ERROR('#1: var array = [1,2,,4,5]; typeof array === "object". Actual: ' + (typeof array)); +} + +//CHECK#2 +if (array instanceof Array !== true) { + $ERROR('#2: var array = [1,2,,4,5]; array instanceof Array === true'); +} + +//CHECK#3 +if (array.toString !== Array.prototype.toString) { + $ERROR('#3: var array = [1,2,,4,5]; array.toString === Array.prototype.toString. Actual: ' + (array.toString)); +} + +//CHECK#4 +if (array.length !== 5) { + $ERROR('#4: var array = [1,2,,4,5]; array.length === 5. Actual: ' + (array.length)); +} + +//CHECK#5 +if (array[0] !== 1) { + $ERROR('#5: var array = [1,2,,4,5]; array[0] === 1. Actual: ' + (array[0])); +} + +//CHECK#6 +if (array[1] !== 2) { + $ERROR('#6: var array = [1,2,,4,5]; array[1] === 2. Actual: ' + (array[1])); +} + +//CHECK#7 +if (array[2] !== undefined) { + $ERROR('#7: var array = [1,2,,4,5]; array[2] === undefined. Actual: ' + (array[2])); +} + +//CHECK#8 +if (array[3] !== 4) { + $ERROR('#8: var array = [1,2,,4,5]; array[3] === 4. Actual: ' + (array[3])); +} + +//CHECK#9 +if (array[4] !== 5) { + $ERROR('#9: var array = [1,2,,4,5]; array[4] === 5. Actual: ' + (array[4])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.4_Array_Initialiser/S11.1.4_A2.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.4_Array_Initialiser/S11.1.4_A2.js new file mode 100644 index 000000000..ebdb09bbf --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.4_Array_Initialiser/S11.1.4_A2.js @@ -0,0 +1,127 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S11.1.4_A2; +* @section: 11.1.4; +* @assertion: Create multi dimensional array; +* @description: Checking various properteis and contents of the arrya defined with "var array = [[1,2], [3], []]"; +*/ + +var array = [[1,2], [3], []]; + +//CHECK#1 +if (typeof array !== "object") { + $ERROR('#1: var array = [[1,2], [3], []]; typeof array === "object". Actual: ' + (typeof array)); +} + +//CHECK#2 +if (array instanceof Array !== true) { + $ERROR('#2: var array = [[1,2], [3], []]; array instanceof Array === true'); +} + +//CHECK#3 +if (array.toString !== Array.prototype.toString) { + $ERROR('#3: var array = [[1,2], [3], []]; array.toString === Array.prototype.toString. Actual: ' + (array.toString)); +} + +//CHECK#4 +if (array.length !== 3) { + $ERROR('#4: var array = [[1,2], [3], []]; array.length === 3. Actual: ' + (array.length)); +} + +var subarray = array[0]; + +//CHECK#5 +if (typeof subarray !== "object") { + $ERROR('#5: var array = [[1,2], [3], []]; var subarray = array[0]; typeof subarray === "object". Actual: ' + (typeof subarray)); +} + +//CHECK#6 +if (subarray instanceof Array !== true) { + $ERROR('#6: var array = [[1,2], [3], []]; var subarray = array[0]; subarray instanceof Array === true'); +} + +//CHECK#7 +if (subarray.toString !== Array.prototype.toString) { + $ERROR('#7: var array = [[1,2], [3], []]; var subarray = array[0]; subarray.toString === Array.prototype.toString. Actual: ' + (subarray.toString)); +} + +//CHECK#8 +if (subarray.length !== 2) { + $ERROR('#8: var array = [[1,2], [3], []]; var subarray = array[0]; subarray.length === 2. Actual: ' + (subarray.length)); +} + +//CHECK#9 +if (subarray[0] !== 1) { + $ERROR('#9: var array = [[1,2], [3], []]; var subarray = array[0]; subarray[0] === 1. Actual: ' + (subarray[0])); +} + +//CHECK#10 +if (subarray[1] !== 2) { + $ERROR('#10: var array = [[1,2], [3], []]; var subarray = array[1]; subarray[1] === 2. Actual: ' + (subarray[1])); +} + +var subarray = array[1]; + +//CHECK#11 +if (typeof subarray !== "object") { +$ERROR('#11: var array = [[1,2], [3], []]; var subarray = array[1]; typeof subarray === "object". Actual: ' + (typeof subarray)); +} + +//CHECK#12 +if (subarray instanceof Array !== true) { +$ERROR('#12: var array = [[1,2], [3], []]; var subarray = array[1]; subarray instanceof Array === true'); +} + +//CHECK#13 +if (subarray.toString !== Array.prototype.toString) { +$ERROR('#13: var array = [[1,2], [3], []]; var subarray = array[1]; subarray.toString === Array.prototype.toString. Actual: ' + (subarray.toString)); +} + +//CHECK#14 +if (subarray.length !== 1) { +$ERROR('#14: var array = [[1,2], [3], []]; var subarray = array[1]; subarray.length === 1. Actual: ' + (subarray.length)); +} + +//CHECK#15 +if (subarray[0] !== 3) { +$ERROR('#15: var array = [[1,2], [3], []]; var subarray = array[1]; subarray[0] === 3. Actual: ' + (subarray[0])); +} + +var subarray = array[2]; + +//CHECK#16 +if (typeof subarray !== "object") { +$ERROR('#16: var array = [[1,2], [3], []]; var subarray = array[2]; typeof subarray === "object". Actual: ' + (typeof subarray)); +} + +//CHECK#17 +if (subarray instanceof Array !== true) { +$ERROR('#17: var array = [[1,2], [3], []]; var subarray = array[2]; subarray instanceof Array === true'); +} + +//CHECK#18 +if (subarray.toString !== Array.prototype.toString) { +$ERROR('#18: var array = [[1,2], [3], []]; var subarray = array[2]; subarray.toString === Array.prototype.toString. Actual: ' + (subarray.toString)); +} + +//CHECK#19 +if (subarray.length !== 0) { +$ERROR('#19: var array = [[1,2], [3], []]; var subarray = array[2]; subarray.length === 0. Actual: ' + (subarray.length)); +} + +//CHECK#20 +if (array[0][0] !== 1) { + $ERROR('#20: var array = [[1,2], [3], []]; array[0][0] === 1. Actual: ' + (array[0][0])); +} + +//CHECK#21 +if (array[0][1] !== 2) { + $ERROR('#21: var array = [[1,2], [3], []]; array[0][1] === 2. Actual: ' + (array[0][1])); +} + +//CHECK#22 +if (array[1][0] !== 3) { + $ERROR('#722: var array = [[1,2], [3], []]; array[1][0] === 3. Actual: ' + (array[1][0])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A1.1.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A1.1.js new file mode 100644 index 000000000..6c30ee266 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A1.1.js @@ -0,0 +1,31 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S11.1.5_A1.1; +* @section: 11.1.5; +* @assertion: Evaluate the production ObjectLiteral: { }; +* @description: Checking various properteis of the object defined with "var object = {}"; +*/ + +var object = {}; + +//CHECK#1 +if (typeof object !== "object") { + $ERROR('#1: var object = {}; typeof object === "object". Actual: ' + (typeof object)); +} + +//CHECK#2 +if (object instanceof Object !== true) { + $ERROR('#2: var object = {}; object instanceof Object === true'); +} + +//CHECK#3 +if (object.toString !== Object.prototype.toString) { + $ERROR('#3: var object = {}; object.toString === Object.prototype.toString. Actual: ' + (object.toString)); +} + +//CHECK#4 +if (object.toString() !== "[object Object]") { + $ERROR('#4: var object = {}; object.toString === "[object Object]". Actual: ' + (object.toString)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A1.2.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A1.2.js new file mode 100644 index 000000000..31bd73453 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A1.2.js @@ -0,0 +1,37 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S11.1.5_A1.2; +* @section: 11.1.5; +* @assertion: Evaluate the production ObjectLiteral: { NumericLiteral : AssignmentExpression}; +* @description: Checking various properteis and contents of the object defined with "var object = {1 : true}"; +*/ + +var object = {1 : true}; + +//CHECK#1 +if (typeof object !== "object") { + $ERROR('#1: var object = {1 : true}; typeof object === "object". Actual: ' + (typeof object)); +} + +//CHECK#2 +if (object instanceof Object !== true) { + $ERROR('#2: var object = {1 : true}; object instanceof Object === true'); +} + +//CHECK#3 +if (object.toString !== Object.prototype.toString) { + $ERROR('#3: var object = {1 : true}; object.toString === Object.prototype.toString. Actual: ' + (object.toString)); +} + +//CHECK#4 +if (object[1] !== true) { + $ERROR('#4: var object = {1 : true}; object[1] === true'); +} + +//CHECK#5 +if (object["1"] !== true) { + $ERROR('#5: var object = {1 : true}; object["1"] === true'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A1.3.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A1.3.js new file mode 100644 index 000000000..28d9a0fbd --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A1.3.js @@ -0,0 +1,36 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S11.1.5_A1.3; +* @section: 11.1.5; +* @assertion: Evaluate the production ObjectLiteral: { StringLiteral : AssignmentExpression}; +* @description: Checking various properteis and contents of the object defined with "var object = {"x" : true}"; +*/ + +var object = {"x" : true}; + +//CHECK#1 +if (typeof object !== "object") { + $ERROR('#1: var object = {"x" : true}; typeof object === "object". Actual: ' + (typeof object)); +} + +//CHECK#2 +if (object instanceof Object !== true) { + $ERROR('#2: var object = {"x" : true}; object instanceof Object === true'); +} + +//CHECK#3 +if (object.toString !== Object.prototype.toString) { + $ERROR('#3: var object = {"x" : true}; object.toString === Object.prototype.toString. Actual: ' + (object.toString)); +} + +//CHECK#4 +if (object["x"] !== true) { + $ERROR('#4: var object = {"x" : true}; object["x"] === true'); +} + +//CHECK#5 +if (object.x !== true) { + $ERROR('#5: var object = {"x" : true}; object.x === true'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A1.4.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A1.4.js new file mode 100644 index 000000000..77065a3be --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A1.4.js @@ -0,0 +1,36 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S11.1.5_A1.4; +* @section: 11.1.5; +* @assertion: Evaluate the production ObjectLiteral: { Identifier : AssignmentExpression}; +* @description: Checking various properteis and contents of the object defined with "var object = {prop : true}"; +*/ + +var object = {prop : true}; + +//CHECK#1 +if (typeof object !== "object") { + $ERROR('#1: var object = {prop : true}; typeof object === "object". Actual: ' + (typeof object)); +} + +//CHECK#2 +if (object instanceof Object !== true) { + $ERROR('#2: var object = {prop : true}; object instanceof Object === true'); +} + +//CHECK#3 +if (object.toString !== Object.prototype.toString) { + $ERROR('#3: var object = {prop : true}; object.toString === Object.prototype.toString. Actual: ' + (object.toString)); +} + +//CHECK#4 +if (object["prop"] !== true) { + $ERROR('#4: var object = {prop : true}; object["prop"] === true'); +} + +//CHECK#5 +if (object.prop !== true) { + $ERROR('#5: var object = {prop : true}; object.prop === true'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A2.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A2.js new file mode 100644 index 000000000..7959ef1aa --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A2.js @@ -0,0 +1,93 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S11.1.5_A2; +* @section: 11.1.5; +* @assertion: Evaluate the production ObjectLiteral: { PropertyName : AssignmentExpression }; +* @description: Creating property "prop" of various types(boolean, number and etc.); +*/ + +//CHECK#1 +var x = true; +var object = {prop : x}; +if (object.prop !== x) { + $ERROR('#1: var x = true; var object = {prop : x}; object.prop === x. Actual: ' + (object.prop)); +} + +//CHECK#2 +var x = new Boolean(true); +var object = {prop : x}; +if (object.prop !== x) { + $ERROR('#2: var x = new Boolean(true); var object = {prop : x}; object.prop === x. Actual: ' + (object.prop)); +} + +//CHECK#3 +var x = 1; +var object = {prop : x}; +if (object.prop !== x) { + $ERROR('#3: var x = 1; var object = {prop : x}; object.prop === x. Actual: ' + (object.prop)); +} + +//CHECK#4 +var x = new Number(1); +var object = {prop : x}; +if (object.prop !== x) { + $ERROR('#4: var x = new Number(1); var object = {prop : x}; object.prop === x. Actual: ' + (object.prop)); +} + +//CHECK#5 +var x = "1"; +var object = {prop : x}; +if (object.prop !== x) { + $ERROR('#5: var x = "1"; var object = {prop : x}; object.prop === x. Actual: ' + (object.prop)); +} + +//CHECK#6 +var x = new String(1); +var object = {prop : x}; +if (object.prop !== x) { + $ERROR('#6: var x = new String(1); var object = {prop : x}; object.prop === x. Actual: ' + (object.prop)); +} + +//CHECK#7 +var x = undefined; +var object = {prop : x}; +if (object.prop !== x) { + $ERROR('#7: var x = undefined; var object = {prop : x}; object.prop === x. Actual: ' + (object.prop)); +} + +//CHECK#8 +var x = null; +var object = {prop : x}; +if (object.prop !== x) { + $ERROR('#8: var x = null; var object = {prop : x}; object.prop === x. Actual: ' + (object.prop)); +} + +//CHECK#9 +var x = {}; +var object = {prop : x}; +if (object.prop !== x) { + $ERROR('#9: var x = {}; var object = {prop : x}; object.prop === x. Actual: ' + (object.prop)); +} + +//CHECK#10 +var x = [1,2]; +var object = {prop : x}; +if (object.prop !== x) { + $ERROR('#10: var x = [1,2]; var object = {prop : x}; object.prop === x. Actual: ' + (object.prop)); +} + +//CHECK#11 +var x = function() {}; +var object = {prop : x}; +if (object.prop !== x) { + $ERROR('#11: var x = function() {}; var object = {prop : x}; object.prop === x. Actual: ' + (object.prop)); +} + +//CHECK#12 +var x = this; +var object = {prop : x}; +if (object.prop !== x) { + $ERROR('#12: var x = this; var object = {prop : x}; object.prop === x. Actual: ' + (object.prop)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A3.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A3.js new file mode 100644 index 000000000..89a844b63 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A3.js @@ -0,0 +1,26 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S11.1.5_A3; +* @section: 11.1.5; +* @assertion: Evaluate the production ObjectLiteral: { PropertyNameAndValueList }; +* @description: Creating the object defined with "var object = {0 : 1, "1" : "x", o : {}}"; +*/ + +var object = {0 : 1, "1" : "x", o : {}}; + +//CHECK#1 +if (object[0] !== 1) { + $ERROR('#1: var object = {0 : 1; "1" : "x"; o : {}}; object[0] === 1. Actual: ' + (object[0])); +} + +//CHECK#2 +if (object["1"] !== "x") { + $ERROR('#2: var object = {0 : 1; "1" : "x"; o : {}}; object["1"] === "x". Actual: ' + (object["1"])); +} + +//CHECK#3 +if (typeof object.o !== "object") { + $ERROR('#1: var object = {0 : 1; "1" : "x"; o : {}}; typeof object.o === "object". Actual: ' + (typeof object.o)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A4.1.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A4.1.js new file mode 100644 index 000000000..bda88873b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A4.1.js @@ -0,0 +1,13 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S11.1.5_A4.1; +* @section: 11.1.5; +* @assertion: The PropertyName is not BooleanLiteral; +* @description: Checking if execution of "var object = {true : 1}" fails; +* @negative +*/ + +//CHECK#1 +var object = {true : 1}; diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A4.2.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A4.2.js new file mode 100644 index 000000000..d2fbf4d1e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A4.2.js @@ -0,0 +1,13 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S11.1.5_A4.2; +* @section: 11.1.5; +* @assertion: The PropertyName is not nullLiteral; +* @description: Checking if execution of "var object = {null : true}" fails; +* @negative +*/ + +//CHECK#1 +var object = {null : true}; diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A4.3.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A4.3.js new file mode 100644 index 000000000..639e41a45 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A4.3.js @@ -0,0 +1,33 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S11.1.5_A4.3; +* @section: 11.1.5; +* @assertion: The PropertyName is undefined, ToString(BooleanLiteral), ToString(nullLiteral); +* @description: Creating properties with following names: undefined, 'true', 'null'; +*/ + +//CHECK#1 +var object = {undefined : true}; +if (object.undefined !== true) { + $ERROR('#1: var object = {undefined : true}; object.undefined === true'); +} + +//CHECK#2 +var object = {undefined : true}; +if (object["undefined"] !== true) { + $ERROR('#2: var object = {undefined : true}; object["undefined"] === true'); +} + +//CHECK#3 +var object = {"true" : true}; +if (object["true"] !== true) { + $ERROR('#3: var object = {"true" : true}; object["true"] === true'); +} + +//CHECK#4 +var object = {"null" : true}; +if (object["null"] !== true) { + $ERROR('#4: var object = {"null" : true}; object["null"] === true'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.6_The_Grouping_Operator/S11.1.6_A1.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.6_The_Grouping_Operator/S11.1.6_A1.js new file mode 100644 index 000000000..78c0e9d43 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.6_The_Grouping_Operator/S11.1.6_A1.js @@ -0,0 +1,59 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S11.1.6_A1; +* @section: 11.1.6, 7.2, 7.3; +* @assertion: White Space and Line Terminator inside "grouping" operator are allowed; +* @description: Inserting WhiteSpaces and LineTerminators into grouping operator. Eval is used; +*/ + +//CHECK#1 +if (eval("(\u00091\u0009)") !== 1) { + $ERROR('#1: (\\u00091\\u0009) === 1'); +} + +//CHECK#2 +if (eval("(\u000B1\u000B)") !== 1) { + $ERROR('#2: (\\u000B1\\u000B) === 1'); +} + +//CHECK#3 +if (eval("(\u000C1\u000C)") !== 1) { + $ERROR('#3: (\\u000C1\\u000C) === 1'); +} + +//CHECK#4 +if (eval("(\u00201\u0020)") !== 1) { + $ERROR('#4: (\\u00201\\u0020 === 1'); +} + +//CHECK#5 +if (eval("(\u00A01\u00A0)") !== 1) { + $ERROR('#5: (\\u00A01\\u00A0) === 1'); +} + +//CHECK#6 +if (eval("(\u000A1\u000A)") !== 1) { + $ERROR('#6: (\\u000A1\\u000A) === 1'); +} + +//CHECK#7 +if (eval("(\u000D1\u000D)") !== 1) { + $ERROR('#7: (\\u000D1\\u000D) === 1'); +} + +//CHECK#8 +if (eval("(\u20281\u2028)") !== 1) { + $ERROR('#8: (\\u20281\\u2028) === 1'); +} + +//CHECK#9 +if (eval("(\u20291\u2029)") !== 1) { + $ERROR('#9: (\\u20291\\u2029) === 1'); +} + +//CHECK#10 +if (eval("(\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u20291\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u2029)") !== 1) { + $ERROR('#10: (\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20291\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029) === 1'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.6_The_Grouping_Operator/S11.1.6_A2.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.6_The_Grouping_Operator/S11.1.6_A2.js new file mode 100644 index 000000000..23152e4b0 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.6_The_Grouping_Operator/S11.1.6_A2.js @@ -0,0 +1,30 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S11.1.6_A2; +* @section: 11.1.6; +* @assertion: "This" operator doesn't use GetValue. The operators "delete" and "typeof" can be applied to parenthesised expressions; +* @description: Applying "delete" and "typeof" operators to an undefined variable and a property of an object; +*/ + +//CHECK#1 +if (delete (x) !== true) { + $ERROR('#1: delete (x) === true'); +} + +//CHECK#2 +if (typeof (x) !== "undefined") { + $ERROR('#2: typeof (x) === "undefined". Actual: ' + (typeof (x))); +} + +var object = {}; +//CHECK#3 +if (delete (object.prop) !== true) { + $ERROR('#3: var object = {}; delete (object.prop) === true'); +} + +//CHECK#4 +if (typeof (object.prop) !== "undefined") { + $ERROR('#4: var object = {}; typeof (object.prop) === "undefined". Actual: ' + (typeof (object.prop))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.6_The_Grouping_Operator/S11.1.6_A3_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.6_The_Grouping_Operator/S11.1.6_A3_T1.js new file mode 100644 index 000000000..245c653ee --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.6_The_Grouping_Operator/S11.1.6_A3_T1.js @@ -0,0 +1,22 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S11.1.6_A3_T1; +* @section: 11.1.6; +* @assertion: "This" operator only evaluates Expression; +* @description: Applying grouping operator to Boolean; +*/ + +// Check for Boolean + +//CHECK#1 +if ((true) !== true) { + $ERROR('#1: (true) === true'); +} + +//CHECK#2 +var x = new Boolean(true); +if ((x) !== x) { + $ERROR('#2: var x = new Boolean(true); (x) === x. Actual: ' + ((x))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.6_The_Grouping_Operator/S11.1.6_A3_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.6_The_Grouping_Operator/S11.1.6_A3_T2.js new file mode 100644 index 000000000..3593f1563 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.6_The_Grouping_Operator/S11.1.6_A3_T2.js @@ -0,0 +1,22 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S11.1.6_A3_T2; +* @section: 11.1.6; +* @assertion: "This" operator only evaluates Expression; +* @description: Applying grouping operator to Number; +*/ + +//Check for Number + +//CHECK#1 +if ((1) !== 1) { + $ERROR('#1: (1) === 1. Actual: ' + ((1))); +} + +//CHECK#2 +var x = new Number(1); +if ((x) !== x) { + $ERROR('#2: var x = new Number(1); (x) === x. Actual: ' + ((x))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.6_The_Grouping_Operator/S11.1.6_A3_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.6_The_Grouping_Operator/S11.1.6_A3_T3.js new file mode 100644 index 000000000..9658c7616 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.6_The_Grouping_Operator/S11.1.6_A3_T3.js @@ -0,0 +1,27 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S11.1.6_A3_T3; +* @section: 11.1.6; +* @assertion: "This" operator only evaluates Expression; +* @description: Applying grouping operator to String; +*/ + +//Check for String + +//CHECK#1 +if (("1") !== "1") { + $ERROR('#1: ("1") === "1". Actual: ' + (("1"))); +} + +//CHECK#2 +if (("x") !== "x") { + $ERROR('#2: ("x") === "x". Actual: ' + (("x"))); +} + +//CHECK#3 +var x = new Number("1"); +if ((x) !== x) { + $ERROR('#3: var x = new Number("1"); (x) === x. Actual: ' + ((x))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.6_The_Grouping_Operator/S11.1.6_A3_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.6_The_Grouping_Operator/S11.1.6_A3_T4.js new file mode 100644 index 000000000..0387ed371 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.6_The_Grouping_Operator/S11.1.6_A3_T4.js @@ -0,0 +1,26 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S11.1.6_A3_T4; +* @section: 11.1.6; +* @assertion: "This" operator only evaluates Expression; +* @description: Applying grouping operator to undefined; +*/ + +//Check for undefined and null + +//CHECK#1 +if ((undefined) !== undefined) { + $ERROR('#1: (undefined) === undefined. Actual: ' + ((undefined))); +} + +//CHECK#2 +if ((void 0) !== void 0) { + $ERROR('#2: (void 0) === void 0. Actual: ' + ((void 0))); +} + +//CHECK#2 +if ((null) !== null) { + $ERROR('#2: (null) === null. Actual: ' + ((null))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.6_The_Grouping_Operator/S11.1.6_A3_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.6_The_Grouping_Operator/S11.1.6_A3_T5.js new file mode 100644 index 000000000..473673bf5 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.6_The_Grouping_Operator/S11.1.6_A3_T5.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S11.1.6_A3_T5; +* @section: 11.1.6; +* @assertion: "This" operator only evaluates Expression; +* @description: Using grouping operator in declaration of variables; +*/ + +//CHECK#1 +(x) = 1; +if (x !== 1) { + $ERROR('#1: (x) = 1; x === 1. Actual: ' + (x)); +} + +//CHECK#2 +var y = 1; (y)++; ++(y); (y)--; --(y); +if (y !== 1) { + $ERROR('#2: var y = 1; (y)++; ++(y); (y)--; --(y); y === 1. Actual: ' + (y)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.6_The_Grouping_Operator/S11.1.6_A3_T6.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.6_The_Grouping_Operator/S11.1.6_A3_T6.js new file mode 100644 index 000000000..3fa268af8 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.6_The_Grouping_Operator/S11.1.6_A3_T6.js @@ -0,0 +1,19 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S11.1.6_A3_T6; +* @section: 11.1.6; +* @assertion: "This" operator only evaluates Expression; +* @description: Applying grouping operator to delete and typeof operators; +*/ + +//CHECK#1 +if (delete (x) !== true) { + $ERROR('#1: delete (x) === true'); +} + +//CHECK#2 +if (typeof (x) !== "undefined") { + $ERROR('#2: typeof (x) === "undefined". Actual: ' + (typeof (x))); +} |