JS codegen bugfix: don't crash on wrong importcpp patterns
This commit is contained in:
parent
cd26d02882
commit
1d9087245c
1 changed files with 3 additions and 0 deletions
|
|
@ -1344,6 +1344,9 @@ proc genArgs(p: PProc, n: PNode, r: var TCompRes; start=1) =
|
||||||
|
|
||||||
proc genOtherArg(p: PProc; n: PNode; i: int; typ: PType;
|
proc genOtherArg(p: PProc; n: PNode; i: int; typ: PType;
|
||||||
generated: var int; r: var TCompRes) =
|
generated: var int; r: var TCompRes) =
|
||||||
|
if i >= n.len:
|
||||||
|
globalError(n.info, "wrong importcpp pattern; expected parameter at position " & $i &
|
||||||
|
" but got only: " & $(n.len-1))
|
||||||
let it = n[i]
|
let it = n[i]
|
||||||
var paramType: PNode = nil
|
var paramType: PNode = nil
|
||||||
if i < sonsLen(typ):
|
if i < sonsLen(typ):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue