diff --git a/chocimport.js b/chocimport.js index e559902..d71cb47 100755 --- a/chocimport.js +++ b/chocimport.js @@ -64,7 +64,7 @@ const elements = { }, ArrowFunctionExpression(el, {scopes, sc, ...state}) { - if (sc === "return" && el.expression) //Braceless arrow functions implicitly return + if (el.expression && (sc === "return" || Ctx.source_lines[el.loc.start.line - 1].endsWith("//extcall"))) //Braceless arrow functions implicitly return descend(el.body, {scopes: [...scopes, { }], sc: "set_content", ...state}); else elements.FunctionExpression(el, {scopes, sc, ...state}); }, diff --git a/factory.js b/factory.js index 004692f..7b8741b 100644 --- a/factory.js +++ b/factory.js @@ -361,7 +361,7 @@ function autobind(obj, prop) { choc = new Proxy(choc, {get: autobind}); lindt = new Proxy(lindt, {get: autobind}); -choc.__version__ = "1.8.2"; +choc.__version__ = "1.8.3"; //For modules, make the main entry-point easily available. export default choc; diff --git a/package.json b/package.json index 70a8102..3761854 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "chocfactory", - "version": "1.8.2", + "version": "1.8.3", "description": "Simple JS front end library", "main": "factory.js", "scripts": { diff --git a/whatsnew.md b/whatsnew.md index 91f8e7f..2f037c8 100644 --- a/whatsnew.md +++ b/whatsnew.md @@ -1,5 +1,8 @@ ## Chocolate Factory version history +### v1.8.3 +* Importer bugfix: `//extcall` now works on arrow functions (JS only) + ### v1.8.2 * Bugfix use of DOM elements inside replace_content (can happen when mixing lindt and choc). Previously it was possible for some such usage to result in elements