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

Disallow import type { type a } from '' #305

Merged
merged 1 commit into from Jan 17, 2017

Conversation

Projects
None yet
3 participants
@danez
Copy link
Member

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

I saw that flow was failing, but babylon parsed it just fine.

import typeof {typeof t} from "foo";
import type {type t} from "foo";

@jeffmo Can you confirm that this is correct?

Daniel Tschinder
@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Jan 17, 2017

Current coverage is 97.27% (diff: 100%)

Merging #305 into master will increase coverage by <.01%

@@             master       #305   diff @@
==========================================
  Files            21         21          
  Lines          3999       4000     +1   
  Methods         489        469    -20   
  Messages          0          0          
  Branches       1169       1191    +22   
==========================================
+ Hits           3890       3891     +1   
  Misses           49         49          
  Partials         60         60          

Powered by Codecov. Last update 28c467e...fc069fd

@jeffmo

This comment has been minimized.

Copy link
Contributor

jeffmo commented Jan 17, 2017

Yes this invariant is correct, I must've overlooked it. Thanks for the follow-up!

@danez danez merged commit 999b655 into master Jan 17, 2017

4 checks passed

codecov/patch 100% of diff hit (target 97.27%)
Details
codecov/project 97.27% (+<.01%) compared to 28c467e
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@danez danez deleted the fix-import-short branch Jan 17, 2017

@@ -0,0 +1,3 @@
{

This comment has been minimized.

@jeffmo

jeffmo Jan 17, 2017

Contributor

I'm probably just not familiar with how the test runner/fixtures work, but shouldn't this output have 2 throws (one for each line)?

This comment has been minimized.

@danez

danez Jan 18, 2017

Author Member

You are right, babylon throws at the first error, and never parses the second line. I extracted that in a second test.

@@ -1223,6 +1223,10 @@ export default function (instance) {
specifier.local = specifier.imported.__clone();
}

if (node.importKind !== "value" && specifier.importKind !== null) {

This comment has been minimized.

@jeffmo

jeffmo Jan 17, 2017

Contributor

Per this discussion with @loganfsmyth, I guess this should stick to explicitly listing out "type" and "typeof"

babel/babel#5035 (comment)

This comment has been minimized.

@danez

danez Jan 18, 2017

Author Member

Changed that in #312

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