diff options
author | max99x <max99x@gmail.com> | 2011-06-25 10:27:49 +0300 |
---|---|---|
committer | max99x <max99x@gmail.com> | 2011-06-25 10:27:49 +0300 |
commit | 2f3bd046bb52234771dce5c689141626370e26ce (patch) | |
tree | 8c6297a73e97d0473359480aade22a6207f0ed37 /src/jsifier.js | |
parent | c9b968a4467fc1c004da69dc2f0000728fbf108e (diff) |
Added support for exporting (non-function) global variables.
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 2344b21f..71797daa 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -178,9 +178,13 @@ function JSify(data, functionsOnly, givenFunctions, givenGlobalVariables) { } constant = makePointer(constant, null, 'ALLOC_STATIC', item.type); + var js = item.ident + '=' + constant + ';'; + if (item.ident in EXPORTED_GLOBALS) { + js += '\nModule["' + item.ident + '"] = ' + item.ident + ';'; + } return ret.concat({ intertype: 'GlobalVariable', - JS: item.ident + '=' + constant + ';', + JS: js, }); } } |