[babel-generator]: jsescOption.numbers does not affect NumericLiterals
See original GitHub issueBug Report
- I would like to work on a fix!
Current Behavior Currently, when I set:
{
jsescOption: {
numbers: 'hexadecimal'
}
}
This option has not affects any numbers that @babel/generator
is generated.
For example i need the following in the output generated code:
var foo = 0x1;
Expected behavior/code
{
jsescOption: {
numbers: 'hexadecimal'
}
}
This option should affect any numbers that @babel/generator
is generated
- @babel/generator version: 7.7.7
- Node/npm version: Node 12
Possible Solution
Looks like here: https://github.com/babel/babel/blob/master/packages/babel-generator/src/generators/types.js#L121
number value should be generated using jsesc
like in StringLiteral
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
babel/generator - Babel.js
When Babel generator prints code from the AST, the output format is not guaranteed ... to numbers only if jsescOption.numbers (added in v7.9.0...
Read more >https://raw.githubusercontent.com/assemblylanguage...
This devtool is not neither made for production nor for readable output files. ... Converting the array of base-26 numbers into the characters...
Read more >基础包制作 (b6bba109) · Commits · 徐俊 / yungu_node_modules ...
If the column number is not known, you may omit it. ... retainLines | boolean | `false` | Attempt to use the same...
Read more >Package Diff: tap @ 14.10.7 .. 14.10.8
Visual diff of the npm package 'tap' comparing 14.10.7 with 14.10.8.
Read more >chore: add cloudbase · 123bb319aa - omi - Gitea Yiem
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Set the options as descrived above.
With these options, all numbers should be generated in hexadecimal view:
0
->0x0
@nicolo-ribaudo I would like to work on this. Can you please guide how to proceed? Thanks 😃