diff options
author | max99x <max99x@gmail.com> | 2011-07-17 13:12:42 +0300 |
---|---|---|
committer | max99x <max99x@gmail.com> | 2011-07-17 13:12:42 +0300 |
commit | 61c5b7568e542d8c353a1b78be2a151f93b55acb (patch) | |
tree | 47760a69a78b998f9d15b2b3ccd46427f493fa33 /src/modules.js | |
parent | 26031d46a779fcfe44e4cd6d2476eee99b0c621b (diff) | |
parent | ab56efe76e94a0508d3983e9430e2aa18b1e2667 (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/modules.js')
-rw-r--r-- | src/modules.js | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/modules.js b/src/modules.js index f1f5f487..dc4a296d 100644 --- a/src/modules.js +++ b/src/modules.js @@ -171,22 +171,26 @@ var Functions = { }; var LibraryManager = { - ready: false, + library: null, - init: function() { - this.ready = true; + load: function() { + assert(!this.library); + + for (suffix in set('', '_sdl', '_gl', '_browser')) { + eval(processMacros(preprocess(read('library' + suffix + '.js'), CONSTANTS))); + } }, // Given an ident, see if it is an alias for something, and so forth, returning // the earliest ancestor (the root) getRootIdent: function(ident) { - if (!this.ready) return null; - var ret = Library[ident]; + if (!this.library) return null; + var ret = LibraryManager.library[ident]; if (!ret) return null; var last = ident; while (typeof ret === 'string') { last = ret; - ret = Library[ret]; + ret = LibraryManager.library[ret]; } return last; } |