Title: [120045] trunk
Revision
120045
Author
commit-qu...@webkit.org
Date
2012-06-12 00:08:14 -0700 (Tue, 12 Jun 2012)

Log Message

Property names of the built-in object cannot be retrieved
after trying to delete one of its properties
https://bugs.webkit.org/show_bug.cgi?id=86461

Patch by Hojong Han <hojong....@samsung.com> on 2012-06-12
Reviewed by Gavin Barraclough.

Source/_javascript_Core:

* runtime/JSObject.cpp:
(JSC::getClassPropertyNames):
(JSC::JSObject::getOwnPropertyNames):

LayoutTests:

* fast/js/delete-syntax-expected.txt:
* fast/js/script-tests/delete-syntax.js:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (120044 => 120045)


--- trunk/LayoutTests/ChangeLog	2012-06-12 06:24:48 UTC (rev 120044)
+++ trunk/LayoutTests/ChangeLog	2012-06-12 07:08:14 UTC (rev 120045)
@@ -1,3 +1,14 @@
+2012-06-12  Hojong Han  <hojong....@samsung.com>
+
+        Property names of the built-in object cannot be retrieved 
+        after trying to delete one of its properties
+        https://bugs.webkit.org/show_bug.cgi?id=86461
+
+        Reviewed by Gavin Barraclough.
+
+        * fast/js/delete-syntax-expected.txt:
+        * fast/js/script-tests/delete-syntax.js:
+
 2012-06-11  Dominic Cooney  <domin...@chromium.org>
 
         [Chromium] Unreviewed: Rebaseline gradients tests

Modified: trunk/LayoutTests/fast/js/delete-syntax-expected.txt (120044 => 120045)


--- trunk/LayoutTests/fast/js/delete-syntax-expected.txt	2012-06-12 06:24:48 UTC (rev 120044)
+++ trunk/LayoutTests/fast/js/delete-syntax-expected.txt	2012-06-12 07:08:14 UTC (rev 120045)
@@ -30,6 +30,19 @@
 PASS RegExp.prototype.exec is undefined
 PASS RegExp.prototype.test is null
 PASS Object.getOwnPropertyNames(Object.prototype).indexOf('__defineSetter__') is -1
+PASS navigatorPropertyNames.indexOf('appName') != -1 is true
+PASS navigatorPropertyNames.indexOf('appVersion') != -1 is true
+PASS navigatorPropertyNames.indexOf('language') != -1 is true
+PASS navigatorPropertyNames.indexOf('userAgent') != -1 is true
+PASS navigatorPropertyNames.indexOf('platform') != -1 is true
+PASS navigatorPropertyNames.indexOf('plugins') != -1 is true
+PASS navigatorPropertyNames.indexOf('mimeTypes') != -1 is true
+PASS navigatorPropertyNames.indexOf('product') != -1 is true
+PASS navigatorPropertyNames.indexOf('productSub') != -1 is true
+PASS navigatorPropertyNames.indexOf('vendor') != -1 is true
+PASS navigatorPropertyNames.indexOf('vendorSub') != -1 is true
+PASS navigatorPropertyNames.indexOf('cookieEnabled') != -1 is true
+PASS navigatorPropertyNames.indexOf('onLine') != -1 is true
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/fast/js/script-tests/delete-syntax.js (120044 => 120045)


--- trunk/LayoutTests/fast/js/script-tests/delete-syntax.js	2012-06-12 06:24:48 UTC (rev 120044)
+++ trunk/LayoutTests/fast/js/script-tests/delete-syntax.js	2012-06-12 07:08:14 UTC (rev 120045)
@@ -72,3 +72,23 @@
 delete Object.prototype.__defineSetter__;
 shouldBe("Object.getOwnPropertyNames(Object.prototype).indexOf('__defineSetter__')", "-1");
 
+delete navigator.appCodeName;
+var navigatorPropertyNames = Object.getOwnPropertyNames(navigator);
+var expectedPropertyNames = [
+    "appName",
+    "appVersion",
+    "language",
+    "userAgent",
+    "platform",
+    "plugins",
+    "mimeTypes",
+    "product",
+    "productSub",
+    "vendor",
+    "vendorSub",
+    "cookieEnabled",
+    "onLine"
+];
+
+for (var i = 0; i < expectedPropertyNames.length; ++i)
+    shouldBeTrue("navigatorPropertyNames.indexOf('" + expectedPropertyNames[i] +"') != -1");

Modified: trunk/Source/_javascript_Core/ChangeLog (120044 => 120045)


--- trunk/Source/_javascript_Core/ChangeLog	2012-06-12 06:24:48 UTC (rev 120044)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-06-12 07:08:14 UTC (rev 120045)
@@ -1,3 +1,15 @@
+2012-06-12  Hojong Han  <hojong....@samsung.com>
+
+        Property names of the built-in object cannot be retrieved 
+        after trying to delete one of its properties
+        https://bugs.webkit.org/show_bug.cgi?id=86461
+
+        Reviewed by Gavin Barraclough.
+
+        * runtime/JSObject.cpp:
+        (JSC::getClassPropertyNames):
+        (JSC::JSObject::getOwnPropertyNames):
+
 2012-06-11  Gyuyoung Kim  <gyuyoung....@samsung.com>
 
         [CMAKE][EFL] Remove duplicated executable output path

Modified: trunk/Source/_javascript_Core/runtime/JSObject.cpp (120044 => 120045)


--- trunk/Source/_javascript_Core/runtime/JSObject.cpp	2012-06-12 06:24:48 UTC (rev 120044)
+++ trunk/Source/_javascript_Core/runtime/JSObject.cpp	2012-06-12 07:08:14 UTC (rev 120045)
@@ -56,7 +56,7 @@
 
 const ClassInfo JSFinalObject::s_info = { "Object", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSFinalObject) };
 
-static inline void getClassPropertyNames(ExecState* exec, const ClassInfo* classInfo, PropertyNameArray& propertyNames, EnumerationMode mode)
+static inline void getClassPropertyNames(ExecState* exec, const ClassInfo* classInfo, PropertyNameArray& propertyNames, EnumerationMode mode, bool didReify)
 {
     // Add properties from the static hashtables of properties
     for (; classInfo; classInfo = classInfo->parentClass) {
@@ -69,7 +69,7 @@
         int hashSizeMask = table->compactSize - 1;
         const HashEntry* entry = table->table;
         for (int i = 0; i <= hashSizeMask; ++i, ++entry) {
-            if (entry->key() && (!(entry->attributes() & DontEnum) || (mode == IncludeDontEnumProperties)))
+            if (entry->key() && (!(entry->attributes() & DontEnum) || (mode == IncludeDontEnumProperties)) && !((entry->attributes() & Function) && didReify))
                 propertyNames.add(entry->key());
         }
     }
@@ -417,8 +417,7 @@
 
 void JSObject::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
 {
-    if (!object->staticFunctionsReified())
-        getClassPropertyNames(exec, object->classInfo(), propertyNames, mode);
+    getClassPropertyNames(exec, object->classInfo(), propertyNames, mode, object->staticFunctionsReified());
     object->structure()->getPropertyNamesFromStructure(exec->globalData(), propertyNames, mode);
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to