diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f94e0722954e1..0e39f9096dd902 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Node.js ChangeLog +## 2016-01-21, Version 4.2.6 'Argon' (LTS), @TheAlphaNerd + +### Notable changes + +* Fix regression in debugger and profiler functionality + +### Known issues + +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). + +### Commits + +* [[`1408f7abb1`](https://github.com/nodejs/node/commit/1408f7abb1)] - **module,src**: do not wrap modules with -1 lineOffset (cjihrig) [#4298](https://github.com/nodejs/node/pull/4298) +* [[`1f8e1472cc`](https://github.com/nodejs/node/commit/1f8e1472cc)] - **test**: add test for debugging one line files (cjihrig) [#4298](https://github.com/nodejs/node/pull/4298) + + ## 2016-01-20, Version 4.2.5 'Argon' (LTS), @TheAlphaNerd Maintenance update. diff --git a/lib/module.js b/lib/module.js index 99c476210991fd..1d937f8baa2aa8 100644 --- a/lib/module.js +++ b/lib/module.js @@ -372,7 +372,7 @@ Module.prototype._compile = function(content, filename) { var wrapper = Module.wrap(content); var compiledWrapper = runInThisContext(wrapper, - { filename: filename, lineOffset: -1 }); + { filename: filename, lineOffset: 0 }); if (global.v8debug) { if (!resolvedArgv) { // we enter the repl if we're not given a filename argument. diff --git a/src/node.js b/src/node.js index 367f68b25c003c..b38594f7c09274 100644 --- a/src/node.js +++ b/src/node.js @@ -942,7 +942,7 @@ }; NativeModule.wrapper = [ - '(function (exports, require, module, __filename, __dirname) {\n', + '(function (exports, require, module, __filename, __dirname) { ', '\n});' ]; @@ -952,7 +952,7 @@ var fn = runInThisContext(source, { filename: this.filename, - lineOffset: -1 + lineOffset: 0 }); fn(this.exports, NativeModule.require, this, this.filename); diff --git a/src/node_version.h b/src/node_version.h index 6e795fb70ef0d7..1d2730b54b605a 100644 --- a/src/node_version.h +++ b/src/node_version.h @@ -3,7 +3,7 @@ #define NODE_MAJOR_VERSION 4 #define NODE_MINOR_VERSION 2 -#define NODE_PATCH_VERSION 6 +#define NODE_PATCH_VERSION 7 #define NODE_VERSION_IS_LTS 1 #define NODE_VERSION_LTS_CODENAME "Argon" diff --git a/test/fixtures/exports-function-with-param.js b/test/fixtures/exports-function-with-param.js new file mode 100644 index 00000000000000..263b9064422108 --- /dev/null +++ b/test/fixtures/exports-function-with-param.js @@ -0,0 +1 @@ +module.exports = function foo(arg) { return arg; } diff --git a/test/parallel/test-vm-debug-context.js b/test/parallel/test-vm-debug-context.js index 2e86d136bea2fa..b648592eaea901 100644 --- a/test/parallel/test-vm-debug-context.js +++ b/test/parallel/test-vm-debug-context.js @@ -53,6 +53,24 @@ assert.strictEqual(vm.runInDebugContext(undefined), undefined); assert.equal(breaks, 1); })(); +// Can set listeners and breakpoints on a single line file +(function() { + const Debug = vm.runInDebugContext('Debug'); + const fn = require(common.fixturesDir + '/exports-function-with-param'); + let called = false; + + Debug.setListener(function(event, state, data) { + if (data.constructor.name === 'BreakEvent') { + called = true; + } + }); + + Debug.setBreakPoint(fn); + fn('foo'); + assert.strictEqual(Debug.showBreakPoints(fn), '(arg) { [B0]return arg; }'); + assert.strictEqual(called, true); +})(); + // See https://github.com/nodejs/node/issues/1190, fatal errors should not // crash the process. var script = common.fixturesDir + '/vm-run-in-debug-context.js'; diff --git a/test/sequential/test-module-loading.js b/test/sequential/test-module-loading.js index 19ba398d960701..ead3447320c50a 100644 --- a/test/sequential/test-module-loading.js +++ b/test/sequential/test-module-loading.js @@ -285,9 +285,9 @@ assert.equal(42, require('../fixtures/utf8-bom.js')); assert.equal(42, require('../fixtures/utf8-bom.json')); // Error on the first line of a module should -// have the correct line and column number +// have the correct line number assert.throws(function() { require('../fixtures/test-error-first-line-offset.js'); }, function(err) { - return /test-error-first-line-offset.js:1:1/.test(err.stack); + return /test-error-first-line-offset.js:1:/.test(err.stack); }, 'Expected appearance of proper offset in Error stack');