aboutsummaryrefslogtreecommitdiffstats
path: root/external
diff options
context:
space:
mode:
authorMark Miller <erights@gmail.com>2011-06-27 08:58:09 -0600
committerMark Miller <erights@gmail.com>2011-06-27 08:58:09 -0600
commita7e6453c0e374f5d2075d6c4e52203845d34225a (patch)
tree7b39626100521a47b83e3a28bd218ae46177e277 /external
parenta23061829155a73e9d782c9fdc8f0f32144fa0b6 (diff)
Adding new files from sputniktests r97
Diffstat (limited to 'external')
-rw-r--r--external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A12.js18
-rw-r--r--external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.12_The_JSON_Object/15.12.2_JSON.parse/S15.12.2_A1.js19
-rw-r--r--external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.2_Object_Objects/15.2.4_Properties_of_the_Object_Prototype_Object/15.2.4.4_Object.prototype.valueOf/S15.2.4.4_A14.js12
-rw-r--r--external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.2_Function.prototype.toString/S15.3.4.2_A12.js13
-rw-r--r--external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.2_Function.prototype.toString/S15.3.4.2_A13.js13
-rw-r--r--external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.2_Function.prototype.toString/S15.3.4.2_A14.js13
-rw-r--r--external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.2_Function.prototype.toString/S15.3.4.2_A15.js16
-rw-r--r--external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.2_Function.prototype.toString/S15.3.4.2_A16.js18
-rw-r--r--external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A13.js11
-rw-r--r--external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A14.js11
-rw-r--r--external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A15.js11
-rw-r--r--external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A16.js27
-rw-r--r--external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.4_Function.prototype.call/S15.3.4.4_A13.js11
-rw-r--r--external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.4_Function.prototype.call/S15.3.4.4_A14.js11
-rw-r--r--external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.4_Function.prototype.call/S15.3.4.4_A15.js11
-rw-r--r--external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.4_Function.prototype.call/S15.3.4.4_A16.js27
-rw-r--r--external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.5_Function.prototype.bind/S15.3.4.5_A1.js15
-rw-r--r--external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.5_Function.prototype.bind/S15.3.4.5_A13.js12
-rw-r--r--external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.5_Function.prototype.bind/S15.3.4.5_A14.js12
-rw-r--r--external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.5_Function.prototype.bind/S15.3.4.5_A15.js12
-rw-r--r--external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.5_Function.prototype.bind/S15.3.4.5_A16.js27
-rw-r--r--external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.5_Function.prototype.bind/S15.3.4.5_A2.js16
-rw-r--r--external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A8.js24
-rw-r--r--external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.18_Array_prototype_forEach/S15.4.4.18_A1.js11
-rw-r--r--external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.18_Array_prototype_forEach/S15.4.4.18_A2.js14
-rw-r--r--external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.11_String.prototype.replace/S15.5.4.11_A12.js23
26 files changed, 408 insertions, 0 deletions
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A12.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A12.js
new file mode 100644
index 000000000..111aedb39
--- /dev/null
+++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.10_RegExp_Objects/15.10.6_Properties_of_the_RegExp_Prototype_Object/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A12.js
@@ -0,0 +1,18 @@
+// Copyright 2011 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+* @name: S15.10.6.2_A12;
+* @section: 15.10.6.2;
+* @assertion: regExp exec() acts like regExp.exec('undefined') (step 2);
+* @description: Checking RegExp.prototype.exec.length;
+*/
+
+(/foo/).test('xfoox');
+var match = new RegExp('(.|\r|\n)*','').exec()[0];
+if (match === 'xfoox') {
+ $FAIL('#1: regExp.exec() leaks match globally');
+}
+if (match !== 'undefined') {
+ $FAIL('#2: regExp.exec() must coerce absent first arg to "undefined"');
+}
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.12_The_JSON_Object/15.12.2_JSON.parse/S15.12.2_A1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.12_The_JSON_Object/15.12.2_JSON.parse/S15.12.2_A1.js
new file mode 100644
index 000000000..a7b140810
--- /dev/null
+++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.12_The_JSON_Object/15.12.2_JSON.parse/S15.12.2_A1.js
@@ -0,0 +1,19 @@
+// Copyright 2011 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * @name: S15.12.2_A1;
+ * @section: 15.12.2;
+ * @assertion: JSON.parse must create a property with the given
+ * property name;
+ * @description: Tests that JSON.parse treats "__proto__" as a regular
+ * property name;
+ */
+
+var x = JSON.parse('{"__proto__":[]}');
+if (Object.getPrototypeOf(x) !== Object.prototype) {
+ $FAIL('#1: JSON.parse confused by "__proto__"');
+}
+if (!Array.isArray(x.__proto__)) {
+ $FAIL('#2: JSON.parse did not set "__proto__" as a regular property');
+}
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.2_Object_Objects/15.2.4_Properties_of_the_Object_Prototype_Object/15.2.4.4_Object.prototype.valueOf/S15.2.4.4_A14.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.2_Object_Objects/15.2.4_Properties_of_the_Object_Prototype_Object/15.2.4.4_Object.prototype.valueOf/S15.2.4.4_A14.js
new file mode 100644
index 000000000..268ae9e87
--- /dev/null
+++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.2_Object_Objects/15.2.4_Properties_of_the_Object_Prototype_Object/15.2.4.4_Object.prototype.valueOf/S15.2.4.4_A14.js
@@ -0,0 +1,12 @@
+// Copyright 2011 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+* @name: S15.2.4.4_A14;
+* @section: 15.2.4.4;
+* @assertion: Let O be the result of calling ToObject passing the this
+* value as the argument.
+* @negative
+*/
+
+(1,Object.prototype.valueOf)();
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.2_Function.prototype.toString/S15.3.4.2_A12.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.2_Function.prototype.toString/S15.3.4.2_A12.js
new file mode 100644
index 000000000..6c26bd6a8
--- /dev/null
+++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.2_Function.prototype.toString/S15.3.4.2_A12.js
@@ -0,0 +1,13 @@
+// Copyright 2011 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+* @name: S15.3.4.2_A12;
+* @section: 15.3.4.2;
+* @assertion: The Function.prototype.toString function is not generic;
+* it throws a TypeError exception if its this value is not
+* a Function object.
+* @negative TypeError;
+*/
+
+Function.prototype.toString.call(undefined);
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.2_Function.prototype.toString/S15.3.4.2_A13.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.2_Function.prototype.toString/S15.3.4.2_A13.js
new file mode 100644
index 000000000..32a391302
--- /dev/null
+++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.2_Function.prototype.toString/S15.3.4.2_A13.js
@@ -0,0 +1,13 @@
+// Copyright 2011 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+* @name: S15.3.4.2_A13;
+* @section: 15.3.4.2;
+* @assertion: The toString function is not generic; it throws a
+* TypeError exception if its this value is not a Function
+* object.
+* @negative TypeError;
+*/
+
+Function.prototype.toString.call(null);
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.2_Function.prototype.toString/S15.3.4.2_A14.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.2_Function.prototype.toString/S15.3.4.2_A14.js
new file mode 100644
index 000000000..8ff48e6de
--- /dev/null
+++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.2_Function.prototype.toString/S15.3.4.2_A14.js
@@ -0,0 +1,13 @@
+// Copyright 2011 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+* @name: S15.3.4.2_A14;
+* @section: 15.3.4.2;
+* @assertion: The toString function is not generic; it throws a
+* TypeError exception if its this value is not a Function
+* object.
+* @negative TypeError;
+*/
+
+Function.prototype.toString.call({});
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.2_Function.prototype.toString/S15.3.4.2_A15.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.2_Function.prototype.toString/S15.3.4.2_A15.js
new file mode 100644
index 000000000..4dbd35928
--- /dev/null
+++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.2_Function.prototype.toString/S15.3.4.2_A15.js
@@ -0,0 +1,16 @@
+// Copyright 2011 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+* @name: S15.3.4.2_A15;
+* @section: 15.3.4.2;
+* @assertion: The toString function is not generic; it throws a
+* TypeError exception if its this value is not a Function
+* object.
+* @description: Whether or not they are callable, RegExp objects are
+* not Function objects, so toString should throw a
+* TypeError.
+* @negative TypeError;
+*/
+
+Function.prototype.toString.call(/x/);
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.2_Function.prototype.toString/S15.3.4.2_A16.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.2_Function.prototype.toString/S15.3.4.2_A16.js
new file mode 100644
index 000000000..6a51b0cee
--- /dev/null
+++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.2_Function.prototype.toString/S15.3.4.2_A16.js
@@ -0,0 +1,18 @@
+// Copyright 2011 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+* @name: S15.3.4.2_A16;
+* @section: 15.3.4.2;
+* @assertion: The toString function is not generic; it throws a
+* TypeError exception if its this value is not a Function
+* object.
+* @description: The String constructor, given an object, should invoke
+* that object's toString method as a method, i.e., with
+* its this value bound to that object.
+* @negative TypeError;
+*/
+
+var obj = {toString: Function.prototype.toString};
+
+String(obj);
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A13.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A13.js
new file mode 100644
index 000000000..01196f9a0
--- /dev/null
+++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A13.js
@@ -0,0 +1,11 @@
+// Copyright 2011 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+* @name: S15.3.4.3_A13;
+* @section: 15.3.4.3;
+* @assertion: If IsCallable(func) is false, then throw a TypeError exception.
+* @negative TypeError;
+*/
+
+Function.prototype.apply.call(undefined, {}, []);
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A14.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A14.js
new file mode 100644
index 000000000..c756e4c41
--- /dev/null
+++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A14.js
@@ -0,0 +1,11 @@
+// Copyright 2011 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+* @name: S15.3.4.3_A14;
+* @section: 15.3.4.3;
+* @assertion: If IsCallable(func) is false, then throw a TypeError exception.
+* @negative TypeError;
+*/
+
+Function.prototype.apply.call(null, {}, []);
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A15.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A15.js
new file mode 100644
index 000000000..339d44689
--- /dev/null
+++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A15.js
@@ -0,0 +1,11 @@
+// Copyright 2011 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+* @name: S15.3.4.3_A15;
+* @section: 15.3.4.3;
+* @assertion: If IsCallable(func) is false, then throw a TypeError exception.
+* @negative TypeError;
+*/
+
+Function.prototype.apply.call({}, {}, []);
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A16.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A16.js
new file mode 100644
index 000000000..08425ed70
--- /dev/null
+++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.3_Function.prototype.apply/S15.3.4.3_A16.js
@@ -0,0 +1,27 @@
+// Copyright 2011 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+* @name: S15.3.4.3_A16;
+* @section: 15.3.4.3;
+* @assertion: If IsCallable(func) is false, then throw a TypeError exception.
+* @description: A RegExp is not a function, but it may be
+* callable. Iff it is, it's typeof should be 'function',
+* in which case apply should accept it as a valid this
+* value.
+*/
+
+var re = (/x/);
+if (typeof re === 'function') {
+ Function.prototype.apply.call(re, undefined, ['x']);
+} else {
+ try {
+ Function.prototype.bind.call(re, undefined);
+ $FAIL('#1: If IsCallable(func) is false, ' +
+ 'then (bind should) throw a TypeError exception');
+ } catch (e) {
+ if (!(e instanceof TypeError)) {
+ $ERROR('#1: TypeError expected. Actual: ' + e);
+ }
+ }
+}
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.4_Function.prototype.call/S15.3.4.4_A13.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.4_Function.prototype.call/S15.3.4.4_A13.js
new file mode 100644
index 000000000..6dcf1f960
--- /dev/null
+++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.4_Function.prototype.call/S15.3.4.4_A13.js
@@ -0,0 +1,11 @@
+// Copyright 2011 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+* @name: S15.3.4.4_A13;
+* @section: 15.3.4.4;
+* @assertion: If IsCallable(func) is false, then throw a TypeError exception.
+* @negative TypeError;
+*/
+
+Function.prototype.call.call(undefined, {});
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.4_Function.prototype.call/S15.3.4.4_A14.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.4_Function.prototype.call/S15.3.4.4_A14.js
new file mode 100644
index 000000000..88a8ae002
--- /dev/null
+++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.4_Function.prototype.call/S15.3.4.4_A14.js
@@ -0,0 +1,11 @@
+// Copyright 2011 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+* @name: S15.3.4.4_A14;
+* @section: 15.3.4.4;
+* @assertion: If IsCallable(func) is false, then throw a TypeError exception.
+* @negative TypeError;
+*/
+
+Function.prototype.call.call(null, {});
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.4_Function.prototype.call/S15.3.4.4_A15.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.4_Function.prototype.call/S15.3.4.4_A15.js
new file mode 100644
index 000000000..d337793eb
--- /dev/null
+++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.4_Function.prototype.call/S15.3.4.4_A15.js
@@ -0,0 +1,11 @@
+// Copyright 2011 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+* @name: S15.3.4.4_A15;
+* @section: 15.3.4.4;
+* @assertion: If IsCallable(func) is false, then throw a TypeError exception.
+* @negative TypeError;
+*/
+
+Function.prototype.call.call({}, {});
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.4_Function.prototype.call/S15.3.4.4_A16.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.4_Function.prototype.call/S15.3.4.4_A16.js
new file mode 100644
index 000000000..2333f4ec4
--- /dev/null
+++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.4_Function.prototype.call/S15.3.4.4_A16.js
@@ -0,0 +1,27 @@
+// Copyright 2011 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+* @name: S15.3.4.4_A16;
+* @section: 15.3.4.4;
+* @assertion: If IsCallable(func) is false, then throw a TypeError exception.
+* @description: A RegExp is not a function, but it may be
+* callable. Iff it is, it's typeof should be 'function',
+* in which case call should accept it as a valid this
+* value.
+*/
+
+var re = (/x/);
+if (typeof re === 'function') {
+ Function.prototype.call.call(re, undefined, 'x');
+} else {
+ try {
+ Function.prototype.bind.call(re, undefined);
+ $FAIL('#1: If IsCallable(func) is false, ' +
+ 'then (bind should) throw a TypeError exception');
+ } catch (e) {
+ if (!(e instanceof TypeError)) {
+ $ERROR('#1: TypeError expected. Actual: ' + e);
+ }
+ }
+}
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.5_Function.prototype.bind/S15.3.4.5_A1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.5_Function.prototype.bind/S15.3.4.5_A1.js
new file mode 100644
index 000000000..c58334ba2
--- /dev/null
+++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.5_Function.prototype.bind/S15.3.4.5_A1.js
@@ -0,0 +1,15 @@
+// Copyright 2011 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+* @name: S15.3.4.5_A1;
+* @section: 15.3.4.5;
+* @assertion: "caller" of bound function is poisoned (step 20);
+* @description A bound function should fail to find its "caller";
+* @negative TypeError;
+*/
+
+function foo() { return bar.caller; }
+var bar = foo.bind({});
+function baz() { return bar(); }
+baz();
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.5_Function.prototype.bind/S15.3.4.5_A13.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.5_Function.prototype.bind/S15.3.4.5_A13.js
new file mode 100644
index 000000000..9b677d8cd
--- /dev/null
+++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.5_Function.prototype.bind/S15.3.4.5_A13.js
@@ -0,0 +1,12 @@
+// Copyright 2011 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+* @name: S15.3.4.5_A13;
+* @section: 15.3.4.5;
+* @assertion: If IsCallable(func) is false, then throw a TypeError exception.
+* @negative TypeError;
+*/
+
+Function.prototype.bind.call(undefined, {});
+
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.5_Function.prototype.bind/S15.3.4.5_A14.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.5_Function.prototype.bind/S15.3.4.5_A14.js
new file mode 100644
index 000000000..f3b209f24
--- /dev/null
+++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.5_Function.prototype.bind/S15.3.4.5_A14.js
@@ -0,0 +1,12 @@
+// Copyright 2011 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+* @name: S15.3.4.5_A14;
+* @section: 15.3.4.5;
+* @assertion: If IsCallable(func) is false, then throw a TypeError exception.
+* @negative TypeError;
+*/
+
+Function.prototype.bind.call(null, {});
+
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.5_Function.prototype.bind/S15.3.4.5_A15.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.5_Function.prototype.bind/S15.3.4.5_A15.js
new file mode 100644
index 000000000..281983a64
--- /dev/null
+++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.5_Function.prototype.bind/S15.3.4.5_A15.js
@@ -0,0 +1,12 @@
+// Copyright 2011 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+* @name: S15.3.4.5_A15;
+* @section: 15.3.4.5;
+* @assertion: If IsCallable(func) is false, then throw a TypeError exception.
+* @negative TypeError;
+*/
+
+Function.prototype.bind.call({}, {});
+
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.5_Function.prototype.bind/S15.3.4.5_A16.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.5_Function.prototype.bind/S15.3.4.5_A16.js
new file mode 100644
index 000000000..c0d57b81a
--- /dev/null
+++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.5_Function.prototype.bind/S15.3.4.5_A16.js
@@ -0,0 +1,27 @@
+// Copyright 2011 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+* @name: S15.3.4.5_A16;
+* @section: 15.3.4.5;
+* @assertion: If IsCallable(func) is false, then throw a TypeError exception.
+* @description: A RegExp is not a function, but it may be
+* callable. Iff it is, it's typeof should be 'function',
+* in which case bind should accept it as a valid this
+* value.
+*/
+
+var re = (/x/);
+if (typeof re === 'function') {
+ Function.prototype.bind.call(re, undefined);
+} else {
+ try {
+ Function.prototype.bind.call(re, undefined);
+ $FAIL('#1: If IsCallable(func) is false, ' +
+ 'then (bind should) throw a TypeError exception');
+ } catch (e) {
+ if (!(e instanceof TypeError)) {
+ $ERROR('#1: TypeError expected. Actual: ' + e);
+ }
+ }
+}
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.5_Function.prototype.bind/S15.3.4.5_A2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.5_Function.prototype.bind/S15.3.4.5_A2.js
new file mode 100644
index 000000000..08e3489a5
--- /dev/null
+++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.3_Function_Objects/15.3.4_Properties_of_the_Function_Prototype_Object/15.3.4.5_Function.prototype.bind/S15.3.4.5_A2.js
@@ -0,0 +1,16 @@
+// Copyright 2011 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+* @name: S15.3.4.5_A1;
+* @section: 15.3.4.5;
+* @assertion: "arguments" of bound function is poisoned (step 21);
+* @description a bound function should fail to find the bound function
+* "arguments";
+* @negative TypeError;
+*/
+
+function foo() { return bar.arguments; }
+var bar = foo.bind({});
+function baz() { return bar(); }
+baz();
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A8.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A8.js
new file mode 100644
index 000000000..b32842a7b
--- /dev/null
+++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A8.js
@@ -0,0 +1,24 @@
+// Copyright 2011 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+* @name: S15.4.4.11_A8;
+* @section: 15.4.4.11;
+* @assertion: Call the comparefn passing undefined as the this value
+* (step 13b);
+* @description: comparefn tests that its this value is undefined;
+*/
+
+var global = this;
+[2,3].sort(function(x,y) {
+ "use strict";
+
+ if (this === global) {
+ $FAIL('#1: Sort leaks global');
+ }
+ if (this !== undefined) {
+ $FAIL('#2: Sort comparefn should be called with this===undefined. ' +
+ 'Actual: ' + this);
+ }
+ return x - y;
+});
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.18_Array_prototype_forEach/S15.4.4.18_A1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.18_Array_prototype_forEach/S15.4.4.18_A1.js
new file mode 100644
index 000000000..8497a0cdc
--- /dev/null
+++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.18_Array_prototype_forEach/S15.4.4.18_A1.js
@@ -0,0 +1,11 @@
+// Copyright 2011 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * @name: S15.4.4.18_A1;
+ * @section: 15.4.4.18;
+ * @assertion: array.forEach can be frozen while in progress
+ * @description: Freezes array.forEach during a forEach to see if it works
+*/
+
+['z'].forEach(function(){ Object.freeze(Array.prototype.forEach); });
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.18_Array_prototype_forEach/S15.4.4.18_A2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.18_Array_prototype_forEach/S15.4.4.18_A2.js
new file mode 100644
index 000000000..e22dc1fbf
--- /dev/null
+++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.18_Array_prototype_forEach/S15.4.4.18_A2.js
@@ -0,0 +1,14 @@
+// Copyright 2011 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * @name: S15.4.4.18_A2;
+ * @section: 15.4.4.18;
+ * @assertion: array.forEach can be frozen while in progress
+ * @description: Freezes array.forEach during a forEach to see if it works
+*/
+
+function foo() {
+ ['z'].forEach(function(){ Object.freeze(Array.prototype.forEach); });
+}
+foo();
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.11_String.prototype.replace/S15.5.4.11_A12.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.11_String.prototype.replace/S15.5.4.11_A12.js
new file mode 100644
index 000000000..bfc32db70
--- /dev/null
+++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.11_String.prototype.replace/S15.5.4.11_A12.js
@@ -0,0 +1,23 @@
+// Copyright 2011 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+* @name: S15.5.4.11_A12;
+* @section: 15.5.4.11;
+* @assertion: Call replaceValue passing undefined as the this value;
+* @description: replaceValue tests that its this value is undefined;
+*/
+
+var global = this;
+'x'.replace(/x/, function() {
+ "use strict";
+
+ if (this === global) {
+ $FAIL('#1: String replace leaks global');
+ }
+ if (this !== undefined) {
+ $FAIL('#2: replaceValue should be called with this===undefined. ' +
+ 'Actual: ' + this);
+ }
+ return 'y';
+});