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(PrivateScriptTestPrototype) { | 7 installClass("PrivateScriptTest", function(PrivateScriptTestPrototype) { |
8 | 8 |
9 PrivateScriptTestPrototype.initialize = function() { | 9 PrivateScriptTestPrototype.initialize = function() { |
10 this.m_shortAttribute = -1; | 10 this.m_shortAttribute = -1; |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
136 } | 136 } |
137 | 137 |
138 PrivateScriptTestPrototype.voidMethodThrowsSyntaxError = function() { | 138 PrivateScriptTestPrototype.voidMethodThrowsSyntaxError = function() { |
139 throwException(PrivateScriptJSError.SyntaxError, "method threw SyntaxErr or"); | 139 throwException(PrivateScriptJSError.SyntaxError, "method threw SyntaxErr or"); |
140 } | 140 } |
141 | 141 |
142 PrivateScriptTestPrototype.voidMethodThrowsReferenceError = function() { | 142 PrivateScriptTestPrototype.voidMethodThrowsReferenceError = function() { |
143 throwException(PrivateScriptJSError.ReferenceError, "method threw Refere nceError"); | 143 throwException(PrivateScriptJSError.ReferenceError, "method threw Refere nceError"); |
144 } | 144 } |
145 | 145 |
146 PrivateScriptTestPrototype.voidMethodThrowsReferenceError = function() { | |
vivekg
2014/09/09 02:04:04
voidMethodThrowsStackOverflowError ??
| |
147 function f() { f(); } | |
148 f(); | |
149 } | |
150 | |
146 PrivateScriptTestPrototype.addIntegerForPrivateScriptOnly = function(value1, value2) { | 151 PrivateScriptTestPrototype.addIntegerForPrivateScriptOnly = function(value1, value2) { |
147 return value1 + value2; | 152 return value1 + value2; |
148 } | 153 } |
149 | 154 |
150 Object.defineProperty(PrivateScriptTestPrototype, "stringAttributeForPrivate ScriptOnly", { | 155 Object.defineProperty(PrivateScriptTestPrototype, "stringAttributeForPrivate ScriptOnly", { |
151 get: function() { return this.m_stringAttributeForPrivateScriptOnly; }, | 156 get: function() { return this.m_stringAttributeForPrivateScriptOnly; }, |
152 set: function(value) { this.m_stringAttributeForPrivateScriptOnly = valu e; } | 157 set: function(value) { this.m_stringAttributeForPrivateScriptOnly = valu e; } |
153 }); | 158 }); |
154 | 159 |
155 PrivateScriptTestPrototype.addIntegerImplementedInCPP = function(value1, val ue2) { | 160 PrivateScriptTestPrototype.addIntegerImplementedInCPP = function(value1, val ue2) { |
156 return this.addIntegerImplementedInCPPForPrivateScriptOnly(value1, value 2); | 161 return this.addIntegerImplementedInCPPForPrivateScriptOnly(value1, value 2); |
157 } | 162 } |
158 | 163 |
159 Object.defineProperty(PrivateScriptTestPrototype, "stringAttributeImplemente dInCPP", { | 164 Object.defineProperty(PrivateScriptTestPrototype, "stringAttributeImplemente dInCPP", { |
160 get: function() { return this.m_stringAttributeImplementedInCPPForPrivat eScriptOnly; }, | 165 get: function() { return this.m_stringAttributeImplementedInCPPForPrivat eScriptOnly; }, |
161 set: function(value) { this.m_stringAttributeImplementedInCPPForPrivateS criptOnly = value; } | 166 set: function(value) { this.m_stringAttributeImplementedInCPPForPrivateS criptOnly = value; } |
162 }); | 167 }); |
163 | 168 |
164 PrivateScriptTestPrototype.dispatchDocumentOnload = function(document) { | 169 PrivateScriptTestPrototype.dispatchDocumentOnload = function(document) { |
165 var event = new Event("load", { bubbles: true, cancelable: true }); | 170 var event = new Event("load", { bubbles: true, cancelable: true }); |
166 event.valueInPrivateScript = "this should not be visible in user's scrip t"; | 171 event.valueInPrivateScript = "this should not be visible in user's scrip t"; |
167 document.dispatchEvent(event); | 172 document.dispatchEvent(event); |
168 } | 173 } |
169 | 174 |
170 }); | 175 }); |
OLD | NEW |