diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-01-23 16:34:36 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-01-23 16:34:36 -0800 |
commit | ab20c69e046731f722f39016539dc1ffe4040aa1 (patch) | |
tree | a20370a075ddb043c9e32608dad7e4402a9eda42 /src/jsifier.js | |
parent | 4200a73e281b3bb10c11d9bc57a9a07602ff23b4 (diff) |
refactor makeComparison and use it in more places
Diffstat (limited to 'src/jsifier.js')
-rw-r--r-- | src/jsifier.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index dba2ad51..84a9b5f7 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -1106,7 +1106,7 @@ function JSify(data, functionsOnly, givenFunctions) { var value; if (useIfs) { value = targetLabels[targetLabel].map(function(value) { - return makeComparison(signedIdent, makeSignOp(value, item.type, 're'), item.type) + return makeComparison(signedIdent, '==', makeSignOp(value, item.type, 're'), item.type) }).join(' | '); ret += 'if (' + value + ') {\n'; } else { @@ -1270,7 +1270,7 @@ function JSify(data, functionsOnly, givenFunctions) { var phiSets = calcPhiSets(item); var js = 'var ibr = ' + finalizeLLVMParameter(item.value) + ';\n'; for (var targetLabel in phiSets) { - js += 'if (' + makeComparison('ibr', targetLabel, 'i32') + ') { ' + getPhiSetsForLabel(phiSets, targetLabel) + ' }\n'; + js += 'if (' + makeComparison('ibr', '==', targetLabel, 'i32') + ') { ' + getPhiSetsForLabel(phiSets, targetLabel) + ' }\n'; } return js + makeBranch('ibr', item.currLabelId, true); }); |