Skip to content
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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/_debugger.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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.

const repl = Module.requireRepl();
const inherits = util.inherits;
const assert = require('assert');
const spawn = require('child_process').spawn;
Expand Down Expand Up @@ -1110,7 +1110,7 @@ Interface.prototype.list = function(delta) {
if (lineno == 1) {
// The first line needs to have the module wrapper filtered out of
// it.
var wrapper = module.wrapper[0];
var wrapper = Module.wrapper[0];
lines[i] = lines[i].slice(wrapper.length);

client.currentSourceColumn -= wrapper.length;
Expand Down