Skip to content
This repository has been archived by the owner on May 19, 2018. It is now read-only.

keywords are not allowed as local specifier in imports #307

Merged
merged 1 commit into from
Feb 10, 2017

Conversation

danez
Copy link
Member

@danez danez commented Jan 17, 2017

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

This should not be allowed

import { default } from "foo";

https://www.ecma-international.org/ecma-262/7.0/#prod-BindingIdentifier

The Identifier is an BindingIdentifier and the spec says not ReservedKeyword

As flow completely overwrites the parsing I also had to change it there.
Furthermore I fixed the implementation in the flow plugin to consider keywords and not only names and also changed parsing Identifier to always do the ReservedKeyword check, so that the error message gets clearer.
Before: Unexpected token (what else would it be?)
After : <keyword> is a reserved word

@codecov-io
Copy link

codecov-io commented Jan 17, 2017

Current coverage is 97.19% (diff: 100%)

Merging #307 into master will increase coverage by 0.06%

@@             master       #307   diff @@
==========================================
  Files            21         21          
  Lines          3487       3492     +5   
  Methods         400        400          
  Messages          0          0          
  Branches        896        895     -1   
==========================================
+ Hits           3387       3394     +7   
+ Misses           44         43     -1   
+ Partials         56         55     -1   

Powered by Codecov. Last update 0a00aff...fe21e06

@danez danez force-pushed the fix-import-keyword branch 2 times, most recently from 50c9845 to a6ad78d Compare January 18, 2017 15:58
Also fix some error messages to be more specific
@danez danez merged commit 4bd682e into master Feb 10, 2017
@danez danez deleted the fix-import-keyword branch February 10, 2017 13:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants