Created
April 5, 2011 22:20
-
-
Save stagas/904705 to your computer and use it in GitHub Desktop.
with undefined foo test
This file contains 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 locals = {} | |
var err | |
do { | |
err = undefined | |
try { | |
with(locals) { | |
foo | |
bar | |
kewl | |
console.log('all ok') | |
} | |
} catch(e) { | |
err = e | |
if (err.type === 'not_defined') { | |
locals[err.arguments[0]] = undefined | |
} | |
} | |
} while(err && err.type === 'not_defined') | |
console.log('done') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment