From 284837daa07b29d6a63a748544a90b1f5842ac5c Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 10 Sep 2012 19:10:20 +0200 Subject: Imported WebKit commit 68645295d2e3e09af2c942f092556f06aa5f8b0d (http://svn.webkit.org/repository/webkit/trunk@128073) New snapshot --- Source/JavaScriptCore/tests/mozilla/expected.html | 262 ++++++++++++--------- .../tests/mozilla/js1_2/function/tostring-1.js | 29 ++- .../tests/mozilla/js1_2/function/tostring-2.js | 57 +++-- 3 files changed, 199 insertions(+), 149 deletions(-) (limited to 'Source/JavaScriptCore/tests') diff --git a/Source/JavaScriptCore/tests/mozilla/expected.html b/Source/JavaScriptCore/tests/mozilla/expected.html index 2283f77b5..06136de27 100644 --- a/Source/JavaScriptCore/tests/mozilla/expected.html +++ b/Source/JavaScriptCore/tests/mozilla/expected.html @@ -7,11 +7,11 @@

Test List: All tests
Skip List: ecma/Date/15.9.2.1.js, ecma/Date/15.9.2.2-1.js, ecma/Date/15.9.2.2-2.js, ecma/Date/15.9.2.2-3.js, ecma/Date/15.9.2.2-4.js, ecma/Date/15.9.2.2-5.js, ecma/Date/15.9.2.2-6.js, ecma_3/Date/15.9.5.7.js, ecma/Date/15.9.5.14.js, ecma/Date/15.9.5.31-1.js, ecma/Date/15.9.5.34-1.js
-1124 test(s) selected, 1116 test(s) completed, 46 failures reported (4.12% failed)
-Engine command line: "/Volumes/Big/ggaren/webkit/WebKitBuild/Debug/jsc"
-OS type: Darwin garen.apple.com 11.3.0 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64 x86_64
-Testcase execution time: 1 minutes, 8 seconds.
-Tests completed on Tue Apr 3 22:31:56 2012.

+1124 test(s) selected, 1116 test(s) completed, 44 failures reported (3.94% failed)
+Engine command line: "/Volumes/Data/Saxony/OpenSource/WebKitBuild/Debug/jsc"
+OS type: Darwin Bearclaw-Kaliber.local 12.0.0 Darwin Kernel Version 12.0.0: Sun Jun 24 23:00:16 PDT 2012; root:xnu-2050.7.9~1/RELEASE_X86_64 x86_64
+Testcase execution time: 52 seconds.
+Tests completed on Thu Sep 6 15:11:19 2012.

[ Failure Details | Retest List | Test Selection Page ]


@@ -29,6 +29,8 @@ Testcase terminated with signal 0
Complete testcase output was:
RegExp/hex-001.js JS regexp anchoring on empty match bug
BUGNUMBER: http://bugzilla.mozilla.org/show_bug.cgi?id=2157
+Exception: TypeError: '/a||b/' is not a function (evaluating '/a||b/('')')
+global code@./ecma_2/RegExp/regress-001.js:18

Testcase ecma_3/FunExpr/fe-001.js failed
[ Previous Failure | Next Failure | Top of Page ]
@@ -43,7 +45,10 @@ FAILED!: [reported from test()]
Expected exit code 0, got 3
Testcase terminated with signal 0
Complete testcase output was:
-Testcase produced no output!

+Exception: SyntaxError: Unexpected token '('
+eval@[native code]
+global code@./ecma_3/Statements/regress-194364.js:56
+
Testcase ecma_3/Unicode/uc-001.js failed Bug Number 23610
[ Previous Failure | Next Failure | Top of Page ]
STATUS: Unicode format-control character (Category Cf) test.
@@ -58,6 +63,9 @@ FAILED!: [reported from test()]
Testcase terminated with signal 0
Complete testcase output was:
JS1_2 Object.toString()
+Exception: TypeError: '/^\{(.*)\}$/' is not a function (evaluating '/^\{(.*)\}$/(s)')
+checkObjectToString@./js1_2/Objects/toString-001.js:103
+global code@./js1_2/Objects/toString-001.js:64

Testcase js1_2/function/Function_object.js failed
[ Previous Failure | Next Failure | Top of Page ]
@@ -80,69 +88,53 @@ eval("function f(){}function g(){}") = undefined FAILED! expected: error
Testcase terminated with signal 0
Complete testcase output was:
JS_1.2 The variable statment
+Exception: TypeError: '/abc/' is not a function (evaluating 'x("hi")')
+global code@./js1_2/function/regexparg-1.js:80

-
Testcase js1_2/function/tostring-1.js failed
+
Testcase js1_2/operator/equality.js failed
[ Previous Failure | Next Failure | Top of Page ]

Failure messages were:
-} FAILED! expected:
-} FAILED! expected:
-} FAILED! expected:
-} FAILED! expected:
-} FAILED! expected:
-

