| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 "use strict"; | 5 "use strict"; |
| 6 | 6 |
| 7 installClass("PrivateScriptTest", function(global) { | 7 installClass("PrivateScriptTest", function(global, InternalsPrototype) { |
| 8 var InternalsPrototype = Object.create(Element.prototype); | |
| 9 | 8 |
| 10 InternalsPrototype.initialize = function() { | 9 InternalsPrototype.initialize = function() { |
| 11 this.m_shortAttribute = -1; | 10 this.m_shortAttribute = -1; |
| 12 this.m_stringAttribute = "xxx"; | 11 this.m_stringAttribute = "xxx"; |
| 13 this.m_nodeAttribute = null; | 12 this.m_nodeAttribute = null; |
| 14 this.m_stringAttributeForPrivateScriptOnly = "yyy"; | 13 this.m_stringAttributeForPrivateScriptOnly = "yyy"; |
| 15 } | 14 } |
| 16 | 15 |
| 17 InternalsPrototype.doNothing = function() { | 16 InternalsPrototype.doNothing = function() { |
| 18 } | 17 } |
| 19 | 18 |
| 20 InternalsPrototype.return123 = function() { | 19 InternalsPrototype.return123 = function() { |
| 21 return 123; | 20 return 123; |
| 22 } | 21 } |
| 23 | 22 |
| 24 InternalsPrototype.echoInteger = function(value) { | 23 InternalsPrototype.echoInteger = function(value) { |
| 25 return value; | 24 return value; |
| 26 } | 25 } |
| 27 | 26 |
| 28 InternalsPrototype.echoString = function(value) { | 27 InternalsPrototype.echoString = function(value) { |
| 29 return value; | 28 return value; |
| 30 } | 29 } |
| 31 | 30 |
| 32 InternalsPrototype.echoNode = function(value) { | 31 InternalsPrototype.echoNode = function(value) { |
| 33 return value; | 32 return value; |
| 34 } | 33 } |
| 35 | 34 |
| 36 InternalsPrototype.addInteger = function(value1, value2) { | 35 InternalsPrototype.addValues_ = function(value1, value2) { |
| 37 return value1 + value2; | 36 return value1 + value2; |
| 38 } | 37 } |
| 39 | 38 |
| 39 InternalsPrototype.addInteger = function(value1, value2) { |
| 40 return this.addValues_(value1, value2); |
| 41 } |
| 42 |
| 40 InternalsPrototype.addString = function(value1, value2) { | 43 InternalsPrototype.addString = function(value1, value2) { |
| 41 return value1 + value2; | 44 return this.addValues_(value1, value2); |
| 42 } | 45 } |
| 43 | 46 |
| 44 InternalsPrototype.setIntegerToDocument = function(document, value) { | 47 InternalsPrototype.setIntegerToDocument = function(document, value) { |
| 45 document.integer = value; | 48 document.integer = value; |
| 46 } | 49 } |
| 47 | 50 |
| 48 InternalsPrototype.getIntegerFromDocument = function(document) { | 51 InternalsPrototype.getIntegerFromDocument = function(document) { |
| 49 return document.integer; | 52 return document.integer; |
| 50 } | 53 } |
| 51 | 54 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 } | 124 } |
| 122 | 125 |
| 123 InternalsPrototype.addIntegerForPrivateScriptOnly = function(value1, value2)
{ | 126 InternalsPrototype.addIntegerForPrivateScriptOnly = function(value1, value2)
{ |
| 124 return value1 + value2; | 127 return value1 + value2; |
| 125 } | 128 } |
| 126 | 129 |
| 127 Object.defineProperty(InternalsPrototype, "stringAttributeForPrivateScriptOn
ly", { | 130 Object.defineProperty(InternalsPrototype, "stringAttributeForPrivateScriptOn
ly", { |
| 128 get: function() { return this.m_stringAttributeForPrivateScriptOnly; }, | 131 get: function() { return this.m_stringAttributeForPrivateScriptOnly; }, |
| 129 set: function(value) { this.m_stringAttributeForPrivateScriptOnly = valu
e; } | 132 set: function(value) { this.m_stringAttributeForPrivateScriptOnly = valu
e; } |
| 130 }); | 133 }); |
| 131 | |
| 132 return InternalsPrototype; | |
| 133 }); | 134 }); |
| OLD | NEW |