diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-04-11 13:34:08 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-04-11 13:45:21 -0700 |
commit | 332e7a0ffb65a4b86efa8bb2d10110515feb2d4e (patch) | |
tree | c74ed11a8e883a700519dabd3c4cb200ac9cf9b5 /src/jsifier.js | |
parent | 36b98fa522ef3946168379f5b555fa7aabdbabfe (diff) |
include glMatrix when glBegin is used
Diffstat (limited to 'src/jsifier.js')
-rw-r--r-- | src/jsifier.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index 8e688d8d..904517e1 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -375,11 +375,15 @@ function JSify(data, functionsOnly, givenFunctions) { processItem: function(item) { function addFromLibrary(ident) { if (ident in addedLibraryItems) return ''; + addedLibraryItems[ident] = true; + + // dependencies can be JS functions, which we just run + if (typeof ident == 'function') return ident(); + // Don't replace implemented functions with library ones (which can happen when we add dependencies). // Note: We don't return the dependencies here. Be careful not to end up where this matters if (('_' + ident) in Functions.implementedFunctions) return ''; - addedLibraryItems[ident] = true; var snippet = LibraryManager.library[ident]; var redirectedIdent = null; var deps = LibraryManager.library[ident + '__deps'] || []; |