-
Testcase js1_2/function/tostring-2.js failed
- [ Previous Failure | Next Failure | Top of Page ]
-
-Failure messages were:
-} FAILED! expected:
-} FAILED! expected:
-} FAILED! expected:
-} FAILED! expected:
-} FAILED! expected:
-} FAILED! expected:
-} FAILED! expected:
-} FAILED! expected:
-} FAILED! expected:
-

-
Testcase js1_2/operator/equality.js failed
- [ Previous Failure | Next Failure | Top of Page ]
-
-Failure messages were:
(new String('x') == 'x') = true FAILED! expected: false
('x' == new String('x')) = true FAILED! expected: false

-
Testcase js1_2/regexp/RegExp_lastIndex.js failed
- [ Previous Failure | Next Failure | Top of Page ]
+
Testcase js1_2/regexp/RegExp_lastIndex.js failed
+ [ Previous Failure | Next Failure | Top of Page ]

Failure messages were:
re=/x./g; re.lastIndex=4; re.exec('xyabcdxa') = xa FAILED! expected: ["xa"]
re.exec('xyabcdef') = xy FAILED! expected: ["xy"]

-
Testcase js1_2/regexp/regress-6359.js failed Bug Number http://bugzilla.mozilla.org/show_bug.cgi?id=6359
- [ Previous Failure | Next Failure | Top of Page ]
+
Testcase js1_2/regexp/regress-6359.js failed Bug Number http://bugzilla.mozilla.org/show_bug.cgi?id=6359
+ [ Previous Failure | Next Failure | Top of Page ]
Expected exit code 0, got 3
Testcase terminated with signal 0
Complete testcase output was:
BUGNUMBER: http://bugzilla.mozilla.org/show_bug.cgi?id=6359
+Exception: TypeError: '/(a*)b\1+/' is not a function (evaluating '/(a*)b\1+/("baaac")')
+global code@./js1_2/regexp/regress-6359.js:56

-
Testcase js1_2/regexp/regress-9141.js failed Bug Number http://bugzilla.mozilla.org/show_bug.cgi?id=9141
- [ Previous Failure | Next Failure | Top of Page ]
+
Testcase js1_2/regexp/regress-9141.js failed Bug Number http://bugzilla.mozilla.org/show_bug.cgi?id=9141
+ [ Previous Failure | Next Failure | Top of Page ]
Expected exit code 0, got 3
Testcase terminated with signal 0
Complete testcase output was:
BUGNUMBER: http://bugzilla.mozilla.org/show_bug.cgi?id=9141
+Exception: TypeError: '/(?:xx|x)*/' is not a function (evaluating '/(?:xx|x)*/(s)')
+global code@./js1_2/regexp/regress-9141.js:73

