diff options
author | Jose <jose@zeroc.com> | 2014-09-02 14:22:34 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2014-09-02 14:22:34 +0200 |
commit | fef794cdd1f8eb698fa3ccfe6f4cacba88030e9d (patch) | |
tree | 8e0c3c353dbbaa57d60a1da49c13b4153e918763 /js/src/Ice/browser/Debug.js | |
parent | Fix (ICE-3445) - consider not installing internal header files (diff) | |
download | ice-fef794cdd1f8eb698fa3ccfe6f4cacba88030e9d.tar.bz2 ice-fef794cdd1f8eb698fa3ccfe6f4cacba88030e9d.tar.xz ice-fef794cdd1f8eb698fa3ccfe6f4cacba88030e9d.zip |
Fixed (ICE-5654) - Update JS mapping to not use global types in NodeJS
Diffstat (limited to 'js/src/Ice/browser/Debug.js')
-rw-r--r-- | js/src/Ice/browser/Debug.js | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/js/src/Ice/browser/Debug.js b/js/src/Ice/browser/Debug.js index c6739e40ebd..529a59236fb 100644 --- a/js/src/Ice/browser/Debug.js +++ b/js/src/Ice/browser/Debug.js @@ -7,35 +7,29 @@ // // ********************************************************************** -(function(global){ - require("Ice/Class"); - require("Ice/Exception"); - - var Ice = global.Ice || {}; - - var Exception = Ice.Exception; - - var AssertionFailedException = Ice.Class(Error, { +var Ice = require("../Ice/ModuleRegistry").Ice; +Ice.__M.require(module, "Ice", ["../Ice/Class", "../Ice/Exception"]); + +Ice.AssertionFailedException = Ice.Class(Error, + { __init__: function(message) { Error.call(this); - Exception.captureStackTrace(this); + Ice.Exception.captureStackTrace(this); this.message = message; } }); - var Debug = {}; - - Debug.AssertionFailedException = AssertionFailedException; - Debug.assert = function(b, msg) +Ice.Debug = +{ + assert: function(b, msg) { if(!b) { console.log(msg === undefined ? "assertion failed" : msg); console.log(Error().stack); - throw new AssertionFailedException(msg === undefined ? "assertion failed" : msg); + throw new Ice.AssertionFailedException(msg === undefined ? "assertion failed" : msg); } - }; - Ice.Debug = Debug; - global.Ice = Ice; -}(typeof (global) === "undefined" ? window : global)); + } +}; +module.exports.Ice = Ice; |