Skip to content

Commit

Permalink
remove temp type override and use new recast pr
Browse files Browse the repository at this point in the history
  • Loading branch information
hzoo committed Jul 4, 2016
1 parent ef32f68 commit 2836a76
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions packages/babel-core/test/api.js
Expand Up @@ -103,30 +103,6 @@ suite("api", function () {
}

test("can transform and keep formatting", function() {
var def = recast.types.Type.def
var or = recast.types.Type.or;
var defaults = {
"null": function() { return null },
"emptyArray": function() { return [] },
"false": function() { return false },
"true": function() { return true },
"undefined": function() {}
}

def("ObjectProperty")
.bases("Node") // Want to be able to visit Property Nodes.
.build("key", "value", "computed", "shorthand", "decorators")

.field("key", or(def("Literal"), def("Identifier"), def("Expression")))
.field("value", or(def("Expression"), def("Pattern")))
.field("shorthand", Boolean, defaults["false"])
.field("computed", Boolean, defaults["false"])
.field("decorators",
or([def("Decorator")], null),
defaults["null"]);

recast.types.finalize();

var result = execTest();
assert.equal(result.code, "var a={ b };");
});
Expand Down

0 comments on commit 2836a76

Please sign in to comment.