Uh oh!
There was an error while loading. Please reload this page.
module: fix error first line col offset - #2867
Conversation
76c8ac5 to
9c0f78bComparekenany
commented
Sep 14, 2015
I feel like @brendan0powers's authorship should be preserved here. |
tflanagan
commented
Sep 14, 2015
👍 Just looking for things to do (this seemed rather important) |
brendanashworth
commented
Sep 15, 2015
Are there any side effects of using the second commit (tflanagan@9d8e6a9)? It seems way simpler. |
There was a problem hiding this comment.
Need to also update docs on Script constructor
There was a problem hiding this comment.
I've updated the docs in two places with the lineOffset and columnOffset parameters, and also added a missing filename and timeout parameter listings.
cjihrig
commented
Sep 16, 2015
I agree with @brendanashworth that the other commit looks much simpler. Does it cause any issues on Windows? |
tflanagan
commented
Oct 8, 2015
bump for LTS? Don't want this PR to end up like @brendan0powers's |
brendanashworth
commented
Oct 10, 2015
@tflanagan does tflanagan@489b5b4 cause any issues (perhaps windows)? I think this should be pushed instead of the other bigger commits. But this would be a candidate for LTS back-porting anyways. |
tflanagan
commented
Oct 10, 2015
I've beening running it on windows for over 3 weeks without issues, granted any issue would only show if an error occured |
brendanashworth
commented
Oct 10, 2015
@tflanagan could you push only that commit to this PR then? Then we can review and run the CI. |
489b5b4 to
41810b8Comparetflanagan
commented
Oct 12, 2015
@brendanashworth okay, i've rebased/amended/pushed it down to one commit with the NL approach.
|
tflanagan
commented
Oct 20, 2015
poke edit: poke |
There was a problem hiding this comment.
The first line of this comment can probably be removed.
cjihrig
commented
Nov 20, 2015
@tflanagan I'm interested in getting this landed. Would you mind rebasing? |
tflanagan
commented
Nov 20, 2015
@cjihrig Rebased, running new tests now, will force push shortly |
41810b8 to
7dc621bComparetflanagan
commented
Nov 20, 2015
@cjihrig Done. Besides for those pesky flaky Buffer tests, it passes local tests fwiw Edit: Fixed the docs |
b28d69a to
1505c73Compare1505c73 to
e4281caComparecjihrig
commented
Nov 20, 2015
Thanks. LGTM. CI: https://ci.nodejs.org/job/node-test-pull-request/800/ |
tflanagan
commented
Nov 20, 2015
@cjihrig Looks like it passed! :) 💯 |
cjihrig
commented
Nov 20, 2015
💚 from the CI. Nice. Landing. |
Because Node modules are wrapped, errors on the first line of a file leak the wrapper to the user and report the wrong column number. This commit adds a line break to the module wrapper so that the first line is treated the same as all other lines. To compensate for the additional line, a line offset of -1 is also applied to errors. Fixes: #2860 PR-URL: #2867 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
cjihrig
commented
Nov 20, 2015
Thanks! Landed in dfee4e3 |
tflanagan
commented
Nov 20, 2015
Thank you! 👍 |
Because Node modules are wrapped, errors on the first line of a file leak the wrapper to the user and report the wrong column number. This commit adds a line break to the module wrapper so that the first line is treated the same as all other lines. To compensate for the additional line, a line offset of -1 is also applied to errors. Fixes: #2860 PR-URL: #2867 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
In dfee4e3, the module wrapper and line offset used when wrapping module code was changed to better report errors on the first line of modules. However, that commit did not update the runInThisContext() call used to execute the core modules, so their error line numbers have been off by one. This commit provides the correct lineOffset for core modules. Refs: nodejs#2867 PR-URL: nodejs#4254 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
In dfee4e3, the module wrapper and line offset used when wrapping module code was changed to better report errors on the first line of modules. However, that commit did not update the runInThisContext() call used to execute the core modules, so their error line numbers have been off by one. This commit provides the correct lineOffset for core modules. Refs: #2867 PR-URL: #4254 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Minwoo Jung <jmwsoft@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
In dfee4e3, the module wrapper and line offset used when wrapping module code was changed to better report errors on the first line of modules. However, that commit did not update the runInThisContext() call used to execute the core modules, so their error line numbers have been off by one. This commit provides the correct lineOffset for core modules. Refs: #2867 PR-URL: #4254 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Minwoo Jung <jmwsoft@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Because Node modules are wrapped, errors on the first line of a file leak the wrapper to the user and report the wrong column number. This commit adds a line break to the module wrapper so that the first line is treated the same as all other lines. To compensate for the additional line, a line offset of -1 is also applied to errors. Fixes: #2860 PR-URL: #2867 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
In dfee4e3, the module wrapper and line offset used when wrapping module code was changed to better report errors on the first line of modules. However, that commit did not update the runInThisContext() call used to execute the core modules, so their error line numbers have been off by one. This commit provides the correct lineOffset for core modules. Refs: #2867 PR-URL: #4254 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Minwoo Jung <jmwsoft@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Because Node modules are wrapped, errors on the first line of a file leak the wrapper to the user and report the wrong column number. This commit adds a line break to the module wrapper so that the first line is treated the same as all other lines. To compensate for the additional line, a line offset of -1 is also applied to errors. Fixes: #2860 PR-URL: #2867 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
In dfee4e3, the module wrapper and line offset used when wrapping module code was changed to better report errors on the first line of modules. However, that commit did not update the runInThisContext() call used to execute the core modules, so their error line numbers have been off by one. This commit provides the correct lineOffset for core modules. Refs: #2867 PR-URL: #4254 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Minwoo Jung <jmwsoft@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
In dfee4e3, the module wrapper and line offset used when wrapping module code was changed to better report errors on the first line of modules. However, that commit did not update the runInThisContext() call used to execute the core modules, so their error line numbers have been off by one. This commit provides the correct lineOffset for core modules. Refs: nodejs#2867 PR-URL: nodejs#4254 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Minwoo Jung <jmwsoft@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Rehash of nodejs/node-v0.x-archive#25342 with noted corrections.
Fixes#2860, nodejs/node-v0.x-archive#9445
I've also created another variant of this solution by adding a "\n" to the wrapper and setting the
lineOffsetproperty to-1, re: tflanagan@9d8e6a9