[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

barraclough at apple.com barraclough at apple.com
Wed Dec 22 12:55:02 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 8a85c512c654d9f72c9f927f79ffc93db32a5fe6
Author: barraclough at apple.com <barraclough at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Sep 1 20:16:41 2010 +0000

    JavaScriptCore: Ecma-262 15.11.1.1 states that if the argument is undefined then an
    Error object's message property should be set to the empty string.
    
    Rubber stamped by Oliver Hunt.
    
    * runtime/ErrorInstance.cpp:
    (JSC::ErrorInstance::ErrorInstance):
    (JSC::ErrorInstance::create):
    * runtime/ErrorInstance.h:
    * runtime/ErrorPrototype.cpp:
    (JSC::ErrorPrototype::ErrorPrototype):
    
    LayoutTests: Fix three tests in fast/js/kde are failing; fix them.
    
    Rubber stamped by Oliver Hunt.
    
    exceptions.js:
        This is failing because it redefines the method 'should be'.
        Rename the test's version of this method.
    
    RegExp.js:
        This tests erroneously expects a failed match to update the
        cached results on the RegExp object; these are only updated
        on a successful match.
    
    evil-n.js:
        This test erroneously expects the message property of a newly
        constructed Error with no arguments to be undefined; the ECMA
        262-5 spec requires this to be "". Two sputnik tests contain
        the same error (the sputnik tests is actually testing 262-3
        compatibility, which is not what we're interested in).
    
    * fast/js/kde/RegExp-expected.txt:
    * fast/js/kde/evil-n-expected.txt:
    * fast/js/kde/exceptions-expected.txt:
    * fast/js/kde/script-tests/RegExp.js:
    * fast/js/kde/script-tests/evil-n.js:
    * fast/js/kde/script-tests/exceptions.js:
    (kdeShouldBe):
    (testThrow):
    (testThrow2):
    (testReferenceError):
    (testFunctionError):
    (testMathFunctionError):
    (testWhileAbortion):
    * fast/js/sputnik/Conformance/15_Native_Objects/15.11_Error/15.11.1/S15.11.1.1_A1_T1.html:
    * fast/js/sputnik/Conformance/15_Native_Objects/15.11_Error/15.11.2/S15.11.2.1_A1_T1.html:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66616 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index cda0664..5dab16d 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,17 @@
+2010-09-01  Gavin Barraclough  <barraclough at apple.com>
+
+        Rubber stamped by Oliver Hunt.
+
+        Ecma-262 15.11.1.1 states that if the argument is undefined then an
+        Error object's message property should be set to the empty string.
+
+        * runtime/ErrorInstance.cpp:
+        (JSC::ErrorInstance::ErrorInstance):
+        (JSC::ErrorInstance::create):
+        * runtime/ErrorInstance.h:
+        * runtime/ErrorPrototype.cpp:
+        (JSC::ErrorPrototype::ErrorPrototype):
+
 2010-08-31  Darin Adler  <darin at apple.com>
 
         Reviewed by Anders Carlsson.
diff --git a/JavaScriptCore/runtime/ErrorInstance.cpp b/JavaScriptCore/runtime/ErrorInstance.cpp
index be6d0fb..740e20e 100644
--- a/JavaScriptCore/runtime/ErrorInstance.cpp
+++ b/JavaScriptCore/runtime/ErrorInstance.cpp
@@ -25,9 +25,10 @@ namespace JSC {
 
 const ClassInfo ErrorInstance::info = { "Error", 0, 0, 0 };
 
-ErrorInstance::ErrorInstance(NonNullPassRefPtr<Structure> structure)
+ErrorInstance::ErrorInstance(JSGlobalData* globalData, NonNullPassRefPtr<Structure> structure)
     : JSObject(structure)
 {
+    putDirect(globalData->propertyNames->message, jsString(globalData, ""));
 }
 
 ErrorInstance::ErrorInstance(JSGlobalData* globalData, NonNullPassRefPtr<Structure> structure, const UString& message)
@@ -44,7 +45,7 @@ ErrorInstance* ErrorInstance::create(JSGlobalData* globalData, NonNullPassRefPtr
 ErrorInstance* ErrorInstance::create(ExecState* exec, NonNullPassRefPtr<Structure> structure, JSValue message)
 {
     if (message.isUndefined())
-        return new (exec) ErrorInstance(structure);
+        return new (exec) ErrorInstance(&exec->globalData(), structure);
     return new (exec) ErrorInstance(&exec->globalData(), structure, message.toString(exec));
 }
 
diff --git a/JavaScriptCore/runtime/ErrorInstance.h b/JavaScriptCore/runtime/ErrorInstance.h
index 35edcb0..a49cc3c 100644
--- a/JavaScriptCore/runtime/ErrorInstance.h
+++ b/JavaScriptCore/runtime/ErrorInstance.h
@@ -35,7 +35,7 @@ namespace JSC {
         static ErrorInstance* create(ExecState* exec, NonNullPassRefPtr<Structure>, JSValue message);
 
     protected:
-        explicit ErrorInstance(NonNullPassRefPtr<Structure>);
+        explicit ErrorInstance(JSGlobalData*, NonNullPassRefPtr<Structure>);
         explicit ErrorInstance(JSGlobalData*, NonNullPassRefPtr<Structure>, const UString&);
     };
 
diff --git a/JavaScriptCore/runtime/ErrorPrototype.cpp b/JavaScriptCore/runtime/ErrorPrototype.cpp
index 0e14a30..d18e7d8 100644
--- a/JavaScriptCore/runtime/ErrorPrototype.cpp
+++ b/JavaScriptCore/runtime/ErrorPrototype.cpp
@@ -36,7 +36,7 @@ static EncodedJSValue JSC_HOST_CALL errorProtoFuncToString(ExecState*);
 
 // ECMA 15.9.4
 ErrorPrototype::ErrorPrototype(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, Structure* prototypeFunctionStructure)
-    : ErrorInstance(&exec->globalData(), structure, "Unknown error")
+    : ErrorInstance(&exec->globalData(), structure)
 {
     // The constructor will be added later in ErrorConstructor's constructor
 
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index a19b062..c298538 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,41 @@
+2010-09-01  Gavin Barraclough  <barraclough at apple.com>
+
+        Rubber stamped by Oliver Hunt.
+
+        Fix three tests in fast/js/kde are failing; fix them.
+
+        exceptions.js:
+            This is failing because it redefines the method 'should be'.
+            Rename the test's version of this method.
+
+        RegExp.js:
+            This tests erroneously expects a failed match to update the
+            cached results on the RegExp object; these are only updated
+            on a successful match.
+
+        evil-n.js:
+            This test erroneously expects the message property of a newly
+            constructed Error with no arguments to be undefined; the ECMA
+            262-5 spec requires this to be "". Two sputnik tests contain
+            the same error (the sputnik tests is actually testing 262-3
+            compatibility, which is not what we're interested in).
+
+        * fast/js/kde/RegExp-expected.txt:
+        * fast/js/kde/evil-n-expected.txt:
+        * fast/js/kde/exceptions-expected.txt:
+        * fast/js/kde/script-tests/RegExp.js:
+        * fast/js/kde/script-tests/evil-n.js:
+        * fast/js/kde/script-tests/exceptions.js:
+        (kdeShouldBe):
+        (testThrow):
+        (testThrow2):
+        (testReferenceError):
+        (testFunctionError):
+        (testMathFunctionError):
+        (testWhileAbortion):
+        * fast/js/sputnik/Conformance/15_Native_Objects/15.11_Error/15.11.1/S15.11.1.1_A1_T1.html:
+        * fast/js/sputnik/Conformance/15_Native_Objects/15.11_Error/15.11.2/S15.11.2.1_A1_T1.html:
+
 2010-09-01  Rob Buis  <rwlbuis at gmail.com>
 
         Reviewed by Darin Adler.
diff --git a/LayoutTests/fast/js/kde/RegExp-expected.txt b/LayoutTests/fast/js/kde/RegExp-expected.txt
index c625155..171ddd1 100644
--- a/LayoutTests/fast/js/kde/RegExp-expected.txt
+++ b/LayoutTests/fast/js/kde/RegExp-expected.txt
@@ -48,10 +48,10 @@ PASS RegExp.$3 is '200'
 PASS RegExp.$5 is '150'
 PASS RegExp.$7 is '15'
 PASS ''.match(/((\d+)(px)* (\d+)(px)* (\d+)(px)* (\d+)(px)*)/) is null
-FAIL RegExp.$1 should be . Was 100.
-FAIL RegExp.$3 should be . Was 200.
-FAIL RegExp.$5 should be . Was 150.
-FAIL RegExp.$7 should be . Was 15.
+PASS RegExp.$1 is '100'
+PASS RegExp.$3 is '200'
+PASS RegExp.$5 is '150'
+PASS RegExp.$7 is '15'
 PASS 'faure at kde.org'.match(invalidChars) == null is true
 PASS 'faure-kde at kde.org'.match(invalidChars) == null is false
 PASS 'test1test2'.replace('test','X') is 'X1test2'
diff --git a/LayoutTests/fast/js/kde/evil-n-expected.txt b/LayoutTests/fast/js/kde/evil-n-expected.txt
index 9b55691..46d54e0 100644
--- a/LayoutTests/fast/js/kde/evil-n-expected.txt
+++ b/LayoutTests/fast/js/kde/evil-n-expected.txt
@@ -3,9 +3,9 @@ KDE JS Test
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-FAIL (new Error()).message should be undefined. Was Unknown error
+PASS (new Error()).message is ''
 PASS ''.split(/.*/).length is 0
-FAIL window.successfullyParsed should be undefined. Was true
+PASS window.successfullyParsed is undefined.
 
 TEST COMPLETE
 
diff --git a/LayoutTests/fast/js/kde/exceptions-expected.txt b/LayoutTests/fast/js/kde/exceptions-expected.txt
index e13dc31..38b2c20 100644
--- a/LayoutTests/fast/js/kde/exceptions-expected.txt
+++ b/LayoutTests/fast/js/kde/exceptions-expected.txt
@@ -4,15 +4,15 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 
 
 Except a lot of errors. They should all be caught and lead to PASS
-testing throw() .......... PASS
-testing throw() .......... PASS
-ReferenceError .......... PASS
-error propagation in functions .......... PASS
+testing throw() .......... Passed
+testing throw() .......... Passed
+ReferenceError .......... Passed
+error propagation in functions .......... Passed
 catch
 finally
-Math() error .......... PASS
-Abort while() on error .......... PASS
-undefined .......... FAIL
+Math() error .......... Passed
+Abort while() on error .......... Passed
+PASS successfullyParsed is true
 
 TEST COMPLETE
 
diff --git a/LayoutTests/fast/js/kde/script-tests/RegExp.js b/LayoutTests/fast/js/kde/script-tests/RegExp.js
index fbab840..997b503 100644
--- a/LayoutTests/fast/js/kde/script-tests/RegExp.js
+++ b/LayoutTests/fast/js/kde/script-tests/RegExp.js
@@ -66,10 +66,11 @@ shouldBe("RegExp.$3","'200'");
 shouldBe("RegExp.$5","'150'");
 shouldBe("RegExp.$7","'15'");
 shouldBe("''.match(/\((\\d+)(px)* (\\d+)(px)* (\\d+)(px)* (\\d+)(px)*\)/)","null");
-shouldBe("RegExp.$1","''");
-shouldBe("RegExp.$3","''");
-shouldBe("RegExp.$5","''");
-shouldBe("RegExp.$7","''");
+// After a failed match, cached results on the RegExp object are unchanged.
+shouldBe("RegExp.$1","'100'");
+shouldBe("RegExp.$3","'200'");
+shouldBe("RegExp.$5","'150'");
+shouldBe("RegExp.$7","'15'");
 
 var invalidChars = /[^@\.\w]/g; // #47092
 shouldBe("'faure at kde.org'.match(invalidChars) == null", "true");
diff --git a/LayoutTests/fast/js/kde/script-tests/evil-n.js b/LayoutTests/fast/js/kde/script-tests/evil-n.js
index 9ab931b..b756d7d 100644
--- a/LayoutTests/fast/js/kde/script-tests/evil-n.js
+++ b/LayoutTests/fast/js/kde/script-tests/evil-n.js
@@ -1,6 +1,4 @@
-shouldBeUndefined("(new Error()).message");
+shouldBe("(new Error()).message", "''");
 
 // the empty match isn't taken in account
 shouldBe("''.split(/.*/).length", "0");
-
-successfullyParsed = true
diff --git a/LayoutTests/fast/js/kde/script-tests/exceptions.js b/LayoutTests/fast/js/kde/script-tests/exceptions.js
index d685747..0aabe87 100644
--- a/LayoutTests/fast/js/kde/script-tests/exceptions.js
+++ b/LayoutTests/fast/js/kde/script-tests/exceptions.js
@@ -1,9 +1,9 @@
-function shouldBe(a, b, c)
+function kdeShouldBe(a, b, c)
 {
   if ( a == b )
-   debug(c+" .......... PASS");
+   debug(c+" .......... Passed");
   else
-   debug(c+" .......... FAIL");
+   debug(c+" .......... Failed");
 }
 
 function testThrow()
@@ -14,7 +14,7 @@ function testThrow()
   } catch (e) {
     caught = true;
   }
-  shouldBe(caught, true, "testing throw()");
+  kdeShouldBe(caught, true, "testing throw()");
 }
 
 // same as above but lacking a semicolon after throw
@@ -26,7 +26,7 @@ function testThrow2()
   } catch (e) {
     caught = true;
   }
-  shouldBe(caught, true, "testing throw()");
+  kdeShouldBe(caught, true, "testing throw()");
 }
 
 function testReferenceError()
@@ -40,7 +40,7 @@ function testReferenceError()
     err = e.name;
   }
   // test err
-  shouldBe(caught, true, "ReferenceError");
+  kdeShouldBe(caught, true, "ReferenceError");
 }
 
 function testFunctionErrorHelper()
