diff options
author | LemonBoy <LemonBoy@users.noreply.github.com> | 2018-09-07 01:56:36 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-09-07 01:56:36 +0200 |
commit | 84eab97fed35651234da14d188962bb8045b5b1e (patch) | |
tree | c6bcc9b144559363b7bbe902715def1c398f485c /compiler | |
parent | af1e84f54da32b5e8e917edc533c6efa6846acc2 (diff) | |
download | Nim-84eab97fed35651234da14d188962bb8045b5b1e.tar.gz |
Sync line generation between C and JS backends (#8888)
Fixes #7224
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/jsgen.nim | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim index da35002b7..0fc21b2d1 100644 --- a/compiler/jsgen.nim +++ b/compiler/jsgen.nim @@ -658,15 +658,16 @@ proc genTry(p: PProc, n: PNode, r: var TCompRes) = line(p, "}\L") proc genRaiseStmt(p: PProc, n: PNode) = - genLineDir(p, n) if n.sons[0].kind != nkEmpty: var a: TCompRes gen(p, n.sons[0], a) let typ = skipTypes(n.sons[0].typ, abstractPtrs) + genLineDir(p, n) useMagic(p, "raiseException") lineF(p, "raiseException($1, $2);$n", [a.rdLoc, makeJSString(typ.sym.name.s)]) else: + genLineDir(p, n) useMagic(p, "reraiseException") line(p, "reraiseException();\L") @@ -856,6 +857,7 @@ proc genAsgnAux(p: PProc, x, y: PNode, noCopyNeeded: bool) = else: gen(p, x, a) + genLineDir(p, y) gen(p, y, b) # we don't care if it's an etyBaseIndex (global) of a string, it's @@ -892,11 +894,9 @@ proc genAsgnAux(p: PProc, x, y: PNode, noCopyNeeded: bool) = lineF(p, "$1 = $2;$n", [a.res, b.res]) proc genAsgn(p: PProc, n: PNode) = - genLineDir(p, n) genAsgnAux(p, n.sons[0], n.sons[1], noCopyNeeded=false) proc genFastAsgn(p: PProc, n: PNode) = - genLineDir(p, n) # 'shallowCopy' always produced 'noCopyNeeded = true' here but this is wrong # for code like # while j >= pos: |