diff --git a/CodenameOne/src/com/codename1/javascript/JavascriptContext.java b/CodenameOne/src/com/codename1/javascript/JavascriptContext.java index a5623988fe..322f836542 100644 --- a/CodenameOne/src/com/codename1/javascript/JavascriptContext.java +++ b/CodenameOne/src/com/codename1/javascript/JavascriptContext.java @@ -260,10 +260,10 @@ private synchronized String exec(String js, boolean async){ } if (async) { - browser.execute(installCode()+"("+js+")"); + browser.execute(installCode()+";("+js+")"); return null; } else { - return browser.executeAndReturnString(installCode()+"("+js+")"); + return browser.executeAndReturnString(installCode()+";("+js+")"); } }