Last active
September 8, 2017 18:58
-
-
Save gskachkov/1c7f2cd0eb4623ba8abb9fdfc4a49c66 to your computer and use it in GitHub Desktop.
Eval function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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