Skip to content

Commit

Permalink
Print V8IntrinsicIdentifier
Browse files Browse the repository at this point in the history
  • Loading branch information
jridgewell committed Jul 24, 2019
1 parent 6bba3c9 commit 5845c1c
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/babel-generator/src/generators/expressions.js
Expand Up @@ -264,3 +264,8 @@ export function PrivateName(node: Object) {
this.token("#");
this.print(node.id, node);
}

export function V8IntrinsicIdentifier(node: Object) {
this.token("%");
this.word(node.name);
}
@@ -0,0 +1 @@
%DebugPrint(foo);
@@ -0,0 +1,3 @@
{
"plugins": ["v8intrinsic"]
}
@@ -0,0 +1 @@
%DebugPrint(foo);
13 changes: 12 additions & 1 deletion packages/babel-types/src/definitions/misc.js
@@ -1,5 +1,9 @@
// @flow
import defineType, { assertNodeType, assertOneOf } from "./utils";
import defineType, {
assertNodeType,
assertOneOf,
assertValueType,
} from "./utils";
import { PLACEHOLDERS } from "./placeholders";

defineType("Noop", {
Expand All @@ -19,3 +23,10 @@ defineType("Placeholder", {
},
},
});

defineType("V8IntrinsicIdentifier", {
builder: ["name"],
fields: {
name: assertValueType("string"),
},
});

0 comments on commit 5845c1c

Please sign in to comment.