aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-10-24 12:11:44 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-10-24 12:14:55 -0700
commit067a60d649a5f8a1af76d4a15dee31c81fe0f384 (patch)
tree8d7676614bb7ff531de45aa8b892ce2a6e4c8761 /src
parent50ee300ffabb6c5e5c6a2d4b4762343822ea1dc2 (diff)
handle empty inline asms; fixes #1729
Diffstat (limited to 'src')
-rw-r--r--src/intertyper.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/intertyper.js b/src/intertyper.js
index 96db6966..d3640889 100644
--- a/src/intertyper.js
+++ b/src/intertyper.js
@@ -672,12 +672,14 @@ function intertyper(lines, sidePass, baseLineNums) {
assert((item.tokens[5].text.match(/=/g) || []).length <= 1, 'we only support at most 1 exported variable from inline js: ' + item.ident);
var i = 0;
var params = [], args = [];
- splitTokenList(tokensLeft[3].tokens).map(function(element) {
- var ident = toNiceIdent(element[1].text);
- var type = element[0].text;
- params.push('$' + (i++));
- args.push(ident);
- });
+ if (tokensLeft[3].tokens) {
+ splitTokenList(tokensLeft[3].tokens).map(function(element) {
+ var ident = toNiceIdent(element[1].text);
+ var type = element[0].text;
+ params.push('$' + (i++));
+ args.push(ident);
+ });
+ }
if (item.assignTo) item.ident = 'return ' + item.ident;
item.ident = '(function(' + params + ') { ' + item.ident + ' })(' + args + ');';
return { forward: null, ret: item, item: item };