-
Testcase js1_2/regexp/simple_form.js failed
- [ Previous Failure | Next Failure | Top of Page ]
+
Testcase js1_2/regexp/simple_form.js failed
+ [ Previous Failure | Next Failure | Top of Page ]
Expected exit code 0, got 3
Testcase terminated with signal 0
Complete testcase output was:
Executing script: simple_form.js
As described in Netscape doc "Whats new in JavaScript 1.2" RegExp: simple form
+Exception: TypeError: '/[0-9]{3}/' is not a function (evaluating '/[0-9]{3}/('23 2 34 678 9 09')')
+global code@./js1_2/regexp/simple_form.js:43

-
Testcase js1_2/regexp/string_split.js failed
- [ Previous Failure | Next Failure | Top of Page ]
+
Testcase js1_2/regexp/string_split.js failed
+ [ Previous Failure | Next Failure | Top of Page ]

Failure messages were:
'abc'.split(/[a-z]/) = ,,, FAILED! expected: ,,
@@ -150,22 +142,22 @@ Failure messages were:
'abc'.split(new RegExp('[a-z]')) = ,,, FAILED! expected: ,,
'abc'.split(new RegExp('[a-z]')) = ,,, FAILED! expected: ,,

-
Testcase js1_2/version120/boolean-001.js failed
- [ Previous Failure | Next Failure | Top of Page ]
+
Testcase js1_2/version120/boolean-001.js failed
+ [ Previous Failure | Next Failure | Top of Page ]

Failure messages were:
new Boolean(false) = true FAILED! expected: false

-
Testcase js1_2/version120/regress-99663.js failed
- [ Previous Failure | Next Failure | Top of Page ]
+
Testcase js1_2/version120/regress-99663.js failed
+ [ Previous Failure | Next Failure | Top of Page ]
STATUS: Regression test for Bugzilla bug 99663
Failure messages were:
Section 1 of test - got Error: Can't find variable: it FAILED! expected: a "read-only" error
Section 2 of test - got Error: Can't find variable: it FAILED! expected: a "read-only" error
Section 3 of test - got Error: Can't find variable: it FAILED! expected: a "read-only" error

-
Testcase js1_3/Script/function-001-n.js failed Bug Number 10278
- [ Previous Failure | Next Failure | Top of Page ]
+
Testcase js1_3/Script/function-001-n.js failed Bug Number 10278
+ [ Previous Failure | Next Failure | Top of Page ]
Expected exit code 3, got 0
Testcase terminated with signal 0
Complete testcase output was:
@@ -173,15 +165,17 @@ BUGNUMBER: 10278
function-001.js functions not separated by semicolons are errors in version 120 and higher
eval("function f(){}function g(){}") = undefined FAILED! expected: error

-
Testcase js1_3/Script/script-001.js failed
- [ Previous Failure | Next Failure | Top of Page ]
+
Testcase js1_3/Script/script-001.js failed
+ [ Previous Failure | Next Failure | Top of Page ]
Expected exit code 0, got 3
Testcase terminated with signal 0
Complete testcase output was:
script-001 NativeScript
+Exception: ReferenceError: Can't find variable: Script
+global code@./js1_3/Script/script-001.js:133

-
Testcase js1_3/regress/function-001-n.js failed Bug Number 10278
- [ Previous Failure | Next Failure | Top of Page ]
+
Testcase js1_3/regress/function-001-n.js failed Bug Number 10278
+ [ Previous Failure | Next Failure | Top of Page ]
Expected exit code 3, got 0
Testcase terminated with signal 0
Complete testcase output was:
@@ -189,90 +183,114 @@ BUGNUMBER: 10278
function-001.js functions not separated by semicolons are errors in version 120 and higher
eval("function f(){}function g(){}") = undefined FAILED! expected: error

-
Testcase js1_5/Exceptions/catchguard-001.js failed
+
Testcase js1_5/Exceptions/catchguard-001.js failed
+ [ Previous Failure | Next Failure | Top of Page ]
+Expected exit code 0, got 3
+Testcase terminated with signal 0
+Complete testcase output was:
+Exception: SyntaxError: Expected token ')'
+

