Commit 5b5df7d0 authored by Rosanny Sihombing's avatar Rosanny Sihombing
Browse files

Revert "Merge branch 'cherry-pick-5b932c11' into 'testing'"

This reverts merge request !169
parent 4806fefb
......@@ -269,7 +269,7 @@ export interface ObjectExpression extends BaseNode {
export interface ObjectMethod extends BaseNode {
type: "ObjectMethod";
kind: "method" | "get" | "set";
key: Expression | Identifier | StringLiteral | NumericLiteral;
key: Expression | Identifier | StringLiteral | NumericLiteral | BigIntLiteral;
params: Array<Identifier | Pattern | RestElement>;
body: BlockStatement;
computed: boolean;
......@@ -510,7 +510,7 @@ export interface MetaProperty extends BaseNode {
export interface ClassMethod extends BaseNode {
type: "ClassMethod";
kind: "get" | "set" | "method" | "constructor";
key: Identifier | StringLiteral | NumericLiteral | Expression;
key: Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression;
params: Array<Identifier | Pattern | RestElement | TSParameterProperty>;
body: BlockStatement;
computed: boolean;
......@@ -606,7 +606,7 @@ export interface OptionalCallExpression extends BaseNode {
export interface ClassProperty extends BaseNode {
type: "ClassProperty";
key: Identifier | StringLiteral | NumericLiteral | Expression;
key: Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression;
value: Expression | null;
typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop | null;
decorators: Array<Decorator> | null;
......@@ -624,7 +624,7 @@ export interface ClassProperty extends BaseNode {
export interface ClassAccessorProperty extends BaseNode {
type: "ClassAccessorProperty";
key: Identifier | StringLiteral | NumericLiteral | Expression | PrivateName;
key: Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression | PrivateName;
value: Expression | null;
typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop | null;
decorators: Array<Decorator> | null;
......@@ -645,7 +645,7 @@ export interface ClassPrivateProperty extends BaseNode {
key: PrivateName;
value: Expression | null;
decorators: Array<Decorator> | null;
static: any;
static: boolean;
definite: boolean | null;
readonly: boolean | null;
typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop | null;
......@@ -654,7 +654,7 @@ export interface ClassPrivateProperty extends BaseNode {
export interface ClassPrivateMethod extends BaseNode {
type: "ClassPrivateMethod";
kind: "get" | "set" | "method" | "constructor";
kind: "get" | "set" | "method";
key: PrivateName;
params: Array<Identifier | Pattern | RestElement | TSParameterProperty>;
body: BlockStatement;
......@@ -1268,7 +1268,7 @@ export interface TSDeclareFunction extends BaseNode {
export interface TSDeclareMethod extends BaseNode {
type: "TSDeclareMethod";
decorators: Array<Decorator> | null;
key: Identifier | StringLiteral | NumericLiteral | Expression;
key: Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression;
typeParameters: TSTypeParameterDeclaration | Noop | null;
params: Array<Identifier | Pattern | RestElement | TSParameterProperty>;
returnType: TSTypeAnnotation | Noop | null;
......@@ -1309,7 +1309,7 @@ export interface TSPropertySignature extends BaseNode {
key: Expression;
typeAnnotation: TSTypeAnnotation | null;
initializer: Expression | null;
computed: boolean | null;
computed: boolean;
kind: "get" | "set";
optional: boolean | null;
readonly: boolean | null;
......@@ -1321,7 +1321,7 @@ export interface TSMethodSignature extends BaseNode {
typeParameters: TSTypeParameterDeclaration | null;
parameters: Array<Identifier | RestElement>;
typeAnnotation: TSTypeAnnotation | null;
computed: boolean | null;
computed: boolean;
kind: "method" | "get" | "set";
optional: boolean | null;
}
......@@ -1799,7 +1799,7 @@ export function memberExpression(object: Expression, property: Expression | Iden
export function newExpression(callee: Expression | V8IntrinsicIdentifier, _arguments: Array<Expression | SpreadElement | JSXNamespacedName | ArgumentPlaceholder>): NewExpression;
export function program(body: Array<Statement>, directives?: Array<Directive>, sourceType?: "script" | "module", interpreter?: InterpreterDirective | null): Program;
export function objectExpression(properties: Array<ObjectMethod | ObjectProperty | SpreadElement>): ObjectExpression;
export function objectMethod(kind: "method" | "get" | "set" | undefined, key: Expression | Identifier | StringLiteral | NumericLiteral, params: Array<Identifier | Pattern | RestElement>, body: BlockStatement, computed?: boolean, generator?: boolean, async?: boolean): ObjectMethod;
export function objectMethod(kind: "method" | "get" | "set" | undefined, key: Expression | Identifier | StringLiteral | NumericLiteral | BigIntLiteral, params: Array<Identifier | Pattern | RestElement>, body: BlockStatement, computed?: boolean, generator?: boolean, async?: boolean): ObjectMethod;
export function objectProperty(key: Expression | Identifier | StringLiteral | NumericLiteral | BigIntLiteral | DecimalLiteral | PrivateName, value: Expression | PatternLike, computed?: boolean, shorthand?: boolean, decorators?: Array<Decorator> | null): ObjectProperty;
export function restElement(argument: LVal): RestElement;
export function returnStatement(argument?: Expression | null): ReturnStatement;
......@@ -1832,7 +1832,7 @@ export function importDefaultSpecifier(local: Identifier): ImportDefaultSpecifie
export function importNamespaceSpecifier(local: Identifier): ImportNamespaceSpecifier;
export function importSpecifier(local: Identifier, imported: Identifier | StringLiteral): ImportSpecifier;
export function metaProperty(meta: Identifier, property: Identifier): MetaProperty;
export function classMethod(kind: "get" | "set" | "method" | "constructor" | undefined, key: Identifier | StringLiteral | NumericLiteral | Expression, params: Array<Identifier | Pattern | RestElement | TSParameterProperty>, body: BlockStatement, computed?: boolean, _static?: boolean, generator?: boolean, async?: boolean): ClassMethod;
export function classMethod(kind: "get" | "set" | "method" | "constructor" | undefined, key: Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression, params: Array<Identifier | Pattern | RestElement | TSParameterProperty>, body: BlockStatement, computed?: boolean, _static?: boolean, generator?: boolean, async?: boolean): ClassMethod;
export function objectPattern(properties: Array<RestElement | ObjectProperty>): ObjectPattern;
export function spreadElement(argument: Expression): SpreadElement;
declare function _super(): Super;
......@@ -1848,10 +1848,10 @@ export function bigIntLiteral(value: string): BigIntLiteral;
export function exportNamespaceSpecifier(exported: Identifier): ExportNamespaceSpecifier;
export function optionalMemberExpression(object: Expression, property: Expression | Identifier, computed: boolean | undefined, optional: boolean): OptionalMemberExpression;
export function optionalCallExpression(callee: Expression, _arguments: Array<Expression | SpreadElement | JSXNamespacedName | ArgumentPlaceholder>, optional: boolean): OptionalCallExpression;
export function classProperty(key: Identifier | StringLiteral | NumericLiteral | Expression, value?: Expression | null, typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null, decorators?: Array<Decorator> | null, computed?: boolean, _static?: boolean): ClassProperty;
export function classAccessorProperty(key: Identifier | StringLiteral | NumericLiteral | Expression | PrivateName, value?: Expression | null, typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null, decorators?: Array<Decorator> | null, computed?: boolean, _static?: boolean): ClassAccessorProperty;
export function classPrivateProperty(key: PrivateName, value: Expression | null | undefined, decorators: Array<Decorator> | null | undefined, _static: any): ClassPrivateProperty;
export function classPrivateMethod(kind: "get" | "set" | "method" | "constructor" | undefined, key: PrivateName, params: Array<Identifier | Pattern | RestElement | TSParameterProperty>, body: BlockStatement, _static?: boolean): ClassPrivateMethod;
export function classProperty(key: Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression, value?: Expression | null, typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null, decorators?: Array<Decorator> | null, computed?: boolean, _static?: boolean): ClassProperty;
export function classAccessorProperty(key: Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression | PrivateName, value?: Expression | null, typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null, decorators?: Array<Decorator> | null, computed?: boolean, _static?: boolean): ClassAccessorProperty;
export function classPrivateProperty(key: PrivateName, value?: Expression | null, decorators?: Array<Decorator> | null, _static?: boolean): ClassPrivateProperty;
export function classPrivateMethod(kind: "get" | "set" | "method" | undefined, key: PrivateName, params: Array<Identifier | Pattern | RestElement | TSParameterProperty>, body: BlockStatement, _static?: boolean): ClassPrivateMethod;
export function privateName(id: Identifier): PrivateName;
export function staticBlock(body: Array<Statement>): StaticBlock;
export function anyTypeAnnotation(): AnyTypeAnnotation;
......@@ -1953,7 +1953,7 @@ export function pipelineBareFunction(callee: Expression): PipelineBareFunction;
export function pipelinePrimaryTopicReference(): PipelinePrimaryTopicReference;
export function tsParameterProperty(parameter: Identifier | AssignmentPattern): TSParameterProperty;
export function tsDeclareFunction(id: Identifier | null | undefined, typeParameters: TSTypeParameterDeclaration | Noop | null | undefined, params: Array<Identifier | Pattern | RestElement>, returnType?: TSTypeAnnotation | Noop | null): TSDeclareFunction;
export function tsDeclareMethod(decorators: Array<Decorator> | null | undefined, key: Identifier | StringLiteral | NumericLiteral | Expression, typeParameters: TSTypeParameterDeclaration | Noop | null | undefined, params: Array<Identifier | Pattern | RestElement | TSParameterProperty>, returnType?: TSTypeAnnotation | Noop | null): TSDeclareMethod;
export function tsDeclareMethod(decorators: Array<Decorator> | null | undefined, key: Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression, typeParameters: TSTypeParameterDeclaration | Noop | null | undefined, params: Array<Identifier | Pattern | RestElement | TSParameterProperty>, returnType?: TSTypeAnnotation | Noop | null): TSDeclareMethod;
export function tsQualifiedName(left: TSEntityName, right: Identifier): TSQualifiedName;
export function tsCallSignatureDeclaration(typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array<Identifier | RestElement>, typeAnnotation?: TSTypeAnnotation | null): TSCallSignatureDeclaration;
export function tsConstructSignatureDeclaration(typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array<Identifier | RestElement>, typeAnnotation?: TSTypeAnnotation | null): TSConstructSignatureDeclaration;
......
This diff is collapsed.
This diff is collapsed.
......@@ -12,8 +12,8 @@ function getQualifiedName(node) {
}
function removeTypeDuplicates(nodes) {
const generics = {};
const bases = {};
const generics = new Map();
const bases = new Map();
const typeGroups = new Set();
const types = [];
......@@ -30,7 +30,7 @@ function removeTypeDuplicates(nodes) {
}
if ((0, _generated.isFlowBaseAnnotation)(node)) {
bases[node.type] = node;
bases.set(node.type, node);
continue;
}
......@@ -46,8 +46,8 @@ function removeTypeDuplicates(nodes) {
if ((0, _generated.isGenericTypeAnnotation)(node)) {
const name = getQualifiedName(node.id);
if (generics[name]) {
let existing = generics[name];
if (generics.has(name)) {
let existing = generics.get(name);
if (existing.typeParameters) {
if (node.typeParameters) {
......@@ -57,7 +57,7 @@ function removeTypeDuplicates(nodes) {
existing = node.typeParameters;
}
} else {
generics[name] = node;
generics.set(name, node);
}
continue;
......@@ -66,12 +66,12 @@ function removeTypeDuplicates(nodes) {
types.push(node);
}
for (const type of Object.keys(bases)) {
types.push(bases[type]);
for (const [, baseType] of bases) {
types.push(baseType);
}
for (const name of Object.keys(generics)) {
types.push(generics[name]);
for (const [, genericName] of generics) {
types.push(genericName);
}
return types;
......
{
"name": "@babel/types",
"version": "7.18.7",
"version": "7.18.8",
"description": "Babel Types is a Lodash-esque utility library for AST nodes",
"author": "The Babel Team (https://babel.dev/team)",
"homepage": "https://babel.dev/docs/en/next/babel-types",
......@@ -29,7 +29,7 @@
},
"devDependencies": {
"@babel/generator": "^7.18.7",
"@babel/parser": "^7.18.6",
"@babel/parser": "^7.18.8",
"chalk": "^4.1.0",
"glob": "^7.1.7"
},
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment