New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parser Performance Collection #9348
Changes from all commits
ae154c8
2dc1c91
59c4bbb
48fd387
25a8db2
a7757ec
e4b8cfc
8df0500
0370af5
a1eac37
c2e4158
49f7bcf
455e003
5876807
10555c7
3a3d5cb
f216975
f12905b
b66d921
4e5e319
2d6231f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
// @flow | ||
|
||
import type { Options } from "../options"; | ||
import { reservedWords } from "../util/identifier"; | ||
import { isES2015ReservedWord } from "../util/identifier"; | ||
|
||
import type State from "../tokenizer/state"; | ||
import type { PluginsMap } from "./index"; | ||
|
@@ -16,21 +16,21 @@ export default class BaseParser { | |
|
||
// Initialized by Tokenizer | ||
state: State; | ||
input: string; | ||
|
||
isReservedWord(word: string): boolean { | ||
if (word === "await") { | ||
return this.inModule; | ||
} else { | ||
return reservedWords[6](word); | ||
return isES2015ReservedWord(word); | ||
} | ||
} | ||
|
||
hasPlugin(name: string): boolean { | ||
return Object.hasOwnProperty.call(this.plugins, name); | ||
return this.plugins.has(name); | ||
} | ||
|
||
getPluginOption(plugin: string, name: string) { | ||
if (this.hasPlugin(plugin)) return this.plugins[plugin][name]; | ||
// $FlowIssue | ||
if (this.hasPlugin(plugin)) return this.plugins.get(plugin)[name]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just out of curiosity, what does flow complain about here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is because of this: facebook/flow#2751 |
||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's possible we didn't add this before since Babylon was in another repo and a different config? Or I think it was actually slower before? Or it was because of browser support..