Skip to content

Instantly share code, notes, and snippets.

@rightfold
Created January 13, 2015 10:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rightfold/d21602531589b889725f to your computer and use it in GitHub Desktop.
Save rightfold/d21602531589b889725f to your computer and use it in GitHub Desktop.
function compileExpr(expr) {
try {
return compileExprToESExpr(expr);
} catch (e) {
if (e instanceof MustCompileToStmtError) {
const stmts = compileExprToESStmts(expr, true);
return wrapInIIFE(stmts);
} else {
throw e;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment