errorMessage
leaked to global scope in non-strict mode, ReferenceError
in strict mode
#1034
Labels
errorMessage
leaked to global scope in non-strict mode, ReferenceError
in strict mode
#1034
If I run
node --use_strict -e 'require("chai").expect("42").to.be.above(0)'
I get:Instead of:
If I run
node -e 'try { require("chai").expect("42").to.be.above(0) } catch (ignore) { require("chai").expect(global.errorMessage).to.be.undefined }'
I get:
There are probably other cases of variables being used without declaration; this just happens to be the one I ran into. Using
--use_strict
or--check-leaks
in Mocha testing can help spot these, by the way!The text was updated successfully, but these errors were encountered: