aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDavid Fugate <dfugate@microsoft.com>2012-01-16 11:17:05 -0800
committerDavid Fugate <dfugate@microsoft.com>2012-01-16 11:17:05 -0800
commita180d5f37193a8630f4edcb20e019c96405666c3 (patch)
tree44c04818aeb4d6974d2011f2e6ff85b5b22b67cd /test
parent9e00383b5fedc7417ac22b488e82c2d516951867 (diff)
https://bugs.ecmascript.org/show_bug.cgi?id=61 is fixed.
Diffstat (limited to 'test')
-rw-r--r--test/config/excludelist.xml7
-rw-r--r--test/suite/ch15/15.5/15.5.4/15.5.4.14/S15.5.4.14_A1_T3.js81
-rw-r--r--test/suite/ch15/15.5/15.5.4/15.5.4.14/S15.5.4.14_A1_T6.js16
-rw-r--r--test/suite/ch15/15.5/15.5.4/15.5.4.14/S15.5.4.14_A1_T7.js18
-rw-r--r--test/suite/ch15/15.5/15.5.4/15.5.4.14/S15.5.4.14_A1_T8.js18
-rw-r--r--test/suite/ch15/15.5/15.5.4/15.5.4.14/S15.5.4.14_A1_T9.js18
-rw-r--r--test/suite/ch15/15.5/15.5.4/15.5.4.14/S15.5.4.14_A2_T7.js8
7 files changed, 63 insertions, 103 deletions
diff --git a/test/config/excludelist.xml b/test/config/excludelist.xml
index 10eb937aa..f00ede4de 100644
--- a/test/config/excludelist.xml
+++ b/test/config/excludelist.xml
@@ -32,12 +32,5 @@
<test id="S15.3_A3_T1">Uses this.</test>
<test id="S15.3_A3_T3">Uses this.</test>
-
- <test id="S15.5.4.14_A1_T6">https://bugs.ecmascript.org/show_bug.cgi?id=61</test>
- <test id="S15.5.4.14_A1_T7">https://bugs.ecmascript.org/show_bug.cgi?id=61</test>
- <test id="S15.5.4.14_A2_T7">https://bugs.ecmascript.org/show_bug.cgi?id=61</test>
- <test id="S15.5.4.14_A1_T8">https://bugs.ecmascript.org/show_bug.cgi?id=61</test>
- <test id="S15.5.4.14_A1_T9">https://bugs.ecmascript.org/show_bug.cgi?id=61</test>
- <test id="S15.5.4.14_A1_T3">https://bugs.ecmascript.org/show_bug.cgi?id=61</test>
</excludeList>
diff --git a/test/suite/ch15/15.5/15.5.4/15.5.4.14/S15.5.4.14_A1_T3.js b/test/suite/ch15/15.5/15.5.4/15.5.4.14/S15.5.4.14_A1_T3.js
index a2fc8db36..715a562cd 100644
--- a/test/suite/ch15/15.5/15.5.4/15.5.4.14/S15.5.4.14_A1_T3.js
+++ b/test/suite/ch15/15.5/15.5.4/15.5.4.14/S15.5.4.14_A1_T3.js
@@ -12,47 +12,50 @@
* @description Checking by using eval
*/
-var split = String.prototype.split;
+var split = String.prototype.split.bind(this);
var __obj__lim = {valueOf:function(){return 5;}};
-if (typeof toString === "undefined"){
+try {
toString = Object.prototype.toString;
+} catch(e) { ; }
+
+//Checks are only valid if we can overwrite the global object's toString method
+//(which ES5 doesn't even require to exist)
+if (toString===Object.prototype.toString) {
+ var __class__ = toString();
+
+ var __split = split(eval("\"[\""),__obj__lim);
+
+ //////////////////////////////////////////////////////////////////////////////
+ //CHECK#1
+ if (typeof __split !== "object") {
+ $ERROR('#1: typeof __split === "object". Actual: '+typeof __split );
+ }
+ //
+ //////////////////////////////////////////////////////////////////////////////
+
+ //////////////////////////////////////////////////////////////////////////////
+ //CHECK#2
+ if (__split.constructor !== Array) {
+ $ERROR('#2: __split.constructor === Array. Actual: '+__split.constructor );
+ }
+ //
+ //////////////////////////////////////////////////////////////////////////////
+
+ //////////////////////////////////////////////////////////////////////////////
+ //CHECK#3
+ if (__split.length !== 2) {
+ $ERROR('#3: __split.length === 2. Actual: '+__split.length );
+ }
+ //
+ //////////////////////////////////////////////////////////////////////////////
+
+ //////////////////////////////////////////////////////////////////////////////
+ //CHECK#3
+ if (__split[1].substring(0,6) !== "object") {
+ $ERROR('#4: __split[1].substring(0,6) === "object". Actual: '+__split[1].substring(0,6) );
+ }
+ //
+ //////////////////////////////////////////////////////////////////////////////
}
-
-var __class__ = toString();
-
-var __split = split(eval("\"[\""),__obj__lim);
-
-//////////////////////////////////////////////////////////////////////////////
-//CHECK#1
-if (typeof __split !== "object") {
- $ERROR('#1: typeof __split === "object". Actual: '+typeof __split );
-}
-//
-//////////////////////////////////////////////////////////////////////////////
-
-//////////////////////////////////////////////////////////////////////////////
-//CHECK#2
-if (__split.constructor !== Array) {
- $ERROR('#2: __split.constructor === Array. Actual: '+__split.constructor );
-}
-//
-//////////////////////////////////////////////////////////////////////////////
-
-//////////////////////////////////////////////////////////////////////////////
-//CHECK#3
-if (__split.length !== 2) {
- $ERROR('#3: __split.length === 2. Actual: '+__split.length );
-}
-//
-//////////////////////////////////////////////////////////////////////////////
-
-//////////////////////////////////////////////////////////////////////////////
-//CHECK#3
-if (__split[1].substring(0,6) !== "object") {
- $ERROR('#4: __split[1].substring(0,6) === "object". Actual: '+__split[1].substring(0,6) );
-}
-//
-//////////////////////////////////////////////////////////////////////////////
-
diff --git a/test/suite/ch15/15.5/15.5.4/15.5.4.14/S15.5.4.14_A1_T6.js b/test/suite/ch15/15.5/15.5.4/15.5.4.14/S15.5.4.14_A1_T6.js
index 6fc4e3736..7d3fcceb0 100644
--- a/test/suite/ch15/15.5/15.5.4/15.5.4.14/S15.5.4.14_A1_T6.js
+++ b/test/suite/ch15/15.5/15.5.4/15.5.4.14/S15.5.4.14_A1_T6.js
@@ -33,24 +33,16 @@ if (__split.constructor !== Array) {
//////////////////////////////////////////////////////////////////////////////
//CHECK#3
-if (__split.length !== 2) {
- $ERROR('#3: var x; __split = new String("1undefined").split(x); __split.length === 2. Actual: '+__split.length );
+if (__split.length !== 1) {
+ $ERROR('#3: var x; __split = new String("1undefined").split(x); __split.length === 1. Actual: '+__split.length );
}
//
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//CHECK#4
-if (__split[0] !== "1") {
- $ERROR('#4: var x; __split = new String("1undefined").split(x); __split[0] === "1". Actual: '+__split[0] );
-}
-//
-//////////////////////////////////////////////////////////////////////////////
-
-//////////////////////////////////////////////////////////////////////////////
-//CHECK#5
-if (__split[1] !== "") {
- $ERROR('#5: var x; __split = new String("1undefined").split(x); __split[1] === "". Actual: '+__split[1] );
+if (__split[0] !== "1undefined") {
+ $ERROR('#4: var x; __split = new String("1undefined").split(x); __split[0] === "1undefined". Actual: '+__split[0] );
}
//
//////////////////////////////////////////////////////////////////////////////
diff --git a/test/suite/ch15/15.5/15.5.4/15.5.4.14/S15.5.4.14_A1_T7.js b/test/suite/ch15/15.5/15.5.4/15.5.4.14/S15.5.4.14_A1_T7.js
index 6c31b83a4..bf48c7656 100644
--- a/test/suite/ch15/15.5/15.5.4/15.5.4.14/S15.5.4.14_A1_T7.js
+++ b/test/suite/ch15/15.5/15.5.4/15.5.4.14/S15.5.4.14_A1_T7.js
@@ -12,7 +12,6 @@
* @description Argument is undefined, and instance is String
*/
-//since ToString(undefined) evaluates to "undefined" split(undefined) evaluates to split("undefined",0)
var __split = String("undefinedd").split(undefined);
//////////////////////////////////////////////////////////////////////////////
@@ -33,25 +32,16 @@ if (__split.constructor !== Array) {
//////////////////////////////////////////////////////////////////////////////
//CHECK#3
-if (__split.length !== 2) {
- $ERROR('#3: __split = String("undefinedd").split(undefined); __split.length === 2. Actual: '+__split.length );
+if (__split.length !== 1) {
+ $ERROR('#3: __split = String("undefinedd").split(undefined); __split.length === 1. Actual: '+__split.length );
}
//
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//CHECK#4
-if (__split[0] !== "") {
- $ERROR('#4: __split = String("undefinedd").split(undefined); __split[0] === "". Actual: '+__split[0] );
+if (__split[0] !== "undefinedd") {
+ $ERROR('#4: __split = String("undefinedd").split(undefined); __split[0] === "undefinedd". Actual: '+__split[0] );
}
//
//////////////////////////////////////////////////////////////////////////////
-
-//////////////////////////////////////////////////////////////////////////////
-//CHECK#5
-if (__split[1] !== "d") {
- $ERROR('#5: __split = String("undefinedd").split(undefined); __split[1] === "d". Actual: '+__split[1] );
-}
-//
-//////////////////////////////////////////////////////////////////////////////
-
diff --git a/test/suite/ch15/15.5/15.5.4/15.5.4.14/S15.5.4.14_A1_T8.js b/test/suite/ch15/15.5/15.5.4/15.5.4.14/S15.5.4.14_A1_T8.js
index de8f71717..2feaba65b 100644
--- a/test/suite/ch15/15.5/15.5.4/15.5.4.14/S15.5.4.14_A1_T8.js
+++ b/test/suite/ch15/15.5/15.5.4/15.5.4.14/S15.5.4.14_A1_T8.js
@@ -14,7 +14,6 @@
var __obj = {toString:function(){}};
-//since ToString(void 0) evaluates to "undefined" split(void 0) evaluates to split("undefined")
var __split = String(__obj).split(void 0);
//////////////////////////////////////////////////////////////////////////////
@@ -35,25 +34,16 @@ if (__split.constructor !== Array) {
//////////////////////////////////////////////////////////////////////////////
//CHECK#3
-if (__split.length !== 2) {
- $ERROR('#3: __obj = {toString:function(){}}; __split = String(__obj).split(void 0); __split.length === 2. Actual: '+__split.length );
+if (__split.length !== 1) {
+ $ERROR('#3: __obj = {toString:function(){}}; __split = String(__obj).split(void 0); __split.length === 1. Actual: '+__split.length );
}
//
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//CHECK#4
-if (__split[0] !== "") {
- $ERROR('#4: __obj = {toString:function(){}}; __split = String(__obj).split(void 0); __split[0] !== "". Actual: '+__split[0]);
+if (__split[0] !== "undefined") {
+ $ERROR('#4: __obj = {toString:function(){}}; __split = String(__obj).split(void 0); __split[0] !== "undefined". Actual: '+__split[0]);
}
//
//////////////////////////////////////////////////////////////////////////////
-
-//////////////////////////////////////////////////////////////////////////////
-//CHECK#5
-if (__split[1] !== "") {
- $ERROR('#5: __obj = {toString:function(){}}; __split = String(__obj).split(void 0); __split[1] === "". Actual: '+__split[1] );
-}
-//
-//////////////////////////////////////////////////////////////////////////////
-
diff --git a/test/suite/ch15/15.5/15.5.4/15.5.4.14/S15.5.4.14_A1_T9.js b/test/suite/ch15/15.5/15.5.4/15.5.4.14/S15.5.4.14_A1_T9.js
index e1a28ff83..b50272419 100644
--- a/test/suite/ch15/15.5/15.5.4/15.5.4.14/S15.5.4.14_A1_T9.js
+++ b/test/suite/ch15/15.5/15.5.4/15.5.4.14/S15.5.4.14_A1_T9.js
@@ -17,7 +17,7 @@ var __obj = {
toString:void 0
};
-//since ToString(undefined) evaluates to "undefined" split(undefined) evaluates to split("undefined")
+//since ToString(undefined) evaluates to "undefined"
var __split = new String(__obj).split(function(){}());
//////////////////////////////////////////////////////////////////////////////
@@ -38,24 +38,16 @@ if (__split.constructor !== Array) {
//////////////////////////////////////////////////////////////////////////////
//CHECK#3
-if (__split.length !== 2) {
- $ERROR('#3: __obj = {valueOf:function(){}, toString:void 0}; __split = new String(__obj).split(function(){}()); __split.length === 2. Actual: '+__split.length );
+if (__split.length !== 1) {
+ $ERROR('#3: __obj = {valueOf:function(){}, toString:void 0}; __split = new String(__obj).split(function(){}()); __split.length === 1. Actual: '+__split.length );
}
//
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//CHECK#4
-if (__split[0] !== "") {
- $ERROR('#4: __obj = {valueOf:function(){}, toString:void 0}; __split = new String(__obj).split(function(){}()); __split[0] !== "". Actual: '+__split[0]);
-}
-//
-//////////////////////////////////////////////////////////////////////////////
-
-//////////////////////////////////////////////////////////////////////////////
-//CHECK#5
-if (__split[1] !== "") {
- $ERROR('#5: __obj = {valueOf:function(){}, toString:void 0}; __split = new String(__obj).split(function(){}()); __split[1] === "". Actual: '+__split[1] );
+if (__split[0] !== "undefined") {
+ $ERROR('#4: __obj = {valueOf:function(){}, toString:void 0}; __split = new String(__obj).split(function(){}()); __split[0] !== "undefined". Actual: '+__split[0]);
}
//
//////////////////////////////////////////////////////////////////////////////
diff --git a/test/suite/ch15/15.5/15.5.4/15.5.4.14/S15.5.4.14_A2_T7.js b/test/suite/ch15/15.5/15.5.4/15.5.4.14/S15.5.4.14_A2_T7.js
index cf20b6f5e..45b645767 100644
--- a/test/suite/ch15/15.5/15.5.4/15.5.4.14/S15.5.4.14_A2_T7.js
+++ b/test/suite/ch15/15.5/15.5.4/15.5.4.14/S15.5.4.14_A2_T7.js
@@ -12,14 +12,14 @@
*/
var __string = "thisundefinedisundefinedaundefinedstringundefinedobject";
-var __expected = ["this", "is", "a", "string", "object"];
+var __expected = [__string];
var __split = __string.split(void 0);
//////////////////////////////////////////////////////////////////////////////
//CHECK#1
if (__split.constructor !== Array) {
- $ERROR('#1: var __string = "thisundefinedisundefinedaundefinedstringundefinedobject"; var __expected = ["this", "is", "a", "string", "object"]; __split = __string.split(void 0); __split.constructor === Array. Actual: '+__split.constructor );
+ $ERROR('#1: var __string = "thisundefinedisundefinedaundefinedstringundefinedobject"; var __expected = ["thisundefinedisundefinedaundefinedstringundefinedobject"]; __split = __string.split(void 0); __split.constructor === Array. Actual: '+__split.constructor );
}
//
//////////////////////////////////////////////////////////////////////////////
@@ -27,7 +27,7 @@ if (__split.constructor !== Array) {
//////////////////////////////////////////////////////////////////////////////
//CHECK#2
if (__split.length !== __expected.length) {
- $ERROR('#2: var __string = "thisundefinedisundefinedaundefinedstringundefinedobject"; var __expected = ["this", "is", "a", "string", "object"]; __split = __string.split(void 0); __split.length === __expected.length. Actual: '+__split.length );
+ $ERROR('#2: var __string = "thisundefinedisundefinedaundefinedstringundefinedobject"; var __expected = ["thisundefinedisundefinedaundefinedstringundefinedobject"]; __split = __string.split(void 0); __split.length === __expected.length. Actual: '+__split.length );
}
//
//////////////////////////////////////////////////////////////////////////////
@@ -36,7 +36,7 @@ if (__split.length !== __expected.length) {
//CHECK#3
for ( var i = 0; i < __expected.length; i++ ) {
if (__expected[i]!==__split[i]) {
- $ERROR('#3.'+i+': var __string = "thisundefinedisundefinedaundefinedstringundefinedobject"; var __expected = ["this", "is", "a", "string", "object"]; __split = __string.split(void 0); __expected['+i+']==='+__split[i]+'. Actual: '+__expected[i]);
+ $ERROR('#3.'+i+': var __string = "thisundefinedisundefinedaundefinedstringundefinedobject"; var __expected = ["thisundefinedisundefinedaundefinedstringundefinedobject"]; __split = __string.split(void 0); __expected['+i+']==='+__split[i]+'. Actual: '+__expected[i]);
}
}
//