diff options
author | alon@honor <none@none> | 2010-10-21 19:19:59 -0700 |
---|---|---|
committer | alon@honor <none@none> | 2010-10-21 19:19:59 -0700 |
commit | beb16b9d956b0434330d6ce1eefd67eec5bae111 (patch) | |
tree | 6485b3a55bc1a0e330a25efd06b82dcb9b806622 /src/jsifier.js | |
parent | ce5008630e06a2238b2dc6e5fcbbeebc0ce01cd2 (diff) |
expose ___SIZE of structs
Diffstat (limited to 'src/jsifier.js')
-rw-r--r-- | src/jsifier.js | 7 |
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]; |