Title: [97655] trunk
Revision
97655
Author
[email protected]
Date
2011-10-17 14:51:21 -0700 (Mon, 17 Oct 2011)

Log Message

https://bugs.webkit.org/show_bug.cgi?id=70207
After deleting __defineSetter__, it is absent but appears in name list

Reviewed by Darin Adler.

Source/_javascript_Core: 

* runtime/JSObject.cpp:
(JSC::JSObject::getOwnPropertyNames):
    - This should check whether static functions have been reified.

LayoutTests: 

* fast/js/delete-syntax-expected.txt:
* fast/js/script-tests/delete-syntax.js:
    - Added test case for getOwnPropertyNames.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (97654 => 97655)


--- trunk/LayoutTests/ChangeLog	2011-10-17 21:50:12 UTC (rev 97654)
+++ trunk/LayoutTests/ChangeLog	2011-10-17 21:51:21 UTC (rev 97655)
@@ -1,3 +1,14 @@
+2011-10-17  Gavin Barraclough  <[email protected]>
+
+        https://bugs.webkit.org/show_bug.cgi?id=70207
+        After deleting __defineSetter__, it is absent but appears in name list
+
+        Reviewed by Darin Adler.
+
+        * fast/js/delete-syntax-expected.txt:
+        * fast/js/script-tests/delete-syntax.js:
+            - Added test case for getOwnPropertyNames.
+
 2011-09-22  Ojan Vafai  <[email protected]>
 
         incorrect height with height:auto and writing-mode:vertical-rl

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


--- trunk/LayoutTests/fast/js/delete-syntax-expected.txt	2011-10-17 21:50:12 UTC (rev 97654)
+++ trunk/LayoutTests/fast/js/delete-syntax-expected.txt	2011-10-17 21:51:21 UTC (rev 97655)
@@ -29,6 +29,7 @@
 PASS RegExp.prototype.compile is regExpPrototypeCompile
 PASS RegExp.prototype.exec is undefined
 PASS RegExp.prototype.test is null
+PASS String(Object.getOwnPropertyNames(Object.prototype)) is "constructor,valueOf,__lookupGetter__,toLocaleString,__defineGetter__,hasOwnProperty,propertyIsEnumerable,toString,__lookupSetter__,isPrototypeOf"
 PASS successfullyParsed is true
 
 TEST COMPLETE

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


--- trunk/LayoutTests/fast/js/script-tests/delete-syntax.js	2011-10-17 21:50:12 UTC (rev 97654)
+++ trunk/LayoutTests/fast/js/script-tests/delete-syntax.js	2011-10-17 21:51:21 UTC (rev 97655)
@@ -68,5 +68,9 @@
 shouldBe("RegExp.prototype.exec", "undefined");
 shouldBe("RegExp.prototype.test", "null");
 
+// Check that once a property is deleted its name is removed from the property name array.
+delete Object.prototype.__defineSetter__;
+shouldBe("String(Object.getOwnPropertyNames(Object.prototype))", '"constructor,valueOf,__lookupGetter__,toLocaleString,__defineGetter__,hasOwnProperty,propertyIsEnumerable,toString,__lookupSetter__,isPrototypeOf"');
+
 var successfullyParsed = true;
 

Modified: trunk/Source/_javascript_Core/ChangeLog (97654 => 97655)


--- trunk/Source/_javascript_Core/ChangeLog	2011-10-17 21:50:12 UTC (rev 97654)
+++ trunk/Source/_javascript_Core/ChangeLog	2011-10-17 21:51:21 UTC (rev 97655)
@@ -1,3 +1,14 @@
+2011-10-17  Gavin Barraclough  <[email protected]>
+
+        https://bugs.webkit.org/show_bug.cgi?id=70207
+        After deleting __defineSetter__, it is absent but appears in name list
+
+        Reviewed by Darin Adler.
+
+        * runtime/JSObject.cpp:
+        (JSC::JSObject::getOwnPropertyNames):
+            - This should check whether static functions have been reified.
+
 2011-10-17  Geoffrey Garen  <[email protected]>
 
         Mac build fix.

Modified: trunk/Source/_javascript_Core/runtime/JSObject.cpp (97654 => 97655)


--- trunk/Source/_javascript_Core/runtime/JSObject.cpp	2011-10-17 21:50:12 UTC (rev 97654)
+++ trunk/Source/_javascript_Core/runtime/JSObject.cpp	2011-10-17 21:51:21 UTC (rev 97655)
@@ -527,7 +527,8 @@
 void JSObject::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
 {
     structure()->getPropertyNames(exec->globalData(), propertyNames, mode);
-    getClassPropertyNames(exec, classInfo(), propertyNames, mode);
+    if (!staticFunctionsReified())
+        getClassPropertyNames(exec, classInfo(), propertyNames, mode);
 }
 
 bool JSObject::toBoolean(ExecState*) const
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to