Skip to content

Instantly share code, notes, and snippets.

@gskachkov
Last active September 8, 2017 18:58
Show Gist options
  • Save gskachkov/1c7f2cd0eb4623ba8abb9fdfc4a49c66 to your computer and use it in GitHub Desktop.
Save gskachkov/1c7f2cd0eb4623ba8abb9fdfc4a49c66 to your computer and use it in GitHub Desktop.
Eval function
var assertNotThrow = function (cb) {
var noError = false;
try {
cb();
noError = true;
} catch (e) {}
return noError;
}
function f() {
var foo;
try {
let boo;
eval('function foo(){} function boo() {}');
} catch (e) {
print(e);
}
print(assertNotThrow(() => foo));
print(assertNotThrow(() => boo));
}
// Should we have true false, or false false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment