diff options
author | David Fugate <dfugate@microsoft.com> | 2011-06-27 16:20:31 -0700 |
---|---|---|
committer | David Fugate <dfugate@microsoft.com> | 2011-06-27 16:20:31 -0700 |
commit | ed70f1a7a646d5fee7df05544fe21d635f55fd2f (patch) | |
tree | db6531a69d243b27116394e99bca7c6bc04f01b7 /test/suite/sputnik/Conformance/15_Native/15.4_Array_Objects | |
parent | d4a997996545ba4b7da90d5547b86ccc44d377d0 (diff) | |
download | test262-ed70f1a7a646d5fee7df05544fe21d635f55fd2f.tar.gz |
Ported Sputnik changes over from the 'external' directory to 'test/suite/sputnik'. Still need to convert
the tests over to test262 format.
Diffstat (limited to 'test/suite/sputnik/Conformance/15_Native/15.4_Array_Objects')
4 files changed, 64 insertions, 17 deletions
diff --git a/test/suite/sputnik/Conformance/15_Native/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/test/suite/sputnik/Conformance/15_Native/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/test/suite/sputnik/Conformance/15_Native/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/test/suite/sputnik/Conformance/15_Native/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/test/suite/sputnik/Conformance/15_Native/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/test/suite/sputnik/Conformance/15_Native/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/test/suite/sputnik/Conformance/15_Native/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/test/suite/sputnik/Conformance/15_Native/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/test/suite/sputnik/Conformance/15_Native/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/test/suite/sputnik/Conformance/15_Native/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/S15.4.4_A1.1_T2.js b/test/suite/sputnik/Conformance/15_Native/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/S15.4.4_A1.1_T2.js index 259509ecd..e038e553d 100644 --- a/test/suite/sputnik/Conformance/15_Native/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/S15.4.4_A1.1_T2.js +++ b/test/suite/sputnik/Conformance/15_Native/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/S15.4.4_A1.1_T2.js @@ -1,17 +1,15 @@ -// Copyright 2009 the Sputnik authors. All rights reserved.
-// This code is governed by the BSD license found in the LICENSE file.
-
-/**
- * @name: S15.4.4_A1.1_T2;
- * @section: 15.4.4, 11.4.1;
- * @assertion: The value of the internal [[Prototype]] property of
- * the Array prototype object is the Object prototype object;
- * @description: delete Array.prototype.toString;
- * @strict_mode_negative
-*/
-
-//CHECK#1
-delete Array.prototype.toString;
-if (Array.prototype.toString() !== "[object " + "Array" + "]") {
- $ERROR('#1: delete Array.prototype.toString; var Array.prototype = Object(); Array.prototype.toString() === "[object " + "Array" + "]". Actual: ' + (Array.prototype.toString()));
-}
+// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4_A1.1_T2; + * @section: 15.4.4; + * @assertion:The Array prototype object is itself an array; its +* [[Class]] is "Array", +*/ + +//CHECK#1 +if (Object.prototype.toString.call(Array.prototype) !== "[object Array]") { + $ERROR('The Array prototype object is itself an array; its' + + '[[Class]] is "Array".'); +} |