+
Testcase js1_5/Exceptions/catchguard-002.js failed
+ [ Previous Failure | Next Failure | Top of Page ]
+Expected exit code 0, got 3
+Testcase terminated with signal 0
+Complete testcase output was:
+Exception: SyntaxError: Expected token ')'
+

+
Testcase js1_5/Exceptions/catchguard-003.js failed
[ Previous Failure | Next Failure | Top of Page ]
Expected exit code 0, got 3
Testcase terminated with signal 0
Complete testcase output was:
-Testcase produced no output!

-
Testcase js1_5/Exceptions/catchguard-002.js failed
+Exception: SyntaxError: Expected token ')'
+
+
Testcase js1_5/Exceptions/errstack-001.js failed
[ Previous Failure | Next Failure | Top of Page ]
Expected exit code 0, got 3
Testcase terminated with signal 0
Complete testcase output was:
-Testcase produced no output!

-
Testcase js1_5/Exceptions/catchguard-003.js failed
+Exception: TypeError: 'undefined' is not an object (evaluating 'stackFrames[4].substring')
+global code@./js1_5/Exceptions/errstack-001.js:122
+
+
Testcase js1_5/Exceptions/regress-50447.js failed Bug Number 50447
[ Previous Failure | Next Failure | Top of Page ]
Expected exit code 0, got 3
Testcase terminated with signal 0
Complete testcase output was:
-Testcase produced no output!

-
Testcase js1_5/Exceptions/errstack-001.js failed
+BUGNUMBER: 50447
+STATUS: Test (non-ECMA) Error object properties fileName, lineNumber
+Exception: TypeError: 'undefined' is not an object (evaluating 'e.fileName.search')
+testRealError@./js1_5/Exceptions/regress-50447.js:65
+test@./js1_5/Exceptions/regress-50447.js:44
+global code@./js1_5/Exceptions/regress-50447.js:34
+
+
Testcase js1_5/GetSet/getset-001.js failed
[ Previous Failure | Next Failure | Top of Page ]
Expected exit code 0, got 3
Testcase terminated with signal 0
Complete testcase output was:
-Testcase produced no output!

-
Testcase js1_5/Exceptions/regress-50447.js failed Bug Number 50447
+Exception: SyntaxError: Expected an identifier but found 'getter' instead
+
+
Testcase js1_5/GetSet/getset-002.js failed
[ Previous Failure | Next Failure | Top of Page ]
Expected exit code 0, got 3
Testcase terminated with signal 0
Complete testcase output was:
-BUGNUMBER: 50447
-STATUS: Test (non-ECMA) Error object properties fileName, lineNumber
+Exception: SyntaxError: Expected an identifier but found 'getter' instead

-
Testcase js1_5/GetSet/getset-001.js failed
+
Testcase js1_5/GetSet/getset-003.js failed
[ Previous Failure | Next Failure | Top of Page ]
Expected exit code 0, got 3
Testcase terminated with signal 0
Complete testcase output was:
-Testcase produced no output!

-
Testcase js1_5/GetSet/getset-002.js failed
+Exception: SyntaxError: Expected an identifier but found 'setter' instead
+
+
Testcase js1_5/Object/regress-90596-001.js failed
[ Previous Failure | Next Failure | Top of Page ]
Expected exit code 0, got 3
Testcase terminated with signal 0
Complete testcase output was:
-Testcase produced no output!

-
Testcase js1_5/GetSet/getset-003.js failed
+Exception: TypeError: 'undefined' is not a function (evaluating 'obj.toSource()')
+global code@./js1_5/Object/regress-90596-001.js:48
+
+
Testcase js1_5/Object/regress-90596-002.js failed
[ Previous Failure | Next Failure | Top of Page ]
Expected exit code 0, got 3
Testcase terminated with signal 0
Complete testcase output was:
-Testcase produced no output!

-
Testcase js1_5/Object/regress-90596-001.js failed
+Exception: ReferenceError: Can't find variable: uneval
+global code@./js1_5/Object/regress-90596-002.js:48
+
+
Testcase js1_5/Object/regress-96284-001.js failed
[ Previous Failure | Next Failure | Top of Page ]
Expected exit code 0, got 3
Testcase terminated with signal 0
Complete testcase output was:
-Testcase produced no output!

-
Testcase js1_5/Object/regress-90596-002.js failed
+Exception: TypeError: 'undefined' is not a function (evaluating 'obj1.toSource()')
+global code@./js1_5/Object/regress-96284-001.js:49
+
+
Testcase js1_5/Object/regress-96284-002.js failed
[ Previous Failure | Next Failure | Top of Page ]
Expected exit code 0, got 3
Testcase terminated with signal 0
Complete testcase output was:
-Testcase produced no output!

-
Testcase js1_5/Object/regress-96284-001.js failed
+Exception: ReferenceError: Can't find variable: uneval
+global code@./js1_5/Object/regress-96284-002.js:49
+
+
Testcase js1_5/Regress/regress-44009.js failed Bug Number 44009
[ Previous Failure | Next Failure | Top of Page ]
Expected exit code 0, got 3
Testcase terminated with signal 0
Complete testcase output was:
-Testcase produced no output!

-
Testcase js1_5/Object/regress-96284-002.js failed
- [ Previous Failure | Next Failure | Top of Page ]
-Expected exit code 0, got 3
-Testcase terminated with signal 0
-Complete testcase output was:
-Testcase produced no output!

-
Testcase js1_5/Regress/regress-44009.js failed Bug Number 44009
- [ Previous Failure | Next Failure | Top of Page ]
-Expected exit code 0, got 3
-Testcase terminated with signal 0
-Complete testcase output was:
BUGNUMBER: 44009
STATUS: Testing that we don't crash on obj.toSource()
+Exception: TypeError: 'undefined' is not a function (evaluating 'obj.toSource()')
+testThis@./js1_5/Regress/regress-44009.js:60
+test@./js1_5/Regress/regress-44009.js:48
+global code@./js1_5/Regress/regress-44009.js:35

-
Testcase js1_5/Regress/regress-103602.js failed Bug Number 103602
- [ Previous Failure | Next Failure | Top of Page ]
+
Testcase js1_5/Regress/regress-103602.js failed Bug Number 103602
+ [ Previous Failure | Next Failure | Top of Page ]
STATUS: Reassignment to a const is NOT an error per ECMA
Failure messages were:
FAILED!: [reported from test()] Section 1 of test -
@@ -282,26 +300,32 @@ FAILED!: [reported from test()] Section 3 of test -
FAILED!: [reported from test()] Expected value '1', Actual value '2'
FAILED!: [reported from test()]

-
Testcase js1_5/Regress/regress-104077.js failed
- [ Previous Failure | Next Failure | Top of Page ]
+
Testcase js1_5/Regress/regress-104077.js failed
+ [ Previous Failure | Next Failure | Top of Page ]
Expected exit code 0, got 3
Testcase terminated with signal 0
Complete testcase output was:
-Testcase produced no output!

-
Testcase js1_5/Regress/regress-127557.js failed
- [ Previous Failure | Next Failure | Top of Page ]
+Exception: SyntaxError: Expected token ')'
+
+
Testcase js1_5/Regress/regress-127557.js failed
+ [ Previous Failure | Next Failure | Top of Page ]
Expected exit code 0, got 3
Testcase terminated with signal 0
Complete testcase output was:
-Testcase produced no output!

