[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Thu Apr 8 00:21:02 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit bfb61b34906ca5d5c510873e1bb68782041491bf
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Dec 5 01:21:45 2009 +0000

    2009-12-04  Kent Hansen  <kent.hansen at nokia.com>
    
            Reviewed by Darin Adler.
    
            JavaScript delete operator should return false for string properties
            https://bugs.webkit.org/show_bug.cgi?id=32012
    
            * runtime/StringObject.cpp:
            (JSC::StringObject::deleteProperty):
    2009-12-04  Kent Hansen  <kent.hansen at nokia.com>
    
            Reviewed by Darin Adler.
    
            Add test for JavaScript string property deletion
            https://bugs.webkit.org/show_bug.cgi?id=32012
    
            * fast/js/script-tests/string-property-deletion.js: Added.
            * fast/js/string-property-deletion-expected.txt: Added.
            * fast/js/string-property-deletion.html: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51724 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 146709d..295eef3 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,13 @@
+2009-12-04  Kent Hansen  <kent.hansen at nokia.com>
+
+        Reviewed by Darin Adler.
+
+        JavaScript delete operator should return false for string properties
+        https://bugs.webkit.org/show_bug.cgi?id=32012
+
+        * runtime/StringObject.cpp:
+        (JSC::StringObject::deleteProperty):
+
 2009-12-03  Drew Wilson  <atwilson at chromium.org>
 
         Rolled back r51633 because it causes a perf regression in Chromium.
diff --git a/JavaScriptCore/runtime/StringObject.cpp b/JavaScriptCore/runtime/StringObject.cpp
index 9455c36..f23a20d 100644
--- a/JavaScriptCore/runtime/StringObject.cpp
+++ b/JavaScriptCore/runtime/StringObject.cpp
@@ -79,6 +79,10 @@ bool StringObject::deleteProperty(ExecState* exec, const Identifier& propertyNam
 {
     if (propertyName == exec->propertyNames().length)
         return false;
+    bool isStrictUInt32;
+    unsigned i = propertyName.toStrictUInt32(&isStrictUInt32);
+    if (isStrictUInt32 && internalValue()->canGetIndex(i))
+        return false;
     return JSObject::deleteProperty(exec, propertyName);
 }
 
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 55c6326..80a53c4 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2009-12-04  Kent Hansen  <kent.hansen at nokia.com>
+
+        Reviewed by Darin Adler.
+
+        Add test for JavaScript string property deletion
+        https://bugs.webkit.org/show_bug.cgi?id=32012
+
+        * fast/js/script-tests/string-property-deletion.js: Added.
+        * fast/js/string-property-deletion-expected.txt: Added.
+        * fast/js/string-property-deletion.html: Added.
+
 2009-12-04  Yuzo Fujishima  <yuzo at google.com>
 
         Reviewed by Alexey Proskuryakov.
diff --git a/LayoutTests/fast/js/script-tests/string-property-deletion.js b/LayoutTests/fast/js/script-tests/string-property-deletion.js
new file mode 100644
index 0000000..98cecda
--- /dev/null
+++ b/LayoutTests/fast/js/script-tests/string-property-deletion.js
@@ -0,0 +1,19 @@
+description("This page tests deletion of properties on a string object.");
+
+var str = "abc";
+shouldBe('str.length', '3');
+shouldBe('delete str.length', 'false');
+shouldBe('delete str[0]', 'false');
+shouldBe('delete str[1]', 'false');
+shouldBe('delete str[2]', 'false');
+shouldBe('delete str[3]', 'true');
+shouldBe('delete str[-1]', 'true');
+shouldBe('delete str[4294967294]', 'true');
+shouldBe('delete str[4294967295]', 'true');
+shouldBe('delete str[4294967296]', 'true');
+shouldBe('delete str[0.0]', 'false');
+shouldBe('delete str[0.1]', 'true');
+shouldBe('delete str[\'0.0\']', 'true');
+shouldBe('delete str.foo', 'true');
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/js/string-property-deletion-expected.txt b/LayoutTests/fast/js/string-property-deletion-expected.txt
new file mode 100644
index 0000000..995d4f6
--- /dev/null
+++ b/LayoutTests/fast/js/string-property-deletion-expected.txt
@@ -0,0 +1,23 @@
+This page tests deletion of properties on a string object.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS str.length is 3
+PASS delete str.length is false
+PASS delete str[0] is false
+PASS delete str[1] is false
+PASS delete str[2] is false
+PASS delete str[3] is true
+PASS delete str[-1] is true
+PASS delete str[4294967294] is true
+PASS delete str[4294967295] is true
+PASS delete str[4294967296] is true
+PASS delete str[0.0] is false
+PASS delete str[0.1] is true
+PASS delete str['0.0'] is true
+PASS delete str.foo is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/js/string-property-deletion.html b/LayoutTests/fast/js/string-property-deletion.html
new file mode 100644
index 0000000..b57d35c
--- /dev/null
+++ b/LayoutTests/fast/js/string-property-deletion.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="resources/js-test-style.css">
+<script src="resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/string-property-deletion.js"></script>
+<script src="resources/js-test-post.js"></script>
+</body>
+</html>

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list