Update regenerator to v0.8.34, and remove recast and ast-types.
This version of Regenerator pegs recast to v0.10.18, which pegs ast-types to v0.8.2, which contains special support for all Babel AST types: https://github.com/benjamn/ast-types/blob/master/def/babel.js This version of Regenerator also exports the ast-types module object that it uses (as regenerator.types), so that consumers like Babel can refer to the exact same copy of ast-types when necessary, rather than requiring ast-types themselves. Why that was risky: #1958.
This commit is contained in:
parent
eb6b38d3a8
commit
eac9e9b372
@ -28,7 +28,6 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"acorn-jsx": "^1.0.0",
|
||||
"ast-types": "~0.7.0",
|
||||
"babel-plugin-constant-folding": "^1.0.1",
|
||||
"babel-plugin-dead-code-elimination": "^1.0.2",
|
||||
"babel-plugin-eval": "^1.0.1",
|
||||
@ -63,8 +62,7 @@
|
||||
"path-exists": "^1.0.0",
|
||||
"path-is-absolute": "^1.0.0",
|
||||
"private": "^0.1.6",
|
||||
"recast": "0.10.16",
|
||||
"regenerator": "0.8.32",
|
||||
"regenerator": "0.8.34",
|
||||
"regexpu": "^1.1.2",
|
||||
"repeating": "^1.1.2",
|
||||
"resolve": "^1.1.6",
|
||||
|
||||
@ -1,83 +1,7 @@
|
||||
import estraverse from "estraverse";
|
||||
import extend from "lodash/object/extend";
|
||||
import types from "ast-types";
|
||||
import * as t from "./types";
|
||||
|
||||
// estraverse
|
||||
|
||||
extend(estraverse.VisitorKeys, t.VISITOR_KEYS);
|
||||
|
||||
// regenerator/ast-types
|
||||
|
||||
var def = types.Type.def;
|
||||
var or = types.Type.or;
|
||||
|
||||
//def("File")
|
||||
// .bases("Node")
|
||||
// .build("program")
|
||||
// .field("program", def("Program"));
|
||||
|
||||
def("Noop");
|
||||
|
||||
def("AssignmentPattern")
|
||||
.bases("Pattern")
|
||||
.build("left", "right")
|
||||
.field("left", def("Pattern"))
|
||||
.field("right", def("Expression"));
|
||||
|
||||
def("RestElement")
|
||||
.bases("Pattern")
|
||||
.build("argument")
|
||||
.field("argument", def("expression"));
|
||||
|
||||
def("DoExpression")
|
||||
.bases("Expression")
|
||||
.build("body")
|
||||
.field("body", [def("Statement")]);
|
||||
|
||||
def("Super")
|
||||
.bases("Expression");
|
||||
|
||||
def("ExportDefaultDeclaration")
|
||||
.bases("Declaration")
|
||||
.build("declaration")
|
||||
.field("declaration", or(
|
||||
def("Declaration"),
|
||||
def("Expression"),
|
||||
null
|
||||
));
|
||||
|
||||
def("ExportNamedDeclaration")
|
||||
.bases("Declaration")
|
||||
.build("declaration")
|
||||
.field("declaration", or(
|
||||
def("Declaration"),
|
||||
def("Expression"),
|
||||
null
|
||||
))
|
||||
.field("specifiers", [or(
|
||||
def("ExportSpecifier")
|
||||
)])
|
||||
.field("source", or(def("ModuleSpecifier"), null));
|
||||
|
||||
def("ExportNamespaceSpecifier")
|
||||
.bases("Specifier")
|
||||
.field("exported", def("Identifier"));
|
||||
|
||||
def("ExportDefaultSpecifier")
|
||||
.bases("Specifier")
|
||||
.field("exported", def("Identifier"));
|
||||
|
||||
def("ExportAllDeclaration")
|
||||
.bases("Declaration")
|
||||
.build("exported", "source")
|
||||
.field("exported", def("Identifier"))
|
||||
.field("source", def("Literal"));
|
||||
|
||||
def("BindExpression")
|
||||
.bases("Expression")
|
||||
.build("object", "callee")
|
||||
.field("object", or(def("Expression"), null))
|
||||
.field("callee", def("Expression"));
|
||||
|
||||
types.finalize();
|
||||
|
||||
@ -1,6 +1,11 @@
|
||||
import regenerator from "regenerator";
|
||||
import * as t from "../../../types";
|
||||
import { NodePath } from "ast-types";
|
||||
|
||||
// It's important to use the exact same NodePath constructor that
|
||||
// Regenerator uses, rather than require("ast-types").NodePath, because
|
||||
// the version of ast-types that Babel knows about might be different from
|
||||
// the version that Regenerator depends on. See for example #1958.
|
||||
const NodePath = regenerator.types.NodePath;
|
||||
|
||||
export var metadata = {
|
||||
group: "builtin-advanced"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user