question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

-0 gets printed as 0 in Babel

See original GitHub issue

Bug Report

Current Behavior t.numericLiteral does not support -0.

Input Code http://astexplorer.net/#/gist/c5f83ae7704f4089946202031abba218/3c1d2aa4249f46f18aa4b58c0b995d353d0d5186

Possible Solution Check that 0 is -0 with Object.is before printing it.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
loganfsmythcommented, May 22, 2018

Alright, here’s a PR: https://github.com/babel/babel/pull/8005

Also probably a reasonable candidate for backporting but it’d be best to let it bake on 7.x for a few days after our next publish.

1reaction
loganfsmythcommented, May 22, 2018

Interesting, I think that’s something we should treat as a bug in valueToNode, good catch.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does babel rewrite imported function call to (0, fn)(...)?
This is the reason Babel is doing it there: In the original code, the call was simply a() , which calls a with...
Read more >
Number Formatting — Babel 2.11.0 documentation
As with date/time formatting patterns, the patterns Babel supports for number formatting are based on the Locale Data Markup Language specification (LDML).
Read more >
6.0.0 Released - Babel.js
This means the 'blacklist', 'whitelist', 'optional', 'nonStandard', and 'modules' options have all been removed, but that doesn't mean you need ...
Read more >
The openbabel module — Open Babel v2.3.1 documentation
The openbabel module provides direct access to the C++ Open Babel library from Python. ... OBMol() print 'Should print 0 (atoms)' print mol....
Read more >
Java — Open Babel 3.0.1 documentation - Read the Docs
The openbabel.jar file in the Open Babel distribution allows you to use the Open Babel ... ReadString(mol, "C(Cl)(=O)CCC(=O)Cl"); // Print out some general ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found