fix: allow shebang directive (#9922)

* fix: allow shebang directive

* Update packages/babel-parser/src/plugins/flow.js

* chore: prettier
This commit is contained in:
Tan Li Hau
2019-05-07 22:22:25 +08:00
committed by Nicolò Ribaudo
parent 9e9b62f77a
commit 354666aa17
3 changed files with 314 additions and 1 deletions

View File

@@ -96,7 +96,11 @@ export default (superClass: Class<Parser>): Class<Parser> =>
}
finishToken(type: TokenType, val: any): void {
if (!(type === tt.string || type === tt.semi)) {
if (
type !== tt.string &&
type !== tt.semi &&
type !== tt.interpreterDirective
) {
if (this.flowPragma === undefined) {
this.flowPragma = null;
}