Skip to content

Commit

Permalink
compilerEs: fix java ffi ctor call for <init>() to generate valid js
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Giannini authored and Matthew Giannini committed Nov 15, 2023
1 parent d727f2d commit b052295
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/compilerEs/fan/ast/JsExpr.fan
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,13 @@ internal class JsCallExpr : JsExpr
writeTarget
// if native closure, we invoke the func directly (don't do Func.call())
if (isClos) js.w("(")
else js.w(".${name}(", loc)
else
{
if ((targetType?.isForeign ?: false) && isCtor && name == "<init>")
js.w(".javaInit(", loc)
else
js.w(".${name}(", loc)
}
writeArgs
js.w(")")
}
Expand Down

0 comments on commit b052295

Please sign in to comment.