-
Testcase js1_5/Regress/regress-172699.js failed
- [ Previous Failure | Next Failure | Top of Page ]
+Exception: ReferenceError: Can't find variable: clone
+global code@./js1_5/Regress/regress-127557.js:75
+
+
Testcase js1_5/Regress/regress-172699.js failed
+ [ Previous Failure | Next Failure | Top of Page ]
Expected exit code 0, got 3
Testcase terminated with signal 0
Complete testcase output was:
-Testcase produced no output!

-
Testcase js1_5/Regress/regress-179524.js failed Bug Number 179524
- [ Previous Failure | Next Failure | Top of Page ]
+Exception: URIError: URI error
+decodeURI@[native code]
+global code@./js1_5/Regress/regress-172699.js:61
+
+
Testcase js1_5/Regress/regress-179524.js failed Bug Number 179524
+ [ Previous Failure | Next Failure | Top of Page ]
STATUS: Don't crash on extraneous arguments to str.match(), etc.
Failure messages were:
FAILED!: [reported from test()] Section 14 of test -
@@ -351,14 +375,16 @@ FAILED!: [reported from test()] Section 36 of test -
FAILED!: [reported from test()] Expected value 'SHOULD HAVE FALLEN INTO CATCH-BLOCK!', Actual value 'ABC Zbc'
FAILED!: [reported from test()]

-
Testcase js1_5/Scope/regress-220584.js failed
- [ Previous Failure | Next Failure | Top of Page ]
+
Testcase js1_5/Scope/regress-220584.js failed
+ [ Previous Failure | Next Failure | Top of Page ]
Expected exit code 0, got 3
Testcase terminated with signal 0
Complete testcase output was:
-Testcase produced no output!

-
Testcase js1_5/Scope/scope-001.js failed Bug Number 53268
- [ Previous Failure | Next Failure | Top of Page ]
+Exception: ReferenceError: Can't find variable: Script
+global code@./js1_5/Scope/regress-220584.js:56
+
+
Testcase js1_5/Scope/scope-001.js failed Bug Number 53268
+ [ Previous Failure | Next Failure | Top of Page ]
STATUS: Testing scope after changing obj.__proto__
Failure messages were:
FAILED!: [reported from test()] Step 1: setting obj.__proto__ = global object
@@ -369,8 +395,8 @@ FAILED!: [reported from test()] Type mismatch, expected type undefined, actual t FAILED!: [reported from test()] Expected value 'undefined', Actual value '1'
FAILED!: [reported from test()]

-
Testcase js1_6/Regress/regress-301574.js failed Bug Number 301574
- [ Previous Failure | Next Failure | Top of Page ]
+
Testcase js1_6/Regress/regress-301574.js failed Bug Number 301574
+ [ Previous Failure | Next Failure | Top of Page ]
STATUS: E4X should be enabled even when e4x=1 not specified
Failure messages were:
FAILED!: E4X should be enabled even when e4x=1 not specified: XML()
@@ -380,26 +406,30 @@ FAILED!: E4X should be enabled even when e4x=1 not specified: XMLList()
FAILED!: Expected value 'No error', Actual value 'error: ReferenceError: Can't find variable: XML'
FAILED!:

-
Testcase js1_6/Regress/regress-309242.js failed
- [ Previous Failure | Next Failure | Top of Page ]
+
Testcase js1_6/Regress/regress-309242.js failed
+ [ Previous Failure | Next Failure | Top of Page ]
Expected exit code 0, got 3
Testcase terminated with signal 0
Complete testcase output was:
-Testcase produced no output!

-
Testcase js1_6/Regress/regress-314887.js failed
- [ Previous Failure | Next Failure | Top of Page ]
+Exception: SyntaxError: Unexpected token '<'
+
+
Testcase js1_6/Regress/regress-314887.js failed
+ [ Previous Failure | Next Failure | Top of Page ]
Expected exit code 0, got 3
Testcase terminated with signal 0
Complete testcase output was:
-Testcase produced no output!

