Repository navigation
Conversation
Use an `Invalid numeric escape` message that shows the offending escape. Fixes babel#13791. Assisted-by: GPT-6 (Codex)
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/62582 |
|
commit: |
nicolo-ribaudo
left a comment
There was a problem hiding this comment.
I don't understand the code changes. The only thing that changed in the tests are error messages and nothing else, it shouldn't require changes to the error reporting logic.
|
the issue wants this error message to include failing escape character. the code change adds that, as well as the position of the failing character ("detail"). |
|
I don't think this PR really fixes #13791. The culprit of #13791 is that the error is thrown in a position with large column such that the code frame does not easily fit in a small screen. This is common when passing minified source or source with large string to Babel. To properly fix this issue, I suggest we introduce a And now without the parser message change, it is very clear that @oovz It will be a new feature for |
|
@JLHwung thank you! I agree that instead of removing the position we should introduce a |
Replace previous
The only valid numeric escape in strict mode is '\\0'.message with the newInvalid numeric escape '${escape}' in strict mode.that shows the offending escape, such as\8in original issue, as well as its position, making it easier to find in long strings.Fixtures are updated. Added a test.
Edit: code and tests are assisted by AI.