summaryrefslogtreecommitdiff
path: root/js/src/Ice/ModuleRegistry.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/Ice/ModuleRegistry.js')
-rw-r--r--js/src/Ice/ModuleRegistry.js62
1 files changed, 62 insertions, 0 deletions
diff --git a/js/src/Ice/ModuleRegistry.js b/js/src/Ice/ModuleRegistry.js
new file mode 100644
index 00000000000..f2fed3dabf6
--- /dev/null
+++ b/js/src/Ice/ModuleRegistry.js
@@ -0,0 +1,62 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+var __modules__ = {};
+
+var __M =
+{
+ module: function(name)
+ {
+ var m = __modules__[name];
+ if(m === undefined)
+ {
+ m = {};
+ __modules__[name] = m;
+ }
+ return m;
+ },
+ require: function(m, name, paths)
+ {
+ var i = 0, length = paths.length, _m, o;
+ for(; i < length; ++i)
+ {
+ o = m.require(paths[i])[name];
+ if(o)
+ {
+ _m = o;
+ }
+ }
+ return _m;
+ },
+ type: function(scoped)
+ {
+ if(scoped == undefined)
+ {
+ return undefined;
+ }
+ var components = scoped.split(".");
+ var T = __modules__;
+
+ for(var i = 0, length = components.length; i < length; ++i)
+ {
+ T = T[components[i]];
+ if(T === undefined)
+ {
+ return undefined;
+ }
+ }
+ return T;
+ }
+};
+
+var Ice = __M.module("Ice");
+Ice.__ICE_NODEJS__ = true;
+Ice.Slice = {};
+Ice.__M = __M;
+module.exports.Ice = Ice;