Chromium Code Reviews
DescriptionInject a prototype object of a private script into the prototype chain of a holder object
This is a split CL from https://codereview.chromium.org/394773003/.
This CL lets |this| object use properties defined on a prototype object of the private script. For example:
installClass("HTMLMarqueeElement", function(global, HTMLMarqueeElementPrototype) {
HTMLMarqueeElementPrototype.foo = function () { ... };
HTMLMarqueeElementPrototype.bar = function () {
this.foo(); // This CL makes this workable.
};
});
Before this CL, we had to write foo.call(this) because the HTMLMarqueeElementPrototype is not in the prototype chain of |this| object. After this CL, the HTMLMarqueeElementPrototype is in the prototype chain, so we can just write it as this.foo().
BUG=341031
TEST=fast/dom/private_script_unittest.html
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=178918
Patch Set 1 #Patch Set 2 : #Patch Set 3 : #
Messages
Total messages: 5 (0 generated)
|
||||||||||||||||||||||||||||||||||||||||||||||