| 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 // This list must be in sync with the enum in ExceptionCode.h. The order matter
s. | 7 // This list must be in sync with the enum in ExceptionCode.h. The order matter
s. |
| 8 var domExceptions = [ | 8 var domExceptions = [ |
| 9 "IndexSizeError", | 9 "IndexSizeError", |
| 10 "HierarchyRequestError", | 10 "HierarchyRequestError", |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 }); | 74 }); |
| 75 } | 75 } |
| 76 | 76 |
| 77 function DOMExceptionInPrivateScript(code, message) | 77 function DOMExceptionInPrivateScript(code, message) |
| 78 { | 78 { |
| 79 this.code = domExceptionCode[code] || 0; | 79 this.code = domExceptionCode[code] || 0; |
| 80 this.message = message; | 80 this.message = message; |
| 81 this.type = "DOMExceptionInPrivateScript"; | 81 this.type = "DOMExceptionInPrivateScript"; |
| 82 } | 82 } |
| 83 | 83 |
| 84 function privateScriptClass() |
| 85 { |
| 86 } |
| 87 |
| 84 function installClass(className, implementation) | 88 function installClass(className, implementation) |
| 85 { | 89 { |
| 86 installedClasses[className] = implementation(window); | 90 installedClasses[className] = new privateScriptClass(); |
| 91 implementation(window, installedClasses[className]); |
| 87 } | 92 } |
| 88 | 93 |
| 89 init(); | 94 init(); |
| 90 | 95 |
| 91 // This line must be the last statement of this JS file. | 96 // This line must be the last statement of this JS file. |
| 92 // A parenthesis is needed, because the caller of this script (PrivateScriptRunn
er.cpp) | 97 // A parenthesis is needed, because the caller of this script (PrivateScriptRunn
er.cpp) |
| 93 // is depending on the completion value of this script. | 98 // is depending on the completion value of this script. |
| 94 (installedClasses); | 99 (installedClasses); |
| OLD | NEW |