Added jsescOptions to Numeric Literals#11028
Conversation
|
Reffered the code from StringLiteral function for Numeric Literals. What can we use here instead of |
|
@JLHwung Made the changes. But it is affecting other tests. PTAL. |
packages/babel-generator/test/fixtures/escapes/jsonEscape/output.js
Outdated
Show resolved
Hide resolved
packages/babel-generator/test/fixtures/escapes/jsonEscape/options.json
Outdated
Show resolved
Hide resolved
|
@JLHwung @nicolo-ribaudo PTAL now.
|
nicolo-ribaudo
left a comment
There was a problem hiding this comment.
I think that the logic should be something like this:
- Is
this.format.jsescOption.numbersis set,
i. Callthis.number(jsesc(node.value, this.format.jsescOption)) - Otherwise, fallback to our old unmodified logic.
If someone sets this.format.jsescOption.numbers, they are explicitly overwriting any other automatic logic used to format numbers (i.e. literal length when minified: true, or "use the raw value if it's possible").
|
@nicolo-ribaudo @JLHwung PTAL now. Have modified the conditions as mentioned above. |
|
@nicolo-ribaudo Made the changes. PTAL now. |
|
@nicolo-ribaudo Done. Please review. |
Uh oh!
There was an error while loading. Please reload this page.