diff --git a/inst/NEWS b/inst/NEWS index 5d8b2f7d..139109aa 100644 --- a/inst/NEWS +++ b/inst/NEWS @@ -1,3 +1,8 @@ +htmlwidgets 1.5.1.9000 +------------------------------------------------------- + +* Fixed an issue with passing named function declarations to `JS()` and `onRender()` (introduced by v1.4). (#356) + htmlwidgets 1.5.1 ------------------------------------------------------- diff --git a/inst/www/htmlwidgets.js b/inst/www/htmlwidgets.js index 6f3d672d..3d227624 100644 --- a/inst/www/htmlwidgets.js +++ b/inst/www/htmlwidgets.js @@ -249,13 +249,13 @@ function tryEval(code) { var result = null; try { - result = eval(code); + result = eval("(" + code + ")"); } catch(error) { if (!error instanceof SyntaxError) { throw error; } try { - result = eval("(" + code + ")"); + result = eval(code); } catch(e) { if (e instanceof SyntaxError) { throw error;