aboutsummaryrefslogtreecommitdiff
path: root/src/jsifier.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/jsifier.js')
-rw-r--r--src/jsifier.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index 15c5bbba..329c263d 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -13,10 +13,11 @@ function JSify(data) {
substrate.addZyme('Type', {
processItem: function(item) {
var type = TYPES[item.name_];
+ var niceName = toNiceIdent(item.name_)
+ // We might export all of TYPES, cleaner that way, but do not want slowdowns in accessing flatteners
+ item.JS = 'var ' + niceName + '___SIZE = ' + TYPES[item.name_].flatSize + '; // ' + item.name_ + '\n';
if (type.needsFlattening && !type.flatFactor) {
- item.JS = 'var ' + toNiceIdent(item.name_) + '___FLATTENER = ' + JSON.stringify(TYPES[item.name_].flatIndexes) + ';';
- } else {
- item.JS = '// type: ' + item.name_;
+ item.JS += 'var ' + niceName + '___FLATTENER = ' + JSON.stringify(TYPES[item.name_].flatIndexes) + ';';
}
item.__result__ = true;
return [item];