-
Notifications
You must be signed in to change notification settings - Fork 30.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
debugger: don't override module
binding
#572
Conversation
Overriding `module` argument with `const` causes `SyntaxError`.
@@ -4,8 +4,8 @@ const util = require('util'); | |||
const path = require('path'); | |||
const net = require('net'); | |||
const vm = require('vm'); | |||
const module = require('module'); | |||
const repl = module.requireRepl(); | |||
const Module = require('module'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bnoordhuis are you OK with the capitalization? If not, we could replace the two following instances with require('module')
, use a different name, or switch from const
. Any preference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Module
is a constructor so it makes sense. It's exactly how it's called in lib/module.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vkurchatkin you're right. It's used that way in other places too.
LGTM |
And this worked with var? That's interesting... |
Overriding module argument with const causes a SyntaxError. This commit changes the variable name to remove the error. PR-URL: #572 Reviewed-By: Colin Ihrig <[email protected]>
Thanks @vkurchatkin! Landed in f4c536b |
@Fishrock123 yea, I believe the problem is that a |
@Fishrock123 this same with |
Overriding
module
argument withconst
causesSyntaxError
.Apparently this is something you can't do:
P.S.
make test-debugger
hangs, someone has to look at itR=@cjihrig