| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
I found that v8 has been more strict than what Node.js does to parsing the source map magic comments. AFAICT, we don't have a written spec on the magic comment formats. I'll bring this topic to the TC39 tooling discussion to see what can we do to reduce the divergence here.
Anyway, this change looks good to me! Thank you for working on this.
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
With a deeper dig, I found that this works because of the trailing mark $ in the RegExp: i.e. the search begins from the tail of the source content.
If a statement of a string literal that contains a magic comment is present after the actual source map magic comment, this still matches the string literal instead of the actual magic comment.
But I assume we should always take the last magic comment present in the source content, and the magic comment always comes after the real source content. Maybe we can simply add the $ mark in the RegExp instead.
(sorry for the churn, it's late night and I really need to go to sleep 😴)
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks for the feedback. I did go down the root at the beginning but found out that when both sourceMappingURL and sourceURL are specified.
Ex:
node/test/fixtures/source-map/tabs.js
Lines 55 to 56 in 85b46e1
I did however, go back and amend the RegExp to use the global flag which makes this simpler.
Sorry, something went wrong.
|
@alan-agius4 don't hesitate not to force push when pushing more updates, it creates a poor reviewer experience because GitHub is not able to show the diff since the last review, it's a bit frustrating to have to "start over" the review again and again. If instead, you push additional commits to the branch, that would be better for me (and all commits will be squashed into one upon landing anyway). |
Sorry, something went wrong.
Prior to this change `sourceMappingURL` in string where being matched by the RegExp which caused sourcemaps not be loaded when using the `--enable-source-maps` flag. This commit changes the RegExp to match the last occurrence. Fixes: nodejs#44654
Oops sorry about that. I will keep this in mind for the next time. |
Sorry, something went wrong.
There was a problem hiding this comment.
This deserves some comments as I don't think it would be obvious to future reader why we use a loop.
Sorry, something went wrong.
Added comments. |
Sorry, something went wrong.
Sorry, something went wrong.
Co-authored-by: Chengzhong Wu <legendecas@gmail.com>
Sorry, something went wrong.
Sorry, something went wrong.
|
Anything needed from my end to make this green? As the failures seems unrelated to this change. Should I rebase? |
Sorry, something went wrong.
Sorry, something went wrong.
Please don't, it wouldn't help in this case. CI failures seem indeed to be unrelated, I've resumed the CI, hopefully that'd be enough to turn it green. |
Sorry, something went wrong.
Prior to this change `sourceMappingURL` in string where being matched by the RegExp which caused sourcemaps not be loaded when using the `--enable-source-maps` flag. This commit changes the RegExp to match the last occurrence. Fixes: #44654 PR-URL: #44658 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
|
Landed in e6018e2. Thank you for your contribution! |
Sorry, something went wrong.
Prior to this change `sourceMappingURL` in string where being matched by the RegExp which caused sourcemaps not be loaded when using the `--enable-source-maps` flag. This commit changes the RegExp to match the last occurrence. Fixes: #44654 PR-URL: #44658 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Prior to this change `sourceMappingURL` in string where being matched by the RegExp which caused sourcemaps not be loaded when using the `--enable-source-maps` flag. This commit changes the RegExp to match the last occurrence. Fixes: #44654 PR-URL: #44658 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
|
This depends on #43875; marking this as "backport-blocked-v16.x" |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Prior to this change sourceMappingURL in string where being matched by the RegExp which caused sourcemaps not be loaded when using the --enable-source-maps flag. This commit changes the RegExp to match the last occurrence.
Fixes: #44654