Bug 139614
Summary: | Web Inspector: Console should do a better job of determining real constructor | ||
---|---|---|---|
Product: | WebKit | Reporter: | Joseph Pecoraro <joepeck> |
Component: | Web Inspector | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | graouts, inspector-bugzilla-changes, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | 528+ (Nightly build) | ||
Hardware: | All | ||
OS: | All |
Joseph Pecoraro
* 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.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/19281496>
Radar WebKit Bug Importer
<rdar://problem/19281616>