This repository has been archived by the owner. It is now read-only.

Fix negative number literal typeannotations #366

Merged
merged 3 commits into from Feb 20, 2017

Conversation

Projects
None yet
1 participant
@danez
Copy link
Member

danez commented Feb 20, 2017

Q A
Bug fix? y
Breaking change? n
New feature? n
Deprecations? n
Spec compliancy? y
Tests added/pass? y
Fixed tickets
License MIT

Currently negative number literal type annotations contain the wrong raw value:

http://astexplorer.net/#/gist/f6cb8e0c848b800f6fdf2e1b64cad131/90e051a59cdf7e4fa88e79c22f6567dc1c451e45

The raw value is "1" instead of "-1". The flow parser is doing the correct thing.

Also use parseLiteral() to parser string and number literal typeannotations
so that future changes (estree) to literals are also reflected to flow.

Fix negative number literal typeannotations
Also use parseLiteral() to parser string and number literal typeannotations
so that future changes (estree) to literals are also reflected to flow.
@codecov

This comment has been minimized.

Copy link

codecov bot commented Feb 20, 2017

Codecov Report

❗️ No coverage uploaded for pull request base (master@57aacea). Click here to learn what that means.
The diff coverage is 100%.

@@            Coverage Diff            @@
##             master     #366   +/-   ##
=========================================
  Coverage          ?   97.85%           
=========================================
  Files             ?       21           
  Lines             ?     3495           
  Branches          ?      927           
=========================================
  Hits              ?     3420           
  Misses            ?       29           
  Partials          ?       46
Impacted Files Coverage Δ
src/parser/node.js 100% <100%> (ø)
src/plugins/flow.js 98.08% <100%> (ø)
src/parser/expression.js 97.34% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 57aacea...b5f91c9. Read the comment docs.

@danez danez merged commit 2ef00a6 into babel:master Feb 20, 2017

1 of 3 checks passed

codecov/patch No report found to compare against
Details
codecov/project No report found to compare against
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@danez danez deleted the danez:fix-negative-flow branch Feb 20, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.