aboutsummaryrefslogtreecommitdiff
path: root/src/jsifier.js
diff options
context:
space:
mode:
authoralon@honor <none@none>2010-10-27 22:12:02 -0700
committeralon@honor <none@none>2010-10-27 22:12:02 -0700
commit4b48a792ec61ce5b99c6eabf3b7b9f1e7f4afd8f (patch)
tree4b88210e14069791b83cd8c9a8a80cc86e936654 /src/jsifier.js
parent027d1d7ca694ef5128c03a1535235ec65cc87fac (diff)
modularize generated code
Diffstat (limited to 'src/jsifier.js')
-rw-r--r--src/jsifier.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index 1a67e1cd..f140cecc 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -372,7 +372,7 @@ function JSify(data) {
// Finalize function
if (LABEL_DEBUG) func.JS += " INDENT = INDENT.substr(0, INDENT.length-2);\n";
func.JS += '}\n';
- func.JS += func.ident + '.__index__ = Runtime.getFunctionIndex(' + func.ident + ');\n';
+ func.JS += func.ident + '.__index__ = Runtime.getFunctionIndex(' + func.ident + ', "' + func.ident + '");\n';
func.__result__ = true;
return func;
},
@@ -880,6 +880,7 @@ function JSify(data) {
substrate.addItems(data.functionStubs, 'FunctionStub');
var params = { 'QUANTUM_SIZE': QUANTUM_SIZE };
- return preprocess(read('preamble.js').replace('{{RUNTIME}}', getRuntime()) + finalCombiner(substrate.solve()) + read('postamble.js'), params);
+ var body = preprocess(read('preamble.js').replace('{{RUNTIME}}', getRuntime()) + finalCombiner(substrate.solve()) + read('postamble.js'), params);
+ return read('shell.js').replace('{{BODY}}', indentify(body, 2));
}