[Webkit-unassigned] [Bug 139614] New: Web Inspector: Console should do a better job of determining real constructor

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Dec 12 19:01:19 PST 2014


https://bugs.webkit.org/show_bug.cgi?id=139614

            Bug ID: 139614
           Summary: Web Inspector: Console should do a better job of
                    determining real constructor
    Classification: Unclassified
           Product: WebKit
           Version: 528+ (Nightly build)
          Hardware: All
                OS: All
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Web Inspector
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: joepeck at webkit.org
                CC: graouts at webkit.org, joepeck at webkit.org,
                    timothy at apple.com, webkit-bug-importer at group.apple.com

* SUMMARY
For Objects it is very useful to know the constructor. If the prototype has been modified and loses constructor the Console may show misleading values. We should do a better job here.

* TEST
<script>
function BottomLevel() { this._bottom = Math.random(); }
function TopLevel() { BottomLevel.call(this); this._top = Math.random(); }
TopLevel.prototype = {} // Comment this out to get desired result
TopLevel.prototype.__proto__ = BottomLevel.prototype;
var x = new TopLevel;
console.log(x); // => BottomLevel, because x.constructor => BottomLevel.
</script>

* STEPS TO REPRODUCE
1. Inspect test above
  => Console labels "x" a "BottomLevel" object
  => Expected to see "TopLevel" object, since that was the constructor

* NOTES
- Settings constructor on TopLevel fixes the issue
- Chrome shows "TopLevel" with/without prototype.constructor being set.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20141213/09d4eaaa/attachment-0002.html>


More information about the webkit-unassigned mailing list