-
Testcase js1_6/String/regress-306591.js failed Bug Number 306591
- [ Previous Failure | Next Failure | Top of Page ]
+Exception: SyntaxError: Unexpected token '<'
+
+
Testcase js1_6/String/regress-306591.js failed Bug Number 306591
+ [ Previous Failure | Next Failure | Top of Page ]
Expected exit code 0, got 3
Testcase terminated with signal 0
Complete testcase output was:
BUGNUMBER: 306591
STATUS: String static methods
STATUS: See https://bugzilla.mozilla.org/show_bug.cgi?id=304828
+Exception: TypeError: 'undefined' is not a function (evaluating 'String.split(new String('abc'), '')')
+global code@./js1_6/String/regress-306591.js:48

[ Top of Page | Top of Failures ]
@@ -407,9 +437,9 @@ STATUS: See https://bugzilla.mozilla.org/show_bug.cgi?id=304828
 
 

Retest List


-# Retest List, squirrelfish, generated Tue Apr 3 22:31:56 2012. +# Retest List, squirrelfish, generated Thu Sep 6 15:11:19 2012. # Original test base was: All tests. -# 1116 of 1124 test(s) were completed, 46 failures reported. +# 1116 of 1124 test(s) were completed, 44 failures reported. ecma_2/Exceptions/function-001.js ecma_2/RegExp/regress-001.js ecma_3/FunExpr/fe-001.js @@ -419,8 +449,6 @@ js1_2/Objects/toString-001.js js1_2/function/Function_object.js js1_2/function/function-001-n.js js1_2/function/regexparg-1.js -js1_2/function/tostring-1.js -js1_2/function/tostring-2.js js1_2/operator/equality.js js1_2/regexp/RegExp_lastIndex.js js1_2/regexp/regress-6359.js diff --git a/Source/JavaScriptCore/tests/mozilla/js1_2/function/tostring-1.js b/Source/JavaScriptCore/tests/mozilla/js1_2/function/tostring-1.js index d532d65af..cf83f48c1 100644 --- a/Source/JavaScriptCore/tests/mozilla/js1_2/function/tostring-1.js +++ b/Source/JavaScriptCore/tests/mozilla/js1_2/function/tostring-1.js @@ -34,6 +34,15 @@ Date: 12 november 1997 */ +// These test cases should not be testing for a particular +// whitespace formatting (this is implementation defined). +// Strip out whitespace, or in the case of whitespace +// abutting a word character reduce to a single space. +function simplify(str) +{ + return str.replace(/\s+/g, " ").replace(/ (\W)/g, "$1").replace(/(\W) /g, "$1").trim(); +} + var SECTION = "tostring-1"; var VERSION = "JS1_2"; startTest(); @@ -60,28 +69,28 @@ testcases[tc++] = new TestCase( SECTION, "stub.toString()", - t1.valueOf(), - stub.toString() ); + simplify(t1.valueOf()), + simplify(stub.toString()) ); testcases[tc++] = new TestCase( SECTION, "ToString.toString()", - t2.valueOf(), - ToString.toString() ); + simplify(t2.valueOf()), + simplify(ToString.toString()) ); testcases[tc++] = new TestCase( SECTION, "Add.toString()", - t3.valueOf(), - Add.toString() ); + simplify(t3.valueOf()), + simplify(Add.toString()) ); testcases[tc++] = new TestCase( SECTION, "noop.toString()", - t4.toString(), - noop.toString() ); + simplify(t4.toString()), + simplify(noop.toString()) ); testcases[tc++] = new TestCase( SECTION, "f.toString()", - t5.toString(), - f.toString() ); + simplify(t5.toString()), + simplify(f.toString()) ); test(); function noop( value ) { diff --git a/Source/JavaScriptCore/tests/mozilla/js1_2/function/tostring-2.js b/Source/JavaScriptCore/tests/mozilla/js1_2/function/tostring-2.js index 146764d2f..8858d194e 100644 --- a/Source/JavaScriptCore/tests/mozilla/js1_2/function/tostring-2.js +++ b/Source/JavaScriptCore/tests/mozilla/js1_2/function/tostring-2.js @@ -37,6 +37,15 @@ Date: 12 november 1997 */ +// These test cases should not be testing for a particular +// whitespace formatting (this is implementation defined). +// Strip out whitespace, or in the case of whitespace +// abutting a word character reduce to a single space. +function simplify(str) +{ + return str.replace(/\s+/g, " ").replace(/ (\W)/g, "$1").replace(/(\W) /g, "$1").trim(); +} + var SECTION = "tostring-2"; var VERSION = "JS1_2"; startTest(); @@ -72,22 +81,26 @@ function ReallyDoesntEqual( a, b ) { return a !== b; } +// Modified to match expected results; JSC won't automatically insert redundant braces into the result. var testor = new TestFunction( "TestOr", "a", tab+"if (a == null || a == void 0) {\n"+ tab +tab+"return 0;\n"+tab+"} else {\n"+tab+tab+"return a;\n"+tab+"}" ); function TestOr( a ) { - if ( a == null || a == void 0 ) + if ( a == null || a == void 0 ) { return 0; - else + } else { return a; + } } +// Modified to match expected results; JSC won't automatically insert redundant braces into the result. var testand = new TestFunction( "TestAnd", "a", tab+"if (a != null && a != void 0) {\n"+ tab+tab+"return a;\n" + tab+ "} else {\n"+tab+tab+"return 0;\n"+tab+"}" ); function TestAnd( a ) { - if ( a != null && a != void 0 ) + if ( a != null && a != void 0 ) { return a; - else + } else { return 0; + } } var or = new TestFunction( "Or", "a, b", tab + "return a | b;" ); @@ -107,48 +120,48 @@ function XOr( a, b ) { testcases[testcases.length] = new TestCase( SECTION, "Equals.toString()", - equals.valueOf(), - Equals.toString() ); + simplify(equals.valueOf()), + simplify(Equals.toString()) ); testcases[testcases.length] = new TestCase( SECTION, "ReallyEquals.toString()", - reallyequals.valueOf(), - ReallyEquals.toString() ); + simplify(reallyequals.valueOf()), + simplify(ReallyEquals.toString()) ); testcases[testcases.length] = new TestCase( SECTION, "DoesntEqual.toString()", - doesntequal.valueOf(), - DoesntEqual.toString() ); + simplify(doesntequal.valueOf()), + simplify(DoesntEqual.toString()) ); testcases[testcases.length] = new TestCase( SECTION, "ReallyDoesntEqual.toString()", - reallydoesntequal.valueOf(), - ReallyDoesntEqual.toString() ); + simplify(reallydoesntequal.valueOf()), + simplify(ReallyDoesntEqual.toString()) ); testcases[testcases.length] = new TestCase( SECTION, "TestOr.toString()", - testor.valueOf(), - TestOr.toString() ); + simplify(testor.valueOf()), + simplify(TestOr.toString()) ); testcases[testcases.length] = new TestCase( SECTION, "TestAnd.toString()", - testand.valueOf(), - TestAnd.toString() ); + simplify(testand.valueOf()), + simplify(TestAnd.toString()) ); testcases[testcases.length] = new TestCase( SECTION, "Or.toString()", - or.valueOf(), - Or.toString() ); + simplify(or.valueOf()), + simplify(Or.toString()) ); testcases[testcases.length] = new TestCase( SECTION, "And.toString()", - and.valueOf(), - And.toString() ); + simplify(and.valueOf()), + simplify(And.toString()) ); testcases[testcases.length] = new TestCase( SECTION, "XOr.toString()", - xor.valueOf(), - XOr.toString() ); + simplify(xor.valueOf()), + simplify(XOr.toString()) ); test(); -- cgit v1.2.1