Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix global leak of `UnknownFileTypeError` #5

Merged
merged 1 commit into from

2 participants

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 20, 2014
  1. @domharrington
This page is out of date. Refresh to see the latest.
Showing with 10 additions and 1 deletion.
  1. +1 −1  lib/walker.js
  2. +9 −0 test/walker.js
View
2  lib/walker.js
@@ -24,7 +24,7 @@ util.inherits(Walker, EventEmitter)
* Errors of this type are thrown when the type of a file could not be
* determined.
*/
-UnknownFileTypeError = Walker.UnknownFileTypeError = makeError(
+var UnknownFileTypeError = Walker.UnknownFileTypeError = makeError(
'UnknownFileTypeError',
'The type of this file could not be determined.'
)
View
9 test/walker.js
@@ -172,3 +172,12 @@ exports['symlink test'] = function(done) {
done()
})
}
+
+exports['global leak test'] = function(done) {
+ assert.throws(function () {
+ // This should throw because the `UnknownFileTypeError`
+ // should not be global
+ UnknownFileTypeError()
+ })
+ done()
+}
Something went wrong with that request. Please try again.