@@ -56,7 +56,7 @@ function testFunctionError()
   } catch (e) {
     caught = true;
   }
-  shouldBe(caught, true, "error propagation in functions");
+  kdeShouldBe(caught, true, "error propagation in functions");
 }
 
 function testMathFunctionError()
@@ -70,7 +70,7 @@ function testMathFunctionError()
   } finally {
     debug("finally");
   }
-  shouldBe(caught, true, "Math() error");
+  kdeShouldBe(caught, true, "Math() error");
 }
 
 function testWhileAbortion()
@@ -91,7 +91,7 @@ function testWhileAbortion()
   } catch (e) {
     caught++;
   }
-  shouldBe(caught, 2, "Abort while() on error");
+  kdeShouldBe(caught, 2, "Abort while() on error");
 }
 
 debug("Except a lot of errors. They should all be caught and lead to PASS");
diff --git a/LayoutTests/fast/js/sputnik/Conformance/15_Native_Objects/15.11_Error/15.11.1/S15.11.1.1_A1_T1.html b/LayoutTests/fast/js/sputnik/Conformance/15_Native_Objects/15.11_Error/15.11.1/S15.11.1.1_A1_T1.html
index 6413201..07103b5 100644
--- a/LayoutTests/fast/js/sputnik/Conformance/15_Native_Objects/15.11_Error/15.11.1/S15.11.1.1_A1_T1.html
+++ b/LayoutTests/fast/js/sputnik/Conformance/15_Native_Objects/15.11_Error/15.11.1/S15.11.1.1_A1_T1.html
@@ -99,8 +99,8 @@ if(err2.message!=="msg2"){
 //////////////////////////////////////////////////////////////////////////////
 //CHECK#3
 var err3=otherScope();
-if(err3.hasOwnProperty('message')){
-  testFailed('#3: function otherScope(msg){return Error(msg);} var err3=otherScope(); err3.hasOwnProperty("message"). Actual: '+err3.message);
+if(err3.message !== ""){
+  testFailed('#3: function otherScope(msg){return Error(msg);} var err3=otherScope(); err3.message === "". Actual: '+err3.message);
 }
 //
 //////////////////////////////////////////////////////////////////////////////
diff --git a/LayoutTests/fast/js/sputnik/Conformance/15_Native_Objects/15.11_Error/15.11.2/S15.11.2.1_A1_T1.html b/LayoutTests/fast/js/sputnik/Conformance/15_Native_Objects/15.11_Error/15.11.2/S15.11.2.1_A1_T1.html
index a0ff2c1..d75d565 100644
--- a/LayoutTests/fast/js/sputnik/Conformance/15_Native_Objects/15.11_Error/15.11.2/S15.11.2.1_A1_T1.html
+++ b/LayoutTests/fast/js/sputnik/Conformance/15_Native_Objects/15.11_Error/15.11.2/S15.11.2.1_A1_T1.html
@@ -99,8 +99,8 @@ if(err2.message!=="msg2"){
 //////////////////////////////////////////////////////////////////////////////
 //CHECK#3
 var err3=otherScope();
-if(err3.hasOwnProperty('message')){
-  testFailed('#3: function otherScope(msg){return new Error(msg);} var err3=otherScope(); err3.hasOwnProperty("message"). Actual: '+err3.message);
+if(err3.message !== ""){
+  testFailed('#3: function otherScope(msg){return new Error(msg);} var err3=otherScope(); err3.message === "". Actual: '+err3.message);
 }
 //
 //////////////////////////////////////////////////////////////////////////////

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list