-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Parser] Update ast-types and fix up parser
Summary: There were a few changes made to ast-types and the parser was no longer passing the tests. This diff fixes those various issues. The main issues were: 1. Parser support for class property initializers. Flow still doesn't have proper support for them, but they should at least parse. 2. Class method kinds are now `"constructor", "method", "get" and "set"` instead of `"", "init", "get", "set"`. This matches what babel and esprima are doing, though esprima-fb is still stuck with the old kinds. Reviewed By: @avikchaudhuri Differential Revision: D2252999
- Loading branch information
Showing
13 changed files
with
253 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* This is basically the ast-types main.js, except without the conflicting | ||
* babel definitions */ | ||
var types = require("ast-types/lib/types"); | ||
|
||
// This core module of AST types captures ES5 as it is parsed today by | ||
// git://github.com/ariya/esprima.git#master. | ||
require("ast-types/def/core"); | ||
|
||
// Feel free to add to or remove from this list of extension modules to | ||
// configure the precise type hierarchy that you need. | ||
require("ast-types/def/es6"); | ||
require("ast-types/def/es7"); | ||
require("ast-types/def/mozilla"); | ||
require("ast-types/def/e4x"); | ||
require("ast-types/def/fb-harmony"); | ||
require("ast-types/def/esprima"); | ||
|
||
types.finalize(); | ||
|
||
exports.namedTypes = types.namedTypes; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.