Skip to content

Commit

Permalink
module: fix error offset on first line errors via nl
Browse files Browse the repository at this point in the history
  • Loading branch information
tflanagan committed Sep 14, 2015
1 parent 76c8ac5 commit 9d8e6a9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions lib/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ Module.wrapper = NativeModule.wrapper;
Module.wrap = NativeModule.wrap;
Module._debug = util.debuglog('module');

const moduleWrapperColOffset = Module.wrapper[0].length;

// We use this alias for the preprocessor that filters it out
const debug = Module._debug;

Expand Down Expand Up @@ -412,7 +410,7 @@ Module.prototype._compile = function(content, filename) {
var wrapper = Module.wrap(content);

var compiledWrapper = runInThisContext(wrapper,
{ filename: filename, columnOffset: -moduleWrapperColOffset });
{ filename: filename, lineOffset: -1 });
if (global.v8debug) {
if (!resolvedArgv) {
// we enter the repl if we're not given a filename argument.
Expand Down
2 changes: 1 addition & 1 deletion src/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@
};

NativeModule.wrapper = [
'(function (exports, require, module, __filename, __dirname) { ',
'(function (exports, require, module, __filename, __dirname) {\n',
'\n});'
];

Expand Down

0 comments on commit 9d8e6a9

Please sign in to comment.