Bug 86461 - Property names of the built-in object cannot be retrieved after trying to delete one of its properties
Summary: Property names of the built-in object cannot be retrieved after trying to del...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
: 88403 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-05-15 03:40 PDT by Hojong Han
Modified: 2012-06-15 00:26 PDT (History)
6 users (show)

See Also:


Attachments
Patch (2.94 KB, patch)
2012-06-04 04:00 PDT, Hojong Han
no flags Details | Formatted Diff | Diff
Patch (6.09 KB, patch)
2012-06-10 22:42 PDT, Hojong Han
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ec2-cr-linux-04 (536.10 KB, application/zip)
2012-06-11 02:37 PDT, WebKit Review Bot
no flags Details
Patch (5.93 KB, patch)
2012-06-11 03:56 PDT, Hojong Han
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hojong Han 2012-05-15 03:40:44 PDT
[Script]
delete navigator.geolocation;
	
for (var prop in navigator) {
	document.write("name: " + prop + "; value: " + navigator[prop], "<br>");
}

[Actual Result]
name: javaEnabled; value: function javaEnabled() { [native code] }
name: getStorageUpdates; value: function getStorageUpdates() { [native code] }

====================================================================================

I think the result of that script should be like below.
because geolocation cannot be removed since it has "DontDelete | ReadOnly" attribute
and properties of navigator nothing changed at last.

[Expected Result]
name: geolocation; value: [object Geolocation]
name: cookieEnabled; value: true
name: language; value: ko-KR
name: productSub; value: 20030107
name: product; value: Gecko
name: appCodeName; value: Mozilla
name: mimeTypes; value: [object MimeTypeArray]
name: vendorSub; value: 
name: vendor; value: Apple Computer, Inc.
name: platform; value: Win32
name: appName; value: Netscape
name: appVersion; value: 5.0 (Windows NT 5.1) AppleWebKit/534+ (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4
name: userAgent; value: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534+ (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4
name: plugins; value: [object PluginArray]
name: onLine; value: true
name: javaEnabled; value: function javaEnabled() { [native code] }
name: getStorageUpdates; value: function getStorageUpdates() { [native code] }


This issue is occurred after setStaticFunctionsReified().
It blocks an object from calling getClassPropertyNames method.

Any comment welcomed...
Comment 1 Hojong Han 2012-06-04 04:00:14 PDT
Created attachment 145557 [details]
Patch
Comment 2 Gavin Barraclough 2012-06-04 10:53:34 PDT
Hi, the fix looks great, but we do ask that changes are accompanied by a layout test – would it be possible to add one?

The appropriate place to test this is likely in LayoutTests/fast/js, you can add a test case to an appropriate existing test, or create a new test by copying an existing .html and corresponding .js.

Many thanks,
G.
Comment 3 Hojong Han 2012-06-10 22:42:14 PDT
Created attachment 146787 [details]
Patch
Comment 4 WebKit Review Bot 2012-06-11 02:36:57 PDT
Comment on attachment 146787 [details]
Patch

Attachment 146787 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/12925913

New failing tests:
fast/js/delete-syntax.html
Comment 5 WebKit Review Bot 2012-06-11 02:37:02 PDT
Created attachment 146818 [details]
Archive of layout-test-results from ec2-cr-linux-04

The attached test failures were seen while running run-webkit-tests on the chromium-ews.
Bot: ec2-cr-linux-04  Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'>  Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
Comment 6 Hojong Han 2012-06-11 03:56:13 PDT
Created attachment 146821 [details]
Patch
Comment 7 Gavin Barraclough 2012-06-11 23:15:41 PDT
*** Bug 88403 has been marked as a duplicate of this bug. ***
Comment 8 Gavin Barraclough 2012-06-11 23:16:53 PDT
Comment on attachment 146821 [details]
Patch

Thanks for adding the layout test Hojong, this looks great.
Comment 9 WebKit Review Bot 2012-06-12 00:08:29 PDT
Comment on attachment 146821 [details]
Patch

Clearing flags on attachment: 146821

Committed r120045: <http://trac.webkit.org/changeset/120045>
Comment 10 WebKit Review Bot 2012-06-12 00:08:34 PDT
All reviewed patches have been landed.  Closing bug.
Comment 11 Hojong Han 2012-06-15 00:26:14 PDT
(In reply to comment #8)
> (From update of attachment 146821 [details])
> Thanks for adding the layout test Hojong, this looks great.

Really thanks for review Gavin.

There's one thing I'm curious is that how to delete static built-in properties, not function. 
JSObject::deleteProperty does nothing but return true for "Deletable" built-in properties and there's comment like "// FIXME: Should the code here actually do some deletion?".
Are you working on this to figure out?