diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim index d876531e9486..bf657114aa15 100644 --- a/compiler/jsgen.nim +++ b/compiler/jsgen.nim @@ -602,8 +602,8 @@ proc arithAux(p: PProc, n: PNode, r: var TCompRes, op: TMagic) = of mMulF64: applyFormat("($1 * $2)", "($1 * $2)") of mDivF64: applyFormat("($1 / $2)", "($1 / $2)") of mShrI: applyFormat("", "") - of mShlI: applyFormat("($1 << $2)", "($1 << $2)") - of mAshrI: applyFormat("($1 >> $2)", "($1 >> $2)") + of mShlI: applyFormat("($1 * Math.pow(2,$2))", "($1 * Math.pow(2,$2))") + of mAshrI: applyFormat("($1 / Math.pow(2,$2))", "($1 / Math.pow(2,$2))") of mBitandI: applyFormat("($1 & $2)", "($1 & $2)") of mBitorI: applyFormat("($1 | $2)", "($1 | $2)") of mBitxorI: applyFormat("($1 ^ $2)", "($1 ^ $2)")