Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Unified Diff: Source/core/testing/PrivateScriptTest.js

Issue 419683003: Inject a prototype object of a private script into the prototype chain of a holder object (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/HTMLMarqueeElement.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/testing/PrivateScriptTest.js
diff --git a/Source/core/testing/PrivateScriptTest.js b/Source/core/testing/PrivateScriptTest.js
index 88050ca7b3f59b7759a76dfd6b016427f2edee13..1f4100575b549c1c59a31aa9d463d70980bc4004 100644
--- a/Source/core/testing/PrivateScriptTest.js
+++ b/Source/core/testing/PrivateScriptTest.js
@@ -4,8 +4,7 @@
"use strict";
-installClass("PrivateScriptTest", function(global) {
- var InternalsPrototype = Object.create(Element.prototype);
+installClass("PrivateScriptTest", function(global, InternalsPrototype) {
InternalsPrototype.initialize = function() {
this.m_shortAttribute = -1;
@@ -33,12 +32,16 @@ installClass("PrivateScriptTest", function(global) {
return value;
}
- InternalsPrototype.addInteger = function(value1, value2) {
+ InternalsPrototype.addValues_ = function(value1, value2) {
return value1 + value2;
}
+ InternalsPrototype.addInteger = function(value1, value2) {
+ return this.addValues_(value1, value2);
+ }
+
InternalsPrototype.addString = function(value1, value2) {
- return value1 + value2;
+ return this.addValues_(value1, value2);
}
InternalsPrototype.setIntegerToDocument = function(document, value) {
@@ -128,6 +131,4 @@ installClass("PrivateScriptTest", function(global) {
get: function() { return this.m_stringAttributeForPrivateScriptOnly; },
set: function(value) { this.m_stringAttributeForPrivateScriptOnly = value; }
});
-
- return InternalsPrototype;
});
« no previous file with comments | « Source/core/html/HTMLMarqueeElement.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698