Merged
Conversation
This was referenced Aug 17, 2018
johnjbarton
reviewed
Aug 17, 2018
source-map-support.js
Outdated
| var xhr = new XMLHttpRequest(); | ||
| xhr.open('GET', path, false); | ||
| xhr.send(null); | ||
| var contents = null |
johnjbarton
reviewed
Aug 17, 2018
source-map-support.js
Outdated
| try { | ||
| // Use SJAX if we are in the browser | ||
| var xhr = new XMLHttpRequest(); | ||
| xhr.open('GET', path, false); |
There was a problem hiding this comment.
Please add a comment like
// Note: synchronous XHR
It's very weird so a comment would alert readers that it is intended.
or you could use /** async */ false in the call.
Contributor
Author
|
I did not change any of the original code in this PR, just added the try/catch. But of course I can have a look at it. |
68dcad4 to
b024dfe
Compare
Contributor
Author
|
@johnjbarton fixed. |
Collaborator
|
Looks great! Thanks, added a commit to refactor the try/catch, will merge when CI is green 👍 |
Contributor
Author
|
Thanks! 👍 |
|
@LinusU When are you planning to make a release that will contain this commit? |
Collaborator
|
Thx ❤️ released as 0.5.9 🚀 edit: @duydnguyen07 yes |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When the XHR request throws an error (e.g. in case of CORS issues), it is now catched properly. Needed to fix weird Karma/Jasmine issues in Angular CLI projects.
Closes angular/angular-cli#7296.