summaryrefslogtreecommitdiff
path: root/external/contributions/Google/sputnik_conformance_modified/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer
diff options
context:
space:
mode:
Diffstat (limited to 'external/contributions/Google/sputnik_conformance_modified/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer')
-rw-r--r--external/contributions/Google/sputnik_conformance_modified/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A1.1.js31
-rw-r--r--external/contributions/Google/sputnik_conformance_modified/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A1.2.js37
-rw-r--r--external/contributions/Google/sputnik_conformance_modified/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A1.3.js36
-rw-r--r--external/contributions/Google/sputnik_conformance_modified/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A1.4.js36
-rw-r--r--external/contributions/Google/sputnik_conformance_modified/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A2.js93
-rw-r--r--external/contributions/Google/sputnik_conformance_modified/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A3.js26
-rw-r--r--external/contributions/Google/sputnik_conformance_modified/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A4.1.js13
-rw-r--r--external/contributions/Google/sputnik_conformance_modified/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A4.2.js13
-rw-r--r--external/contributions/Google/sputnik_conformance_modified/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A4.3.js33
9 files changed, 318 insertions, 0 deletions
diff --git a/external/contributions/Google/sputnik_conformance_modified/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A1.1.js b/external/contributions/Google/sputnik_conformance_modified/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A1.1.js
new file mode 100644
index 000000000..b234bd1ec
--- /dev/null
+++ b/external/contributions/Google/sputnik_conformance_modified/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/sputnik_conformance_modified/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A1.2.js b/external/contributions/Google/sputnik_conformance_modified/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A1.2.js
new file mode 100644
index 000000000..c32887da6
--- /dev/null
+++ b/external/contributions/Google/sputnik_conformance_modified/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/sputnik_conformance_modified/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A1.3.js b/external/contributions/Google/sputnik_conformance_modified/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A1.3.js
new file mode 100644
index 000000000..8b1d136f7
--- /dev/null
+++ b/external/contributions/Google/sputnik_conformance_modified/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/sputnik_conformance_modified/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A1.4.js b/external/contributions/Google/sputnik_conformance_modified/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A1.4.js
new file mode 100644
index 000000000..634e8111c
--- /dev/null
+++ b/external/contributions/Google/sputnik_conformance_modified/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/sputnik_conformance_modified/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A2.js b/external/contributions/Google/sputnik_conformance_modified/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A2.js
new file mode 100644
index 000000000..c669c7509
--- /dev/null
+++ b/external/contributions/Google/sputnik_conformance_modified/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/sputnik_conformance_modified/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A3.js b/external/contributions/Google/sputnik_conformance_modified/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A3.js
new file mode 100644
index 000000000..cd9d00d1e
--- /dev/null
+++ b/external/contributions/Google/sputnik_conformance_modified/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/sputnik_conformance_modified/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A4.1.js b/external/contributions/Google/sputnik_conformance_modified/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A4.1.js
new file mode 100644
index 000000000..3f5109aa5
--- /dev/null
+++ b/external/contributions/Google/sputnik_conformance_modified/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/sputnik_conformance_modified/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A4.2.js b/external/contributions/Google/sputnik_conformance_modified/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A4.2.js
new file mode 100644
index 000000000..4b0fe13c8
--- /dev/null
+++ b/external/contributions/Google/sputnik_conformance_modified/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/sputnik_conformance_modified/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A4.3.js b/external/contributions/Google/sputnik_conformance_modified/11_Expressions/11.1_Primary_Expressions/11.1.5_Object_Initializer/S11.1.5_A4.3.js
new file mode 100644
index 000000000..b2b71df54
--- /dev/null
+++ b/external/contributions/Google/sputnik_conformance_modified/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');
+}