Chrome's web inspector shows somewhat misleading "representation" of an object. Run this in web inspector's console: function Parent(){} function Child(){} Child.prototype = new Parent; new Child; // displayed as "Parent", instead of expected "Child" It looks like object representation is the result of evaluating non-standard "name" property of object's constructor (or something similar to that). Once `Child.prototype.constructor` is set to reference `Child`, object is represented as "Child". Would it be possible to change this behavior, so that `new Child` is represented as "Child" without setting `Child.prototype.constructor` to `Child`? (the latter is not always possible when working with 3rd party code) Original Chromium bug: http://code.google.com/p/chromium/issues/detail?id=63383
Created attachment 74869 [details] Patch
Comment on attachment 74869 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=74869&action=review > WebCore/inspector/front-end/InjectedScript.js:432 > + // In Chromium DOM wrapper prototypes will have Object as their construcor name, nit: construc[t]or
Created attachment 74871 [details] Patch
(In reply to comment #2) > (From update of attachment 74869 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=74869&action=review > > > WebCore/inspector/front-end/InjectedScript.js:432 > > + // In Chromium DOM wrapper prototypes will have Object as their construcor name, > > nit: construc[t]or Fixed.
Comment on attachment 74871 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=74871&action=review Please do renaming prior to landing. > WebCore/inspector/InjectedScriptHost.idl:41 > + [Custom] DOMObject constructorName(in DOMObject object); internalConstructorName? > WebCore/inspector/front-end/InjectedScript.js:431 > + if (result === "Object") { If constructorName is Object, then we use constructor name?
Attachment 74871 [details] did not build on chromium: Build output: http://queues.webkit.org/results/6391041
Created attachment 74879 [details] Patch
(In reply to comment #5) > (From update of attachment 74871 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=74871&action=review > > Please do renaming prior to landing. > > > WebCore/inspector/InjectedScriptHost.idl:41 > > + [Custom] DOMObject constructorName(in DOMObject object); > > internalConstructorName? > Done.
Attachment 74879 [details] did not build on chromium: Build output: http://queues.webkit.org/results/6314046
Attachment 74879 [details] did not build on chromium: Build output: http://queues.webkit.org/results/6410092
Committed r72800