Bug 101320 - Console not displaying all properties of an Object once native Constructor overwritten
Summary: Console not displaying all properties of an Object once native Constructor ov...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Yury Semikhatsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-06 01:21 PST by Yury Semikhatsky
Modified: 2012-11-07 00:33 PST (History)
10 users (show)

See Also:


Attachments
Patch (3.97 KB, patch)
2012-11-06 01:28 PST, Yury Semikhatsky
no flags Details | Formatted Diff | Diff
Patch (3.97 KB, patch)
2012-11-06 01:30 PST, Yury Semikhatsky
pfeldman: review+
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yury Semikhatsky 2012-11-06 01:21:41 PST
Original Chromium bug report: http://code.google.com/p/chromium/issues/detail?id=159408

Steps to reproduce the problem:
1. Open dev tools and declare object foo with property bar that has value 'hello,world'(used object literal to create object) 
2. log foo (bar and __proto__ properties displayed)
3. overwrite Object constructor (Object = function() {})
4. log foo again (no properties displayed)
5. log foo.bar ('hello,world' printed)

What is the expected behavior?
All the available properties of the object should still be visible as object has already been created prior to the constructor being overwritten.

What went wrong?
The console does not display the object's properties when the properties do exist. Can still log the individual values of the properties, but not the entire object.
Comment 1 Yury Semikhatsky 2012-11-06 01:28:44 PST
Created attachment 172515 [details]
Patch
Comment 2 Pavel Feldman 2012-11-06 01:30:01 PST
Comment on attachment 172515 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=172515&action=review

> Source/WebCore/inspector/InjectedScriptSource.js:37
> +var Object = {}.constructor;

This could be too late, right?
Comment 3 Yury Semikhatsky 2012-11-06 01:30:12 PST
Created attachment 172516 [details]
Patch
Comment 4 Yury Semikhatsky 2012-11-06 01:46:18 PST
(In reply to comment #2)
> (From update of attachment 172515 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=172515&action=review
> 
> > Source/WebCore/inspector/InjectedScriptSource.js:37
> > +var Object = {}.constructor;
> 
> This could be too late, right?

Could you elaborate?
Comment 5 WebKit Review Bot 2012-11-06 03:52:53 PST
Comment on attachment 172516 [details]
Patch

Rejecting attachment 172516 [details] from commit-queue.

New failing tests:
inspector/console/command-line-api.html
inspector-protocol/debugger-terminate-dedicated-worker-while-paused.html
Full output: http://queues.webkit.org/results/14728814
Comment 6 Build Bot 2012-11-06 05:00:53 PST
Comment on attachment 172516 [details]
Patch

Attachment 172516 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/14755114

New failing tests:
inspector/console/command-line-api.html
Comment 7 WebKit Review Bot 2012-11-06 05:43:02 PST
Comment on attachment 172516 [details]
Patch

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

New failing tests:
inspector/console/command-line-api.html
Comment 8 Yury Semikhatsky 2012-11-07 00:33:05 PST
Committed r133727: <http://trac.webkit.org/changeset/133727>