-
Notifications
You must be signed in to change notification settings - Fork 225
use original name from source in error trace #220
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -278,7 +278,7 @@ it('throw with empty source map', function() { | |
| 'throw new Error("test");' | ||
| ], [ | ||
| 'Error: test', | ||
| /^ at Object\.exports\.test \((?:.*[/\\])?.generated.js:1:34\)$/ | ||
| /^ at Object\.exports\.test \((?:.*[/\\])?\.generated.js:1:34\)$/ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice! |
||
| ]); | ||
| }); | ||
|
|
||
|
|
@@ -293,7 +293,7 @@ it('throw in Timeout with empty source map', function(done) { | |
| ' throw new Error("this is the error")', | ||
| /^ \^$/, | ||
| 'Error: this is the error', | ||
| /^ at ((null)|(Timeout))\._onTimeout \((?:.*[/\\])?.generated.js:3:11\)$/ | ||
| /^ at ((null)|(Timeout))\._onTimeout \((?:.*[/\\])?.generated\.js:3:11\)$/ | ||
| ]); | ||
| }); | ||
|
|
||
|
|
@@ -302,7 +302,7 @@ it('throw with source map with gap', function() { | |
| 'throw new Error("test");' | ||
| ], [ | ||
| 'Error: test', | ||
| /^ at Object\.exports\.test \((?:.*[/\\])?.generated.js:1:34\)$/ | ||
| /^ at Object\.exports\.test \((?:.*[/\\])?\.generated\.js:1:34\)$/ | ||
| ]); | ||
| }); | ||
|
|
||
|
|
@@ -311,7 +311,7 @@ it('sourcesContent with data URL', function() { | |
| 'throw new Error("test");' | ||
| ], [ | ||
| 'Error: test', | ||
| /^ at Object\.exports\.test \((?:.*[/\\])?original.js:1001:5\)$/ | ||
| /^ at Object\.exports\.test \((?:.*[/\\])?original\.js:1001:5\)$/ | ||
| ]); | ||
| }); | ||
|
|
||
|
|
@@ -321,7 +321,27 @@ it('finds the last sourceMappingURL', function() { | |
| 'throw new Error("test");' | ||
| ], [ | ||
| 'Error: test', | ||
| /^ at Object\.exports\.test \((?:.*[/\\])?original.js:1002:5\)$/ | ||
| /^ at Object\.exports\.test \((?:.*[/\\])?original\.js:1002:5\)$/ | ||
| ]); | ||
| }); | ||
|
|
||
| it('maps original name from source', function() { | ||
| var sourceMap = createEmptySourceMap(); | ||
| sourceMap.addMapping({ | ||
| generated: { line: 2, column: 8 }, | ||
| original: { line: 1000, column: 10 }, | ||
| source: '.original.js', | ||
| name: 'myOriginalName' | ||
| }); | ||
| compareStackTrace(sourceMap, [ | ||
| 'function foo() {', | ||
| ' throw new Error("test");', | ||
| '}', | ||
| 'foo();' | ||
| ], [ | ||
| 'Error: test', | ||
| /^ at myOriginalName \((?:.*[/\\])?\.original.js:1000:11\)$/, | ||
| /^ at Object\.exports\.test \((?:.*[/\\])?\.generated.js:4:1\)$/ | ||
| ]); | ||
| }); | ||
|
|
||
|
|
@@ -337,7 +357,7 @@ it('default options', function(done) { | |
| 'this is the original code', | ||
| '^', | ||
| 'Error: this is the error', | ||
| /^ at foo \((?:.*[/\\])?.original\.js:1:1\)$/ | ||
| /^ at foo \((?:.*[/\\])?\.original\.js:1:1\)$/ | ||
| ]); | ||
| }); | ||
|
|
||
|
|
@@ -352,7 +372,7 @@ it('handleUncaughtExceptions is true', function(done) { | |
| 'this is the original code', | ||
| '^', | ||
| 'Error: this is the error', | ||
| /^ at foo \((?:.*[/\\])?.original\.js:1:1\)$/ | ||
| /^ at foo \((?:.*[/\\])?\.original\.js:1:1\)$/ | ||
| ]); | ||
| }); | ||
|
|
||
|
|
@@ -414,7 +434,7 @@ it('specifically requested error source', function(done) { | |
| 'process.on("uncaughtException", function (e) { console.log("SRC:" + sms.getErrorSource(e)); });', | ||
| 'process.nextTick(foo);' | ||
| ], [ | ||
| /^SRC:.*[/\\].original.js:1$/, | ||
| /^SRC:.*[/\\]\.original\.js:1$/, | ||
| 'this is the original code', | ||
| '^' | ||
| ]); | ||
|
|
@@ -488,9 +508,9 @@ it('should consult all retrieve source map providers', function(done) { | |
| 'process.nextTick(function() { console.log(count); });', | ||
| ], [ | ||
| 'Error: this is the error', | ||
| /^ at foo \((?:.*[/\\])?original.js:1004:5\)$/, | ||
| /^ at foo \((?:.*[/\\])?original\.js:1004:5\)$/, | ||
| 'Error: this is the error', | ||
| /^ at foo \((?:.*[/\\])?original.js:1004:5\)$/, | ||
| /^ at foo \((?:.*[/\\])?original\.js:1004:5\)$/, | ||
| '1', // The retrieval should only be attempted once | ||
| ]); | ||
| }); | ||
|
|
@@ -525,9 +545,9 @@ it('should allow for runtime inline source maps', function(done) { | |
| 'require("./.generated.jss");', | ||
| ], [ | ||
| 'Error: this is the error', | ||
| /^ at foo \(.*[/\\]original.js:1004:5\)$/, | ||
| /^ at foo \(.*[/\\]original\.js:1004:5\)$/, | ||
| 'Error: this is the error', | ||
| /^ at foo \(.*[/\\]original.js:1004:5\)$/, | ||
| /^ at foo \(.*[/\\]original\.js:1004:5\)$/, | ||
| '0', // The retrieval should only be attempted once | ||
| ]); | ||
| }); | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
there are various minor regex changes too