Internal slot properties (#7947)
* Support internalSlots to babel-types and babel-generator * Parsing support for internal slot properties * Print internal slots in babel-generator * Add whitespace before first internal slot property
This commit is contained in:
6
packages/babel-generator/test/fixtures/flow/internal-slot/input.js
vendored
Normal file
6
packages/babel-generator/test/fixtures/flow/internal-slot/input.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
declare class C { static [[foo]]: T }
|
||||
declare class C { [[foo]]: T }
|
||||
interface T { [[foo]]: X }
|
||||
interface T { [[foo]](): X }
|
||||
type T = { [[foo]]: X }
|
||||
type T = { [[foo]](): X }
|
||||
18
packages/babel-generator/test/fixtures/flow/internal-slot/output.js
vendored
Normal file
18
packages/babel-generator/test/fixtures/flow/internal-slot/output.js
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
declare class C {
|
||||
static [[foo]]: T
|
||||
}
|
||||
declare class C {
|
||||
[[foo]]: T
|
||||
}
|
||||
interface T {
|
||||
[[foo]]: X
|
||||
}
|
||||
interface T {
|
||||
[[foo]]() => X
|
||||
}
|
||||
type T = {
|
||||
[[foo]]: X
|
||||
};
|
||||
type T = {
|
||||
[[foo]]() => X
|
||||
};
|
||||
@@ -304,6 +304,7 @@ describe("programmatic generation", function() {
|
||||
[t.objectTypeProperty(t.identifier("bar"), t.stringTypeAnnotation())],
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
);
|
||||
|
||||
const output = generate(objectStatement).code;
|
||||
@@ -317,6 +318,7 @@ describe("programmatic generation", function() {
|
||||
[t.objectTypeProperty(t.identifier("bar"), t.stringTypeAnnotation())],
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
true,
|
||||
);
|
||||
|
||||
@@ -336,6 +338,7 @@ describe("programmatic generation", function() {
|
||||
t.numberTypeAnnotation(),
|
||||
),
|
||||
],
|
||||
null,
|
||||
);
|
||||
|
||||
const output = generate(objectStatement).code;
|
||||
|
||||
Reference in New Issue
Block a user