summaryrefslogtreecommitdiff
path: root/chromium/third_party/node
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/node')
-rw-r--r--chromium/third_party/node/node_modules.tar.gz.sha12
-rw-r--r--chromium/third_party/node/node_modules/@babel/code-frame/LICENSE22
-rw-r--r--chromium/third_party/node/node_modules/@babel/code-frame/lib/index.js163
-rw-r--r--chromium/third_party/node/node_modules/@babel/code-frame/package.json29
-rw-r--r--chromium/third_party/node/node_modules/@babel/generator/LICENSE22
-rw-r--r--chromium/third_party/node/node_modules/@babel/generator/lib/buffer.js265
-rw-r--r--chromium/third_party/node/node_modules/@babel/generator/lib/generators/base.js96
-rw-r--r--chromium/third_party/node/node_modules/@babel/generator/lib/generators/classes.js173
-rw-r--r--chromium/third_party/node/node_modules/@babel/generator/lib/generators/expressions.js317
-rw-r--r--chromium/third_party/node/node_modules/@babel/generator/lib/generators/flow.js795
-rw-r--r--chromium/third_party/node/node_modules/@babel/generator/lib/generators/index.js148
-rw-r--r--chromium/third_party/node/node_modules/@babel/generator/lib/generators/jsx.js145
-rw-r--r--chromium/third_party/node/node_modules/@babel/generator/lib/generators/methods.js149
-rw-r--r--chromium/third_party/node/node_modules/@babel/generator/lib/generators/modules.js234
-rw-r--r--chromium/third_party/node/node_modules/@babel/generator/lib/generators/statements.js327
-rw-r--r--chromium/third_party/node/node_modules/@babel/generator/lib/generators/template-literals.js33
-rw-r--r--chromium/third_party/node/node_modules/@babel/generator/lib/generators/types.js279
-rw-r--r--chromium/third_party/node/node_modules/@babel/generator/lib/generators/typescript.js806
-rw-r--r--chromium/third_party/node/node_modules/@babel/generator/lib/index.js97
-rw-r--r--chromium/third_party/node/node_modules/@babel/generator/lib/node/index.js111
-rw-r--r--chromium/third_party/node/node_modules/@babel/generator/lib/node/parentheses.js342
-rw-r--r--chromium/third_party/node/node_modules/@babel/generator/lib/node/whitespace.js214
-rw-r--r--chromium/third_party/node/node_modules/@babel/generator/lib/printer.js540
-rw-r--r--chromium/third_party/node/node_modules/@babel/generator/lib/source-map.js78
-rw-r--r--chromium/third_party/node/node_modules/@babel/generator/package.json36
-rw-r--r--chromium/third_party/node/node_modules/@babel/helper-function-name/LICENSE22
-rw-r--r--chromium/third_party/node/node_modules/@babel/helper-function-name/lib/index.js188
-rw-r--r--chromium/third_party/node/node_modules/@babel/helper-function-name/package.json25
-rw-r--r--chromium/third_party/node/node_modules/@babel/helper-get-function-arity/LICENSE22
-rw-r--r--chromium/third_party/node/node_modules/@babel/helper-get-function-arity/lib/index.js27
-rw-r--r--chromium/third_party/node/node_modules/@babel/helper-get-function-arity/package.json23
-rw-r--r--chromium/third_party/node/node_modules/@babel/helper-hoist-variables/LICENSE22
-rw-r--r--chromium/third_party/node/node_modules/@babel/helper-hoist-variables/lib/index.js58
-rw-r--r--chromium/third_party/node/node_modules/@babel/helper-hoist-variables/package.json27
-rw-r--r--chromium/third_party/node/node_modules/@babel/helper-split-export-declaration/LICENSE22
-rw-r--r--chromium/third_party/node/node_modules/@babel/helper-split-export-declaration/lib/index.js67
-rw-r--r--chromium/third_party/node/node_modules/@babel/helper-split-export-declaration/package.json23
-rw-r--r--chromium/third_party/node/node_modules/@babel/helper-validator-identifier/LICENSE22
-rw-r--r--chromium/third_party/node/node_modules/@babel/helper-validator-identifier/lib/identifier.js84
-rw-r--r--chromium/third_party/node/node_modules/@babel/helper-validator-identifier/lib/index.js57
-rw-r--r--chromium/third_party/node/node_modules/@babel/helper-validator-identifier/lib/keyword.js38
-rw-r--r--chromium/third_party/node/node_modules/@babel/helper-validator-identifier/package.json24
-rw-r--r--chromium/third_party/node/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js75
-rw-r--r--chromium/third_party/node/node_modules/@babel/highlight/LICENSE22
-rw-r--r--chromium/third_party/node/node_modules/@babel/highlight/lib/index.js116
-rw-r--r--chromium/third_party/node/node_modules/@babel/highlight/package.json29
-rw-r--r--chromium/third_party/node/node_modules/@babel/parser/LICENSE19
-rwxr-xr-xchromium/third_party/node/node_modules/@babel/parser/bin/babel-parser.js15
-rw-r--r--chromium/third_party/node/node_modules/@babel/parser/lib/index.js14699
-rw-r--r--chromium/third_party/node/node_modules/@babel/parser/package.json42
-rw-r--r--chromium/third_party/node/node_modules/@babel/template/LICENSE22
-rw-r--r--chromium/third_party/node/node_modules/@babel/template/lib/builder.js81
-rw-r--r--chromium/third_party/node/node_modules/@babel/template/lib/formatters.js71
-rw-r--r--chromium/third_party/node/node_modules/@babel/template/lib/index.js32
-rw-r--r--chromium/third_party/node/node_modules/@babel/template/lib/literal.js80
-rw-r--r--chromium/third_party/node/node_modules/@babel/template/lib/options.js83
-rw-r--r--chromium/third_party/node/node_modules/@babel/template/lib/parse.js188
-rw-r--r--chromium/third_party/node/node_modules/@babel/template/lib/populate.js135
-rw-r--r--chromium/third_party/node/node_modules/@babel/template/lib/string.js22
-rw-r--r--chromium/third_party/node/node_modules/@babel/template/package.json26
-rw-r--r--chromium/third_party/node/node_modules/@babel/traverse/LICENSE22
-rw-r--r--chromium/third_party/node/node_modules/@babel/traverse/lib/cache.js26
-rw-r--r--chromium/third_party/node/node_modules/@babel/traverse/lib/context.js137
-rw-r--r--chromium/third_party/node/node_modules/@babel/traverse/lib/hub.js23
-rw-r--r--chromium/third_party/node/node_modules/@babel/traverse/lib/index.js118
-rw-r--r--chromium/third_party/node/node_modules/@babel/traverse/lib/path/ancestry.js180
-rw-r--r--chromium/third_party/node/node_modules/@babel/traverse/lib/path/comments.js42
-rw-r--r--chromium/third_party/node/node_modules/@babel/traverse/lib/path/context.js253
-rw-r--r--chromium/third_party/node/node_modules/@babel/traverse/lib/path/conversion.js468
-rw-r--r--chromium/third_party/node/node_modules/@babel/traverse/lib/path/evaluation.js401
-rw-r--r--chromium/third_party/node/node_modules/@babel/traverse/lib/path/family.js407
-rw-r--r--chromium/third_party/node/node_modules/@babel/traverse/lib/path/generated/asserts.js5
-rw-r--r--chromium/third_party/node/node_modules/@babel/traverse/lib/path/generated/validators.js5
-rw-r--r--chromium/third_party/node/node_modules/@babel/traverse/lib/path/generated/virtual-types.js3
-rw-r--r--chromium/third_party/node/node_modules/@babel/traverse/lib/path/index.js253
-rw-r--r--chromium/third_party/node/node_modules/@babel/traverse/lib/path/inference/index.js156
-rw-r--r--chromium/third_party/node/node_modules/@babel/traverse/lib/path/inference/inferer-reference.js206
-rw-r--r--chromium/third_party/node/node_modules/@babel/traverse/lib/path/inference/inferers.js261
-rw-r--r--chromium/third_party/node/node_modules/@babel/traverse/lib/path/introspection.js436
-rw-r--r--chromium/third_party/node/node_modules/@babel/traverse/lib/path/lib/hoister.js206
-rw-r--r--chromium/third_party/node/node_modules/@babel/traverse/lib/path/lib/removal-hooks.js38
-rw-r--r--chromium/third_party/node/node_modules/@babel/traverse/lib/path/lib/virtual-types.js230
-rw-r--r--chromium/third_party/node/node_modules/@babel/traverse/lib/path/modification.js232
-rw-r--r--chromium/third_party/node/node_modules/@babel/traverse/lib/path/removal.js73
-rw-r--r--chromium/third_party/node/node_modules/@babel/traverse/lib/path/replacement.js260
-rw-r--r--chromium/third_party/node/node_modules/@babel/traverse/lib/scope/binding.js75
-rw-r--r--chromium/third_party/node/node_modules/@babel/traverse/lib/scope/index.js1015
-rw-r--r--chromium/third_party/node/node_modules/@babel/traverse/lib/scope/lib/renamer.js146
-rw-r--r--chromium/third_party/node/node_modules/@babel/traverse/lib/types.js5
-rw-r--r--chromium/third_party/node/node_modules/@babel/traverse/lib/visitors.js242
-rw-r--r--chromium/third_party/node/node_modules/@babel/traverse/package.json35
-rw-r--r--chromium/third_party/node/node_modules/@babel/traverse/scripts/generators/asserts.js25
-rw-r--r--chromium/third_party/node/node_modules/@babel/traverse/scripts/generators/validators.js43
-rw-r--r--chromium/third_party/node/node_modules/@babel/traverse/scripts/generators/virtual-types.js24
-rw-r--r--chromium/third_party/node/node_modules/@babel/traverse/scripts/package.json1
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/LICENSE22
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/asserts/assertNode.js17
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/asserts/generated/index.js1492
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/ast-types/generated/index.js0
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/builders/builder.js42
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js20
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js30
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/builders/generated/index.js1261
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/builders/generated/uppercase.js1507
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/builders/react/buildChildren.js29
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js21
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/clone/clone.js12
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/clone/cloneDeep.js12
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js12
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/clone/cloneNode.js114
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/clone/cloneWithoutLoc.js12
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/comments/addComment.js15
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/comments/addComments.js23
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/comments/inheritInnerComments.js12
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/comments/inheritLeadingComments.js12
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/comments/inheritTrailingComments.js12
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/comments/inheritsComments.js19
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/comments/removeComments.js16
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/constants/generated/index.js99
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/constants/index.js49
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/converters/Scope.js0
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/converters/ensureBlock.js12
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js75
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/converters/toBindingIdentifierName.js14
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/converters/toBlock.js34
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/converters/toComputedKey.js15
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/converters/toExpression.js33
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/converters/toIdentifier.js30
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/converters/toKeyAlias.js46
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/converters/toSequenceExpression.js21
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/converters/toStatement.js47
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/converters/valueToNode.js99
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/definitions/core.js1590
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/definitions/experimental.js142
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/definitions/flow.js481
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/definitions/index.js103
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/definitions/jsx.js161
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/definitions/misc.js31
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/definitions/placeholders.js33
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/definitions/typescript.js469
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/definitions/utils.js324
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/index.js647
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/index.js.flow2539
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/modifications/appendToMemberExpression.js15
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js78
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/modifications/inherits.js31
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/modifications/prependToMemberExpression.js13
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/modifications/removeProperties.js30
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/modifications/removePropertiesDeep.js15
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js54
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js104
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js15
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/traverse/traverse.js55
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/traverse/traverseFast.js28
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/utils/inherit.js12
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js47
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/utils/shallowEqual.js18
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js13
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/validators/generated/index.js4731
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/validators/is.js33
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/validators/isBinding.js31
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/validators/isBlockScoped.js14
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/validators/isImmutable.js24
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/validators/isLet.js14
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/validators/isNode.js12
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/validators/isNodesEquivalent.js67
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/validators/isPlaceholderType.js21
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/validators/isReferenced.js127
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/validators/isScope.js20
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/validators/isSpecifierDefault.js14
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/validators/isType.js24
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/validators/isValidES3Identifier.js14
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/validators/isValidIdentifier.js20
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/validators/isVar.js16
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/validators/matchesPattern.js42
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/validators/react/isCompatTag.js10
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/validators/react/isReactComponent.js12
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/validators/validate.js32
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/package.json39
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/scripts/generators/asserts.js50
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/scripts/generators/ast-types.js139
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/scripts/generators/builders.js163
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/scripts/generators/constants.js15
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/scripts/generators/docs.js277
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/scripts/generators/flow.js260
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/scripts/generators/typescript-legacy.js369
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/scripts/generators/validators.js87
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/scripts/package.json1
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/scripts/utils/formatBuilderName.js8
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/scripts/utils/lowerFirst.js3
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/scripts/utils/stringifyValidator.js66
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/scripts/utils/toFunctionName.js4
-rw-r--r--chromium/third_party/node/node_modules/ansi-styles/index.js165
-rw-r--r--chromium/third_party/node/node_modules/ansi-styles/license9
-rw-r--r--chromium/third_party/node/node_modules/ansi-styles/package.json56
-rw-r--r--chromium/third_party/node/node_modules/balanced-match/index.js62
-rw-r--r--chromium/third_party/node/node_modules/balanced-match/package.json48
-rw-r--r--chromium/third_party/node/node_modules/brace-expansion/LICENSE21
-rw-r--r--chromium/third_party/node/node_modules/brace-expansion/index.js201
-rw-r--r--chromium/third_party/node/node_modules/brace-expansion/package.json47
-rw-r--r--chromium/third_party/node/node_modules/chalk/index.js228
-rw-r--r--chromium/third_party/node/node_modules/chalk/index.js.flow93
-rw-r--r--chromium/third_party/node/node_modules/chalk/license9
-rw-r--r--chromium/third_party/node/node_modules/chalk/package.json71
-rw-r--r--chromium/third_party/node/node_modules/chalk/templates.js128
-rw-r--r--chromium/third_party/node/node_modules/color-convert/LICENSE21
-rw-r--r--chromium/third_party/node/node_modules/color-convert/conversions.js868
-rw-r--r--chromium/third_party/node/node_modules/color-convert/index.js78
-rw-r--r--chromium/third_party/node/node_modules/color-convert/package.json46
-rw-r--r--chromium/third_party/node/node_modules/color-convert/route.js97
-rw-r--r--chromium/third_party/node/node_modules/color-name/LICENSE8
-rw-r--r--chromium/third_party/node/node_modules/color-name/index.js152
-rw-r--r--chromium/third_party/node/node_modules/color-name/package.json25
-rw-r--r--chromium/third_party/node/node_modules/color-name/test.js7
-rw-r--r--chromium/third_party/node/node_modules/commander/LICENSE22
-rw-r--r--chromium/third_party/node/node_modules/commander/index.js1224
-rw-r--r--chromium/third_party/node/node_modules/commander/package.json38
-rw-r--r--chromium/third_party/node/node_modules/concat-map/LICENSE18
-rw-r--r--chromium/third_party/node/node_modules/concat-map/README.markdown62
-rw-r--r--chromium/third_party/node/node_modules/concat-map/index.js13
-rw-r--r--chromium/third_party/node/node_modules/concat-map/package.json43
-rw-r--r--chromium/third_party/node/node_modules/debug/LICENSE20
-rw-r--r--chromium/third_party/node/node_modules/debug/package.json59
-rw-r--r--chromium/third_party/node/node_modules/debug/src/browser.js269
-rw-r--r--chromium/third_party/node/node_modules/debug/src/common.js274
-rw-r--r--chromium/third_party/node/node_modules/debug/src/index.js10
-rw-r--r--chromium/third_party/node/node_modules/debug/src/node.js263
-rw-r--r--chromium/third_party/node/node_modules/escape-string-regexp/index.js11
-rw-r--r--chromium/third_party/node/node_modules/escape-string-regexp/license21
-rw-r--r--chromium/third_party/node/node_modules/escape-string-regexp/package.json41
-rw-r--r--chromium/third_party/node/node_modules/esutils/LICENSE.BSD19
-rw-r--r--chromium/third_party/node/node_modules/esutils/lib/ast.js144
-rw-r--r--chromium/third_party/node/node_modules/esutils/lib/code.js135
-rw-r--r--chromium/third_party/node/node_modules/esutils/lib/keyword.js165
-rw-r--r--chromium/third_party/node/node_modules/esutils/lib/utils.js33
-rw-r--r--chromium/third_party/node/node_modules/esutils/package.json44
-rw-r--r--chromium/third_party/node/node_modules/function-bind/LICENSE20
-rw-r--r--chromium/third_party/node/node_modules/function-bind/implementation.js52
-rw-r--r--chromium/third_party/node/node_modules/function-bind/index.js5
-rw-r--r--chromium/third_party/node/node_modules/function-bind/package.json63
-rw-r--r--chromium/third_party/node/node_modules/globals/globals.json1563
-rw-r--r--chromium/third_party/node/node_modules/globals/index.js2
-rw-r--r--chromium/third_party/node/node_modules/globals/license9
-rw-r--r--chromium/third_party/node/node_modules/globals/package.json41
-rw-r--r--chromium/third_party/node/node_modules/has-flag/index.js8
-rw-r--r--chromium/third_party/node/node_modules/has-flag/license9
-rw-r--r--chromium/third_party/node/node_modules/has-flag/package.json44
-rw-r--r--chromium/third_party/node/node_modules/has/LICENSE-MIT22
-rw-r--r--chromium/third_party/node/node_modules/has/package.json48
-rw-r--r--chromium/third_party/node/node_modules/has/src/index.js5
-rw-r--r--chromium/third_party/node/node_modules/is-core-module/LICENSE20
-rw-r--r--chromium/third_party/node/node_modules/is-core-module/core.json150
-rw-r--r--chromium/third_party/node/node_modules/is-core-module/index.js69
-rw-r--r--chromium/third_party/node/node_modules/is-core-module/package.json69
-rw-r--r--chromium/third_party/node/node_modules/js-tokens/LICENSE21
-rw-r--r--chromium/third_party/node/node_modules/js-tokens/index.js23
-rw-r--r--chromium/third_party/node/node_modules/js-tokens/package.json30
-rw-r--r--chromium/third_party/node/node_modules/jsesc/LICENSE-MIT.txt20
-rwxr-xr-xchromium/third_party/node/node_modules/jsesc/bin/jsesc148
-rw-r--r--chromium/third_party/node/node_modules/jsesc/jsesc.js329
-rw-r--r--chromium/third_party/node/node_modules/jsesc/man/jsesc.194
-rw-r--r--chromium/third_party/node/node_modules/jsesc/package.json54
-rw-r--r--chromium/third_party/node/node_modules/minimatch/LICENSE15
-rw-r--r--chromium/third_party/node/node_modules/minimatch/minimatch.js923
-rw-r--r--chromium/third_party/node/node_modules/minimatch/package.json30
-rw-r--r--chromium/third_party/node/node_modules/ms/index.js162
-rw-r--r--chromium/third_party/node/node_modules/ms/package.json37
-rw-r--r--chromium/third_party/node/node_modules/path-is-inside/LICENSE.txt47
-rw-r--r--chromium/third_party/node/node_modules/path-is-inside/lib/path-is-inside.js28
-rw-r--r--chromium/third_party/node/node_modules/path-is-inside/package.json21
-rw-r--r--chromium/third_party/node/node_modules/resolve/LICENSE21
-rw-r--r--chromium/third_party/node/node_modules/resolve/index.js6
-rw-r--r--chromium/third_party/node/node_modules/resolve/lib/async.js320
-rw-r--r--chromium/third_party/node/node_modules/resolve/lib/caller.js8
-rw-r--r--chromium/third_party/node/node_modules/resolve/lib/core.js53
-rw-r--r--chromium/third_party/node/node_modules/resolve/lib/core.json83
-rw-r--r--chromium/third_party/node/node_modules/resolve/lib/is-core.js5
-rw-r--r--chromium/third_party/node/node_modules/resolve/lib/node-modules-paths.js42
-rw-r--r--chromium/third_party/node/node_modules/resolve/lib/normalize-options.js10
-rw-r--r--chromium/third_party/node/node_modules/resolve/lib/sync.js199
-rw-r--r--chromium/third_party/node/node_modules/resolve/package.json51
-rw-r--r--chromium/third_party/node/node_modules/resolve/readme.markdown279
-rw-r--r--chromium/third_party/node/node_modules/supports-color/browser.js5
-rw-r--r--chromium/third_party/node/node_modules/supports-color/index.js131
-rw-r--r--chromium/third_party/node/node_modules/supports-color/license9
-rw-r--r--chromium/third_party/node/node_modules/supports-color/package.json53
-rw-r--r--chromium/third_party/node/node_modules/to-fast-properties/index.js27
-rw-r--r--chromium/third_party/node/node_modules/to-fast-properties/license10
-rw-r--r--chromium/third_party/node/node_modules/to-fast-properties/package.json35
289 files changed, 57971 insertions, 1 deletions
diff --git a/chromium/third_party/node/node_modules.tar.gz.sha1 b/chromium/third_party/node/node_modules.tar.gz.sha1
index 3eb591554f8..66ba7eac52a 100644
--- a/chromium/third_party/node/node_modules.tar.gz.sha1
+++ b/chromium/third_party/node/node_modules.tar.gz.sha1
@@ -1 +1 @@
-691ddf79fa889ba538a8e25f79dde7bc3175e409
+1aac8548d2a6b8c5d32a49be55f4619c2da34403
diff --git a/chromium/third_party/node/node_modules/@babel/code-frame/LICENSE b/chromium/third_party/node/node_modules/@babel/code-frame/LICENSE
new file mode 100644
index 00000000000..f31575ec773
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/code-frame/LICENSE
@@ -0,0 +1,22 @@
+MIT License
+
+Copyright (c) 2014-present Sebastian McKenzie and other contributors
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/chromium/third_party/node/node_modules/@babel/code-frame/lib/index.js b/chromium/third_party/node/node_modules/@babel/code-frame/lib/index.js
new file mode 100644
index 00000000000..a32a1e1f392
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/code-frame/lib/index.js
@@ -0,0 +1,163 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.codeFrameColumns = codeFrameColumns;
+exports.default = _default;
+
+var _highlight = require("@babel/highlight");
+
+let deprecationWarningShown = false;
+
+function getDefs(chalk) {
+ return {
+ gutter: chalk.grey,
+ marker: chalk.red.bold,
+ message: chalk.red.bold
+ };
+}
+
+const NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
+
+function getMarkerLines(loc, source, opts) {
+ const startLoc = Object.assign({
+ column: 0,
+ line: -1
+ }, loc.start);
+ const endLoc = Object.assign({}, startLoc, loc.end);
+ const {
+ linesAbove = 2,
+ linesBelow = 3
+ } = opts || {};
+ const startLine = startLoc.line;
+ const startColumn = startLoc.column;
+ const endLine = endLoc.line;
+ const endColumn = endLoc.column;
+ let start = Math.max(startLine - (linesAbove + 1), 0);
+ let end = Math.min(source.length, endLine + linesBelow);
+
+ if (startLine === -1) {
+ start = 0;
+ }
+
+ if (endLine === -1) {
+ end = source.length;
+ }
+
+ const lineDiff = endLine - startLine;
+ const markerLines = {};
+
+ if (lineDiff) {
+ for (let i = 0; i <= lineDiff; i++) {
+ const lineNumber = i + startLine;
+
+ if (!startColumn) {
+ markerLines[lineNumber] = true;
+ } else if (i === 0) {
+ const sourceLength = source[lineNumber - 1].length;
+ markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];
+ } else if (i === lineDiff) {
+ markerLines[lineNumber] = [0, endColumn];
+ } else {
+ const sourceLength = source[lineNumber - i].length;
+ markerLines[lineNumber] = [0, sourceLength];
+ }
+ }
+ } else {
+ if (startColumn === endColumn) {
+ if (startColumn) {
+ markerLines[startLine] = [startColumn, 0];
+ } else {
+ markerLines[startLine] = true;
+ }
+ } else {
+ markerLines[startLine] = [startColumn, endColumn - startColumn];
+ }
+ }
+
+ return {
+ start,
+ end,
+ markerLines
+ };
+}
+
+function codeFrameColumns(rawLines, loc, opts = {}) {
+ const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts);
+ const chalk = (0, _highlight.getChalk)(opts);
+ const defs = getDefs(chalk);
+
+ const maybeHighlight = (chalkFn, string) => {
+ return highlighted ? chalkFn(string) : string;
+ };
+
+ const lines = rawLines.split(NEWLINE);
+ const {
+ start,
+ end,
+ markerLines
+ } = getMarkerLines(loc, lines, opts);
+ const hasColumns = loc.start && typeof loc.start.column === "number";
+ const numberMaxWidth = String(end).length;
+ const highlightedLines = highlighted ? (0, _highlight.default)(rawLines, opts) : rawLines;
+ let frame = highlightedLines.split(NEWLINE).slice(start, end).map((line, index) => {
+ const number = start + 1 + index;
+ const paddedNumber = ` ${number}`.slice(-numberMaxWidth);
+ const gutter = ` ${paddedNumber} |`;
+ const hasMarker = markerLines[number];
+ const lastMarkerLine = !markerLines[number + 1];
+
+ if (hasMarker) {
+ let markerLine = "";
+
+ if (Array.isArray(hasMarker)) {
+ const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " ");
+ const numberOfMarkers = hasMarker[1] || 1;
+ markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), " ", markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join("");
+
+ if (lastMarkerLine && opts.message) {
+ markerLine += " " + maybeHighlight(defs.message, opts.message);
+ }
+ }
+
+ return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line.length > 0 ? ` ${line}` : "", markerLine].join("");
+ } else {
+ return ` ${maybeHighlight(defs.gutter, gutter)}${line.length > 0 ? ` ${line}` : ""}`;
+ }
+ }).join("\n");
+
+ if (opts.message && !hasColumns) {
+ frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}\n${frame}`;
+ }
+
+ if (highlighted) {
+ return chalk.reset(frame);
+ } else {
+ return frame;
+ }
+}
+
+function _default(rawLines, lineNumber, colNumber, opts = {}) {
+ if (!deprecationWarningShown) {
+ deprecationWarningShown = true;
+ const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";
+
+ if (process.emitWarning) {
+ process.emitWarning(message, "DeprecationWarning");
+ } else {
+ const deprecationError = new Error(message);
+ deprecationError.name = "DeprecationWarning";
+ console.warn(new Error(message));
+ }
+ }
+
+ colNumber = Math.max(colNumber, 0);
+ const location = {
+ start: {
+ column: colNumber,
+ line: lineNumber
+ }
+ };
+ return codeFrameColumns(rawLines, location, opts);
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/code-frame/package.json b/chromium/third_party/node/node_modules/@babel/code-frame/package.json
new file mode 100644
index 00000000000..25f803d24f8
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/code-frame/package.json
@@ -0,0 +1,29 @@
+{
+ "name": "@babel/code-frame",
+ "version": "7.14.5",
+ "description": "Generate errors that contain a code frame that point to source locations.",
+ "author": "The Babel Team (https://babel.dev/team)",
+ "homepage": "https://babel.dev/docs/en/next/babel-code-frame",
+ "bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen",
+ "license": "MIT",
+ "publishConfig": {
+ "access": "public"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/babel/babel.git",
+ "directory": "packages/babel-code-frame"
+ },
+ "main": "./lib/index.js",
+ "dependencies": {
+ "@babel/highlight": "^7.14.5"
+ },
+ "devDependencies": {
+ "@types/chalk": "^2.0.0",
+ "chalk": "^2.0.0",
+ "strip-ansi": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/generator/LICENSE b/chromium/third_party/node/node_modules/@babel/generator/LICENSE
new file mode 100644
index 00000000000..f31575ec773
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/generator/LICENSE
@@ -0,0 +1,22 @@
+MIT License
+
+Copyright (c) 2014-present Sebastian McKenzie and other contributors
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/chromium/third_party/node/node_modules/@babel/generator/lib/buffer.js b/chromium/third_party/node/node_modules/@babel/generator/lib/buffer.js
new file mode 100644
index 00000000000..14458139690
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/generator/lib/buffer.js
@@ -0,0 +1,265 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = void 0;
+const SPACES_RE = /^[ \t]+$/;
+
+class Buffer {
+ constructor(map) {
+ this._map = null;
+ this._buf = "";
+ this._last = 0;
+ this._queue = [];
+ this._position = {
+ line: 1,
+ column: 0
+ };
+ this._sourcePosition = {
+ identifierName: null,
+ line: null,
+ column: null,
+ filename: null
+ };
+ this._disallowedPop = null;
+ this._map = map;
+ }
+
+ get() {
+ this._flush();
+
+ const map = this._map;
+ const result = {
+ code: this._buf.trimRight(),
+ map: null,
+ rawMappings: map == null ? void 0 : map.getRawMappings()
+ };
+
+ if (map) {
+ Object.defineProperty(result, "map", {
+ configurable: true,
+ enumerable: true,
+
+ get() {
+ return this.map = map.get();
+ },
+
+ set(value) {
+ Object.defineProperty(this, "map", {
+ value,
+ writable: true
+ });
+ }
+
+ });
+ }
+
+ return result;
+ }
+
+ append(str) {
+ this._flush();
+
+ const {
+ line,
+ column,
+ filename,
+ identifierName,
+ force
+ } = this._sourcePosition;
+
+ this._append(str, line, column, identifierName, filename, force);
+ }
+
+ queue(str) {
+ if (str === "\n") {
+ while (this._queue.length > 0 && SPACES_RE.test(this._queue[0][0])) {
+ this._queue.shift();
+ }
+ }
+
+ const {
+ line,
+ column,
+ filename,
+ identifierName,
+ force
+ } = this._sourcePosition;
+
+ this._queue.unshift([str, line, column, identifierName, filename, force]);
+ }
+
+ _flush() {
+ let item;
+
+ while (item = this._queue.pop()) {
+ this._append(...item);
+ }
+ }
+
+ _append(str, line, column, identifierName, filename, force) {
+ this._buf += str;
+ this._last = str.charCodeAt(str.length - 1);
+ let i = str.indexOf("\n");
+ let last = 0;
+
+ if (i !== 0) {
+ this._mark(line, column, identifierName, filename, force);
+ }
+
+ while (i !== -1) {
+ this._position.line++;
+ this._position.column = 0;
+ last = i + 1;
+
+ if (last < str.length) {
+ this._mark(++line, 0, identifierName, filename, force);
+ }
+
+ i = str.indexOf("\n", last);
+ }
+
+ this._position.column += str.length - last;
+ }
+
+ _mark(line, column, identifierName, filename, force) {
+ var _this$_map;
+
+ (_this$_map = this._map) == null ? void 0 : _this$_map.mark(this._position.line, this._position.column, line, column, identifierName, filename, force);
+ }
+
+ removeTrailingNewline() {
+ if (this._queue.length > 0 && this._queue[0][0] === "\n") {
+ this._queue.shift();
+ }
+ }
+
+ removeLastSemicolon() {
+ if (this._queue.length > 0 && this._queue[0][0] === ";") {
+ this._queue.shift();
+ }
+ }
+
+ getLastChar() {
+ let last;
+
+ if (this._queue.length > 0) {
+ const str = this._queue[0][0];
+ last = str.charCodeAt(0);
+ } else {
+ last = this._last;
+ }
+
+ return last;
+ }
+
+ endsWithCharAndNewline() {
+ const queue = this._queue;
+
+ if (queue.length > 0) {
+ const last = queue[0][0];
+ const lastCp = last.charCodeAt(0);
+ if (lastCp !== 10) return;
+
+ if (queue.length > 1) {
+ const secondLast = queue[1][0];
+ return secondLast.charCodeAt(0);
+ } else {
+ return this._last;
+ }
+ }
+ }
+
+ hasContent() {
+ return this._queue.length > 0 || !!this._last;
+ }
+
+ exactSource(loc, cb) {
+ this.source("start", loc, true);
+ cb();
+ this.source("end", loc);
+
+ this._disallowPop("start", loc);
+ }
+
+ source(prop, loc, force) {
+ if (prop && !loc) return;
+
+ this._normalizePosition(prop, loc, this._sourcePosition, force);
+ }
+
+ withSource(prop, loc, cb) {
+ if (!this._map) return cb();
+ const originalLine = this._sourcePosition.line;
+ const originalColumn = this._sourcePosition.column;
+ const originalFilename = this._sourcePosition.filename;
+ const originalIdentifierName = this._sourcePosition.identifierName;
+ this.source(prop, loc);
+ cb();
+
+ if ((!this._sourcePosition.force || this._sourcePosition.line !== originalLine || this._sourcePosition.column !== originalColumn || this._sourcePosition.filename !== originalFilename) && (!this._disallowedPop || this._disallowedPop.line !== originalLine || this._disallowedPop.column !== originalColumn || this._disallowedPop.filename !== originalFilename)) {
+ this._sourcePosition.line = originalLine;
+ this._sourcePosition.column = originalColumn;
+ this._sourcePosition.filename = originalFilename;
+ this._sourcePosition.identifierName = originalIdentifierName;
+ this._sourcePosition.force = false;
+ this._disallowedPop = null;
+ }
+ }
+
+ _disallowPop(prop, loc) {
+ if (prop && !loc) return;
+ this._disallowedPop = this._normalizePosition(prop, loc);
+ }
+
+ _normalizePosition(prop, loc, targetObj, force) {
+ const pos = loc ? loc[prop] : null;
+
+ if (targetObj === undefined) {
+ targetObj = {
+ identifierName: null,
+ line: null,
+ column: null,
+ filename: null,
+ force: false
+ };
+ }
+
+ const origLine = targetObj.line;
+ const origColumn = targetObj.column;
+ const origFilename = targetObj.filename;
+ targetObj.identifierName = prop === "start" && (loc == null ? void 0 : loc.identifierName) || null;
+ targetObj.line = pos == null ? void 0 : pos.line;
+ targetObj.column = pos == null ? void 0 : pos.column;
+ targetObj.filename = loc == null ? void 0 : loc.filename;
+
+ if (force || targetObj.line !== origLine || targetObj.column !== origColumn || targetObj.filename !== origFilename) {
+ targetObj.force = force;
+ }
+
+ return targetObj;
+ }
+
+ getCurrentColumn() {
+ const extra = this._queue.reduce((acc, item) => item[0] + acc, "");
+
+ const lastIndex = extra.lastIndexOf("\n");
+ return lastIndex === -1 ? this._position.column + extra.length : extra.length - 1 - lastIndex;
+ }
+
+ getCurrentLine() {
+ const extra = this._queue.reduce((acc, item) => item[0] + acc, "");
+
+ let count = 0;
+
+ for (let i = 0; i < extra.length; i++) {
+ if (extra[i] === "\n") count++;
+ }
+
+ return this._position.line + count;
+ }
+
+}
+
+exports.default = Buffer; \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/generator/lib/generators/base.js b/chromium/third_party/node/node_modules/@babel/generator/lib/generators/base.js
new file mode 100644
index 00000000000..222a3c2bb67
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/generator/lib/generators/base.js
@@ -0,0 +1,96 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.File = File;
+exports.Program = Program;
+exports.BlockStatement = BlockStatement;
+exports.Directive = Directive;
+exports.DirectiveLiteral = DirectiveLiteral;
+exports.InterpreterDirective = InterpreterDirective;
+exports.Placeholder = Placeholder;
+
+function File(node) {
+ if (node.program) {
+ this.print(node.program.interpreter, node);
+ }
+
+ this.print(node.program, node);
+}
+
+function Program(node) {
+ this.printInnerComments(node, false);
+ this.printSequence(node.directives, node);
+ if (node.directives && node.directives.length) this.newline();
+ this.printSequence(node.body, node);
+}
+
+function BlockStatement(node) {
+ var _node$directives;
+
+ this.token("{");
+ this.printInnerComments(node);
+ const hasDirectives = (_node$directives = node.directives) == null ? void 0 : _node$directives.length;
+
+ if (node.body.length || hasDirectives) {
+ this.newline();
+ this.printSequence(node.directives, node, {
+ indent: true
+ });
+ if (hasDirectives) this.newline();
+ this.printSequence(node.body, node, {
+ indent: true
+ });
+ this.removeTrailingNewline();
+ this.source("end", node.loc);
+ if (!this.endsWith(10)) this.newline();
+ this.rightBrace();
+ } else {
+ this.source("end", node.loc);
+ this.token("}");
+ }
+}
+
+function Directive(node) {
+ this.print(node.value, node);
+ this.semicolon();
+}
+
+const unescapedSingleQuoteRE = /(?:^|[^\\])(?:\\\\)*'/;
+const unescapedDoubleQuoteRE = /(?:^|[^\\])(?:\\\\)*"/;
+
+function DirectiveLiteral(node) {
+ const raw = this.getPossibleRaw(node);
+
+ if (raw != null) {
+ this.token(raw);
+ return;
+ }
+
+ const {
+ value
+ } = node;
+
+ if (!unescapedDoubleQuoteRE.test(value)) {
+ this.token(`"${value}"`);
+ } else if (!unescapedSingleQuoteRE.test(value)) {
+ this.token(`'${value}'`);
+ } else {
+ throw new Error("Malformed AST: it is not possible to print a directive containing" + " both unescaped single and double quotes.");
+ }
+}
+
+function InterpreterDirective(node) {
+ this.token(`#!${node.value}\n`);
+}
+
+function Placeholder(node) {
+ this.token("%%");
+ this.print(node.name);
+ this.token("%%");
+
+ if (node.expectedNode === "Statement") {
+ this.semicolon();
+ }
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/generator/lib/generators/classes.js b/chromium/third_party/node/node_modules/@babel/generator/lib/generators/classes.js
new file mode 100644
index 00000000000..eae92d43113
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/generator/lib/generators/classes.js
@@ -0,0 +1,173 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.ClassExpression = exports.ClassDeclaration = ClassDeclaration;
+exports.ClassBody = ClassBody;
+exports.ClassProperty = ClassProperty;
+exports.ClassPrivateProperty = ClassPrivateProperty;
+exports.ClassMethod = ClassMethod;
+exports.ClassPrivateMethod = ClassPrivateMethod;
+exports._classMethodHead = _classMethodHead;
+exports.StaticBlock = StaticBlock;
+
+var _t = require("@babel/types");
+
+const {
+ isExportDefaultDeclaration,
+ isExportNamedDeclaration
+} = _t;
+
+function ClassDeclaration(node, parent) {
+ if (!this.format.decoratorsBeforeExport || !isExportDefaultDeclaration(parent) && !isExportNamedDeclaration(parent)) {
+ this.printJoin(node.decorators, node);
+ }
+
+ if (node.declare) {
+ this.word("declare");
+ this.space();
+ }
+
+ if (node.abstract) {
+ this.word("abstract");
+ this.space();
+ }
+
+ this.word("class");
+
+ if (node.id) {
+ this.space();
+ this.print(node.id, node);
+ }
+
+ this.print(node.typeParameters, node);
+
+ if (node.superClass) {
+ this.space();
+ this.word("extends");
+ this.space();
+ this.print(node.superClass, node);
+ this.print(node.superTypeParameters, node);
+ }
+
+ if (node.implements) {
+ this.space();
+ this.word("implements");
+ this.space();
+ this.printList(node.implements, node);
+ }
+
+ this.space();
+ this.print(node.body, node);
+}
+
+function ClassBody(node) {
+ this.token("{");
+ this.printInnerComments(node);
+
+ if (node.body.length === 0) {
+ this.token("}");
+ } else {
+ this.newline();
+ this.indent();
+ this.printSequence(node.body, node);
+ this.dedent();
+ if (!this.endsWith(10)) this.newline();
+ this.rightBrace();
+ }
+}
+
+function ClassProperty(node) {
+ this.printJoin(node.decorators, node);
+ this.source("end", node.key.loc);
+ this.tsPrintClassMemberModifiers(node, true);
+
+ if (node.computed) {
+ this.token("[");
+ this.print(node.key, node);
+ this.token("]");
+ } else {
+ this._variance(node);
+
+ this.print(node.key, node);
+ }
+
+ if (node.optional) {
+ this.token("?");
+ }
+
+ if (node.definite) {
+ this.token("!");
+ }
+
+ this.print(node.typeAnnotation, node);
+
+ if (node.value) {
+ this.space();
+ this.token("=");
+ this.space();
+ this.print(node.value, node);
+ }
+
+ this.semicolon();
+}
+
+function ClassPrivateProperty(node) {
+ this.printJoin(node.decorators, node);
+
+ if (node.static) {
+ this.word("static");
+ this.space();
+ }
+
+ this.print(node.key, node);
+ this.print(node.typeAnnotation, node);
+
+ if (node.value) {
+ this.space();
+ this.token("=");
+ this.space();
+ this.print(node.value, node);
+ }
+
+ this.semicolon();
+}
+
+function ClassMethod(node) {
+ this._classMethodHead(node);
+
+ this.space();
+ this.print(node.body, node);
+}
+
+function ClassPrivateMethod(node) {
+ this._classMethodHead(node);
+
+ this.space();
+ this.print(node.body, node);
+}
+
+function _classMethodHead(node) {
+ this.printJoin(node.decorators, node);
+ this.source("end", node.key.loc);
+ this.tsPrintClassMemberModifiers(node, false);
+
+ this._methodHead(node);
+}
+
+function StaticBlock(node) {
+ this.word("static");
+ this.space();
+ this.token("{");
+
+ if (node.body.length === 0) {
+ this.token("}");
+ } else {
+ this.newline();
+ this.printSequence(node.body, node, {
+ indent: true
+ });
+ this.rightBrace();
+ }
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/generator/lib/generators/expressions.js b/chromium/third_party/node/node_modules/@babel/generator/lib/generators/expressions.js
new file mode 100644
index 00000000000..a0f293fd630
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/generator/lib/generators/expressions.js
@@ -0,0 +1,317 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.UnaryExpression = UnaryExpression;
+exports.DoExpression = DoExpression;
+exports.ParenthesizedExpression = ParenthesizedExpression;
+exports.UpdateExpression = UpdateExpression;
+exports.ConditionalExpression = ConditionalExpression;
+exports.NewExpression = NewExpression;
+exports.SequenceExpression = SequenceExpression;
+exports.ThisExpression = ThisExpression;
+exports.Super = Super;
+exports.Decorator = Decorator;
+exports.OptionalMemberExpression = OptionalMemberExpression;
+exports.OptionalCallExpression = OptionalCallExpression;
+exports.CallExpression = CallExpression;
+exports.Import = Import;
+exports.EmptyStatement = EmptyStatement;
+exports.ExpressionStatement = ExpressionStatement;
+exports.AssignmentPattern = AssignmentPattern;
+exports.LogicalExpression = exports.BinaryExpression = exports.AssignmentExpression = AssignmentExpression;
+exports.BindExpression = BindExpression;
+exports.MemberExpression = MemberExpression;
+exports.MetaProperty = MetaProperty;
+exports.PrivateName = PrivateName;
+exports.V8IntrinsicIdentifier = V8IntrinsicIdentifier;
+exports.ModuleExpression = ModuleExpression;
+exports.AwaitExpression = exports.YieldExpression = void 0;
+
+var _t = require("@babel/types");
+
+var n = require("../node");
+
+const {
+ isCallExpression,
+ isLiteral,
+ isMemberExpression,
+ isNewExpression
+} = _t;
+
+function UnaryExpression(node) {
+ if (node.operator === "void" || node.operator === "delete" || node.operator === "typeof" || node.operator === "throw") {
+ this.word(node.operator);
+ this.space();
+ } else {
+ this.token(node.operator);
+ }
+
+ this.print(node.argument, node);
+}
+
+function DoExpression(node) {
+ if (node.async) {
+ this.word("async");
+ this.space();
+ }
+
+ this.word("do");
+ this.space();
+ this.print(node.body, node);
+}
+
+function ParenthesizedExpression(node) {
+ this.token("(");
+ this.print(node.expression, node);
+ this.token(")");
+}
+
+function UpdateExpression(node) {
+ if (node.prefix) {
+ this.token(node.operator);
+ this.print(node.argument, node);
+ } else {
+ this.startTerminatorless(true);
+ this.print(node.argument, node);
+ this.endTerminatorless();
+ this.token(node.operator);
+ }
+}
+
+function ConditionalExpression(node) {
+ this.print(node.test, node);
+ this.space();
+ this.token("?");
+ this.space();
+ this.print(node.consequent, node);
+ this.space();
+ this.token(":");
+ this.space();
+ this.print(node.alternate, node);
+}
+
+function NewExpression(node, parent) {
+ this.word("new");
+ this.space();
+ this.print(node.callee, node);
+
+ if (this.format.minified && node.arguments.length === 0 && !node.optional && !isCallExpression(parent, {
+ callee: node
+ }) && !isMemberExpression(parent) && !isNewExpression(parent)) {
+ return;
+ }
+
+ this.print(node.typeArguments, node);
+ this.print(node.typeParameters, node);
+
+ if (node.optional) {
+ this.token("?.");
+ }
+
+ this.token("(");
+ this.printList(node.arguments, node);
+ this.token(")");
+}
+
+function SequenceExpression(node) {
+ this.printList(node.expressions, node);
+}
+
+function ThisExpression() {
+ this.word("this");
+}
+
+function Super() {
+ this.word("super");
+}
+
+function Decorator(node) {
+ this.token("@");
+ this.print(node.expression, node);
+ this.newline();
+}
+
+function OptionalMemberExpression(node) {
+ this.print(node.object, node);
+
+ if (!node.computed && isMemberExpression(node.property)) {
+ throw new TypeError("Got a MemberExpression for MemberExpression property");
+ }
+
+ let computed = node.computed;
+
+ if (isLiteral(node.property) && typeof node.property.value === "number") {
+ computed = true;
+ }
+
+ if (node.optional) {
+ this.token("?.");
+ }
+
+ if (computed) {
+ this.token("[");
+ this.print(node.property, node);
+ this.token("]");
+ } else {
+ if (!node.optional) {
+ this.token(".");
+ }
+
+ this.print(node.property, node);
+ }
+}
+
+function OptionalCallExpression(node) {
+ this.print(node.callee, node);
+ this.print(node.typeArguments, node);
+ this.print(node.typeParameters, node);
+
+ if (node.optional) {
+ this.token("?.");
+ }
+
+ this.token("(");
+ this.printList(node.arguments, node);
+ this.token(")");
+}
+
+function CallExpression(node) {
+ this.print(node.callee, node);
+ this.print(node.typeArguments, node);
+ this.print(node.typeParameters, node);
+ this.token("(");
+ this.printList(node.arguments, node);
+ this.token(")");
+}
+
+function Import() {
+ this.word("import");
+}
+
+function buildYieldAwait(keyword) {
+ return function (node) {
+ this.word(keyword);
+
+ if (node.delegate) {
+ this.token("*");
+ }
+
+ if (node.argument) {
+ this.space();
+ const terminatorState = this.startTerminatorless();
+ this.print(node.argument, node);
+ this.endTerminatorless(terminatorState);
+ }
+ };
+}
+
+const YieldExpression = buildYieldAwait("yield");
+exports.YieldExpression = YieldExpression;
+const AwaitExpression = buildYieldAwait("await");
+exports.AwaitExpression = AwaitExpression;
+
+function EmptyStatement() {
+ this.semicolon(true);
+}
+
+function ExpressionStatement(node) {
+ this.print(node.expression, node);
+ this.semicolon();
+}
+
+function AssignmentPattern(node) {
+ this.print(node.left, node);
+ if (node.left.optional) this.token("?");
+ this.print(node.left.typeAnnotation, node);
+ this.space();
+ this.token("=");
+ this.space();
+ this.print(node.right, node);
+}
+
+function AssignmentExpression(node, parent) {
+ const parens = this.inForStatementInitCounter && node.operator === "in" && !n.needsParens(node, parent);
+
+ if (parens) {
+ this.token("(");
+ }
+
+ this.print(node.left, node);
+ this.space();
+
+ if (node.operator === "in" || node.operator === "instanceof") {
+ this.word(node.operator);
+ } else {
+ this.token(node.operator);
+ }
+
+ this.space();
+ this.print(node.right, node);
+
+ if (parens) {
+ this.token(")");
+ }
+}
+
+function BindExpression(node) {
+ this.print(node.object, node);
+ this.token("::");
+ this.print(node.callee, node);
+}
+
+function MemberExpression(node) {
+ this.print(node.object, node);
+
+ if (!node.computed && isMemberExpression(node.property)) {
+ throw new TypeError("Got a MemberExpression for MemberExpression property");
+ }
+
+ let computed = node.computed;
+
+ if (isLiteral(node.property) && typeof node.property.value === "number") {
+ computed = true;
+ }
+
+ if (computed) {
+ this.token("[");
+ this.print(node.property, node);
+ this.token("]");
+ } else {
+ this.token(".");
+ this.print(node.property, node);
+ }
+}
+
+function MetaProperty(node) {
+ this.print(node.meta, node);
+ this.token(".");
+ this.print(node.property, node);
+}
+
+function PrivateName(node) {
+ this.token("#");
+ this.print(node.id, node);
+}
+
+function V8IntrinsicIdentifier(node) {
+ this.token("%");
+ this.word(node.name);
+}
+
+function ModuleExpression(node) {
+ this.word("module");
+ this.space();
+ this.token("{");
+
+ if (node.body.body.length === 0) {
+ this.token("}");
+ } else {
+ this.newline();
+ this.printSequence(node.body.body, node, {
+ indent: true
+ });
+ this.rightBrace();
+ }
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/generator/lib/generators/flow.js b/chromium/third_party/node/node_modules/@babel/generator/lib/generators/flow.js
new file mode 100644
index 00000000000..b2bce2f0839
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/generator/lib/generators/flow.js
@@ -0,0 +1,795 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.AnyTypeAnnotation = AnyTypeAnnotation;
+exports.ArrayTypeAnnotation = ArrayTypeAnnotation;
+exports.BooleanTypeAnnotation = BooleanTypeAnnotation;
+exports.BooleanLiteralTypeAnnotation = BooleanLiteralTypeAnnotation;
+exports.NullLiteralTypeAnnotation = NullLiteralTypeAnnotation;
+exports.DeclareClass = DeclareClass;
+exports.DeclareFunction = DeclareFunction;
+exports.InferredPredicate = InferredPredicate;
+exports.DeclaredPredicate = DeclaredPredicate;
+exports.DeclareInterface = DeclareInterface;
+exports.DeclareModule = DeclareModule;
+exports.DeclareModuleExports = DeclareModuleExports;
+exports.DeclareTypeAlias = DeclareTypeAlias;
+exports.DeclareOpaqueType = DeclareOpaqueType;
+exports.DeclareVariable = DeclareVariable;
+exports.DeclareExportDeclaration = DeclareExportDeclaration;
+exports.DeclareExportAllDeclaration = DeclareExportAllDeclaration;
+exports.EnumDeclaration = EnumDeclaration;
+exports.EnumBooleanBody = EnumBooleanBody;
+exports.EnumNumberBody = EnumNumberBody;
+exports.EnumStringBody = EnumStringBody;
+exports.EnumSymbolBody = EnumSymbolBody;
+exports.EnumDefaultedMember = EnumDefaultedMember;
+exports.EnumBooleanMember = EnumBooleanMember;
+exports.EnumNumberMember = EnumNumberMember;
+exports.EnumStringMember = EnumStringMember;
+exports.ExistsTypeAnnotation = ExistsTypeAnnotation;
+exports.FunctionTypeAnnotation = FunctionTypeAnnotation;
+exports.FunctionTypeParam = FunctionTypeParam;
+exports.GenericTypeAnnotation = exports.ClassImplements = exports.InterfaceExtends = InterfaceExtends;
+exports._interfaceish = _interfaceish;
+exports._variance = _variance;
+exports.InterfaceDeclaration = InterfaceDeclaration;
+exports.InterfaceTypeAnnotation = InterfaceTypeAnnotation;
+exports.IntersectionTypeAnnotation = IntersectionTypeAnnotation;
+exports.MixedTypeAnnotation = MixedTypeAnnotation;
+exports.EmptyTypeAnnotation = EmptyTypeAnnotation;
+exports.NullableTypeAnnotation = NullableTypeAnnotation;
+exports.NumberTypeAnnotation = NumberTypeAnnotation;
+exports.StringTypeAnnotation = StringTypeAnnotation;
+exports.ThisTypeAnnotation = ThisTypeAnnotation;
+exports.TupleTypeAnnotation = TupleTypeAnnotation;
+exports.TypeofTypeAnnotation = TypeofTypeAnnotation;
+exports.TypeAlias = TypeAlias;
+exports.TypeAnnotation = TypeAnnotation;
+exports.TypeParameterDeclaration = exports.TypeParameterInstantiation = TypeParameterInstantiation;
+exports.TypeParameter = TypeParameter;
+exports.OpaqueType = OpaqueType;
+exports.ObjectTypeAnnotation = ObjectTypeAnnotation;
+exports.ObjectTypeInternalSlot = ObjectTypeInternalSlot;
+exports.ObjectTypeCallProperty = ObjectTypeCallProperty;
+exports.ObjectTypeIndexer = ObjectTypeIndexer;
+exports.ObjectTypeProperty = ObjectTypeProperty;
+exports.ObjectTypeSpreadProperty = ObjectTypeSpreadProperty;
+exports.QualifiedTypeIdentifier = QualifiedTypeIdentifier;
+exports.SymbolTypeAnnotation = SymbolTypeAnnotation;
+exports.UnionTypeAnnotation = UnionTypeAnnotation;
+exports.TypeCastExpression = TypeCastExpression;
+exports.Variance = Variance;
+exports.VoidTypeAnnotation = VoidTypeAnnotation;
+exports.IndexedAccessType = IndexedAccessType;
+exports.OptionalIndexedAccessType = OptionalIndexedAccessType;
+Object.defineProperty(exports, "NumberLiteralTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _types2.NumericLiteral;
+ }
+});
+Object.defineProperty(exports, "StringLiteralTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _types2.StringLiteral;
+ }
+});
+
+var _t = require("@babel/types");
+
+var _modules = require("./modules");
+
+var _types2 = require("./types");
+
+const {
+ isDeclareExportDeclaration,
+ isStatement
+} = _t;
+
+function AnyTypeAnnotation() {
+ this.word("any");
+}
+
+function ArrayTypeAnnotation(node) {
+ this.print(node.elementType, node);
+ this.token("[");
+ this.token("]");
+}
+
+function BooleanTypeAnnotation() {
+ this.word("boolean");
+}
+
+function BooleanLiteralTypeAnnotation(node) {
+ this.word(node.value ? "true" : "false");
+}
+
+function NullLiteralTypeAnnotation() {
+ this.word("null");
+}
+
+function DeclareClass(node, parent) {
+ if (!isDeclareExportDeclaration(parent)) {
+ this.word("declare");
+ this.space();
+ }
+
+ this.word("class");
+ this.space();
+
+ this._interfaceish(node);
+}
+
+function DeclareFunction(node, parent) {
+ if (!isDeclareExportDeclaration(parent)) {
+ this.word("declare");
+ this.space();
+ }
+
+ this.word("function");
+ this.space();
+ this.print(node.id, node);
+ this.print(node.id.typeAnnotation.typeAnnotation, node);
+
+ if (node.predicate) {
+ this.space();
+ this.print(node.predicate, node);
+ }
+
+ this.semicolon();
+}
+
+function InferredPredicate() {
+ this.token("%");
+ this.word("checks");
+}
+
+function DeclaredPredicate(node) {
+ this.token("%");
+ this.word("checks");
+ this.token("(");
+ this.print(node.value, node);
+ this.token(")");
+}
+
+function DeclareInterface(node) {
+ this.word("declare");
+ this.space();
+ this.InterfaceDeclaration(node);
+}
+
+function DeclareModule(node) {
+ this.word("declare");
+ this.space();
+ this.word("module");
+ this.space();
+ this.print(node.id, node);
+ this.space();
+ this.print(node.body, node);
+}
+
+function DeclareModuleExports(node) {
+ this.word("declare");
+ this.space();
+ this.word("module");
+ this.token(".");
+ this.word("exports");
+ this.print(node.typeAnnotation, node);
+}
+
+function DeclareTypeAlias(node) {
+ this.word("declare");
+ this.space();
+ this.TypeAlias(node);
+}
+
+function DeclareOpaqueType(node, parent) {
+ if (!isDeclareExportDeclaration(parent)) {
+ this.word("declare");
+ this.space();
+ }
+
+ this.OpaqueType(node);
+}
+
+function DeclareVariable(node, parent) {
+ if (!isDeclareExportDeclaration(parent)) {
+ this.word("declare");
+ this.space();
+ }
+
+ this.word("var");
+ this.space();
+ this.print(node.id, node);
+ this.print(node.id.typeAnnotation, node);
+ this.semicolon();
+}
+
+function DeclareExportDeclaration(node) {
+ this.word("declare");
+ this.space();
+ this.word("export");
+ this.space();
+
+ if (node.default) {
+ this.word("default");
+ this.space();
+ }
+
+ FlowExportDeclaration.apply(this, arguments);
+}
+
+function DeclareExportAllDeclaration() {
+ this.word("declare");
+ this.space();
+
+ _modules.ExportAllDeclaration.apply(this, arguments);
+}
+
+function EnumDeclaration(node) {
+ const {
+ id,
+ body
+ } = node;
+ this.word("enum");
+ this.space();
+ this.print(id, node);
+ this.print(body, node);
+}
+
+function enumExplicitType(context, name, hasExplicitType) {
+ if (hasExplicitType) {
+ context.space();
+ context.word("of");
+ context.space();
+ context.word(name);
+ }
+
+ context.space();
+}
+
+function enumBody(context, node) {
+ const {
+ members
+ } = node;
+ context.token("{");
+ context.indent();
+ context.newline();
+
+ for (const member of members) {
+ context.print(member, node);
+ context.newline();
+ }
+
+ if (node.hasUnknownMembers) {
+ context.token("...");
+ context.newline();
+ }
+
+ context.dedent();
+ context.token("}");
+}
+
+function EnumBooleanBody(node) {
+ const {
+ explicitType
+ } = node;
+ enumExplicitType(this, "boolean", explicitType);
+ enumBody(this, node);
+}
+
+function EnumNumberBody(node) {
+ const {
+ explicitType
+ } = node;
+ enumExplicitType(this, "number", explicitType);
+ enumBody(this, node);
+}
+
+function EnumStringBody(node) {
+ const {
+ explicitType
+ } = node;
+ enumExplicitType(this, "string", explicitType);
+ enumBody(this, node);
+}
+
+function EnumSymbolBody(node) {
+ enumExplicitType(this, "symbol", true);
+ enumBody(this, node);
+}
+
+function EnumDefaultedMember(node) {
+ const {
+ id
+ } = node;
+ this.print(id, node);
+ this.token(",");
+}
+
+function enumInitializedMember(context, node) {
+ const {
+ id,
+ init
+ } = node;
+ context.print(id, node);
+ context.space();
+ context.token("=");
+ context.space();
+ context.print(init, node);
+ context.token(",");
+}
+
+function EnumBooleanMember(node) {
+ enumInitializedMember(this, node);
+}
+
+function EnumNumberMember(node) {
+ enumInitializedMember(this, node);
+}
+
+function EnumStringMember(node) {
+ enumInitializedMember(this, node);
+}
+
+function FlowExportDeclaration(node) {
+ if (node.declaration) {
+ const declar = node.declaration;
+ this.print(declar, node);
+ if (!isStatement(declar)) this.semicolon();
+ } else {
+ this.token("{");
+
+ if (node.specifiers.length) {
+ this.space();
+ this.printList(node.specifiers, node);
+ this.space();
+ }
+
+ this.token("}");
+
+ if (node.source) {
+ this.space();
+ this.word("from");
+ this.space();
+ this.print(node.source, node);
+ }
+
+ this.semicolon();
+ }
+}
+
+function ExistsTypeAnnotation() {
+ this.token("*");
+}
+
+function FunctionTypeAnnotation(node, parent) {
+ this.print(node.typeParameters, node);
+ this.token("(");
+
+ if (node.this) {
+ this.word("this");
+ this.token(":");
+ this.space();
+ this.print(node.this.typeAnnotation, node);
+
+ if (node.params.length || node.rest) {
+ this.token(",");
+ this.space();
+ }
+ }
+
+ this.printList(node.params, node);
+
+ if (node.rest) {
+ if (node.params.length) {
+ this.token(",");
+ this.space();
+ }
+
+ this.token("...");
+ this.print(node.rest, node);
+ }
+
+ this.token(")");
+
+ if (parent.type === "ObjectTypeCallProperty" || parent.type === "DeclareFunction" || parent.type === "ObjectTypeProperty" && parent.method) {
+ this.token(":");
+ } else {
+ this.space();
+ this.token("=>");
+ }
+
+ this.space();
+ this.print(node.returnType, node);
+}
+
+function FunctionTypeParam(node) {
+ this.print(node.name, node);
+ if (node.optional) this.token("?");
+
+ if (node.name) {
+ this.token(":");
+ this.space();
+ }
+
+ this.print(node.typeAnnotation, node);
+}
+
+function InterfaceExtends(node) {
+ this.print(node.id, node);
+ this.print(node.typeParameters, node);
+}
+
+function _interfaceish(node) {
+ var _node$extends;
+
+ this.print(node.id, node);
+ this.print(node.typeParameters, node);
+
+ if ((_node$extends = node.extends) != null && _node$extends.length) {
+ this.space();
+ this.word("extends");
+ this.space();
+ this.printList(node.extends, node);
+ }
+
+ if (node.mixins && node.mixins.length) {
+ this.space();
+ this.word("mixins");
+ this.space();
+ this.printList(node.mixins, node);
+ }
+
+ if (node.implements && node.implements.length) {
+ this.space();
+ this.word("implements");
+ this.space();
+ this.printList(node.implements, node);
+ }
+
+ this.space();
+ this.print(node.body, node);
+}
+
+function _variance(node) {
+ if (node.variance) {
+ if (node.variance.kind === "plus") {
+ this.token("+");
+ } else if (node.variance.kind === "minus") {
+ this.token("-");
+ }
+ }
+}
+
+function InterfaceDeclaration(node) {
+ this.word("interface");
+ this.space();
+
+ this._interfaceish(node);
+}
+
+function andSeparator() {
+ this.space();
+ this.token("&");
+ this.space();
+}
+
+function InterfaceTypeAnnotation(node) {
+ this.word("interface");
+
+ if (node.extends && node.extends.length) {
+ this.space();
+ this.word("extends");
+ this.space();
+ this.printList(node.extends, node);
+ }
+
+ this.space();
+ this.print(node.body, node);
+}
+
+function IntersectionTypeAnnotation(node) {
+ this.printJoin(node.types, node, {
+ separator: andSeparator
+ });
+}
+
+function MixedTypeAnnotation() {
+ this.word("mixed");
+}
+
+function EmptyTypeAnnotation() {
+ this.word("empty");
+}
+
+function NullableTypeAnnotation(node) {
+ this.token("?");
+ this.print(node.typeAnnotation, node);
+}
+
+function NumberTypeAnnotation() {
+ this.word("number");
+}
+
+function StringTypeAnnotation() {
+ this.word("string");
+}
+
+function ThisTypeAnnotation() {
+ this.word("this");
+}
+
+function TupleTypeAnnotation(node) {
+ this.token("[");
+ this.printList(node.types, node);
+ this.token("]");
+}
+
+function TypeofTypeAnnotation(node) {
+ this.word("typeof");
+ this.space();
+ this.print(node.argument, node);
+}
+
+function TypeAlias(node) {
+ this.word("type");
+ this.space();
+ this.print(node.id, node);
+ this.print(node.typeParameters, node);
+ this.space();
+ this.token("=");
+ this.space();
+ this.print(node.right, node);
+ this.semicolon();
+}
+
+function TypeAnnotation(node) {
+ this.token(":");
+ this.space();
+ if (node.optional) this.token("?");
+ this.print(node.typeAnnotation, node);
+}
+
+function TypeParameterInstantiation(node) {
+ this.token("<");
+ this.printList(node.params, node, {});
+ this.token(">");
+}
+
+function TypeParameter(node) {
+ this._variance(node);
+
+ this.word(node.name);
+
+ if (node.bound) {
+ this.print(node.bound, node);
+ }
+
+ if (node.default) {
+ this.space();
+ this.token("=");
+ this.space();
+ this.print(node.default, node);
+ }
+}
+
+function OpaqueType(node) {
+ this.word("opaque");
+ this.space();
+ this.word("type");
+ this.space();
+ this.print(node.id, node);
+ this.print(node.typeParameters, node);
+
+ if (node.supertype) {
+ this.token(":");
+ this.space();
+ this.print(node.supertype, node);
+ }
+
+ if (node.impltype) {
+ this.space();
+ this.token("=");
+ this.space();
+ this.print(node.impltype, node);
+ }
+
+ this.semicolon();
+}
+
+function ObjectTypeAnnotation(node) {
+ if (node.exact) {
+ this.token("{|");
+ } else {
+ this.token("{");
+ }
+
+ const props = [...node.properties, ...(node.callProperties || []), ...(node.indexers || []), ...(node.internalSlots || [])];
+
+ if (props.length) {
+ this.space();
+ this.printJoin(props, node, {
+ addNewlines(leading) {
+ if (leading && !props[0]) return 1;
+ },
+
+ indent: true,
+ statement: true,
+ iterator: () => {
+ if (props.length !== 1 || node.inexact) {
+ this.token(",");
+ this.space();
+ }
+ }
+ });
+ this.space();
+ }
+
+ if (node.inexact) {
+ this.indent();
+ this.token("...");
+
+ if (props.length) {
+ this.newline();
+ }
+
+ this.dedent();
+ }
+
+ if (node.exact) {
+ this.token("|}");
+ } else {
+ this.token("}");
+ }
+}
+
+function ObjectTypeInternalSlot(node) {
+ if (node.static) {
+ this.word("static");
+ this.space();
+ }
+
+ this.token("[");
+ this.token("[");
+ this.print(node.id, node);
+ this.token("]");
+ this.token("]");
+ if (node.optional) this.token("?");
+
+ if (!node.method) {
+ this.token(":");
+ this.space();
+ }
+
+ this.print(node.value, node);
+}
+
+function ObjectTypeCallProperty(node) {
+ if (node.static) {
+ this.word("static");
+ this.space();
+ }
+
+ this.print(node.value, node);
+}
+
+function ObjectTypeIndexer(node) {
+ if (node.static) {
+ this.word("static");
+ this.space();
+ }
+
+ this._variance(node);
+
+ this.token("[");
+
+ if (node.id) {
+ this.print(node.id, node);
+ this.token(":");
+ this.space();
+ }
+
+ this.print(node.key, node);
+ this.token("]");
+ this.token(":");
+ this.space();
+ this.print(node.value, node);
+}
+
+function ObjectTypeProperty(node) {
+ if (node.proto) {
+ this.word("proto");
+ this.space();
+ }
+
+ if (node.static) {
+ this.word("static");
+ this.space();
+ }
+
+ if (node.kind === "get" || node.kind === "set") {
+ this.word(node.kind);
+ this.space();
+ }
+
+ this._variance(node);
+
+ this.print(node.key, node);
+ if (node.optional) this.token("?");
+
+ if (!node.method) {
+ this.token(":");
+ this.space();
+ }
+
+ this.print(node.value, node);
+}
+
+function ObjectTypeSpreadProperty(node) {
+ this.token("...");
+ this.print(node.argument, node);
+}
+
+function QualifiedTypeIdentifier(node) {
+ this.print(node.qualification, node);
+ this.token(".");
+ this.print(node.id, node);
+}
+
+function SymbolTypeAnnotation() {
+ this.word("symbol");
+}
+
+function orSeparator() {
+ this.space();
+ this.token("|");
+ this.space();
+}
+
+function UnionTypeAnnotation(node) {
+ this.printJoin(node.types, node, {
+ separator: orSeparator
+ });
+}
+
+function TypeCastExpression(node) {
+ this.token("(");
+ this.print(node.expression, node);
+ this.print(node.typeAnnotation, node);
+ this.token(")");
+}
+
+function Variance(node) {
+ if (node.kind === "plus") {
+ this.token("+");
+ } else {
+ this.token("-");
+ }
+}
+
+function VoidTypeAnnotation() {
+ this.word("void");
+}
+
+function IndexedAccessType(node) {
+ this.print(node.objectType, node);
+ this.token("[");
+ this.print(node.indexType, node);
+ this.token("]");
+}
+
+function OptionalIndexedAccessType(node) {
+ this.print(node.objectType, node);
+
+ if (node.optional) {
+ this.token("?.");
+ }
+
+ this.token("[");
+ this.print(node.indexType, node);
+ this.token("]");
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/generator/lib/generators/index.js b/chromium/third_party/node/node_modules/@babel/generator/lib/generators/index.js
new file mode 100644
index 00000000000..8820db09efe
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/generator/lib/generators/index.js
@@ -0,0 +1,148 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _templateLiterals = require("./template-literals");
+
+Object.keys(_templateLiterals).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (key in exports && exports[key] === _templateLiterals[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _templateLiterals[key];
+ }
+ });
+});
+
+var _expressions = require("./expressions");
+
+Object.keys(_expressions).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (key in exports && exports[key] === _expressions[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _expressions[key];
+ }
+ });
+});
+
+var _statements = require("./statements");
+
+Object.keys(_statements).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (key in exports && exports[key] === _statements[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _statements[key];
+ }
+ });
+});
+
+var _classes = require("./classes");
+
+Object.keys(_classes).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (key in exports && exports[key] === _classes[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _classes[key];
+ }
+ });
+});
+
+var _methods = require("./methods");
+
+Object.keys(_methods).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (key in exports && exports[key] === _methods[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _methods[key];
+ }
+ });
+});
+
+var _modules = require("./modules");
+
+Object.keys(_modules).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (key in exports && exports[key] === _modules[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _modules[key];
+ }
+ });
+});
+
+var _types = require("./types");
+
+Object.keys(_types).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (key in exports && exports[key] === _types[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _types[key];
+ }
+ });
+});
+
+var _flow = require("./flow");
+
+Object.keys(_flow).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (key in exports && exports[key] === _flow[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _flow[key];
+ }
+ });
+});
+
+var _base = require("./base");
+
+Object.keys(_base).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (key in exports && exports[key] === _base[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _base[key];
+ }
+ });
+});
+
+var _jsx = require("./jsx");
+
+Object.keys(_jsx).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (key in exports && exports[key] === _jsx[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _jsx[key];
+ }
+ });
+});
+
+var _typescript = require("./typescript");
+
+Object.keys(_typescript).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (key in exports && exports[key] === _typescript[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _typescript[key];
+ }
+ });
+}); \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/generator/lib/generators/jsx.js b/chromium/third_party/node/node_modules/@babel/generator/lib/generators/jsx.js
new file mode 100644
index 00000000000..48509139839
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/generator/lib/generators/jsx.js
@@ -0,0 +1,145 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.JSXAttribute = JSXAttribute;
+exports.JSXIdentifier = JSXIdentifier;
+exports.JSXNamespacedName = JSXNamespacedName;
+exports.JSXMemberExpression = JSXMemberExpression;
+exports.JSXSpreadAttribute = JSXSpreadAttribute;
+exports.JSXExpressionContainer = JSXExpressionContainer;
+exports.JSXSpreadChild = JSXSpreadChild;
+exports.JSXText = JSXText;
+exports.JSXElement = JSXElement;
+exports.JSXOpeningElement = JSXOpeningElement;
+exports.JSXClosingElement = JSXClosingElement;
+exports.JSXEmptyExpression = JSXEmptyExpression;
+exports.JSXFragment = JSXFragment;
+exports.JSXOpeningFragment = JSXOpeningFragment;
+exports.JSXClosingFragment = JSXClosingFragment;
+
+function JSXAttribute(node) {
+ this.print(node.name, node);
+
+ if (node.value) {
+ this.token("=");
+ this.print(node.value, node);
+ }
+}
+
+function JSXIdentifier(node) {
+ this.word(node.name);
+}
+
+function JSXNamespacedName(node) {
+ this.print(node.namespace, node);
+ this.token(":");
+ this.print(node.name, node);
+}
+
+function JSXMemberExpression(node) {
+ this.print(node.object, node);
+ this.token(".");
+ this.print(node.property, node);
+}
+
+function JSXSpreadAttribute(node) {
+ this.token("{");
+ this.token("...");
+ this.print(node.argument, node);
+ this.token("}");
+}
+
+function JSXExpressionContainer(node) {
+ this.token("{");
+ this.print(node.expression, node);
+ this.token("}");
+}
+
+function JSXSpreadChild(node) {
+ this.token("{");
+ this.token("...");
+ this.print(node.expression, node);
+ this.token("}");
+}
+
+function JSXText(node) {
+ const raw = this.getPossibleRaw(node);
+
+ if (raw != null) {
+ this.token(raw);
+ } else {
+ this.token(node.value);
+ }
+}
+
+function JSXElement(node) {
+ const open = node.openingElement;
+ this.print(open, node);
+ if (open.selfClosing) return;
+ this.indent();
+
+ for (const child of node.children) {
+ this.print(child, node);
+ }
+
+ this.dedent();
+ this.print(node.closingElement, node);
+}
+
+function spaceSeparator() {
+ this.space();
+}
+
+function JSXOpeningElement(node) {
+ this.token("<");
+ this.print(node.name, node);
+ this.print(node.typeParameters, node);
+
+ if (node.attributes.length > 0) {
+ this.space();
+ this.printJoin(node.attributes, node, {
+ separator: spaceSeparator
+ });
+ }
+
+ if (node.selfClosing) {
+ this.space();
+ this.token("/>");
+ } else {
+ this.token(">");
+ }
+}
+
+function JSXClosingElement(node) {
+ this.token("</");
+ this.print(node.name, node);
+ this.token(">");
+}
+
+function JSXEmptyExpression(node) {
+ this.printInnerComments(node);
+}
+
+function JSXFragment(node) {
+ this.print(node.openingFragment, node);
+ this.indent();
+
+ for (const child of node.children) {
+ this.print(child, node);
+ }
+
+ this.dedent();
+ this.print(node.closingFragment, node);
+}
+
+function JSXOpeningFragment() {
+ this.token("<");
+ this.token(">");
+}
+
+function JSXClosingFragment() {
+ this.token("</");
+ this.token(">");
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/generator/lib/generators/methods.js b/chromium/third_party/node/node_modules/@babel/generator/lib/generators/methods.js
new file mode 100644
index 00000000000..417945bf84c
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/generator/lib/generators/methods.js
@@ -0,0 +1,149 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports._params = _params;
+exports._parameters = _parameters;
+exports._param = _param;
+exports._methodHead = _methodHead;
+exports._predicate = _predicate;
+exports._functionHead = _functionHead;
+exports.FunctionDeclaration = exports.FunctionExpression = FunctionExpression;
+exports.ArrowFunctionExpression = ArrowFunctionExpression;
+
+var _t = require("@babel/types");
+
+const {
+ isIdentifier
+} = _t;
+
+function _params(node) {
+ this.print(node.typeParameters, node);
+ this.token("(");
+
+ this._parameters(node.params, node);
+
+ this.token(")");
+ this.print(node.returnType, node);
+}
+
+function _parameters(parameters, parent) {
+ for (let i = 0; i < parameters.length; i++) {
+ this._param(parameters[i], parent);
+
+ if (i < parameters.length - 1) {
+ this.token(",");
+ this.space();
+ }
+ }
+}
+
+function _param(parameter, parent) {
+ this.printJoin(parameter.decorators, parameter);
+ this.print(parameter, parent);
+ if (parameter.optional) this.token("?");
+ this.print(parameter.typeAnnotation, parameter);
+}
+
+function _methodHead(node) {
+ const kind = node.kind;
+ const key = node.key;
+
+ if (kind === "get" || kind === "set") {
+ this.word(kind);
+ this.space();
+ }
+
+ if (node.async) {
+ this._catchUp("start", key.loc);
+
+ this.word("async");
+ this.space();
+ }
+
+ if (kind === "method" || kind === "init") {
+ if (node.generator) {
+ this.token("*");
+ }
+ }
+
+ if (node.computed) {
+ this.token("[");
+ this.print(key, node);
+ this.token("]");
+ } else {
+ this.print(key, node);
+ }
+
+ if (node.optional) {
+ this.token("?");
+ }
+
+ this._params(node);
+}
+
+function _predicate(node) {
+ if (node.predicate) {
+ if (!node.returnType) {
+ this.token(":");
+ }
+
+ this.space();
+ this.print(node.predicate, node);
+ }
+}
+
+function _functionHead(node) {
+ if (node.async) {
+ this.word("async");
+ this.space();
+ }
+
+ this.word("function");
+ if (node.generator) this.token("*");
+ this.space();
+
+ if (node.id) {
+ this.print(node.id, node);
+ }
+
+ this._params(node);
+
+ this._predicate(node);
+}
+
+function FunctionExpression(node) {
+ this._functionHead(node);
+
+ this.space();
+ this.print(node.body, node);
+}
+
+function ArrowFunctionExpression(node) {
+ if (node.async) {
+ this.word("async");
+ this.space();
+ }
+
+ const firstParam = node.params[0];
+
+ if (!this.format.retainLines && !this.format.auxiliaryCommentBefore && !this.format.auxiliaryCommentAfter && node.params.length === 1 && isIdentifier(firstParam) && !hasTypesOrComments(node, firstParam)) {
+ this.print(firstParam, node);
+ } else {
+ this._params(node);
+ }
+
+ this._predicate(node);
+
+ this.space();
+ this.token("=>");
+ this.space();
+ this.print(node.body, node);
+}
+
+function hasTypesOrComments(node, param) {
+ var _param$leadingComment, _param$trailingCommen;
+
+ return !!(node.typeParameters || node.returnType || node.predicate || param.typeAnnotation || param.optional || (_param$leadingComment = param.leadingComments) != null && _param$leadingComment.length || (_param$trailingCommen = param.trailingComments) != null && _param$trailingCommen.length);
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/generator/lib/generators/modules.js b/chromium/third_party/node/node_modules/@babel/generator/lib/generators/modules.js
new file mode 100644
index 00000000000..3259ef11a64
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/generator/lib/generators/modules.js
@@ -0,0 +1,234 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.ImportSpecifier = ImportSpecifier;
+exports.ImportDefaultSpecifier = ImportDefaultSpecifier;
+exports.ExportDefaultSpecifier = ExportDefaultSpecifier;
+exports.ExportSpecifier = ExportSpecifier;
+exports.ExportNamespaceSpecifier = ExportNamespaceSpecifier;
+exports.ExportAllDeclaration = ExportAllDeclaration;
+exports.ExportNamedDeclaration = ExportNamedDeclaration;
+exports.ExportDefaultDeclaration = ExportDefaultDeclaration;
+exports.ImportDeclaration = ImportDeclaration;
+exports.ImportAttribute = ImportAttribute;
+exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier;
+
+var _t = require("@babel/types");
+
+const {
+ isClassDeclaration,
+ isExportDefaultSpecifier,
+ isExportNamespaceSpecifier,
+ isImportDefaultSpecifier,
+ isImportNamespaceSpecifier,
+ isStatement
+} = _t;
+
+function ImportSpecifier(node) {
+ if (node.importKind === "type" || node.importKind === "typeof") {
+ this.word(node.importKind);
+ this.space();
+ }
+
+ this.print(node.imported, node);
+
+ if (node.local && node.local.name !== node.imported.name) {
+ this.space();
+ this.word("as");
+ this.space();
+ this.print(node.local, node);
+ }
+}
+
+function ImportDefaultSpecifier(node) {
+ this.print(node.local, node);
+}
+
+function ExportDefaultSpecifier(node) {
+ this.print(node.exported, node);
+}
+
+function ExportSpecifier(node) {
+ this.print(node.local, node);
+
+ if (node.exported && node.local.name !== node.exported.name) {
+ this.space();
+ this.word("as");
+ this.space();
+ this.print(node.exported, node);
+ }
+}
+
+function ExportNamespaceSpecifier(node) {
+ this.token("*");
+ this.space();
+ this.word("as");
+ this.space();
+ this.print(node.exported, node);
+}
+
+function ExportAllDeclaration(node) {
+ this.word("export");
+ this.space();
+
+ if (node.exportKind === "type") {
+ this.word("type");
+ this.space();
+ }
+
+ this.token("*");
+ this.space();
+ this.word("from");
+ this.space();
+ this.print(node.source, node);
+ this.printAssertions(node);
+ this.semicolon();
+}
+
+function ExportNamedDeclaration(node) {
+ if (this.format.decoratorsBeforeExport && isClassDeclaration(node.declaration)) {
+ this.printJoin(node.declaration.decorators, node);
+ }
+
+ this.word("export");
+ this.space();
+ ExportDeclaration.apply(this, arguments);
+}
+
+function ExportDefaultDeclaration(node) {
+ if (this.format.decoratorsBeforeExport && isClassDeclaration(node.declaration)) {
+ this.printJoin(node.declaration.decorators, node);
+ }
+
+ this.word("export");
+ this.space();
+ this.word("default");
+ this.space();
+ ExportDeclaration.apply(this, arguments);
+}
+
+function ExportDeclaration(node) {
+ if (node.declaration) {
+ const declar = node.declaration;
+ this.print(declar, node);
+ if (!isStatement(declar)) this.semicolon();
+ } else {
+ if (node.exportKind === "type") {
+ this.word("type");
+ this.space();
+ }
+
+ const specifiers = node.specifiers.slice(0);
+ let hasSpecial = false;
+
+ for (;;) {
+ const first = specifiers[0];
+
+ if (isExportDefaultSpecifier(first) || isExportNamespaceSpecifier(first)) {
+ hasSpecial = true;
+ this.print(specifiers.shift(), node);
+
+ if (specifiers.length) {
+ this.token(",");
+ this.space();
+ }
+ } else {
+ break;
+ }
+ }
+
+ if (specifiers.length || !specifiers.length && !hasSpecial) {
+ this.token("{");
+
+ if (specifiers.length) {
+ this.space();
+ this.printList(specifiers, node);
+ this.space();
+ }
+
+ this.token("}");
+ }
+
+ if (node.source) {
+ this.space();
+ this.word("from");
+ this.space();
+ this.print(node.source, node);
+ this.printAssertions(node);
+ }
+
+ this.semicolon();
+ }
+}
+
+function ImportDeclaration(node) {
+ this.word("import");
+ this.space();
+
+ if (node.importKind === "type" || node.importKind === "typeof") {
+ this.word(node.importKind);
+ this.space();
+ }
+
+ const specifiers = node.specifiers.slice(0);
+
+ if (specifiers != null && specifiers.length) {
+ for (;;) {
+ const first = specifiers[0];
+
+ if (isImportDefaultSpecifier(first) || isImportNamespaceSpecifier(first)) {
+ this.print(specifiers.shift(), node);
+
+ if (specifiers.length) {
+ this.token(",");
+ this.space();
+ }
+ } else {
+ break;
+ }
+ }
+
+ if (specifiers.length) {
+ this.token("{");
+ this.space();
+ this.printList(specifiers, node);
+ this.space();
+ this.token("}");
+ }
+
+ this.space();
+ this.word("from");
+ this.space();
+ }
+
+ this.print(node.source, node);
+ this.printAssertions(node);
+ {
+ var _node$attributes;
+
+ if ((_node$attributes = node.attributes) != null && _node$attributes.length) {
+ this.space();
+ this.word("with");
+ this.space();
+ this.printList(node.attributes, node);
+ }
+ }
+ this.semicolon();
+}
+
+function ImportAttribute(node) {
+ this.print(node.key);
+ this.token(":");
+ this.space();
+ this.print(node.value);
+}
+
+function ImportNamespaceSpecifier(node) {
+ this.token("*");
+ this.space();
+ this.word("as");
+ this.space();
+ this.print(node.local, node);
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/generator/lib/generators/statements.js b/chromium/third_party/node/node_modules/@babel/generator/lib/generators/statements.js
new file mode 100644
index 00000000000..528013b90de
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/generator/lib/generators/statements.js
@@ -0,0 +1,327 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.WithStatement = WithStatement;
+exports.IfStatement = IfStatement;
+exports.ForStatement = ForStatement;
+exports.WhileStatement = WhileStatement;
+exports.DoWhileStatement = DoWhileStatement;
+exports.LabeledStatement = LabeledStatement;
+exports.TryStatement = TryStatement;
+exports.CatchClause = CatchClause;
+exports.SwitchStatement = SwitchStatement;
+exports.SwitchCase = SwitchCase;
+exports.DebuggerStatement = DebuggerStatement;
+exports.VariableDeclaration = VariableDeclaration;
+exports.VariableDeclarator = VariableDeclarator;
+exports.ThrowStatement = exports.BreakStatement = exports.ReturnStatement = exports.ContinueStatement = exports.ForOfStatement = exports.ForInStatement = void 0;
+
+var _t = require("@babel/types");
+
+const {
+ isFor,
+ isForStatement,
+ isIfStatement,
+ isStatement
+} = _t;
+
+function WithStatement(node) {
+ this.word("with");
+ this.space();
+ this.token("(");
+ this.print(node.object, node);
+ this.token(")");
+ this.printBlock(node);
+}
+
+function IfStatement(node) {
+ this.word("if");
+ this.space();
+ this.token("(");
+ this.print(node.test, node);
+ this.token(")");
+ this.space();
+ const needsBlock = node.alternate && isIfStatement(getLastStatement(node.consequent));
+
+ if (needsBlock) {
+ this.token("{");
+ this.newline();
+ this.indent();
+ }
+
+ this.printAndIndentOnComments(node.consequent, node);
+
+ if (needsBlock) {
+ this.dedent();
+ this.newline();
+ this.token("}");
+ }
+
+ if (node.alternate) {
+ if (this.endsWith(125)) this.space();
+ this.word("else");
+ this.space();
+ this.printAndIndentOnComments(node.alternate, node);
+ }
+}
+
+function getLastStatement(statement) {
+ if (!isStatement(statement.body)) return statement;
+ return getLastStatement(statement.body);
+}
+
+function ForStatement(node) {
+ this.word("for");
+ this.space();
+ this.token("(");
+ this.inForStatementInitCounter++;
+ this.print(node.init, node);
+ this.inForStatementInitCounter--;
+ this.token(";");
+
+ if (node.test) {
+ this.space();
+ this.print(node.test, node);
+ }
+
+ this.token(";");
+
+ if (node.update) {
+ this.space();
+ this.print(node.update, node);
+ }
+
+ this.token(")");
+ this.printBlock(node);
+}
+
+function WhileStatement(node) {
+ this.word("while");
+ this.space();
+ this.token("(");
+ this.print(node.test, node);
+ this.token(")");
+ this.printBlock(node);
+}
+
+const buildForXStatement = function (op) {
+ return function (node) {
+ this.word("for");
+ this.space();
+
+ if (op === "of" && node.await) {
+ this.word("await");
+ this.space();
+ }
+
+ this.token("(");
+ this.print(node.left, node);
+ this.space();
+ this.word(op);
+ this.space();
+ this.print(node.right, node);
+ this.token(")");
+ this.printBlock(node);
+ };
+};
+
+const ForInStatement = buildForXStatement("in");
+exports.ForInStatement = ForInStatement;
+const ForOfStatement = buildForXStatement("of");
+exports.ForOfStatement = ForOfStatement;
+
+function DoWhileStatement(node) {
+ this.word("do");
+ this.space();
+ this.print(node.body, node);
+ this.space();
+ this.word("while");
+ this.space();
+ this.token("(");
+ this.print(node.test, node);
+ this.token(")");
+ this.semicolon();
+}
+
+function buildLabelStatement(prefix, key = "label") {
+ return function (node) {
+ this.word(prefix);
+ const label = node[key];
+
+ if (label) {
+ this.space();
+ const isLabel = key == "label";
+ const terminatorState = this.startTerminatorless(isLabel);
+ this.print(label, node);
+ this.endTerminatorless(terminatorState);
+ }
+
+ this.semicolon();
+ };
+}
+
+const ContinueStatement = buildLabelStatement("continue");
+exports.ContinueStatement = ContinueStatement;
+const ReturnStatement = buildLabelStatement("return", "argument");
+exports.ReturnStatement = ReturnStatement;
+const BreakStatement = buildLabelStatement("break");
+exports.BreakStatement = BreakStatement;
+const ThrowStatement = buildLabelStatement("throw", "argument");
+exports.ThrowStatement = ThrowStatement;
+
+function LabeledStatement(node) {
+ this.print(node.label, node);
+ this.token(":");
+ this.space();
+ this.print(node.body, node);
+}
+
+function TryStatement(node) {
+ this.word("try");
+ this.space();
+ this.print(node.block, node);
+ this.space();
+
+ if (node.handlers) {
+ this.print(node.handlers[0], node);
+ } else {
+ this.print(node.handler, node);
+ }
+
+ if (node.finalizer) {
+ this.space();
+ this.word("finally");
+ this.space();
+ this.print(node.finalizer, node);
+ }
+}
+
+function CatchClause(node) {
+ this.word("catch");
+ this.space();
+
+ if (node.param) {
+ this.token("(");
+ this.print(node.param, node);
+ this.print(node.param.typeAnnotation, node);
+ this.token(")");
+ this.space();
+ }
+
+ this.print(node.body, node);
+}
+
+function SwitchStatement(node) {
+ this.word("switch");
+ this.space();
+ this.token("(");
+ this.print(node.discriminant, node);
+ this.token(")");
+ this.space();
+ this.token("{");
+ this.printSequence(node.cases, node, {
+ indent: true,
+
+ addNewlines(leading, cas) {
+ if (!leading && node.cases[node.cases.length - 1] === cas) return -1;
+ }
+
+ });
+ this.token("}");
+}
+
+function SwitchCase(node) {
+ if (node.test) {
+ this.word("case");
+ this.space();
+ this.print(node.test, node);
+ this.token(":");
+ } else {
+ this.word("default");
+ this.token(":");
+ }
+
+ if (node.consequent.length) {
+ this.newline();
+ this.printSequence(node.consequent, node, {
+ indent: true
+ });
+ }
+}
+
+function DebuggerStatement() {
+ this.word("debugger");
+ this.semicolon();
+}
+
+function variableDeclarationIndent() {
+ this.token(",");
+ this.newline();
+
+ if (this.endsWith(10)) {
+ for (let i = 0; i < 4; i++) this.space(true);
+ }
+}
+
+function constDeclarationIndent() {
+ this.token(",");
+ this.newline();
+
+ if (this.endsWith(10)) {
+ for (let i = 0; i < 6; i++) this.space(true);
+ }
+}
+
+function VariableDeclaration(node, parent) {
+ if (node.declare) {
+ this.word("declare");
+ this.space();
+ }
+
+ this.word(node.kind);
+ this.space();
+ let hasInits = false;
+
+ if (!isFor(parent)) {
+ for (const declar of node.declarations) {
+ if (declar.init) {
+ hasInits = true;
+ }
+ }
+ }
+
+ let separator;
+
+ if (hasInits) {
+ separator = node.kind === "const" ? constDeclarationIndent : variableDeclarationIndent;
+ }
+
+ this.printList(node.declarations, node, {
+ separator
+ });
+
+ if (isFor(parent)) {
+ if (isForStatement(parent)) {
+ if (parent.init === node) return;
+ } else {
+ if (parent.left === node) return;
+ }
+ }
+
+ this.semicolon();
+}
+
+function VariableDeclarator(node) {
+ this.print(node.id, node);
+ if (node.definite) this.token("!");
+ this.print(node.id.typeAnnotation, node);
+
+ if (node.init) {
+ this.space();
+ this.token("=");
+ this.space();
+ this.print(node.init, node);
+ }
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/generator/lib/generators/template-literals.js b/chromium/third_party/node/node_modules/@babel/generator/lib/generators/template-literals.js
new file mode 100644
index 00000000000..054330362d6
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/generator/lib/generators/template-literals.js
@@ -0,0 +1,33 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.TaggedTemplateExpression = TaggedTemplateExpression;
+exports.TemplateElement = TemplateElement;
+exports.TemplateLiteral = TemplateLiteral;
+
+function TaggedTemplateExpression(node) {
+ this.print(node.tag, node);
+ this.print(node.typeParameters, node);
+ this.print(node.quasi, node);
+}
+
+function TemplateElement(node, parent) {
+ const isFirst = parent.quasis[0] === node;
+ const isLast = parent.quasis[parent.quasis.length - 1] === node;
+ const value = (isFirst ? "`" : "}") + node.value.raw + (isLast ? "`" : "${");
+ this.token(value);
+}
+
+function TemplateLiteral(node) {
+ const quasis = node.quasis;
+
+ for (let i = 0; i < quasis.length; i++) {
+ this.print(quasis[i], node);
+
+ if (i + 1 < quasis.length) {
+ this.print(node.expressions[i], node);
+ }
+ }
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/generator/lib/generators/types.js b/chromium/third_party/node/node_modules/@babel/generator/lib/generators/types.js
new file mode 100644
index 00000000000..ce8de5f1e2b
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/generator/lib/generators/types.js
@@ -0,0 +1,279 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.Identifier = Identifier;
+exports.ArgumentPlaceholder = ArgumentPlaceholder;
+exports.SpreadElement = exports.RestElement = RestElement;
+exports.ObjectPattern = exports.ObjectExpression = ObjectExpression;
+exports.ObjectMethod = ObjectMethod;
+exports.ObjectProperty = ObjectProperty;
+exports.ArrayPattern = exports.ArrayExpression = ArrayExpression;
+exports.RecordExpression = RecordExpression;
+exports.TupleExpression = TupleExpression;
+exports.RegExpLiteral = RegExpLiteral;
+exports.BooleanLiteral = BooleanLiteral;
+exports.NullLiteral = NullLiteral;
+exports.NumericLiteral = NumericLiteral;
+exports.StringLiteral = StringLiteral;
+exports.BigIntLiteral = BigIntLiteral;
+exports.DecimalLiteral = DecimalLiteral;
+exports.TopicReference = TopicReference;
+exports.PipelineTopicExpression = PipelineTopicExpression;
+exports.PipelineBareFunction = PipelineBareFunction;
+exports.PipelinePrimaryTopicReference = PipelinePrimaryTopicReference;
+
+var _t = require("@babel/types");
+
+var _jsesc = require("jsesc");
+
+const {
+ isAssignmentPattern,
+ isIdentifier
+} = _t;
+
+function Identifier(node) {
+ this.exactSource(node.loc, () => {
+ this.word(node.name);
+ });
+}
+
+function ArgumentPlaceholder() {
+ this.token("?");
+}
+
+function RestElement(node) {
+ this.token("...");
+ this.print(node.argument, node);
+}
+
+function ObjectExpression(node) {
+ const props = node.properties;
+ this.token("{");
+ this.printInnerComments(node);
+
+ if (props.length) {
+ this.space();
+ this.printList(props, node, {
+ indent: true,
+ statement: true
+ });
+ this.space();
+ }
+
+ this.token("}");
+}
+
+function ObjectMethod(node) {
+ this.printJoin(node.decorators, node);
+
+ this._methodHead(node);
+
+ this.space();
+ this.print(node.body, node);
+}
+
+function ObjectProperty(node) {
+ this.printJoin(node.decorators, node);
+
+ if (node.computed) {
+ this.token("[");
+ this.print(node.key, node);
+ this.token("]");
+ } else {
+ if (isAssignmentPattern(node.value) && isIdentifier(node.key) && node.key.name === node.value.left.name) {
+ this.print(node.value, node);
+ return;
+ }
+
+ this.print(node.key, node);
+
+ if (node.shorthand && isIdentifier(node.key) && isIdentifier(node.value) && node.key.name === node.value.name) {
+ return;
+ }
+ }
+
+ this.token(":");
+ this.space();
+ this.print(node.value, node);
+}
+
+function ArrayExpression(node) {
+ const elems = node.elements;
+ const len = elems.length;
+ this.token("[");
+ this.printInnerComments(node);
+
+ for (let i = 0; i < elems.length; i++) {
+ const elem = elems[i];
+
+ if (elem) {
+ if (i > 0) this.space();
+ this.print(elem, node);
+ if (i < len - 1) this.token(",");
+ } else {
+ this.token(",");
+ }
+ }
+
+ this.token("]");
+}
+
+function RecordExpression(node) {
+ const props = node.properties;
+ let startToken;
+ let endToken;
+
+ if (this.format.recordAndTupleSyntaxType === "bar") {
+ startToken = "{|";
+ endToken = "|}";
+ } else if (this.format.recordAndTupleSyntaxType === "hash") {
+ startToken = "#{";
+ endToken = "}";
+ } else {
+ throw new Error(`The "recordAndTupleSyntaxType" generator option must be "bar" or "hash" (${JSON.stringify(this.format.recordAndTupleSyntaxType)} received).`);
+ }
+
+ this.token(startToken);
+ this.printInnerComments(node);
+
+ if (props.length) {
+ this.space();
+ this.printList(props, node, {
+ indent: true,
+ statement: true
+ });
+ this.space();
+ }
+
+ this.token(endToken);
+}
+
+function TupleExpression(node) {
+ const elems = node.elements;
+ const len = elems.length;
+ let startToken;
+ let endToken;
+
+ if (this.format.recordAndTupleSyntaxType === "bar") {
+ startToken = "[|";
+ endToken = "|]";
+ } else if (this.format.recordAndTupleSyntaxType === "hash") {
+ startToken = "#[";
+ endToken = "]";
+ } else {
+ throw new Error(`${this.format.recordAndTupleSyntaxType} is not a valid recordAndTuple syntax type`);
+ }
+
+ this.token(startToken);
+ this.printInnerComments(node);
+
+ for (let i = 0; i < elems.length; i++) {
+ const elem = elems[i];
+
+ if (elem) {
+ if (i > 0) this.space();
+ this.print(elem, node);
+ if (i < len - 1) this.token(",");
+ }
+ }
+
+ this.token(endToken);
+}
+
+function RegExpLiteral(node) {
+ this.word(`/${node.pattern}/${node.flags}`);
+}
+
+function BooleanLiteral(node) {
+ this.word(node.value ? "true" : "false");
+}
+
+function NullLiteral() {
+ this.word("null");
+}
+
+function NumericLiteral(node) {
+ const raw = this.getPossibleRaw(node);
+ const opts = this.format.jsescOption;
+ const value = node.value + "";
+
+ if (opts.numbers) {
+ this.number(_jsesc(node.value, opts));
+ } else if (raw == null) {
+ this.number(value);
+ } else if (this.format.minified) {
+ this.number(raw.length < value.length ? raw : value);
+ } else {
+ this.number(raw);
+ }
+}
+
+function StringLiteral(node) {
+ const raw = this.getPossibleRaw(node);
+
+ if (!this.format.minified && raw != null) {
+ this.token(raw);
+ return;
+ }
+
+ const val = _jsesc(node.value, Object.assign(this.format.jsescOption, this.format.jsonCompatibleStrings && {
+ json: true
+ }));
+
+ return this.token(val);
+}
+
+function BigIntLiteral(node) {
+ const raw = this.getPossibleRaw(node);
+
+ if (!this.format.minified && raw != null) {
+ this.word(raw);
+ return;
+ }
+
+ this.word(node.value + "n");
+}
+
+function DecimalLiteral(node) {
+ const raw = this.getPossibleRaw(node);
+
+ if (!this.format.minified && raw != null) {
+ this.word(raw);
+ return;
+ }
+
+ this.word(node.value + "m");
+}
+
+function TopicReference() {
+ const {
+ topicToken
+ } = this.format;
+
+ switch (topicToken) {
+ case "#":
+ this.token("#");
+ break;
+
+ default:
+ {
+ const givenTopicTokenJSON = JSON.stringify(topicToken);
+ const message = `The "topicToken" generator option must be "#" (${givenTopicTokenJSON} received instead).`;
+ throw new Error(message);
+ }
+ }
+}
+
+function PipelineTopicExpression(node) {
+ this.print(node.expression, node);
+}
+
+function PipelineBareFunction(node) {
+ this.print(node.callee, node);
+}
+
+function PipelinePrimaryTopicReference() {
+ this.token("#");
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/generator/lib/generators/typescript.js b/chromium/third_party/node/node_modules/@babel/generator/lib/generators/typescript.js
new file mode 100644
index 00000000000..380e40b57e3
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/generator/lib/generators/typescript.js
@@ -0,0 +1,806 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.TSTypeAnnotation = TSTypeAnnotation;
+exports.TSTypeParameterDeclaration = exports.TSTypeParameterInstantiation = TSTypeParameterInstantiation;
+exports.TSTypeParameter = TSTypeParameter;
+exports.TSParameterProperty = TSParameterProperty;
+exports.TSDeclareFunction = TSDeclareFunction;
+exports.TSDeclareMethod = TSDeclareMethod;
+exports.TSQualifiedName = TSQualifiedName;
+exports.TSCallSignatureDeclaration = TSCallSignatureDeclaration;
+exports.TSConstructSignatureDeclaration = TSConstructSignatureDeclaration;
+exports.TSPropertySignature = TSPropertySignature;
+exports.tsPrintPropertyOrMethodName = tsPrintPropertyOrMethodName;
+exports.TSMethodSignature = TSMethodSignature;
+exports.TSIndexSignature = TSIndexSignature;
+exports.TSAnyKeyword = TSAnyKeyword;
+exports.TSBigIntKeyword = TSBigIntKeyword;
+exports.TSUnknownKeyword = TSUnknownKeyword;
+exports.TSNumberKeyword = TSNumberKeyword;
+exports.TSObjectKeyword = TSObjectKeyword;
+exports.TSBooleanKeyword = TSBooleanKeyword;
+exports.TSStringKeyword = TSStringKeyword;
+exports.TSSymbolKeyword = TSSymbolKeyword;
+exports.TSVoidKeyword = TSVoidKeyword;
+exports.TSUndefinedKeyword = TSUndefinedKeyword;
+exports.TSNullKeyword = TSNullKeyword;
+exports.TSNeverKeyword = TSNeverKeyword;
+exports.TSIntrinsicKeyword = TSIntrinsicKeyword;
+exports.TSThisType = TSThisType;
+exports.TSFunctionType = TSFunctionType;
+exports.TSConstructorType = TSConstructorType;
+exports.tsPrintFunctionOrConstructorType = tsPrintFunctionOrConstructorType;
+exports.TSTypeReference = TSTypeReference;
+exports.TSTypePredicate = TSTypePredicate;
+exports.TSTypeQuery = TSTypeQuery;
+exports.TSTypeLiteral = TSTypeLiteral;
+exports.tsPrintTypeLiteralOrInterfaceBody = tsPrintTypeLiteralOrInterfaceBody;
+exports.tsPrintBraced = tsPrintBraced;
+exports.TSArrayType = TSArrayType;
+exports.TSTupleType = TSTupleType;
+exports.TSOptionalType = TSOptionalType;
+exports.TSRestType = TSRestType;
+exports.TSNamedTupleMember = TSNamedTupleMember;
+exports.TSUnionType = TSUnionType;
+exports.TSIntersectionType = TSIntersectionType;
+exports.tsPrintUnionOrIntersectionType = tsPrintUnionOrIntersectionType;
+exports.TSConditionalType = TSConditionalType;
+exports.TSInferType = TSInferType;
+exports.TSParenthesizedType = TSParenthesizedType;
+exports.TSTypeOperator = TSTypeOperator;
+exports.TSIndexedAccessType = TSIndexedAccessType;
+exports.TSMappedType = TSMappedType;
+exports.TSLiteralType = TSLiteralType;
+exports.TSExpressionWithTypeArguments = TSExpressionWithTypeArguments;
+exports.TSInterfaceDeclaration = TSInterfaceDeclaration;
+exports.TSInterfaceBody = TSInterfaceBody;
+exports.TSTypeAliasDeclaration = TSTypeAliasDeclaration;
+exports.TSAsExpression = TSAsExpression;
+exports.TSTypeAssertion = TSTypeAssertion;
+exports.TSEnumDeclaration = TSEnumDeclaration;
+exports.TSEnumMember = TSEnumMember;
+exports.TSModuleDeclaration = TSModuleDeclaration;
+exports.TSModuleBlock = TSModuleBlock;
+exports.TSImportType = TSImportType;
+exports.TSImportEqualsDeclaration = TSImportEqualsDeclaration;
+exports.TSExternalModuleReference = TSExternalModuleReference;
+exports.TSNonNullExpression = TSNonNullExpression;
+exports.TSExportAssignment = TSExportAssignment;
+exports.TSNamespaceExportDeclaration = TSNamespaceExportDeclaration;
+exports.tsPrintSignatureDeclarationBase = tsPrintSignatureDeclarationBase;
+exports.tsPrintClassMemberModifiers = tsPrintClassMemberModifiers;
+
+function TSTypeAnnotation(node) {
+ this.token(":");
+ this.space();
+ if (node.optional) this.token("?");
+ this.print(node.typeAnnotation, node);
+}
+
+function TSTypeParameterInstantiation(node) {
+ this.token("<");
+ this.printList(node.params, node, {});
+ this.token(">");
+}
+
+function TSTypeParameter(node) {
+ this.word(node.name);
+
+ if (node.constraint) {
+ this.space();
+ this.word("extends");
+ this.space();
+ this.print(node.constraint, node);
+ }
+
+ if (node.default) {
+ this.space();
+ this.token("=");
+ this.space();
+ this.print(node.default, node);
+ }
+}
+
+function TSParameterProperty(node) {
+ if (node.accessibility) {
+ this.word(node.accessibility);
+ this.space();
+ }
+
+ if (node.readonly) {
+ this.word("readonly");
+ this.space();
+ }
+
+ this._param(node.parameter);
+}
+
+function TSDeclareFunction(node) {
+ if (node.declare) {
+ this.word("declare");
+ this.space();
+ }
+
+ this._functionHead(node);
+
+ this.token(";");
+}
+
+function TSDeclareMethod(node) {
+ this._classMethodHead(node);
+
+ this.token(";");
+}
+
+function TSQualifiedName(node) {
+ this.print(node.left, node);
+ this.token(".");
+ this.print(node.right, node);
+}
+
+function TSCallSignatureDeclaration(node) {
+ this.tsPrintSignatureDeclarationBase(node);
+ this.token(";");
+}
+
+function TSConstructSignatureDeclaration(node) {
+ this.word("new");
+ this.space();
+ this.tsPrintSignatureDeclarationBase(node);
+ this.token(";");
+}
+
+function TSPropertySignature(node) {
+ const {
+ readonly,
+ initializer
+ } = node;
+
+ if (readonly) {
+ this.word("readonly");
+ this.space();
+ }
+
+ this.tsPrintPropertyOrMethodName(node);
+ this.print(node.typeAnnotation, node);
+
+ if (initializer) {
+ this.space();
+ this.token("=");
+ this.space();
+ this.print(initializer, node);
+ }
+
+ this.token(";");
+}
+
+function tsPrintPropertyOrMethodName(node) {
+ if (node.computed) {
+ this.token("[");
+ }
+
+ this.print(node.key, node);
+
+ if (node.computed) {
+ this.token("]");
+ }
+
+ if (node.optional) {
+ this.token("?");
+ }
+}
+
+function TSMethodSignature(node) {
+ const {
+ kind
+ } = node;
+
+ if (kind === "set" || kind === "get") {
+ this.word(kind);
+ this.space();
+ }
+
+ this.tsPrintPropertyOrMethodName(node);
+ this.tsPrintSignatureDeclarationBase(node);
+ this.token(";");
+}
+
+function TSIndexSignature(node) {
+ const {
+ readonly,
+ static: isStatic
+ } = node;
+
+ if (isStatic) {
+ this.word("static");
+ this.space();
+ }
+
+ if (readonly) {
+ this.word("readonly");
+ this.space();
+ }
+
+ this.token("[");
+
+ this._parameters(node.parameters, node);
+
+ this.token("]");
+ this.print(node.typeAnnotation, node);
+ this.token(";");
+}
+
+function TSAnyKeyword() {
+ this.word("any");
+}
+
+function TSBigIntKeyword() {
+ this.word("bigint");
+}
+
+function TSUnknownKeyword() {
+ this.word("unknown");
+}
+
+function TSNumberKeyword() {
+ this.word("number");
+}
+
+function TSObjectKeyword() {
+ this.word("object");
+}
+
+function TSBooleanKeyword() {
+ this.word("boolean");
+}
+
+function TSStringKeyword() {
+ this.word("string");
+}
+
+function TSSymbolKeyword() {
+ this.word("symbol");
+}
+
+function TSVoidKeyword() {
+ this.word("void");
+}
+
+function TSUndefinedKeyword() {
+ this.word("undefined");
+}
+
+function TSNullKeyword() {
+ this.word("null");
+}
+
+function TSNeverKeyword() {
+ this.word("never");
+}
+
+function TSIntrinsicKeyword() {
+ this.word("intrinsic");
+}
+
+function TSThisType() {
+ this.word("this");
+}
+
+function TSFunctionType(node) {
+ this.tsPrintFunctionOrConstructorType(node);
+}
+
+function TSConstructorType(node) {
+ if (node.abstract) {
+ this.word("abstract");
+ this.space();
+ }
+
+ this.word("new");
+ this.space();
+ this.tsPrintFunctionOrConstructorType(node);
+}
+
+function tsPrintFunctionOrConstructorType(node) {
+ const {
+ typeParameters,
+ parameters
+ } = node;
+ this.print(typeParameters, node);
+ this.token("(");
+
+ this._parameters(parameters, node);
+
+ this.token(")");
+ this.space();
+ this.token("=>");
+ this.space();
+ this.print(node.typeAnnotation.typeAnnotation, node);
+}
+
+function TSTypeReference(node) {
+ this.print(node.typeName, node);
+ this.print(node.typeParameters, node);
+}
+
+function TSTypePredicate(node) {
+ if (node.asserts) {
+ this.word("asserts");
+ this.space();
+ }
+
+ this.print(node.parameterName);
+
+ if (node.typeAnnotation) {
+ this.space();
+ this.word("is");
+ this.space();
+ this.print(node.typeAnnotation.typeAnnotation);
+ }
+}
+
+function TSTypeQuery(node) {
+ this.word("typeof");
+ this.space();
+ this.print(node.exprName);
+}
+
+function TSTypeLiteral(node) {
+ this.tsPrintTypeLiteralOrInterfaceBody(node.members, node);
+}
+
+function tsPrintTypeLiteralOrInterfaceBody(members, node) {
+ this.tsPrintBraced(members, node);
+}
+
+function tsPrintBraced(members, node) {
+ this.token("{");
+
+ if (members.length) {
+ this.indent();
+ this.newline();
+
+ for (const member of members) {
+ this.print(member, node);
+ this.newline();
+ }
+
+ this.dedent();
+ this.rightBrace();
+ } else {
+ this.token("}");
+ }
+}
+
+function TSArrayType(node) {
+ this.print(node.elementType, node);
+ this.token("[]");
+}
+
+function TSTupleType(node) {
+ this.token("[");
+ this.printList(node.elementTypes, node);
+ this.token("]");
+}
+
+function TSOptionalType(node) {
+ this.print(node.typeAnnotation, node);
+ this.token("?");
+}
+
+function TSRestType(node) {
+ this.token("...");
+ this.print(node.typeAnnotation, node);
+}
+
+function TSNamedTupleMember(node) {
+ this.print(node.label, node);
+ if (node.optional) this.token("?");
+ this.token(":");
+ this.space();
+ this.print(node.elementType, node);
+}
+
+function TSUnionType(node) {
+ this.tsPrintUnionOrIntersectionType(node, "|");
+}
+
+function TSIntersectionType(node) {
+ this.tsPrintUnionOrIntersectionType(node, "&");
+}
+
+function tsPrintUnionOrIntersectionType(node, sep) {
+ this.printJoin(node.types, node, {
+ separator() {
+ this.space();
+ this.token(sep);
+ this.space();
+ }
+
+ });
+}
+
+function TSConditionalType(node) {
+ this.print(node.checkType);
+ this.space();
+ this.word("extends");
+ this.space();
+ this.print(node.extendsType);
+ this.space();
+ this.token("?");
+ this.space();
+ this.print(node.trueType);
+ this.space();
+ this.token(":");
+ this.space();
+ this.print(node.falseType);
+}
+
+function TSInferType(node) {
+ this.token("infer");
+ this.space();
+ this.print(node.typeParameter);
+}
+
+function TSParenthesizedType(node) {
+ this.token("(");
+ this.print(node.typeAnnotation, node);
+ this.token(")");
+}
+
+function TSTypeOperator(node) {
+ this.word(node.operator);
+ this.space();
+ this.print(node.typeAnnotation, node);
+}
+
+function TSIndexedAccessType(node) {
+ this.print(node.objectType, node);
+ this.token("[");
+ this.print(node.indexType, node);
+ this.token("]");
+}
+
+function TSMappedType(node) {
+ const {
+ nameType,
+ optional,
+ readonly,
+ typeParameter
+ } = node;
+ this.token("{");
+ this.space();
+
+ if (readonly) {
+ tokenIfPlusMinus(this, readonly);
+ this.word("readonly");
+ this.space();
+ }
+
+ this.token("[");
+ this.word(typeParameter.name);
+ this.space();
+ this.word("in");
+ this.space();
+ this.print(typeParameter.constraint, typeParameter);
+
+ if (nameType) {
+ this.space();
+ this.word("as");
+ this.space();
+ this.print(nameType, node);
+ }
+
+ this.token("]");
+
+ if (optional) {
+ tokenIfPlusMinus(this, optional);
+ this.token("?");
+ }
+
+ this.token(":");
+ this.space();
+ this.print(node.typeAnnotation, node);
+ this.space();
+ this.token("}");
+}
+
+function tokenIfPlusMinus(self, tok) {
+ if (tok !== true) {
+ self.token(tok);
+ }
+}
+
+function TSLiteralType(node) {
+ this.print(node.literal, node);
+}
+
+function TSExpressionWithTypeArguments(node) {
+ this.print(node.expression, node);
+ this.print(node.typeParameters, node);
+}
+
+function TSInterfaceDeclaration(node) {
+ const {
+ declare,
+ id,
+ typeParameters,
+ extends: extendz,
+ body
+ } = node;
+
+ if (declare) {
+ this.word("declare");
+ this.space();
+ }
+
+ this.word("interface");
+ this.space();
+ this.print(id, node);
+ this.print(typeParameters, node);
+
+ if (extendz != null && extendz.length) {
+ this.space();
+ this.word("extends");
+ this.space();
+ this.printList(extendz, node);
+ }
+
+ this.space();
+ this.print(body, node);
+}
+
+function TSInterfaceBody(node) {
+ this.tsPrintTypeLiteralOrInterfaceBody(node.body, node);
+}
+
+function TSTypeAliasDeclaration(node) {
+ const {
+ declare,
+ id,
+ typeParameters,
+ typeAnnotation
+ } = node;
+
+ if (declare) {
+ this.word("declare");
+ this.space();
+ }
+
+ this.word("type");
+ this.space();
+ this.print(id, node);
+ this.print(typeParameters, node);
+ this.space();
+ this.token("=");
+ this.space();
+ this.print(typeAnnotation, node);
+ this.token(";");
+}
+
+function TSAsExpression(node) {
+ const {
+ expression,
+ typeAnnotation
+ } = node;
+ this.print(expression, node);
+ this.space();
+ this.word("as");
+ this.space();
+ this.print(typeAnnotation, node);
+}
+
+function TSTypeAssertion(node) {
+ const {
+ typeAnnotation,
+ expression
+ } = node;
+ this.token("<");
+ this.print(typeAnnotation, node);
+ this.token(">");
+ this.space();
+ this.print(expression, node);
+}
+
+function TSEnumDeclaration(node) {
+ const {
+ declare,
+ const: isConst,
+ id,
+ members
+ } = node;
+
+ if (declare) {
+ this.word("declare");
+ this.space();
+ }
+
+ if (isConst) {
+ this.word("const");
+ this.space();
+ }
+
+ this.word("enum");
+ this.space();
+ this.print(id, node);
+ this.space();
+ this.tsPrintBraced(members, node);
+}
+
+function TSEnumMember(node) {
+ const {
+ id,
+ initializer
+ } = node;
+ this.print(id, node);
+
+ if (initializer) {
+ this.space();
+ this.token("=");
+ this.space();
+ this.print(initializer, node);
+ }
+
+ this.token(",");
+}
+
+function TSModuleDeclaration(node) {
+ const {
+ declare,
+ id
+ } = node;
+
+ if (declare) {
+ this.word("declare");
+ this.space();
+ }
+
+ if (!node.global) {
+ this.word(id.type === "Identifier" ? "namespace" : "module");
+ this.space();
+ }
+
+ this.print(id, node);
+
+ if (!node.body) {
+ this.token(";");
+ return;
+ }
+
+ let body = node.body;
+
+ while (body.type === "TSModuleDeclaration") {
+ this.token(".");
+ this.print(body.id, body);
+ body = body.body;
+ }
+
+ this.space();
+ this.print(body, node);
+}
+
+function TSModuleBlock(node) {
+ this.tsPrintBraced(node.body, node);
+}
+
+function TSImportType(node) {
+ const {
+ argument,
+ qualifier,
+ typeParameters
+ } = node;
+ this.word("import");
+ this.token("(");
+ this.print(argument, node);
+ this.token(")");
+
+ if (qualifier) {
+ this.token(".");
+ this.print(qualifier, node);
+ }
+
+ if (typeParameters) {
+ this.print(typeParameters, node);
+ }
+}
+
+function TSImportEqualsDeclaration(node) {
+ const {
+ isExport,
+ id,
+ moduleReference
+ } = node;
+
+ if (isExport) {
+ this.word("export");
+ this.space();
+ }
+
+ this.word("import");
+ this.space();
+ this.print(id, node);
+ this.space();
+ this.token("=");
+ this.space();
+ this.print(moduleReference, node);
+ this.token(";");
+}
+
+function TSExternalModuleReference(node) {
+ this.token("require(");
+ this.print(node.expression, node);
+ this.token(")");
+}
+
+function TSNonNullExpression(node) {
+ this.print(node.expression, node);
+ this.token("!");
+}
+
+function TSExportAssignment(node) {
+ this.word("export");
+ this.space();
+ this.token("=");
+ this.space();
+ this.print(node.expression, node);
+ this.token(";");
+}
+
+function TSNamespaceExportDeclaration(node) {
+ this.word("export");
+ this.space();
+ this.word("as");
+ this.space();
+ this.word("namespace");
+ this.space();
+ this.print(node.id, node);
+}
+
+function tsPrintSignatureDeclarationBase(node) {
+ const {
+ typeParameters,
+ parameters
+ } = node;
+ this.print(typeParameters, node);
+ this.token("(");
+
+ this._parameters(parameters, node);
+
+ this.token(")");
+ this.print(node.typeAnnotation, node);
+}
+
+function tsPrintClassMemberModifiers(node, isField) {
+ if (isField && node.declare) {
+ this.word("declare");
+ this.space();
+ }
+
+ if (node.accessibility) {
+ this.word(node.accessibility);
+ this.space();
+ }
+
+ if (node.static) {
+ this.word("static");
+ this.space();
+ }
+
+ if (node.override) {
+ this.word("override");
+ this.space();
+ }
+
+ if (node.abstract) {
+ this.word("abstract");
+ this.space();
+ }
+
+ if (isField && node.readonly) {
+ this.word("readonly");
+ this.space();
+ }
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/generator/lib/index.js b/chromium/third_party/node/node_modules/@babel/generator/lib/index.js
new file mode 100644
index 00000000000..0f4d1363d1c
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/generator/lib/index.js
@@ -0,0 +1,97 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = generate;
+exports.CodeGenerator = void 0;
+
+var _sourceMap = require("./source-map");
+
+var _printer = require("./printer");
+
+class Generator extends _printer.default {
+ constructor(ast, opts = {}, code) {
+ const format = normalizeOptions(code, opts);
+ const map = opts.sourceMaps ? new _sourceMap.default(opts, code) : null;
+ super(format, map);
+ this.ast = void 0;
+ this.ast = ast;
+ }
+
+ generate() {
+ return super.generate(this.ast);
+ }
+
+}
+
+function normalizeOptions(code, opts) {
+ const format = {
+ auxiliaryCommentBefore: opts.auxiliaryCommentBefore,
+ auxiliaryCommentAfter: opts.auxiliaryCommentAfter,
+ shouldPrintComment: opts.shouldPrintComment,
+ retainLines: opts.retainLines,
+ retainFunctionParens: opts.retainFunctionParens,
+ comments: opts.comments == null || opts.comments,
+ compact: opts.compact,
+ minified: opts.minified,
+ concise: opts.concise,
+ indent: {
+ adjustMultilineComment: true,
+ style: " ",
+ base: 0
+ },
+ decoratorsBeforeExport: !!opts.decoratorsBeforeExport,
+ jsescOption: Object.assign({
+ quotes: "double",
+ wrap: true,
+ minimal: false
+ }, opts.jsescOption),
+ recordAndTupleSyntaxType: opts.recordAndTupleSyntaxType,
+ topicToken: opts.topicToken
+ };
+ {
+ format.jsonCompatibleStrings = opts.jsonCompatibleStrings;
+ }
+
+ if (format.minified) {
+ format.compact = true;
+
+ format.shouldPrintComment = format.shouldPrintComment || (() => format.comments);
+ } else {
+ format.shouldPrintComment = format.shouldPrintComment || (value => format.comments || value.indexOf("@license") >= 0 || value.indexOf("@preserve") >= 0);
+ }
+
+ if (format.compact === "auto") {
+ format.compact = code.length > 500000;
+
+ if (format.compact) {
+ console.error("[BABEL] Note: The code generator has deoptimised the styling of " + `${opts.filename} as it exceeds the max of ${"500KB"}.`);
+ }
+ }
+
+ if (format.compact) {
+ format.indent.adjustMultilineComment = false;
+ }
+
+ return format;
+}
+
+class CodeGenerator {
+ constructor(ast, opts, code) {
+ this._generator = void 0;
+ this._generator = new Generator(ast, opts, code);
+ }
+
+ generate() {
+ return this._generator.generate();
+ }
+
+}
+
+exports.CodeGenerator = CodeGenerator;
+
+function generate(ast, opts, code) {
+ const gen = new Generator(ast, opts, code);
+ return gen.generate();
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/generator/lib/node/index.js b/chromium/third_party/node/node_modules/@babel/generator/lib/node/index.js
new file mode 100644
index 00000000000..892498e8662
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/generator/lib/node/index.js
@@ -0,0 +1,111 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.needsWhitespace = needsWhitespace;
+exports.needsWhitespaceBefore = needsWhitespaceBefore;
+exports.needsWhitespaceAfter = needsWhitespaceAfter;
+exports.needsParens = needsParens;
+
+var whitespace = require("./whitespace");
+
+var parens = require("./parentheses");
+
+var _t = require("@babel/types");
+
+const {
+ FLIPPED_ALIAS_KEYS,
+ isCallExpression,
+ isExpressionStatement,
+ isMemberExpression,
+ isNewExpression
+} = _t;
+
+function expandAliases(obj) {
+ const newObj = {};
+
+ function add(type, func) {
+ const fn = newObj[type];
+ newObj[type] = fn ? function (node, parent, stack) {
+ const result = fn(node, parent, stack);
+ return result == null ? func(node, parent, stack) : result;
+ } : func;
+ }
+
+ for (const type of Object.keys(obj)) {
+ const aliases = FLIPPED_ALIAS_KEYS[type];
+
+ if (aliases) {
+ for (const alias of aliases) {
+ add(alias, obj[type]);
+ }
+ } else {
+ add(type, obj[type]);
+ }
+ }
+
+ return newObj;
+}
+
+const expandedParens = expandAliases(parens);
+const expandedWhitespaceNodes = expandAliases(whitespace.nodes);
+const expandedWhitespaceList = expandAliases(whitespace.list);
+
+function find(obj, node, parent, printStack) {
+ const fn = obj[node.type];
+ return fn ? fn(node, parent, printStack) : null;
+}
+
+function isOrHasCallExpression(node) {
+ if (isCallExpression(node)) {
+ return true;
+ }
+
+ return isMemberExpression(node) && isOrHasCallExpression(node.object);
+}
+
+function needsWhitespace(node, parent, type) {
+ if (!node) return 0;
+
+ if (isExpressionStatement(node)) {
+ node = node.expression;
+ }
+
+ let linesInfo = find(expandedWhitespaceNodes, node, parent);
+
+ if (!linesInfo) {
+ const items = find(expandedWhitespaceList, node, parent);
+
+ if (items) {
+ for (let i = 0; i < items.length; i++) {
+ linesInfo = needsWhitespace(items[i], node, type);
+ if (linesInfo) break;
+ }
+ }
+ }
+
+ if (typeof linesInfo === "object" && linesInfo !== null) {
+ return linesInfo[type] || 0;
+ }
+
+ return 0;
+}
+
+function needsWhitespaceBefore(node, parent) {
+ return needsWhitespace(node, parent, "before");
+}
+
+function needsWhitespaceAfter(node, parent) {
+ return needsWhitespace(node, parent, "after");
+}
+
+function needsParens(node, parent, printStack) {
+ if (!parent) return false;
+
+ if (isNewExpression(parent) && parent.callee === node) {
+ if (isOrHasCallExpression(node)) return true;
+ }
+
+ return find(expandedParens, node, parent, printStack);
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/generator/lib/node/parentheses.js b/chromium/third_party/node/node_modules/@babel/generator/lib/node/parentheses.js
new file mode 100644
index 00000000000..9a17130208d
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/generator/lib/node/parentheses.js
@@ -0,0 +1,342 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.NullableTypeAnnotation = NullableTypeAnnotation;
+exports.FunctionTypeAnnotation = FunctionTypeAnnotation;
+exports.UpdateExpression = UpdateExpression;
+exports.ObjectExpression = ObjectExpression;
+exports.DoExpression = DoExpression;
+exports.Binary = Binary;
+exports.IntersectionTypeAnnotation = exports.UnionTypeAnnotation = UnionTypeAnnotation;
+exports.OptionalIndexedAccessType = OptionalIndexedAccessType;
+exports.TSAsExpression = TSAsExpression;
+exports.TSTypeAssertion = TSTypeAssertion;
+exports.TSIntersectionType = exports.TSUnionType = TSUnionType;
+exports.TSInferType = TSInferType;
+exports.BinaryExpression = BinaryExpression;
+exports.SequenceExpression = SequenceExpression;
+exports.AwaitExpression = exports.YieldExpression = YieldExpression;
+exports.ClassExpression = ClassExpression;
+exports.UnaryLike = UnaryLike;
+exports.FunctionExpression = FunctionExpression;
+exports.ArrowFunctionExpression = ArrowFunctionExpression;
+exports.ConditionalExpression = ConditionalExpression;
+exports.OptionalCallExpression = exports.OptionalMemberExpression = OptionalMemberExpression;
+exports.AssignmentExpression = AssignmentExpression;
+exports.LogicalExpression = LogicalExpression;
+exports.Identifier = Identifier;
+
+var _t = require("@babel/types");
+
+const {
+ isArrayTypeAnnotation,
+ isArrowFunctionExpression,
+ isAssignmentExpression,
+ isAwaitExpression,
+ isBinary,
+ isBinaryExpression,
+ isCallExpression,
+ isClassDeclaration,
+ isClassExpression,
+ isConditional,
+ isConditionalExpression,
+ isExportDeclaration,
+ isExportDefaultDeclaration,
+ isExpressionStatement,
+ isFor,
+ isForInStatement,
+ isForOfStatement,
+ isForStatement,
+ isIfStatement,
+ isIndexedAccessType,
+ isIntersectionTypeAnnotation,
+ isLogicalExpression,
+ isMemberExpression,
+ isNewExpression,
+ isNullableTypeAnnotation,
+ isObjectPattern,
+ isOptionalCallExpression,
+ isOptionalMemberExpression,
+ isReturnStatement,
+ isSequenceExpression,
+ isSwitchStatement,
+ isTSArrayType,
+ isTSAsExpression,
+ isTSIntersectionType,
+ isTSNonNullExpression,
+ isTSOptionalType,
+ isTSRestType,
+ isTSTypeAssertion,
+ isTSUnionType,
+ isTaggedTemplateExpression,
+ isThrowStatement,
+ isTypeAnnotation,
+ isUnaryLike,
+ isUnionTypeAnnotation,
+ isVariableDeclarator,
+ isWhileStatement,
+ isYieldExpression
+} = _t;
+const PRECEDENCE = {
+ "||": 0,
+ "??": 0,
+ "&&": 1,
+ "|": 2,
+ "^": 3,
+ "&": 4,
+ "==": 5,
+ "===": 5,
+ "!=": 5,
+ "!==": 5,
+ "<": 6,
+ ">": 6,
+ "<=": 6,
+ ">=": 6,
+ in: 6,
+ instanceof: 6,
+ ">>": 7,
+ "<<": 7,
+ ">>>": 7,
+ "+": 8,
+ "-": 8,
+ "*": 9,
+ "/": 9,
+ "%": 9,
+ "**": 10
+};
+
+const isClassExtendsClause = (node, parent) => (isClassDeclaration(parent) || isClassExpression(parent)) && parent.superClass === node;
+
+const hasPostfixPart = (node, parent) => (isMemberExpression(parent) || isOptionalMemberExpression(parent)) && parent.object === node || (isCallExpression(parent) || isOptionalCallExpression(parent) || isNewExpression(parent)) && parent.callee === node || isTaggedTemplateExpression(parent) && parent.tag === node || isTSNonNullExpression(parent);
+
+function NullableTypeAnnotation(node, parent) {
+ return isArrayTypeAnnotation(parent);
+}
+
+function FunctionTypeAnnotation(node, parent, printStack) {
+ return isUnionTypeAnnotation(parent) || isIntersectionTypeAnnotation(parent) || isArrayTypeAnnotation(parent) || isTypeAnnotation(parent) && isArrowFunctionExpression(printStack[printStack.length - 3]);
+}
+
+function UpdateExpression(node, parent) {
+ return hasPostfixPart(node, parent) || isClassExtendsClause(node, parent);
+}
+
+function ObjectExpression(node, parent, printStack) {
+ return isFirstInContext(printStack, {
+ expressionStatement: true,
+ arrowBody: true
+ });
+}
+
+function DoExpression(node, parent, printStack) {
+ return !node.async && isFirstInContext(printStack, {
+ expressionStatement: true
+ });
+}
+
+function Binary(node, parent) {
+ if (node.operator === "**" && isBinaryExpression(parent, {
+ operator: "**"
+ })) {
+ return parent.left === node;
+ }
+
+ if (isClassExtendsClause(node, parent)) {
+ return true;
+ }
+
+ if (hasPostfixPart(node, parent) || isUnaryLike(parent) || isAwaitExpression(parent)) {
+ return true;
+ }
+
+ if (isBinary(parent)) {
+ const parentOp = parent.operator;
+ const parentPos = PRECEDENCE[parentOp];
+ const nodeOp = node.operator;
+ const nodePos = PRECEDENCE[nodeOp];
+
+ if (parentPos === nodePos && parent.right === node && !isLogicalExpression(parent) || parentPos > nodePos) {
+ return true;
+ }
+ }
+}
+
+function UnionTypeAnnotation(node, parent) {
+ return isArrayTypeAnnotation(parent) || isNullableTypeAnnotation(parent) || isIntersectionTypeAnnotation(parent) || isUnionTypeAnnotation(parent);
+}
+
+function OptionalIndexedAccessType(node, parent) {
+ return isIndexedAccessType(parent, {
+ objectType: node
+ });
+}
+
+function TSAsExpression() {
+ return true;
+}
+
+function TSTypeAssertion() {
+ return true;
+}
+
+function TSUnionType(node, parent) {
+ return isTSArrayType(parent) || isTSOptionalType(parent) || isTSIntersectionType(parent) || isTSUnionType(parent) || isTSRestType(parent);
+}
+
+function TSInferType(node, parent) {
+ return isTSArrayType(parent) || isTSOptionalType(parent);
+}
+
+function BinaryExpression(node, parent) {
+ return node.operator === "in" && (isVariableDeclarator(parent) || isFor(parent));
+}
+
+function SequenceExpression(node, parent) {
+ if (isForStatement(parent) || isThrowStatement(parent) || isReturnStatement(parent) || isIfStatement(parent) && parent.test === node || isWhileStatement(parent) && parent.test === node || isForInStatement(parent) && parent.right === node || isSwitchStatement(parent) && parent.discriminant === node || isExpressionStatement(parent) && parent.expression === node) {
+ return false;
+ }
+
+ return true;
+}
+
+function YieldExpression(node, parent) {
+ return isBinary(parent) || isUnaryLike(parent) || hasPostfixPart(node, parent) || isAwaitExpression(parent) && isYieldExpression(node) || isConditionalExpression(parent) && node === parent.test || isClassExtendsClause(node, parent);
+}
+
+function ClassExpression(node, parent, printStack) {
+ return isFirstInContext(printStack, {
+ expressionStatement: true,
+ exportDefault: true
+ });
+}
+
+function UnaryLike(node, parent) {
+ return hasPostfixPart(node, parent) || isBinaryExpression(parent, {
+ operator: "**",
+ left: node
+ }) || isClassExtendsClause(node, parent);
+}
+
+function FunctionExpression(node, parent, printStack) {
+ return isFirstInContext(printStack, {
+ expressionStatement: true,
+ exportDefault: true
+ });
+}
+
+function ArrowFunctionExpression(node, parent) {
+ return isExportDeclaration(parent) || ConditionalExpression(node, parent);
+}
+
+function ConditionalExpression(node, parent) {
+ if (isUnaryLike(parent) || isBinary(parent) || isConditionalExpression(parent, {
+ test: node
+ }) || isAwaitExpression(parent) || isTSTypeAssertion(parent) || isTSAsExpression(parent)) {
+ return true;
+ }
+
+ return UnaryLike(node, parent);
+}
+
+function OptionalMemberExpression(node, parent) {
+ return isCallExpression(parent, {
+ callee: node
+ }) || isMemberExpression(parent, {
+ object: node
+ });
+}
+
+function AssignmentExpression(node, parent) {
+ if (isObjectPattern(node.left)) {
+ return true;
+ } else {
+ return ConditionalExpression(node, parent);
+ }
+}
+
+function LogicalExpression(node, parent) {
+ switch (node.operator) {
+ case "||":
+ if (!isLogicalExpression(parent)) return false;
+ return parent.operator === "??" || parent.operator === "&&";
+
+ case "&&":
+ return isLogicalExpression(parent, {
+ operator: "??"
+ });
+
+ case "??":
+ return isLogicalExpression(parent) && parent.operator !== "??";
+ }
+}
+
+function Identifier(node, parent, printStack) {
+ if (node.name === "let") {
+ const isFollowedByBracket = isMemberExpression(parent, {
+ object: node,
+ computed: true
+ }) || isOptionalMemberExpression(parent, {
+ object: node,
+ computed: true,
+ optional: false
+ });
+ return isFirstInContext(printStack, {
+ expressionStatement: isFollowedByBracket,
+ forHead: isFollowedByBracket,
+ forInHead: isFollowedByBracket,
+ forOfHead: true
+ });
+ }
+
+ return node.name === "async" && isForOfStatement(parent) && node === parent.left;
+}
+
+function isFirstInContext(printStack, {
+ expressionStatement = false,
+ arrowBody = false,
+ exportDefault = false,
+ forHead = false,
+ forInHead = false,
+ forOfHead = false
+}) {
+ let i = printStack.length - 1;
+ let node = printStack[i];
+ i--;
+ let parent = printStack[i];
+
+ while (i >= 0) {
+ if (expressionStatement && isExpressionStatement(parent, {
+ expression: node
+ }) || exportDefault && isExportDefaultDeclaration(parent, {
+ declaration: node
+ }) || arrowBody && isArrowFunctionExpression(parent, {
+ body: node
+ }) || forHead && isForStatement(parent, {
+ init: node
+ }) || forInHead && isForInStatement(parent, {
+ left: node
+ }) || forOfHead && isForOfStatement(parent, {
+ left: node
+ })) {
+ return true;
+ }
+
+ if (hasPostfixPart(node, parent) && !isNewExpression(parent) || isSequenceExpression(parent) && parent.expressions[0] === node || isConditional(parent, {
+ test: node
+ }) || isBinary(parent, {
+ left: node
+ }) || isAssignmentExpression(parent, {
+ left: node
+ })) {
+ node = parent;
+ i--;
+ parent = printStack[i];
+ } else {
+ return false;
+ }
+ }
+
+ return false;
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/generator/lib/node/whitespace.js b/chromium/third_party/node/node_modules/@babel/generator/lib/node/whitespace.js
new file mode 100644
index 00000000000..dd149e4ec44
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/generator/lib/node/whitespace.js
@@ -0,0 +1,214 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.list = exports.nodes = void 0;
+
+var _t = require("@babel/types");
+
+const {
+ FLIPPED_ALIAS_KEYS,
+ isArrayExpression,
+ isAssignmentExpression,
+ isBinary,
+ isBlockStatement,
+ isCallExpression,
+ isFunction,
+ isIdentifier,
+ isLiteral,
+ isMemberExpression,
+ isObjectExpression,
+ isOptionalCallExpression,
+ isOptionalMemberExpression,
+ isStringLiteral
+} = _t;
+
+function crawl(node, state = {}) {
+ if (isMemberExpression(node) || isOptionalMemberExpression(node)) {
+ crawl(node.object, state);
+ if (node.computed) crawl(node.property, state);
+ } else if (isBinary(node) || isAssignmentExpression(node)) {
+ crawl(node.left, state);
+ crawl(node.right, state);
+ } else if (isCallExpression(node) || isOptionalCallExpression(node)) {
+ state.hasCall = true;
+ crawl(node.callee, state);
+ } else if (isFunction(node)) {
+ state.hasFunction = true;
+ } else if (isIdentifier(node)) {
+ state.hasHelper = state.hasHelper || isHelper(node.callee);
+ }
+
+ return state;
+}
+
+function isHelper(node) {
+ if (isMemberExpression(node)) {
+ return isHelper(node.object) || isHelper(node.property);
+ } else if (isIdentifier(node)) {
+ return node.name === "require" || node.name[0] === "_";
+ } else if (isCallExpression(node)) {
+ return isHelper(node.callee);
+ } else if (isBinary(node) || isAssignmentExpression(node)) {
+ return isIdentifier(node.left) && isHelper(node.left) || isHelper(node.right);
+ } else {
+ return false;
+ }
+}
+
+function isType(node) {
+ return isLiteral(node) || isObjectExpression(node) || isArrayExpression(node) || isIdentifier(node) || isMemberExpression(node);
+}
+
+const nodes = {
+ AssignmentExpression(node) {
+ const state = crawl(node.right);
+
+ if (state.hasCall && state.hasHelper || state.hasFunction) {
+ return {
+ before: state.hasFunction,
+ after: true
+ };
+ }
+ },
+
+ SwitchCase(node, parent) {
+ return {
+ before: !!node.consequent.length || parent.cases[0] === node,
+ after: !node.consequent.length && parent.cases[parent.cases.length - 1] === node
+ };
+ },
+
+ LogicalExpression(node) {
+ if (isFunction(node.left) || isFunction(node.right)) {
+ return {
+ after: true
+ };
+ }
+ },
+
+ Literal(node) {
+ if (isStringLiteral(node) && node.value === "use strict") {
+ return {
+ after: true
+ };
+ }
+ },
+
+ CallExpression(node) {
+ if (isFunction(node.callee) || isHelper(node)) {
+ return {
+ before: true,
+ after: true
+ };
+ }
+ },
+
+ OptionalCallExpression(node) {
+ if (isFunction(node.callee)) {
+ return {
+ before: true,
+ after: true
+ };
+ }
+ },
+
+ VariableDeclaration(node) {
+ for (let i = 0; i < node.declarations.length; i++) {
+ const declar = node.declarations[i];
+ let enabled = isHelper(declar.id) && !isType(declar.init);
+
+ if (!enabled) {
+ const state = crawl(declar.init);
+ enabled = isHelper(declar.init) && state.hasCall || state.hasFunction;
+ }
+
+ if (enabled) {
+ return {
+ before: true,
+ after: true
+ };
+ }
+ }
+ },
+
+ IfStatement(node) {
+ if (isBlockStatement(node.consequent)) {
+ return {
+ before: true,
+ after: true
+ };
+ }
+ }
+
+};
+exports.nodes = nodes;
+
+nodes.ObjectProperty = nodes.ObjectTypeProperty = nodes.ObjectMethod = function (node, parent) {
+ if (parent.properties[0] === node) {
+ return {
+ before: true
+ };
+ }
+};
+
+nodes.ObjectTypeCallProperty = function (node, parent) {
+ var _parent$properties;
+
+ if (parent.callProperties[0] === node && !((_parent$properties = parent.properties) != null && _parent$properties.length)) {
+ return {
+ before: true
+ };
+ }
+};
+
+nodes.ObjectTypeIndexer = function (node, parent) {
+ var _parent$properties2, _parent$callPropertie;
+
+ if (parent.indexers[0] === node && !((_parent$properties2 = parent.properties) != null && _parent$properties2.length) && !((_parent$callPropertie = parent.callProperties) != null && _parent$callPropertie.length)) {
+ return {
+ before: true
+ };
+ }
+};
+
+nodes.ObjectTypeInternalSlot = function (node, parent) {
+ var _parent$properties3, _parent$callPropertie2, _parent$indexers;
+
+ if (parent.internalSlots[0] === node && !((_parent$properties3 = parent.properties) != null && _parent$properties3.length) && !((_parent$callPropertie2 = parent.callProperties) != null && _parent$callPropertie2.length) && !((_parent$indexers = parent.indexers) != null && _parent$indexers.length)) {
+ return {
+ before: true
+ };
+ }
+};
+
+const list = {
+ VariableDeclaration(node) {
+ return node.declarations.map(decl => decl.init);
+ },
+
+ ArrayExpression(node) {
+ return node.elements;
+ },
+
+ ObjectExpression(node) {
+ return node.properties;
+ }
+
+};
+exports.list = list;
+[["Function", true], ["Class", true], ["Loop", true], ["LabeledStatement", true], ["SwitchStatement", true], ["TryStatement", true]].forEach(function ([type, amounts]) {
+ if (typeof amounts === "boolean") {
+ amounts = {
+ after: amounts,
+ before: amounts
+ };
+ }
+
+ [type].concat(FLIPPED_ALIAS_KEYS[type] || []).forEach(function (type) {
+ nodes[type] = function () {
+ return amounts;
+ };
+ });
+}); \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/generator/lib/printer.js b/chromium/third_party/node/node_modules/@babel/generator/lib/printer.js
new file mode 100644
index 00000000000..0decd212cb2
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/generator/lib/printer.js
@@ -0,0 +1,540 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = void 0;
+
+var _buffer = require("./buffer");
+
+var n = require("./node");
+
+var _t = require("@babel/types");
+
+var generatorFunctions = require("./generators");
+
+const {
+ isProgram,
+ isFile,
+ isEmptyStatement
+} = _t;
+const SCIENTIFIC_NOTATION = /e/i;
+const ZERO_DECIMAL_INTEGER = /\.0+$/;
+const NON_DECIMAL_LITERAL = /^0[box]/;
+const PURE_ANNOTATION_RE = /^\s*[@#]__PURE__\s*$/;
+const {
+ needsParens,
+ needsWhitespaceAfter,
+ needsWhitespaceBefore
+} = n;
+
+class Printer {
+ constructor(format, map) {
+ this.inForStatementInitCounter = 0;
+ this._printStack = [];
+ this._indent = 0;
+ this._insideAux = false;
+ this._parenPushNewlineState = null;
+ this._noLineTerminator = false;
+ this._printAuxAfterOnNextUserNode = false;
+ this._printedComments = new WeakSet();
+ this._endsWithInteger = false;
+ this._endsWithWord = false;
+ this.format = format;
+ this._buf = new _buffer.default(map);
+ }
+
+ generate(ast) {
+ this.print(ast);
+
+ this._maybeAddAuxComment();
+
+ return this._buf.get();
+ }
+
+ indent() {
+ if (this.format.compact || this.format.concise) return;
+ this._indent++;
+ }
+
+ dedent() {
+ if (this.format.compact || this.format.concise) return;
+ this._indent--;
+ }
+
+ semicolon(force = false) {
+ this._maybeAddAuxComment();
+
+ this._append(";", !force);
+ }
+
+ rightBrace() {
+ if (this.format.minified) {
+ this._buf.removeLastSemicolon();
+ }
+
+ this.token("}");
+ }
+
+ space(force = false) {
+ if (this.format.compact) return;
+
+ if (force) {
+ this._space();
+ } else if (this._buf.hasContent()) {
+ const lastCp = this.getLastChar();
+
+ if (lastCp !== 32 && lastCp !== 10) {
+ this._space();
+ }
+ }
+ }
+
+ word(str) {
+ if (this._endsWithWord || this.endsWith(47) && str.charCodeAt(0) === 47) {
+ this._space();
+ }
+
+ this._maybeAddAuxComment();
+
+ this._append(str);
+
+ this._endsWithWord = true;
+ }
+
+ number(str) {
+ this.word(str);
+ this._endsWithInteger = Number.isInteger(+str) && !NON_DECIMAL_LITERAL.test(str) && !SCIENTIFIC_NOTATION.test(str) && !ZERO_DECIMAL_INTEGER.test(str) && str.charCodeAt(str.length - 1) !== 46;
+ }
+
+ token(str) {
+ const lastChar = this.getLastChar();
+ const strFirst = str.charCodeAt(0);
+
+ if (str === "--" && lastChar === 33 || strFirst === 43 && lastChar === 43 || strFirst === 45 && lastChar === 45 || strFirst === 46 && this._endsWithInteger) {
+ this._space();
+ }
+
+ this._maybeAddAuxComment();
+
+ this._append(str);
+ }
+
+ newline(i = 1) {
+ if (this.format.retainLines || this.format.compact) return;
+
+ if (this.format.concise) {
+ this.space();
+ return;
+ }
+
+ const charBeforeNewline = this.endsWithCharAndNewline();
+ if (charBeforeNewline === 10) return;
+
+ if (charBeforeNewline === 123 || charBeforeNewline === 58) {
+ i--;
+ }
+
+ if (i <= 0) return;
+
+ for (let j = 0; j < i; j++) {
+ this._newline();
+ }
+ }
+
+ endsWith(char) {
+ return this.getLastChar() === char;
+ }
+
+ getLastChar() {
+ return this._buf.getLastChar();
+ }
+
+ endsWithCharAndNewline() {
+ return this._buf.endsWithCharAndNewline();
+ }
+
+ removeTrailingNewline() {
+ this._buf.removeTrailingNewline();
+ }
+
+ exactSource(loc, cb) {
+ this._catchUp("start", loc);
+
+ this._buf.exactSource(loc, cb);
+ }
+
+ source(prop, loc) {
+ this._catchUp(prop, loc);
+
+ this._buf.source(prop, loc);
+ }
+
+ withSource(prop, loc, cb) {
+ this._catchUp(prop, loc);
+
+ this._buf.withSource(prop, loc, cb);
+ }
+
+ _space() {
+ this._append(" ", true);
+ }
+
+ _newline() {
+ this._append("\n", true);
+ }
+
+ _append(str, queue = false) {
+ this._maybeAddParen(str);
+
+ this._maybeIndent(str);
+
+ if (queue) this._buf.queue(str);else this._buf.append(str);
+ this._endsWithWord = false;
+ this._endsWithInteger = false;
+ }
+
+ _maybeIndent(str) {
+ if (this._indent && this.endsWith(10) && str.charCodeAt(0) !== 10) {
+ this._buf.queue(this._getIndent());
+ }
+ }
+
+ _maybeAddParen(str) {
+ const parenPushNewlineState = this._parenPushNewlineState;
+ if (!parenPushNewlineState) return;
+ let i;
+
+ for (i = 0; i < str.length && str[i] === " "; i++) continue;
+
+ if (i === str.length) {
+ return;
+ }
+
+ const cha = str[i];
+
+ if (cha !== "\n") {
+ if (cha !== "/" || i + 1 === str.length) {
+ this._parenPushNewlineState = null;
+ return;
+ }
+
+ const chaPost = str[i + 1];
+
+ if (chaPost === "*") {
+ if (PURE_ANNOTATION_RE.test(str.slice(i + 2, str.length - 2))) {
+ return;
+ }
+ } else if (chaPost !== "/") {
+ this._parenPushNewlineState = null;
+ return;
+ }
+ }
+
+ this.token("(");
+ this.indent();
+ parenPushNewlineState.printed = true;
+ }
+
+ _catchUp(prop, loc) {
+ if (!this.format.retainLines) return;
+ const pos = loc ? loc[prop] : null;
+
+ if ((pos == null ? void 0 : pos.line) != null) {
+ const count = pos.line - this._buf.getCurrentLine();
+
+ for (let i = 0; i < count; i++) {
+ this._newline();
+ }
+ }
+ }
+
+ _getIndent() {
+ return this.format.indent.style.repeat(this._indent);
+ }
+
+ startTerminatorless(isLabel = false) {
+ if (isLabel) {
+ this._noLineTerminator = true;
+ return null;
+ } else {
+ return this._parenPushNewlineState = {
+ printed: false
+ };
+ }
+ }
+
+ endTerminatorless(state) {
+ this._noLineTerminator = false;
+
+ if (state != null && state.printed) {
+ this.dedent();
+ this.newline();
+ this.token(")");
+ }
+ }
+
+ print(node, parent) {
+ if (!node) return;
+ const oldConcise = this.format.concise;
+
+ if (node._compact) {
+ this.format.concise = true;
+ }
+
+ const printMethod = this[node.type];
+
+ if (!printMethod) {
+ throw new ReferenceError(`unknown node of type ${JSON.stringify(node.type)} with constructor ${JSON.stringify(node == null ? void 0 : node.constructor.name)}`);
+ }
+
+ this._printStack.push(node);
+
+ const oldInAux = this._insideAux;
+ this._insideAux = !node.loc;
+
+ this._maybeAddAuxComment(this._insideAux && !oldInAux);
+
+ let shouldPrintParens = needsParens(node, parent, this._printStack);
+
+ if (this.format.retainFunctionParens && node.type === "FunctionExpression" && node.extra && node.extra.parenthesized) {
+ shouldPrintParens = true;
+ }
+
+ if (shouldPrintParens) this.token("(");
+
+ this._printLeadingComments(node);
+
+ const loc = isProgram(node) || isFile(node) ? null : node.loc;
+ this.withSource("start", loc, () => {
+ printMethod.call(this, node, parent);
+ });
+
+ this._printTrailingComments(node);
+
+ if (shouldPrintParens) this.token(")");
+
+ this._printStack.pop();
+
+ this.format.concise = oldConcise;
+ this._insideAux = oldInAux;
+ }
+
+ _maybeAddAuxComment(enteredPositionlessNode) {
+ if (enteredPositionlessNode) this._printAuxBeforeComment();
+ if (!this._insideAux) this._printAuxAfterComment();
+ }
+
+ _printAuxBeforeComment() {
+ if (this._printAuxAfterOnNextUserNode) return;
+ this._printAuxAfterOnNextUserNode = true;
+ const comment = this.format.auxiliaryCommentBefore;
+
+ if (comment) {
+ this._printComment({
+ type: "CommentBlock",
+ value: comment
+ });
+ }
+ }
+
+ _printAuxAfterComment() {
+ if (!this._printAuxAfterOnNextUserNode) return;
+ this._printAuxAfterOnNextUserNode = false;
+ const comment = this.format.auxiliaryCommentAfter;
+
+ if (comment) {
+ this._printComment({
+ type: "CommentBlock",
+ value: comment
+ });
+ }
+ }
+
+ getPossibleRaw(node) {
+ const extra = node.extra;
+
+ if (extra && extra.raw != null && extra.rawValue != null && node.value === extra.rawValue) {
+ return extra.raw;
+ }
+ }
+
+ printJoin(nodes, parent, opts = {}) {
+ if (!(nodes != null && nodes.length)) return;
+ if (opts.indent) this.indent();
+ const newlineOpts = {
+ addNewlines: opts.addNewlines
+ };
+
+ for (let i = 0; i < nodes.length; i++) {
+ const node = nodes[i];
+ if (!node) continue;
+ if (opts.statement) this._printNewline(true, node, parent, newlineOpts);
+ this.print(node, parent);
+
+ if (opts.iterator) {
+ opts.iterator(node, i);
+ }
+
+ if (opts.separator && i < nodes.length - 1) {
+ opts.separator.call(this);
+ }
+
+ if (opts.statement) this._printNewline(false, node, parent, newlineOpts);
+ }
+
+ if (opts.indent) this.dedent();
+ }
+
+ printAndIndentOnComments(node, parent) {
+ const indent = node.leadingComments && node.leadingComments.length > 0;
+ if (indent) this.indent();
+ this.print(node, parent);
+ if (indent) this.dedent();
+ }
+
+ printBlock(parent) {
+ const node = parent.body;
+
+ if (!isEmptyStatement(node)) {
+ this.space();
+ }
+
+ this.print(node, parent);
+ }
+
+ _printTrailingComments(node) {
+ this._printComments(this._getComments(false, node));
+ }
+
+ _printLeadingComments(node) {
+ this._printComments(this._getComments(true, node), true);
+ }
+
+ printInnerComments(node, indent = true) {
+ var _node$innerComments;
+
+ if (!((_node$innerComments = node.innerComments) != null && _node$innerComments.length)) return;
+ if (indent) this.indent();
+
+ this._printComments(node.innerComments);
+
+ if (indent) this.dedent();
+ }
+
+ printSequence(nodes, parent, opts = {}) {
+ opts.statement = true;
+ return this.printJoin(nodes, parent, opts);
+ }
+
+ printList(items, parent, opts = {}) {
+ if (opts.separator == null) {
+ opts.separator = commaSeparator;
+ }
+
+ return this.printJoin(items, parent, opts);
+ }
+
+ _printNewline(leading, node, parent, opts) {
+ if (this.format.retainLines || this.format.compact) return;
+
+ if (this.format.concise) {
+ this.space();
+ return;
+ }
+
+ let lines = 0;
+
+ if (this._buf.hasContent()) {
+ if (!leading) lines++;
+ if (opts.addNewlines) lines += opts.addNewlines(leading, node) || 0;
+ const needs = leading ? needsWhitespaceBefore : needsWhitespaceAfter;
+ if (needs(node, parent)) lines++;
+ }
+
+ this.newline(Math.min(2, lines));
+ }
+
+ _getComments(leading, node) {
+ return node && (leading ? node.leadingComments : node.trailingComments) || [];
+ }
+
+ _printComment(comment, skipNewLines) {
+ if (!this.format.shouldPrintComment(comment.value)) return;
+ if (comment.ignore) return;
+ if (this._printedComments.has(comment)) return;
+
+ this._printedComments.add(comment);
+
+ const isBlockComment = comment.type === "CommentBlock";
+ const printNewLines = isBlockComment && !skipNewLines && !this._noLineTerminator;
+ if (printNewLines && this._buf.hasContent()) this.newline(1);
+ const lastCharCode = this.getLastChar();
+
+ if (lastCharCode !== 91 && lastCharCode !== 123) {
+ this.space();
+ }
+
+ let val = !isBlockComment && !this._noLineTerminator ? `//${comment.value}\n` : `/*${comment.value}*/`;
+
+ if (isBlockComment && this.format.indent.adjustMultilineComment) {
+ var _comment$loc;
+
+ const offset = (_comment$loc = comment.loc) == null ? void 0 : _comment$loc.start.column;
+
+ if (offset) {
+ const newlineRegex = new RegExp("\\n\\s{1," + offset + "}", "g");
+ val = val.replace(newlineRegex, "\n");
+ }
+
+ const indentSize = Math.max(this._getIndent().length, this.format.retainLines ? 0 : this._buf.getCurrentColumn());
+ val = val.replace(/\n(?!$)/g, `\n${" ".repeat(indentSize)}`);
+ }
+
+ if (this.endsWith(47)) this._space();
+ this.withSource("start", comment.loc, () => {
+ this._append(val);
+ });
+ if (printNewLines) this.newline(1);
+ }
+
+ _printComments(comments, inlinePureAnnotation) {
+ if (!(comments != null && comments.length)) return;
+
+ if (inlinePureAnnotation && comments.length === 1 && PURE_ANNOTATION_RE.test(comments[0].value)) {
+ this._printComment(comments[0], this._buf.hasContent() && !this.endsWith(10));
+ } else {
+ for (const comment of comments) {
+ this._printComment(comment);
+ }
+ }
+ }
+
+ printAssertions(node) {
+ var _node$assertions;
+
+ if ((_node$assertions = node.assertions) != null && _node$assertions.length) {
+ this.space();
+ this.word("assert");
+ this.space();
+ this.token("{");
+ this.space();
+ this.printList(node.assertions, node);
+ this.space();
+ this.token("}");
+ }
+ }
+
+}
+
+Object.assign(Printer.prototype, generatorFunctions);
+{
+ Printer.prototype.Noop = function Noop() {};
+}
+var _default = Printer;
+exports.default = _default;
+
+function commaSeparator() {
+ this.token(",");
+ this.space();
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/generator/lib/source-map.js b/chromium/third_party/node/node_modules/@babel/generator/lib/source-map.js
new file mode 100644
index 00000000000..99da1defd77
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/generator/lib/source-map.js
@@ -0,0 +1,78 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = void 0;
+
+var _sourceMap = require("source-map");
+
+class SourceMap {
+ constructor(opts, code) {
+ this._cachedMap = void 0;
+ this._code = void 0;
+ this._opts = void 0;
+ this._rawMappings = void 0;
+ this._lastGenLine = void 0;
+ this._lastSourceLine = void 0;
+ this._lastSourceColumn = void 0;
+ this._cachedMap = null;
+ this._code = code;
+ this._opts = opts;
+ this._rawMappings = [];
+ }
+
+ get() {
+ if (!this._cachedMap) {
+ const map = this._cachedMap = new _sourceMap.SourceMapGenerator({
+ sourceRoot: this._opts.sourceRoot
+ });
+ const code = this._code;
+
+ if (typeof code === "string") {
+ map.setSourceContent(this._opts.sourceFileName.replace(/\\/g, "/"), code);
+ } else if (typeof code === "object") {
+ Object.keys(code).forEach(sourceFileName => {
+ map.setSourceContent(sourceFileName.replace(/\\/g, "/"), code[sourceFileName]);
+ });
+ }
+
+ this._rawMappings.forEach(mapping => map.addMapping(mapping), map);
+ }
+
+ return this._cachedMap.toJSON();
+ }
+
+ getRawMappings() {
+ return this._rawMappings.slice();
+ }
+
+ mark(generatedLine, generatedColumn, line, column, identifierName, filename, force) {
+ if (this._lastGenLine !== generatedLine && line === null) return;
+
+ if (!force && this._lastGenLine === generatedLine && this._lastSourceLine === line && this._lastSourceColumn === column) {
+ return;
+ }
+
+ this._cachedMap = null;
+ this._lastGenLine = generatedLine;
+ this._lastSourceLine = line;
+ this._lastSourceColumn = column;
+
+ this._rawMappings.push({
+ name: identifierName || undefined,
+ generated: {
+ line: generatedLine,
+ column: generatedColumn
+ },
+ source: line == null ? undefined : (filename || this._opts.sourceFileName).replace(/\\/g, "/"),
+ original: line == null ? undefined : {
+ line: line,
+ column: column
+ }
+ });
+ }
+
+}
+
+exports.default = SourceMap; \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/generator/package.json b/chromium/third_party/node/node_modules/@babel/generator/package.json
new file mode 100644
index 00000000000..b5c01ed808c
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/generator/package.json
@@ -0,0 +1,36 @@
+{
+ "name": "@babel/generator",
+ "version": "7.15.4",
+ "description": "Turns an AST into code.",
+ "author": "The Babel Team (https://babel.dev/team)",
+ "license": "MIT",
+ "publishConfig": {
+ "access": "public"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/babel/babel.git",
+ "directory": "packages/babel-generator"
+ },
+ "homepage": "https://babel.dev/docs/en/next/babel-generator",
+ "bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20generator%22+is%3Aopen",
+ "main": "./lib/index.js",
+ "files": [
+ "lib"
+ ],
+ "dependencies": {
+ "@babel/types": "^7.15.4",
+ "jsesc": "^2.5.1",
+ "source-map": "^0.5.0"
+ },
+ "devDependencies": {
+ "@babel/helper-fixtures": "7.14.5",
+ "@babel/parser": "7.15.4",
+ "@types/jsesc": "^2.5.0",
+ "@types/source-map": "^0.5.0",
+ "charcodes": "^0.2.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/helper-function-name/LICENSE b/chromium/third_party/node/node_modules/@babel/helper-function-name/LICENSE
new file mode 100644
index 00000000000..f31575ec773
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/helper-function-name/LICENSE
@@ -0,0 +1,22 @@
+MIT License
+
+Copyright (c) 2014-present Sebastian McKenzie and other contributors
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/chromium/third_party/node/node_modules/@babel/helper-function-name/lib/index.js b/chromium/third_party/node/node_modules/@babel/helper-function-name/lib/index.js
new file mode 100644
index 00000000000..59e88e9b597
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/helper-function-name/lib/index.js
@@ -0,0 +1,188 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = _default;
+
+var _helperGetFunctionArity = require("@babel/helper-get-function-arity");
+
+var _template = require("@babel/template");
+
+var _t = require("@babel/types");
+
+const {
+ NOT_LOCAL_BINDING,
+ cloneNode,
+ identifier,
+ isAssignmentExpression,
+ isFunction,
+ isIdentifier,
+ isLiteral,
+ isNullLiteral,
+ isObjectMethod,
+ isObjectProperty,
+ isRegExpLiteral,
+ isTemplateLiteral,
+ isVariableDeclarator,
+ toBindingIdentifierName
+} = _t;
+const buildPropertyMethodAssignmentWrapper = (0, _template.default)(`
+ (function (FUNCTION_KEY) {
+ function FUNCTION_ID() {
+ return FUNCTION_KEY.apply(this, arguments);
+ }
+
+ FUNCTION_ID.toString = function () {
+ return FUNCTION_KEY.toString();
+ }
+
+ return FUNCTION_ID;
+ })(FUNCTION)
+`);
+const buildGeneratorPropertyMethodAssignmentWrapper = (0, _template.default)(`
+ (function (FUNCTION_KEY) {
+ function* FUNCTION_ID() {
+ return yield* FUNCTION_KEY.apply(this, arguments);
+ }
+
+ FUNCTION_ID.toString = function () {
+ return FUNCTION_KEY.toString();
+ };
+
+ return FUNCTION_ID;
+ })(FUNCTION)
+`);
+const visitor = {
+ "ReferencedIdentifier|BindingIdentifier"(path, state) {
+ if (path.node.name !== state.name) return;
+ const localDeclar = path.scope.getBindingIdentifier(state.name);
+ if (localDeclar !== state.outerDeclar) return;
+ state.selfReference = true;
+ path.stop();
+ }
+
+};
+
+function getNameFromLiteralId(id) {
+ if (isNullLiteral(id)) {
+ return "null";
+ }
+
+ if (isRegExpLiteral(id)) {
+ return `_${id.pattern}_${id.flags}`;
+ }
+
+ if (isTemplateLiteral(id)) {
+ return id.quasis.map(quasi => quasi.value.raw).join("");
+ }
+
+ if (id.value !== undefined) {
+ return id.value + "";
+ }
+
+ return "";
+}
+
+function wrap(state, method, id, scope) {
+ if (state.selfReference) {
+ if (scope.hasBinding(id.name) && !scope.hasGlobal(id.name)) {
+ scope.rename(id.name);
+ } else {
+ if (!isFunction(method)) return;
+ let build = buildPropertyMethodAssignmentWrapper;
+
+ if (method.generator) {
+ build = buildGeneratorPropertyMethodAssignmentWrapper;
+ }
+
+ const template = build({
+ FUNCTION: method,
+ FUNCTION_ID: id,
+ FUNCTION_KEY: scope.generateUidIdentifier(id.name)
+ }).expression;
+ const params = template.callee.body.body[0].params;
+
+ for (let i = 0, len = (0, _helperGetFunctionArity.default)(method); i < len; i++) {
+ params.push(scope.generateUidIdentifier("x"));
+ }
+
+ return template;
+ }
+ }
+
+ method.id = id;
+ scope.getProgramParent().references[id.name] = true;
+}
+
+function visit(node, name, scope) {
+ const state = {
+ selfAssignment: false,
+ selfReference: false,
+ outerDeclar: scope.getBindingIdentifier(name),
+ references: [],
+ name: name
+ };
+ const binding = scope.getOwnBinding(name);
+
+ if (binding) {
+ if (binding.kind === "param") {
+ state.selfReference = true;
+ } else {}
+ } else if (state.outerDeclar || scope.hasGlobal(name)) {
+ scope.traverse(node, visitor, state);
+ }
+
+ return state;
+}
+
+function _default({
+ node,
+ parent,
+ scope,
+ id
+}, localBinding = false) {
+ if (node.id) return;
+
+ if ((isObjectProperty(parent) || isObjectMethod(parent, {
+ kind: "method"
+ })) && (!parent.computed || isLiteral(parent.key))) {
+ id = parent.key;
+ } else if (isVariableDeclarator(parent)) {
+ id = parent.id;
+
+ if (isIdentifier(id) && !localBinding) {
+ const binding = scope.parent.getBinding(id.name);
+
+ if (binding && binding.constant && scope.getBinding(id.name) === binding) {
+ node.id = cloneNode(id);
+ node.id[NOT_LOCAL_BINDING] = true;
+ return;
+ }
+ }
+ } else if (isAssignmentExpression(parent, {
+ operator: "="
+ })) {
+ id = parent.left;
+ } else if (!id) {
+ return;
+ }
+
+ let name;
+
+ if (id && isLiteral(id)) {
+ name = getNameFromLiteralId(id);
+ } else if (id && isIdentifier(id)) {
+ name = id.name;
+ }
+
+ if (name === undefined) {
+ return;
+ }
+
+ name = toBindingIdentifierName(name);
+ id = identifier(name);
+ id[NOT_LOCAL_BINDING] = true;
+ const state = visit(node, name, scope);
+ return wrap(state, node, id, scope) || node;
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/helper-function-name/package.json b/chromium/third_party/node/node_modules/@babel/helper-function-name/package.json
new file mode 100644
index 00000000000..68734a59606
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/helper-function-name/package.json
@@ -0,0 +1,25 @@
+{
+ "name": "@babel/helper-function-name",
+ "version": "7.15.4",
+ "description": "Helper function to change the property 'name' of every function",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/babel/babel.git",
+ "directory": "packages/babel-helper-function-name"
+ },
+ "homepage": "https://babel.dev/docs/en/next/babel-helper-function-name",
+ "license": "MIT",
+ "publishConfig": {
+ "access": "public"
+ },
+ "main": "./lib/index.js",
+ "dependencies": {
+ "@babel/helper-get-function-arity": "^7.15.4",
+ "@babel/template": "^7.15.4",
+ "@babel/types": "^7.15.4"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "author": "The Babel Team (https://babel.dev/team)"
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/helper-get-function-arity/LICENSE b/chromium/third_party/node/node_modules/@babel/helper-get-function-arity/LICENSE
new file mode 100644
index 00000000000..f31575ec773
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/helper-get-function-arity/LICENSE
@@ -0,0 +1,22 @@
+MIT License
+
+Copyright (c) 2014-present Sebastian McKenzie and other contributors
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/chromium/third_party/node/node_modules/@babel/helper-get-function-arity/lib/index.js b/chromium/third_party/node/node_modules/@babel/helper-get-function-arity/lib/index.js
new file mode 100644
index 00000000000..61e22edd292
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/helper-get-function-arity/lib/index.js
@@ -0,0 +1,27 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = _default;
+
+var _t = require("@babel/types");
+
+const {
+ isAssignmentPattern,
+ isRestElement
+} = _t;
+
+function _default(node) {
+ const params = node.params;
+
+ for (let i = 0; i < params.length; i++) {
+ const param = params[i];
+
+ if (isAssignmentPattern(param) || isRestElement(param)) {
+ return i;
+ }
+ }
+
+ return params.length;
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/helper-get-function-arity/package.json b/chromium/third_party/node/node_modules/@babel/helper-get-function-arity/package.json
new file mode 100644
index 00000000000..648e82766ad
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/helper-get-function-arity/package.json
@@ -0,0 +1,23 @@
+{
+ "name": "@babel/helper-get-function-arity",
+ "version": "7.15.4",
+ "description": "Helper function to get function arity",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/babel/babel.git",
+ "directory": "packages/babel-helper-get-function-arity"
+ },
+ "homepage": "https://babel.dev/docs/en/next/babel-helper-get-function-arity",
+ "license": "MIT",
+ "publishConfig": {
+ "access": "public"
+ },
+ "main": "./lib/index.js",
+ "dependencies": {
+ "@babel/types": "^7.15.4"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "author": "The Babel Team (https://babel.dev/team)"
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/helper-hoist-variables/LICENSE b/chromium/third_party/node/node_modules/@babel/helper-hoist-variables/LICENSE
new file mode 100644
index 00000000000..f31575ec773
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/helper-hoist-variables/LICENSE
@@ -0,0 +1,22 @@
+MIT License
+
+Copyright (c) 2014-present Sebastian McKenzie and other contributors
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/chromium/third_party/node/node_modules/@babel/helper-hoist-variables/lib/index.js b/chromium/third_party/node/node_modules/@babel/helper-hoist-variables/lib/index.js
new file mode 100644
index 00000000000..31fb8470e69
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/helper-hoist-variables/lib/index.js
@@ -0,0 +1,58 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = hoistVariables;
+
+var _t = require("@babel/types");
+
+const {
+ assignmentExpression,
+ expressionStatement,
+ identifier
+} = _t;
+const visitor = {
+ Scope(path, state) {
+ if (state.kind === "let") path.skip();
+ },
+
+ FunctionParent(path) {
+ path.skip();
+ },
+
+ VariableDeclaration(path, state) {
+ if (state.kind && path.node.kind !== state.kind) return;
+ const nodes = [];
+ const declarations = path.get("declarations");
+ let firstId;
+
+ for (const declar of declarations) {
+ firstId = declar.node.id;
+
+ if (declar.node.init) {
+ nodes.push(expressionStatement(assignmentExpression("=", declar.node.id, declar.node.init)));
+ }
+
+ for (const name of Object.keys(declar.getBindingIdentifiers())) {
+ state.emit(identifier(name), name, declar.node.init !== null);
+ }
+ }
+
+ if (path.parentPath.isFor({
+ left: path.node
+ })) {
+ path.replaceWith(firstId);
+ } else {
+ path.replaceWithMultiple(nodes);
+ }
+ }
+
+};
+
+function hoistVariables(path, emit, kind = "var") {
+ path.traverse(visitor, {
+ kind,
+ emit
+ });
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/helper-hoist-variables/package.json b/chromium/third_party/node/node_modules/@babel/helper-hoist-variables/package.json
new file mode 100644
index 00000000000..7621f99a207
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/helper-hoist-variables/package.json
@@ -0,0 +1,27 @@
+{
+ "name": "@babel/helper-hoist-variables",
+ "version": "7.15.4",
+ "description": "Helper function to hoist variables",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/babel/babel.git",
+ "directory": "packages/babel-helper-hoist-variables"
+ },
+ "homepage": "https://babel.dev/docs/en/next/babel-helper-hoist-variables",
+ "license": "MIT",
+ "publishConfig": {
+ "access": "public"
+ },
+ "main": "./lib/index.js",
+ "dependencies": {
+ "@babel/types": "^7.15.4"
+ },
+ "TODO": "The @babel/traverse dependency is only needed for the NodePath TS type. We can consider exporting it from @babel/core.",
+ "devDependencies": {
+ "@babel/traverse": "7.15.4"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "author": "The Babel Team (https://babel.dev/team)"
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/helper-split-export-declaration/LICENSE b/chromium/third_party/node/node_modules/@babel/helper-split-export-declaration/LICENSE
new file mode 100644
index 00000000000..f31575ec773
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/helper-split-export-declaration/LICENSE
@@ -0,0 +1,22 @@
+MIT License
+
+Copyright (c) 2014-present Sebastian McKenzie and other contributors
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/chromium/third_party/node/node_modules/@babel/helper-split-export-declaration/lib/index.js b/chromium/third_party/node/node_modules/@babel/helper-split-export-declaration/lib/index.js
new file mode 100644
index 00000000000..6007f89c28d
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/helper-split-export-declaration/lib/index.js
@@ -0,0 +1,67 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = splitExportDeclaration;
+
+var _t = require("@babel/types");
+
+const {
+ cloneNode,
+ exportNamedDeclaration,
+ exportSpecifier,
+ identifier,
+ variableDeclaration,
+ variableDeclarator
+} = _t;
+
+function splitExportDeclaration(exportDeclaration) {
+ if (!exportDeclaration.isExportDeclaration()) {
+ throw new Error("Only export declarations can be split.");
+ }
+
+ const isDefault = exportDeclaration.isExportDefaultDeclaration();
+ const declaration = exportDeclaration.get("declaration");
+ const isClassDeclaration = declaration.isClassDeclaration();
+
+ if (isDefault) {
+ const standaloneDeclaration = declaration.isFunctionDeclaration() || isClassDeclaration;
+ const scope = declaration.isScope() ? declaration.scope.parent : declaration.scope;
+ let id = declaration.node.id;
+ let needBindingRegistration = false;
+
+ if (!id) {
+ needBindingRegistration = true;
+ id = scope.generateUidIdentifier("default");
+
+ if (standaloneDeclaration || declaration.isFunctionExpression() || declaration.isClassExpression()) {
+ declaration.node.id = cloneNode(id);
+ }
+ }
+
+ const updatedDeclaration = standaloneDeclaration ? declaration : variableDeclaration("var", [variableDeclarator(cloneNode(id), declaration.node)]);
+ const updatedExportDeclaration = exportNamedDeclaration(null, [exportSpecifier(cloneNode(id), identifier("default"))]);
+ exportDeclaration.insertAfter(updatedExportDeclaration);
+ exportDeclaration.replaceWith(updatedDeclaration);
+
+ if (needBindingRegistration) {
+ scope.registerDeclaration(exportDeclaration);
+ }
+
+ return exportDeclaration;
+ }
+
+ if (exportDeclaration.get("specifiers").length > 0) {
+ throw new Error("It doesn't make sense to split exported specifiers.");
+ }
+
+ const bindingIdentifiers = declaration.getOuterBindingIdentifiers();
+ const specifiers = Object.keys(bindingIdentifiers).map(name => {
+ return exportSpecifier(identifier(name), identifier(name));
+ });
+ const aliasDeclar = exportNamedDeclaration(null, specifiers);
+ exportDeclaration.insertAfter(aliasDeclar);
+ exportDeclaration.replaceWith(declaration.node);
+ return exportDeclaration;
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/helper-split-export-declaration/package.json b/chromium/third_party/node/node_modules/@babel/helper-split-export-declaration/package.json
new file mode 100644
index 00000000000..8c32ea4fff2
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/helper-split-export-declaration/package.json
@@ -0,0 +1,23 @@
+{
+ "name": "@babel/helper-split-export-declaration",
+ "version": "7.15.4",
+ "description": "",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/babel/babel.git",
+ "directory": "packages/babel-helper-split-export-declaration"
+ },
+ "homepage": "https://babel.dev/docs/en/next/babel-helper-split-export-declaration",
+ "license": "MIT",
+ "publishConfig": {
+ "access": "public"
+ },
+ "main": "./lib/index.js",
+ "dependencies": {
+ "@babel/types": "^7.15.4"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "author": "The Babel Team (https://babel.dev/team)"
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/helper-validator-identifier/LICENSE b/chromium/third_party/node/node_modules/@babel/helper-validator-identifier/LICENSE
new file mode 100644
index 00000000000..f31575ec773
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/helper-validator-identifier/LICENSE
@@ -0,0 +1,22 @@
+MIT License
+
+Copyright (c) 2014-present Sebastian McKenzie and other contributors
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/chromium/third_party/node/node_modules/@babel/helper-validator-identifier/lib/identifier.js b/chromium/third_party/node/node_modules/@babel/helper-validator-identifier/lib/identifier.js
new file mode 100644
index 00000000000..b8a5d9a67f7
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/helper-validator-identifier/lib/identifier.js
@@ -0,0 +1,84 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.isIdentifierStart = isIdentifierStart;
+exports.isIdentifierChar = isIdentifierChar;
+exports.isIdentifierName = isIdentifierName;
+let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
+let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f";
+const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
+const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
+nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
+const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1070, 4050, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 46, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 482, 44, 11, 6, 17, 0, 322, 29, 19, 43, 1269, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4152, 8, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938];
+const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 357, 0, 62, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
+
+function isInAstralSet(code, set) {
+ let pos = 0x10000;
+
+ for (let i = 0, length = set.length; i < length; i += 2) {
+ pos += set[i];
+ if (pos > code) return false;
+ pos += set[i + 1];
+ if (pos >= code) return true;
+ }
+
+ return false;
+}
+
+function isIdentifierStart(code) {
+ if (code < 65) return code === 36;
+ if (code <= 90) return true;
+ if (code < 97) return code === 95;
+ if (code <= 122) return true;
+
+ if (code <= 0xffff) {
+ return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));
+ }
+
+ return isInAstralSet(code, astralIdentifierStartCodes);
+}
+
+function isIdentifierChar(code) {
+ if (code < 48) return code === 36;
+ if (code < 58) return true;
+ if (code < 65) return false;
+ if (code <= 90) return true;
+ if (code < 97) return code === 95;
+ if (code <= 122) return true;
+
+ if (code <= 0xffff) {
+ return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));
+ }
+
+ return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
+}
+
+function isIdentifierName(name) {
+ let isFirst = true;
+
+ for (let i = 0; i < name.length; i++) {
+ let cp = name.charCodeAt(i);
+
+ if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) {
+ const trail = name.charCodeAt(++i);
+
+ if ((trail & 0xfc00) === 0xdc00) {
+ cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);
+ }
+ }
+
+ if (isFirst) {
+ isFirst = false;
+
+ if (!isIdentifierStart(cp)) {
+ return false;
+ }
+ } else if (!isIdentifierChar(cp)) {
+ return false;
+ }
+ }
+
+ return !isFirst;
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/helper-validator-identifier/lib/index.js b/chromium/third_party/node/node_modules/@babel/helper-validator-identifier/lib/index.js
new file mode 100644
index 00000000000..7b623c90a6e
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/helper-validator-identifier/lib/index.js
@@ -0,0 +1,57 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+Object.defineProperty(exports, "isIdentifierName", {
+ enumerable: true,
+ get: function () {
+ return _identifier.isIdentifierName;
+ }
+});
+Object.defineProperty(exports, "isIdentifierChar", {
+ enumerable: true,
+ get: function () {
+ return _identifier.isIdentifierChar;
+ }
+});
+Object.defineProperty(exports, "isIdentifierStart", {
+ enumerable: true,
+ get: function () {
+ return _identifier.isIdentifierStart;
+ }
+});
+Object.defineProperty(exports, "isReservedWord", {
+ enumerable: true,
+ get: function () {
+ return _keyword.isReservedWord;
+ }
+});
+Object.defineProperty(exports, "isStrictBindOnlyReservedWord", {
+ enumerable: true,
+ get: function () {
+ return _keyword.isStrictBindOnlyReservedWord;
+ }
+});
+Object.defineProperty(exports, "isStrictBindReservedWord", {
+ enumerable: true,
+ get: function () {
+ return _keyword.isStrictBindReservedWord;
+ }
+});
+Object.defineProperty(exports, "isStrictReservedWord", {
+ enumerable: true,
+ get: function () {
+ return _keyword.isStrictReservedWord;
+ }
+});
+Object.defineProperty(exports, "isKeyword", {
+ enumerable: true,
+ get: function () {
+ return _keyword.isKeyword;
+ }
+});
+
+var _identifier = require("./identifier");
+
+var _keyword = require("./keyword"); \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/helper-validator-identifier/lib/keyword.js b/chromium/third_party/node/node_modules/@babel/helper-validator-identifier/lib/keyword.js
new file mode 100644
index 00000000000..110cee40028
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/helper-validator-identifier/lib/keyword.js
@@ -0,0 +1,38 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.isReservedWord = isReservedWord;
+exports.isStrictReservedWord = isStrictReservedWord;
+exports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord;
+exports.isStrictBindReservedWord = isStrictBindReservedWord;
+exports.isKeyword = isKeyword;
+const reservedWords = {
+ keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"],
+ strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
+ strictBind: ["eval", "arguments"]
+};
+const keywords = new Set(reservedWords.keyword);
+const reservedWordsStrictSet = new Set(reservedWords.strict);
+const reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
+
+function isReservedWord(word, inModule) {
+ return inModule && word === "await" || word === "enum";
+}
+
+function isStrictReservedWord(word, inModule) {
+ return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
+}
+
+function isStrictBindOnlyReservedWord(word) {
+ return reservedWordsStrictBindSet.has(word);
+}
+
+function isStrictBindReservedWord(word, inModule) {
+ return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
+}
+
+function isKeyword(word) {
+ return keywords.has(word);
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/helper-validator-identifier/package.json b/chromium/third_party/node/node_modules/@babel/helper-validator-identifier/package.json
new file mode 100644
index 00000000000..0efb119c4b5
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/helper-validator-identifier/package.json
@@ -0,0 +1,24 @@
+{
+ "name": "@babel/helper-validator-identifier",
+ "version": "7.15.7",
+ "description": "Validate identifier/keywords name",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/babel/babel.git",
+ "directory": "packages/babel-helper-validator-identifier"
+ },
+ "license": "MIT",
+ "publishConfig": {
+ "access": "public"
+ },
+ "main": "./lib/index.js",
+ "exports": "./lib/index.js",
+ "devDependencies": {
+ "@unicode/unicode-14.0.0": "^1.2.1",
+ "charcodes": "^0.2.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "author": "The Babel Team (https://babel.dev/team)"
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js b/chromium/third_party/node/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js
new file mode 100644
index 00000000000..f644d77df9f
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js
@@ -0,0 +1,75 @@
+"use strict";
+
+// Always use the latest available version of Unicode!
+// https://tc39.github.io/ecma262/#sec-conformance
+const version = "14.0.0";
+
+const start = require("@unicode/unicode-" +
+ version +
+ "/Binary_Property/ID_Start/code-points.js").filter(function (ch) {
+ return ch > 0x7f;
+});
+let last = -1;
+const cont = [0x200c, 0x200d].concat(
+ require("@unicode/unicode-" +
+ version +
+ "/Binary_Property/ID_Continue/code-points.js").filter(function (ch) {
+ return ch > 0x7f && search(start, ch, last + 1) == -1;
+ })
+);
+
+function search(arr, ch, starting) {
+ for (let i = starting; arr[i] <= ch && i < arr.length; last = i++) {
+ if (arr[i] === ch) return i;
+ }
+ return -1;
+}
+
+function pad(str, width) {
+ while (str.length < width) str = "0" + str;
+ return str;
+}
+
+function esc(code) {
+ const hex = code.toString(16);
+ if (hex.length <= 2) return "\\x" + pad(hex, 2);
+ else return "\\u" + pad(hex, 4);
+}
+
+function generate(chars) {
+ const astral = [];
+ let re = "";
+ for (let i = 0, at = 0x10000; i < chars.length; i++) {
+ const from = chars[i];
+ let to = from;
+ while (i < chars.length - 1 && chars[i + 1] == to + 1) {
+ i++;
+ to++;
+ }
+ if (to <= 0xffff) {
+ if (from == to) re += esc(from);
+ else if (from + 1 == to) re += esc(from) + esc(to);
+ else re += esc(from) + "-" + esc(to);
+ } else {
+ astral.push(from - at, to - from);
+ at = to;
+ }
+ }
+ return { nonASCII: re, astral: astral };
+}
+
+const startData = generate(start);
+const contData = generate(cont);
+
+console.log("/* prettier-ignore */");
+console.log('let nonASCIIidentifierStartChars = "' + startData.nonASCII + '";');
+console.log("/* prettier-ignore */");
+console.log('let nonASCIIidentifierChars = "' + contData.nonASCII + '";');
+console.log("/* prettier-ignore */");
+console.log(
+ "const astralIdentifierStartCodes = " + JSON.stringify(startData.astral) + ";"
+);
+console.log("/* prettier-ignore */");
+console.log(
+ "const astralIdentifierCodes = " + JSON.stringify(contData.astral) + ";"
+);
diff --git a/chromium/third_party/node/node_modules/@babel/highlight/LICENSE b/chromium/third_party/node/node_modules/@babel/highlight/LICENSE
new file mode 100644
index 00000000000..f31575ec773
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/highlight/LICENSE
@@ -0,0 +1,22 @@
+MIT License
+
+Copyright (c) 2014-present Sebastian McKenzie and other contributors
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/chromium/third_party/node/node_modules/@babel/highlight/lib/index.js b/chromium/third_party/node/node_modules/@babel/highlight/lib/index.js
new file mode 100644
index 00000000000..34e308f4ef9
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/highlight/lib/index.js
@@ -0,0 +1,116 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.shouldHighlight = shouldHighlight;
+exports.getChalk = getChalk;
+exports.default = highlight;
+
+var _jsTokens = require("js-tokens");
+
+var _helperValidatorIdentifier = require("@babel/helper-validator-identifier");
+
+var _chalk = require("chalk");
+
+const sometimesKeywords = new Set(["as", "async", "from", "get", "of", "set"]);
+
+function getDefs(chalk) {
+ return {
+ keyword: chalk.cyan,
+ capitalized: chalk.yellow,
+ jsxIdentifier: chalk.yellow,
+ punctuator: chalk.yellow,
+ number: chalk.magenta,
+ string: chalk.green,
+ regex: chalk.magenta,
+ comment: chalk.grey,
+ invalid: chalk.white.bgRed.bold
+ };
+}
+
+const NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
+const BRACKET = /^[()[\]{}]$/;
+let tokenize;
+{
+ const JSX_TAG = /^[a-z][\w-]*$/i;
+
+ const getTokenType = function (token, offset, text) {
+ if (token.type === "name") {
+ if ((0, _helperValidatorIdentifier.isKeyword)(token.value) || (0, _helperValidatorIdentifier.isStrictReservedWord)(token.value, true) || sometimesKeywords.has(token.value)) {
+ return "keyword";
+ }
+
+ if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.substr(offset - 2, 2) == "</")) {
+ return "jsxIdentifier";
+ }
+
+ if (token.value[0] !== token.value[0].toLowerCase()) {
+ return "capitalized";
+ }
+ }
+
+ if (token.type === "punctuator" && BRACKET.test(token.value)) {
+ return "bracket";
+ }
+
+ if (token.type === "invalid" && (token.value === "@" || token.value === "#")) {
+ return "punctuator";
+ }
+
+ return token.type;
+ };
+
+ tokenize = function* (text) {
+ let match;
+
+ while (match = _jsTokens.default.exec(text)) {
+ const token = _jsTokens.matchToToken(match);
+
+ yield {
+ type: getTokenType(token, match.index, text),
+ value: token.value
+ };
+ }
+ };
+}
+
+function highlightTokens(defs, text) {
+ let highlighted = "";
+
+ for (const {
+ type,
+ value
+ } of tokenize(text)) {
+ const colorize = defs[type];
+
+ if (colorize) {
+ highlighted += value.split(NEWLINE).map(str => colorize(str)).join("\n");
+ } else {
+ highlighted += value;
+ }
+ }
+
+ return highlighted;
+}
+
+function shouldHighlight(options) {
+ return !!_chalk.supportsColor || options.forceColor;
+}
+
+function getChalk(options) {
+ return options.forceColor ? new _chalk.constructor({
+ enabled: true,
+ level: 1
+ }) : _chalk;
+}
+
+function highlight(code, options = {}) {
+ if (shouldHighlight(options)) {
+ const chalk = getChalk(options);
+ const defs = getDefs(chalk);
+ return highlightTokens(defs, code);
+ } else {
+ return code;
+ }
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/highlight/package.json b/chromium/third_party/node/node_modules/@babel/highlight/package.json
new file mode 100644
index 00000000000..210c22c5110
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/highlight/package.json
@@ -0,0 +1,29 @@
+{
+ "name": "@babel/highlight",
+ "version": "7.14.5",
+ "description": "Syntax highlight JavaScript strings for output in terminals.",
+ "author": "The Babel Team (https://babel.dev/team)",
+ "homepage": "https://babel.dev/docs/en/next/babel-highlight",
+ "license": "MIT",
+ "publishConfig": {
+ "access": "public"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/babel/babel.git",
+ "directory": "packages/babel-highlight"
+ },
+ "main": "./lib/index.js",
+ "dependencies": {
+ "@babel/helper-validator-identifier": "^7.14.5",
+ "chalk": "^2.0.0",
+ "js-tokens": "^4.0.0"
+ },
+ "devDependencies": {
+ "@types/chalk": "^2.0.0",
+ "strip-ansi": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/parser/LICENSE b/chromium/third_party/node/node_modules/@babel/parser/LICENSE
new file mode 100644
index 00000000000..d4c7fc58380
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/parser/LICENSE
@@ -0,0 +1,19 @@
+Copyright (C) 2012-2014 by various contributors (see AUTHORS)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/chromium/third_party/node/node_modules/@babel/parser/bin/babel-parser.js b/chromium/third_party/node/node_modules/@babel/parser/bin/babel-parser.js
new file mode 100755
index 00000000000..3aca314533b
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/parser/bin/babel-parser.js
@@ -0,0 +1,15 @@
+#!/usr/bin/env node
+/* eslint no-var: 0 */
+
+var parser = require("..");
+var fs = require("fs");
+
+var filename = process.argv[2];
+if (!filename) {
+ console.error("no filename specified");
+} else {
+ var file = fs.readFileSync(filename, "utf8");
+ var ast = parser.parse(file);
+
+ console.log(JSON.stringify(ast, null, " "));
+}
diff --git a/chromium/third_party/node/node_modules/@babel/parser/lib/index.js b/chromium/third_party/node/node_modules/@babel/parser/lib/index.js
new file mode 100644
index 00000000000..c8610f19ec0
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/parser/lib/index.js
@@ -0,0 +1,14699 @@
+'use strict';
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+const lineBreak = /\r\n?|[\n\u2028\u2029]/;
+const lineBreakG = new RegExp(lineBreak.source, "g");
+function isNewLine(code) {
+ switch (code) {
+ case 10:
+ case 13:
+ case 8232:
+ case 8233:
+ return true;
+
+ default:
+ return false;
+ }
+}
+const skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
+const skipWhiteSpaceInLine = /(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/y;
+const skipWhiteSpaceToLineBreak = new RegExp("(?=(" + skipWhiteSpaceInLine.source + "))\\1" + /(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source, "y");
+function isWhitespace(code) {
+ switch (code) {
+ case 0x0009:
+ case 0x000b:
+ case 0x000c:
+ case 32:
+ case 160:
+ case 5760:
+ case 0x2000:
+ case 0x2001:
+ case 0x2002:
+ case 0x2003:
+ case 0x2004:
+ case 0x2005:
+ case 0x2006:
+ case 0x2007:
+ case 0x2008:
+ case 0x2009:
+ case 0x200a:
+ case 0x202f:
+ case 0x205f:
+ case 0x3000:
+ case 0xfeff:
+ return true;
+
+ default:
+ return false;
+ }
+}
+
+class Position {
+ constructor(line, col) {
+ this.line = void 0;
+ this.column = void 0;
+ this.line = line;
+ this.column = col;
+ }
+
+}
+class SourceLocation {
+ constructor(start, end) {
+ this.start = void 0;
+ this.end = void 0;
+ this.filename = void 0;
+ this.identifierName = void 0;
+ this.start = start;
+ this.end = end;
+ }
+
+}
+function getLineInfo(input, offset) {
+ let line = 1;
+ let lineStart = 0;
+ let match;
+ lineBreakG.lastIndex = 0;
+
+ while ((match = lineBreakG.exec(input)) && match.index < offset) {
+ line++;
+ lineStart = lineBreakG.lastIndex;
+ }
+
+ return new Position(line, offset - lineStart);
+}
+
+class BaseParser {
+ constructor() {
+ this.sawUnambiguousESM = false;
+ this.ambiguousScriptDifferentAst = false;
+ }
+
+ hasPlugin(name) {
+ return this.plugins.has(name);
+ }
+
+ getPluginOption(plugin, name) {
+ if (this.hasPlugin(plugin)) return this.plugins.get(plugin)[name];
+ }
+
+}
+
+function setTrailingComments(node, comments) {
+ if (node.trailingComments === undefined) {
+ node.trailingComments = comments;
+ } else {
+ node.trailingComments.unshift(...comments);
+ }
+}
+
+function setInnerComments(node, comments) {
+ if (node.innerComments === undefined) {
+ node.innerComments = comments;
+ } else if (comments !== undefined) {
+ node.innerComments.unshift(...comments);
+ }
+}
+
+function adjustInnerComments(node, elements, commentWS) {
+ let lastElement = null;
+ let i = elements.length;
+
+ while (lastElement === null && i > 0) {
+ lastElement = elements[--i];
+ }
+
+ if (lastElement === null || lastElement.start > commentWS.start) {
+ setInnerComments(node, commentWS.comments);
+ } else {
+ setTrailingComments(lastElement, commentWS.comments);
+ }
+}
+
+class CommentsParser extends BaseParser {
+ addComment(comment) {
+ if (this.filename) comment.loc.filename = this.filename;
+ this.state.comments.push(comment);
+ }
+
+ processComment(node) {
+ const {
+ commentStack
+ } = this.state;
+ const commentStackLength = commentStack.length;
+ if (commentStackLength === 0) return;
+ let i = commentStackLength - 1;
+ const lastCommentWS = commentStack[i];
+
+ if (lastCommentWS.start === node.end) {
+ lastCommentWS.leadingNode = node;
+ i--;
+ }
+
+ const {
+ start: nodeStart
+ } = node;
+
+ for (; i >= 0; i--) {
+ const commentWS = commentStack[i];
+ const commentEnd = commentWS.end;
+
+ if (commentEnd > nodeStart) {
+ commentWS.containingNode = node;
+ this.finalizeComment(commentWS);
+ commentStack.splice(i, 1);
+ } else {
+ if (commentEnd === nodeStart) {
+ commentWS.trailingNode = node;
+ }
+
+ break;
+ }
+ }
+ }
+
+ finalizeComment(commentWS) {
+ const {
+ comments
+ } = commentWS;
+
+ if (commentWS.leadingNode !== null || commentWS.trailingNode !== null) {
+ if (commentWS.leadingNode !== null) {
+ setTrailingComments(commentWS.leadingNode, comments);
+ }
+
+ if (commentWS.trailingNode !== null) {
+ commentWS.trailingNode.leadingComments = comments;
+ }
+ } else {
+ const {
+ containingNode: node,
+ start: commentStart
+ } = commentWS;
+
+ if (this.input.charCodeAt(commentStart - 1) === 44) {
+ switch (node.type) {
+ case "ObjectExpression":
+ case "ObjectPattern":
+ case "RecordExpression":
+ adjustInnerComments(node, node.properties, commentWS);
+ break;
+
+ case "CallExpression":
+ case "OptionalCallExpression":
+ adjustInnerComments(node, node.arguments, commentWS);
+ break;
+
+ case "FunctionDeclaration":
+ case "FunctionExpression":
+ case "ArrowFunctionExpression":
+ case "ObjectMethod":
+ case "ClassMethod":
+ case "ClassPrivateMethod":
+ adjustInnerComments(node, node.params, commentWS);
+ break;
+
+ case "ArrayExpression":
+ case "ArrayPattern":
+ case "TupleExpression":
+ adjustInnerComments(node, node.elements, commentWS);
+ break;
+
+ case "ExportNamedDeclaration":
+ case "ImportDeclaration":
+ adjustInnerComments(node, node.specifiers, commentWS);
+ break;
+
+ default:
+ {
+ setInnerComments(node, comments);
+ }
+ }
+ } else {
+ setInnerComments(node, comments);
+ }
+ }
+ }
+
+ finalizeRemainingComments() {
+ const {
+ commentStack
+ } = this.state;
+
+ for (let i = commentStack.length - 1; i >= 0; i--) {
+ this.finalizeComment(commentStack[i]);
+ }
+
+ this.state.commentStack = [];
+ }
+
+ resetPreviousNodeTrailingComments(node) {
+ const {
+ commentStack
+ } = this.state;
+ const {
+ length
+ } = commentStack;
+ if (length === 0) return;
+ const commentWS = commentStack[length - 1];
+
+ if (commentWS.leadingNode === node) {
+ commentWS.leadingNode = null;
+ }
+ }
+
+}
+
+const ErrorCodes = Object.freeze({
+ SyntaxError: "BABEL_PARSER_SYNTAX_ERROR",
+ SourceTypeModuleError: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED"
+});
+
+const ErrorMessages = makeErrorTemplates({
+ AccessorIsGenerator: "A %0ter cannot be a generator.",
+ ArgumentsInClass: "'arguments' is only allowed in functions and class methods.",
+ AsyncFunctionInSingleStatementContext: "Async functions can only be declared at the top level or inside a block.",
+ AwaitBindingIdentifier: "Can not use 'await' as identifier inside an async function.",
+ AwaitBindingIdentifierInStaticBlock: "Can not use 'await' as identifier inside a static block.",
+ AwaitExpressionFormalParameter: "'await' is not allowed in async function parameters.",
+ AwaitNotInAsyncContext: "'await' is only allowed within async functions and at the top levels of modules.",
+ AwaitNotInAsyncFunction: "'await' is only allowed within async functions.",
+ BadGetterArity: "A 'get' accesor must not have any formal parameters.",
+ BadSetterArity: "A 'set' accesor must have exactly one formal parameter.",
+ BadSetterRestParameter: "A 'set' accesor function argument must not be a rest parameter.",
+ ConstructorClassField: "Classes may not have a field named 'constructor'.",
+ ConstructorClassPrivateField: "Classes may not have a private field named '#constructor'.",
+ ConstructorIsAccessor: "Class constructor may not be an accessor.",
+ ConstructorIsAsync: "Constructor can't be an async function.",
+ ConstructorIsGenerator: "Constructor can't be a generator.",
+ DeclarationMissingInitializer: "'%0' require an initialization value.",
+ DecoratorBeforeExport: "Decorators must be placed *before* the 'export' keyword. You can set the 'decoratorsBeforeExport' option to false to use the 'export @decorator class {}' syntax.",
+ DecoratorConstructor: "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",
+ DecoratorExportClass: "Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead.",
+ DecoratorSemicolon: "Decorators must not be followed by a semicolon.",
+ DecoratorStaticBlock: "Decorators can't be used with a static block.",
+ DeletePrivateField: "Deleting a private field is not allowed.",
+ DestructureNamedImport: "ES2015 named imports do not destructure. Use another statement for destructuring after the import.",
+ DuplicateConstructor: "Duplicate constructor in the same class.",
+ DuplicateDefaultExport: "Only one default export allowed per module.",
+ DuplicateExport: "`%0` has already been exported. Exported identifiers must be unique.",
+ DuplicateProto: "Redefinition of __proto__ property.",
+ DuplicateRegExpFlags: "Duplicate regular expression flag.",
+ ElementAfterRest: "Rest element must be last element.",
+ EscapedCharNotAnIdentifier: "Invalid Unicode escape.",
+ ExportBindingIsString: "A string literal cannot be used as an exported binding without `from`.\n- Did you mean `export { '%0' as '%1' } from 'some-module'`?",
+ ExportDefaultFromAsIdentifier: "'from' is not allowed as an identifier after 'export default'.",
+ ForInOfLoopInitializer: "'%0' loop variable declaration may not have an initializer.",
+ ForOfAsync: "The left-hand side of a for-of loop may not be 'async'.",
+ ForOfLet: "The left-hand side of a for-of loop may not start with 'let'.",
+ GeneratorInSingleStatementContext: "Generators can only be declared at the top level or inside a block.",
+ IllegalBreakContinue: "Unsyntactic %0.",
+ IllegalLanguageModeDirective: "Illegal 'use strict' directive in function with non-simple parameter list.",
+ IllegalReturn: "'return' outside of function.",
+ ImportBindingIsString: 'A string literal cannot be used as an imported binding.\n- Did you mean `import { "%0" as foo }`?',
+ ImportCallArgumentTrailingComma: "Trailing comma is disallowed inside import(...) arguments.",
+ ImportCallArity: "`import()` requires exactly %0.",
+ ImportCallNotNewExpression: "Cannot use new with import(...).",
+ ImportCallSpreadArgument: "`...` is not allowed in `import()`.",
+ InvalidBigIntLiteral: "Invalid BigIntLiteral.",
+ InvalidCodePoint: "Code point out of bounds.",
+ InvalidDecimal: "Invalid decimal.",
+ InvalidDigit: "Expected number in radix %0.",
+ InvalidEscapeSequence: "Bad character escape sequence.",
+ InvalidEscapeSequenceTemplate: "Invalid escape sequence in template.",
+ InvalidEscapedReservedWord: "Escape sequence in keyword %0.",
+ InvalidIdentifier: "Invalid identifier %0.",
+ InvalidLhs: "Invalid left-hand side in %0.",
+ InvalidLhsBinding: "Binding invalid left-hand side in %0.",
+ InvalidNumber: "Invalid number.",
+ InvalidOrMissingExponent: "Floating-point numbers require a valid exponent after the 'e'.",
+ InvalidOrUnexpectedToken: "Unexpected character '%0'.",
+ InvalidParenthesizedAssignment: "Invalid parenthesized assignment pattern.",
+ InvalidPrivateFieldResolution: "Private name #%0 is not defined.",
+ InvalidPropertyBindingPattern: "Binding member expression.",
+ InvalidRecordProperty: "Only properties and spread elements are allowed in record definitions.",
+ InvalidRestAssignmentPattern: "Invalid rest operator's argument.",
+ LabelRedeclaration: "Label '%0' is already declared.",
+ LetInLexicalBinding: "'let' is not allowed to be used as a name in 'let' or 'const' declarations.",
+ LineTerminatorBeforeArrow: "No line break is allowed before '=>'.",
+ MalformedRegExpFlags: "Invalid regular expression flag.",
+ MissingClassName: "A class name is required.",
+ MissingEqInAssignment: "Only '=' operator can be used for specifying default value.",
+ MissingSemicolon: "Missing semicolon.",
+ MissingUnicodeEscape: "Expecting Unicode escape sequence \\uXXXX.",
+ MixingCoalesceWithLogical: "Nullish coalescing operator(??) requires parens when mixing with logical operators.",
+ ModuleAttributeDifferentFromType: "The only accepted module attribute is `type`.",
+ ModuleAttributeInvalidValue: "Only string literals are allowed as module attribute values.",
+ ModuleAttributesWithDuplicateKeys: 'Duplicate key "%0" is not allowed in module attributes.',
+ ModuleExportNameHasLoneSurrogate: "An export name cannot include a lone surrogate, found '\\u%0'.",
+ ModuleExportUndefined: "Export '%0' is not defined.",
+ MultipleDefaultsInSwitch: "Multiple default clauses.",
+ NewlineAfterThrow: "Illegal newline after throw.",
+ NoCatchOrFinally: "Missing catch or finally clause.",
+ NumberIdentifier: "Identifier directly after number.",
+ NumericSeparatorInEscapeSequence: "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",
+ ObsoleteAwaitStar: "'await*' has been removed from the async functions proposal. Use Promise.all() instead.",
+ OptionalChainingNoNew: "Constructors in/after an Optional Chain are not allowed.",
+ OptionalChainingNoTemplate: "Tagged Template Literals are not allowed in optionalChain.",
+ OverrideOnConstructor: "'override' modifier cannot appear on a constructor declaration.",
+ ParamDupe: "Argument name clash.",
+ PatternHasAccessor: "Object pattern can't contain getter or setter.",
+ PatternHasMethod: "Object pattern can't contain methods.",
+ PipeBodyIsTighter: "Unexpected %0 after pipeline body; any %0 expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",
+ PipeTopicRequiresHackPipes: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',
+ PipeTopicUnbound: "Topic reference is unbound; it must be inside a pipe body.",
+ PipeTopicUnconfiguredToken: 'Invalid topic token %0. In order to use %0 as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "%0" }.',
+ PipeTopicUnused: "Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",
+ PipeUnparenthesizedBody: "Hack-style pipe body cannot be an unparenthesized %0 expression; please wrap it in parentheses.",
+ PipelineBodyNoArrow: 'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',
+ PipelineBodySequenceExpression: "Pipeline body may not be a comma-separated sequence expression.",
+ PipelineHeadSequenceExpression: "Pipeline head should not be a comma-separated sequence expression.",
+ PipelineTopicUnused: "Pipeline is in topic style but does not use topic reference.",
+ PrimaryTopicNotAllowed: "Topic reference was used in a lexical context without topic binding.",
+ PrimaryTopicRequiresSmartPipeline: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',
+ PrivateInExpectedIn: "Private names are only allowed in property accesses (`obj.#%0`) or in `in` expressions (`#%0 in obj`).",
+ PrivateNameRedeclaration: "Duplicate private name #%0.",
+ RecordExpressionBarIncorrectEndSyntaxType: "Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
+ RecordExpressionBarIncorrectStartSyntaxType: "Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
+ RecordExpressionHashIncorrectStartSyntaxType: "Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",
+ RecordNoProto: "'__proto__' is not allowed in Record expressions.",
+ RestTrailingComma: "Unexpected trailing comma after rest element.",
+ SloppyFunction: "In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",
+ StaticPrototype: "Classes may not have static property named prototype.",
+ StrictDelete: "Deleting local variable in strict mode.",
+ StrictEvalArguments: "Assigning to '%0' in strict mode.",
+ StrictEvalArgumentsBinding: "Binding '%0' in strict mode.",
+ StrictFunction: "In strict mode code, functions can only be declared at top level or inside a block.",
+ StrictNumericEscape: "The only valid numeric escape in strict mode is '\\0'.",
+ StrictOctalLiteral: "Legacy octal literals are not allowed in strict mode.",
+ StrictWith: "'with' in strict mode.",
+ SuperNotAllowed: "`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",
+ SuperPrivateField: "Private fields can't be accessed on super.",
+ TrailingDecorator: "Decorators must be attached to a class element.",
+ TupleExpressionBarIncorrectEndSyntaxType: "Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
+ TupleExpressionBarIncorrectStartSyntaxType: "Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
+ TupleExpressionHashIncorrectStartSyntaxType: "Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",
+ UnexpectedArgumentPlaceholder: "Unexpected argument placeholder.",
+ UnexpectedAwaitAfterPipelineBody: 'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',
+ UnexpectedDigitAfterHash: "Unexpected digit after hash token.",
+ UnexpectedImportExport: "'import' and 'export' may only appear at the top level.",
+ UnexpectedKeyword: "Unexpected keyword '%0'.",
+ UnexpectedLeadingDecorator: "Leading decorators must be attached to a class declaration.",
+ UnexpectedLexicalDeclaration: "Lexical declaration cannot appear in a single-statement context.",
+ UnexpectedNewTarget: "`new.target` can only be used in functions or class properties.",
+ UnexpectedNumericSeparator: "A numeric separator is only allowed between two digits.",
+ UnexpectedPrivateField: "Private names can only be used as the name of a class element (i.e. class C { #p = 42; #m() {} } )\n or a property of member expression (i.e. this.#p).",
+ UnexpectedReservedWord: "Unexpected reserved word '%0'.",
+ UnexpectedSuper: "'super' is only allowed in object methods and classes.",
+ UnexpectedToken: "Unexpected token '%0'.",
+ UnexpectedTokenUnaryExponentiation: "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",
+ UnsupportedBind: "Binding should be performed on object property.",
+ UnsupportedDecoratorExport: "A decorated export must export a class declaration.",
+ UnsupportedDefaultExport: "Only expressions, functions or classes are allowed as the `default` export.",
+ UnsupportedImport: "`import` can only be used in `import()` or `import.meta`.",
+ UnsupportedMetaProperty: "The only valid meta property for %0 is %0.%1.",
+ UnsupportedParameterDecorator: "Decorators cannot be used to decorate parameters.",
+ UnsupportedPropertyDecorator: "Decorators cannot be used to decorate object literal properties.",
+ UnsupportedSuper: "'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",
+ UnterminatedComment: "Unterminated comment.",
+ UnterminatedRegExp: "Unterminated regular expression.",
+ UnterminatedString: "Unterminated string constant.",
+ UnterminatedTemplate: "Unterminated template.",
+ VarRedeclaration: "Identifier '%0' has already been declared.",
+ YieldBindingIdentifier: "Can not use 'yield' as identifier inside a generator.",
+ YieldInParameter: "Yield expression is not allowed in formal parameters.",
+ ZeroDigitNumericSeparator: "Numeric separator can not be used after leading 0."
+}, ErrorCodes.SyntaxError);
+const SourceTypeModuleErrorMessages = makeErrorTemplates({
+ ImportMetaOutsideModule: `import.meta may appear only with 'sourceType: "module"'`,
+ ImportOutsideModule: `'import' and 'export' may appear only with 'sourceType: "module"'`
+}, ErrorCodes.SourceTypeModuleError);
+
+function keepReasonCodeCompat(reasonCode, syntaxPlugin) {
+ {
+ if (syntaxPlugin === "flow" && reasonCode === "PatternIsOptional") {
+ return "OptionalBindingPattern";
+ }
+ }
+ return reasonCode;
+}
+
+function makeErrorTemplates(messages, code, syntaxPlugin) {
+ const templates = {};
+ Object.keys(messages).forEach(reasonCode => {
+ templates[reasonCode] = Object.freeze({
+ code,
+ reasonCode: keepReasonCodeCompat(reasonCode, syntaxPlugin),
+ template: messages[reasonCode]
+ });
+ });
+ return Object.freeze(templates);
+}
+class ParserError extends CommentsParser {
+ getLocationForPosition(pos) {
+ let loc;
+ if (pos === this.state.start) loc = this.state.startLoc;else if (pos === this.state.lastTokStart) loc = this.state.lastTokStartLoc;else if (pos === this.state.end) loc = this.state.endLoc;else if (pos === this.state.lastTokEnd) loc = this.state.lastTokEndLoc;else loc = getLineInfo(this.input, pos);
+ return loc;
+ }
+
+ raise(pos, {
+ code,
+ reasonCode,
+ template
+ }, ...params) {
+ return this.raiseWithData(pos, {
+ code,
+ reasonCode
+ }, template, ...params);
+ }
+
+ raiseOverwrite(pos, {
+ code,
+ template
+ }, ...params) {
+ const loc = this.getLocationForPosition(pos);
+ const message = template.replace(/%(\d+)/g, (_, i) => params[i]) + ` (${loc.line}:${loc.column})`;
+
+ if (this.options.errorRecovery) {
+ const errors = this.state.errors;
+
+ for (let i = errors.length - 1; i >= 0; i--) {
+ const error = errors[i];
+
+ if (error.pos === pos) {
+ return Object.assign(error, {
+ message
+ });
+ } else if (error.pos < pos) {
+ break;
+ }
+ }
+ }
+
+ return this._raise({
+ code,
+ loc,
+ pos
+ }, message);
+ }
+
+ raiseWithData(pos, data, errorTemplate, ...params) {
+ const loc = this.getLocationForPosition(pos);
+ const message = errorTemplate.replace(/%(\d+)/g, (_, i) => params[i]) + ` (${loc.line}:${loc.column})`;
+ return this._raise(Object.assign({
+ loc,
+ pos
+ }, data), message);
+ }
+
+ _raise(errorContext, message) {
+ const err = new SyntaxError(message);
+ Object.assign(err, errorContext);
+
+ if (this.options.errorRecovery) {
+ if (!this.isLookahead) this.state.errors.push(err);
+ return err;
+ } else {
+ throw err;
+ }
+ }
+
+}
+
+var estree = (superClass => class extends superClass {
+ parseRegExpLiteral({
+ pattern,
+ flags
+ }) {
+ let regex = null;
+
+ try {
+ regex = new RegExp(pattern, flags);
+ } catch (e) {}
+
+ const node = this.estreeParseLiteral(regex);
+ node.regex = {
+ pattern,
+ flags
+ };
+ return node;
+ }
+
+ parseBigIntLiteral(value) {
+ let bigInt;
+
+ try {
+ bigInt = BigInt(value);
+ } catch (_unused) {
+ bigInt = null;
+ }
+
+ const node = this.estreeParseLiteral(bigInt);
+ node.bigint = String(node.value || value);
+ return node;
+ }
+
+ parseDecimalLiteral(value) {
+ const decimal = null;
+ const node = this.estreeParseLiteral(decimal);
+ node.decimal = String(node.value || value);
+ return node;
+ }
+
+ estreeParseLiteral(value) {
+ return this.parseLiteral(value, "Literal");
+ }
+
+ parseStringLiteral(value) {
+ return this.estreeParseLiteral(value);
+ }
+
+ parseNumericLiteral(value) {
+ return this.estreeParseLiteral(value);
+ }
+
+ parseNullLiteral() {
+ return this.estreeParseLiteral(null);
+ }
+
+ parseBooleanLiteral(value) {
+ return this.estreeParseLiteral(value);
+ }
+
+ directiveToStmt(directive) {
+ const directiveLiteral = directive.value;
+ const stmt = this.startNodeAt(directive.start, directive.loc.start);
+ const expression = this.startNodeAt(directiveLiteral.start, directiveLiteral.loc.start);
+ expression.value = directiveLiteral.extra.expressionValue;
+ expression.raw = directiveLiteral.extra.raw;
+ stmt.expression = this.finishNodeAt(expression, "Literal", directiveLiteral.end, directiveLiteral.loc.end);
+ stmt.directive = directiveLiteral.extra.raw.slice(1, -1);
+ return this.finishNodeAt(stmt, "ExpressionStatement", directive.end, directive.loc.end);
+ }
+
+ initFunction(node, isAsync) {
+ super.initFunction(node, isAsync);
+ node.expression = false;
+ }
+
+ checkDeclaration(node) {
+ if (node != null && this.isObjectProperty(node)) {
+ this.checkDeclaration(node.value);
+ } else {
+ super.checkDeclaration(node);
+ }
+ }
+
+ getObjectOrClassMethodParams(method) {
+ return method.value.params;
+ }
+
+ isValidDirective(stmt) {
+ var _stmt$expression$extr;
+
+ return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && typeof stmt.expression.value === "string" && !((_stmt$expression$extr = stmt.expression.extra) != null && _stmt$expression$extr.parenthesized);
+ }
+
+ stmtToDirective(stmt) {
+ const value = stmt.expression.value;
+ const directive = super.stmtToDirective(stmt);
+ this.addExtra(directive.value, "expressionValue", value);
+ return directive;
+ }
+
+ parseBlockBody(node, ...args) {
+ super.parseBlockBody(node, ...args);
+ const directiveStatements = node.directives.map(d => this.directiveToStmt(d));
+ node.body = directiveStatements.concat(node.body);
+ delete node.directives;
+ }
+
+ pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
+ this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true);
+
+ if (method.typeParameters) {
+ method.value.typeParameters = method.typeParameters;
+ delete method.typeParameters;
+ }
+
+ classBody.body.push(method);
+ }
+
+ parsePrivateName() {
+ const node = super.parsePrivateName();
+
+ if (!this.getPluginOption("estree", "classFeatures")) {
+ return node;
+ }
+
+ return this.convertPrivateNameToPrivateIdentifier(node);
+ }
+
+ convertPrivateNameToPrivateIdentifier(node) {
+ const name = super.getPrivateNameSV(node);
+ node = node;
+ delete node.id;
+ node.name = name;
+ node.type = "PrivateIdentifier";
+ return node;
+ }
+
+ isPrivateName(node) {
+ if (!this.getPluginOption("estree", "classFeatures")) {
+ return super.isPrivateName(node);
+ }
+
+ return node.type === "PrivateIdentifier";
+ }
+
+ getPrivateNameSV(node) {
+ if (!this.getPluginOption("estree", "classFeatures")) {
+ return super.getPrivateNameSV(node);
+ }
+
+ return node.name;
+ }
+
+ parseLiteral(value, type) {
+ const node = super.parseLiteral(value, type);
+ node.raw = node.extra.raw;
+ delete node.extra;
+ return node;
+ }
+
+ parseFunctionBody(node, allowExpression, isMethod = false) {
+ super.parseFunctionBody(node, allowExpression, isMethod);
+ node.expression = node.body.type !== "BlockStatement";
+ }
+
+ parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) {
+ let funcNode = this.startNode();
+ funcNode.kind = node.kind;
+ funcNode = super.parseMethod(funcNode, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope);
+ funcNode.type = "FunctionExpression";
+ delete funcNode.kind;
+ node.value = funcNode;
+
+ if (type === "ClassPrivateMethod") {
+ node.computed = false;
+ }
+
+ type = "MethodDefinition";
+ return this.finishNode(node, type);
+ }
+
+ parseClassProperty(...args) {
+ const propertyNode = super.parseClassProperty(...args);
+
+ if (this.getPluginOption("estree", "classFeatures")) {
+ propertyNode.type = "PropertyDefinition";
+ }
+
+ return propertyNode;
+ }
+
+ parseClassPrivateProperty(...args) {
+ const propertyNode = super.parseClassPrivateProperty(...args);
+
+ if (this.getPluginOption("estree", "classFeatures")) {
+ propertyNode.type = "PropertyDefinition";
+ propertyNode.computed = false;
+ }
+
+ return propertyNode;
+ }
+
+ parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) {
+ const node = super.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor);
+
+ if (node) {
+ node.type = "Property";
+ if (node.kind === "method") node.kind = "init";
+ node.shorthand = false;
+ }
+
+ return node;
+ }
+
+ parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors) {
+ const node = super.parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors);
+
+ if (node) {
+ node.kind = "init";
+ node.type = "Property";
+ }
+
+ return node;
+ }
+
+ isAssignable(node, isBinding) {
+ if (node != null && this.isObjectProperty(node)) {
+ return this.isAssignable(node.value, isBinding);
+ }
+
+ return super.isAssignable(node, isBinding);
+ }
+
+ toAssignable(node, isLHS = false) {
+ if (node != null && this.isObjectProperty(node)) {
+ this.toAssignable(node.value, isLHS);
+ return node;
+ }
+
+ return super.toAssignable(node, isLHS);
+ }
+
+ toAssignableObjectExpressionProp(prop, ...args) {
+ if (prop.kind === "get" || prop.kind === "set") {
+ this.raise(prop.key.start, ErrorMessages.PatternHasAccessor);
+ } else if (prop.method) {
+ this.raise(prop.key.start, ErrorMessages.PatternHasMethod);
+ } else {
+ super.toAssignableObjectExpressionProp(prop, ...args);
+ }
+ }
+
+ finishCallExpression(node, optional) {
+ super.finishCallExpression(node, optional);
+
+ if (node.callee.type === "Import") {
+ node.type = "ImportExpression";
+ node.source = node.arguments[0];
+
+ if (this.hasPlugin("importAssertions")) {
+ var _node$arguments$;
+
+ node.attributes = (_node$arguments$ = node.arguments[1]) != null ? _node$arguments$ : null;
+ }
+
+ delete node.arguments;
+ delete node.callee;
+ }
+
+ return node;
+ }
+
+ toReferencedArguments(node) {
+ if (node.type === "ImportExpression") {
+ return;
+ }
+
+ super.toReferencedArguments(node);
+ }
+
+ parseExport(node) {
+ super.parseExport(node);
+
+ switch (node.type) {
+ case "ExportAllDeclaration":
+ node.exported = null;
+ break;
+
+ case "ExportNamedDeclaration":
+ if (node.specifiers.length === 1 && node.specifiers[0].type === "ExportNamespaceSpecifier") {
+ node.type = "ExportAllDeclaration";
+ node.exported = node.specifiers[0].exported;
+ delete node.specifiers;
+ }
+
+ break;
+ }
+
+ return node;
+ }
+
+ parseSubscript(base, startPos, startLoc, noCalls, state) {
+ const node = super.parseSubscript(base, startPos, startLoc, noCalls, state);
+
+ if (state.optionalChainMember) {
+ if (node.type === "OptionalMemberExpression" || node.type === "OptionalCallExpression") {
+ node.type = node.type.substring(8);
+ }
+
+ if (state.stop) {
+ const chain = this.startNodeAtNode(node);
+ chain.expression = node;
+ return this.finishNode(chain, "ChainExpression");
+ }
+ } else if (node.type === "MemberExpression" || node.type === "CallExpression") {
+ node.optional = false;
+ }
+
+ return node;
+ }
+
+ hasPropertyAsPrivateName(node) {
+ if (node.type === "ChainExpression") {
+ node = node.expression;
+ }
+
+ return super.hasPropertyAsPrivateName(node);
+ }
+
+ isOptionalChain(node) {
+ return node.type === "ChainExpression";
+ }
+
+ isObjectProperty(node) {
+ return node.type === "Property" && node.kind === "init" && !node.method;
+ }
+
+ isObjectMethod(node) {
+ return node.method || node.kind === "get" || node.kind === "set";
+ }
+
+});
+
+class TokContext {
+ constructor(token, preserveSpace) {
+ this.token = void 0;
+ this.preserveSpace = void 0;
+ this.token = token;
+ this.preserveSpace = !!preserveSpace;
+ }
+
+}
+const types = {
+ brace: new TokContext("{"),
+ template: new TokContext("`", true)
+};
+
+const beforeExpr = true;
+const startsExpr = true;
+const isLoop = true;
+const isAssign = true;
+const prefix = true;
+const postfix = true;
+class ExportedTokenType {
+ constructor(label, conf = {}) {
+ this.label = void 0;
+ this.keyword = void 0;
+ this.beforeExpr = void 0;
+ this.startsExpr = void 0;
+ this.rightAssociative = void 0;
+ this.isLoop = void 0;
+ this.isAssign = void 0;
+ this.prefix = void 0;
+ this.postfix = void 0;
+ this.binop = void 0;
+ this.label = label;
+ this.keyword = conf.keyword;
+ this.beforeExpr = !!conf.beforeExpr;
+ this.startsExpr = !!conf.startsExpr;
+ this.rightAssociative = !!conf.rightAssociative;
+ this.isLoop = !!conf.isLoop;
+ this.isAssign = !!conf.isAssign;
+ this.prefix = !!conf.prefix;
+ this.postfix = !!conf.postfix;
+ this.binop = conf.binop != null ? conf.binop : null;
+ {
+ this.updateContext = null;
+ }
+ }
+
+}
+const keywords$1 = new Map();
+
+function createKeyword(name, options = {}) {
+ options.keyword = name;
+ const token = createToken(name, options);
+ keywords$1.set(name, token);
+ return token;
+}
+
+function createBinop(name, binop) {
+ return createToken(name, {
+ beforeExpr,
+ binop
+ });
+}
+
+let tokenTypeCounter = -1;
+const tokenTypes = [];
+const tokenLabels = [];
+const tokenBinops = [];
+const tokenBeforeExprs = [];
+const tokenStartsExprs = [];
+const tokenPrefixes = [];
+
+function createToken(name, options = {}) {
+ var _options$binop, _options$beforeExpr, _options$startsExpr, _options$prefix;
+
+ ++tokenTypeCounter;
+ tokenLabels.push(name);
+ tokenBinops.push((_options$binop = options.binop) != null ? _options$binop : -1);
+ tokenBeforeExprs.push((_options$beforeExpr = options.beforeExpr) != null ? _options$beforeExpr : false);
+ tokenStartsExprs.push((_options$startsExpr = options.startsExpr) != null ? _options$startsExpr : false);
+ tokenPrefixes.push((_options$prefix = options.prefix) != null ? _options$prefix : false);
+ tokenTypes.push(new ExportedTokenType(name, options));
+ return tokenTypeCounter;
+}
+
+const tt = {
+ num: createToken("num", {
+ startsExpr
+ }),
+ bigint: createToken("bigint", {
+ startsExpr
+ }),
+ decimal: createToken("decimal", {
+ startsExpr
+ }),
+ regexp: createToken("regexp", {
+ startsExpr
+ }),
+ string: createToken("string", {
+ startsExpr
+ }),
+ name: createToken("name", {
+ startsExpr
+ }),
+ privateName: createToken("#name", {
+ startsExpr
+ }),
+ eof: createToken("eof"),
+ bracketL: createToken("[", {
+ beforeExpr,
+ startsExpr
+ }),
+ bracketHashL: createToken("#[", {
+ beforeExpr,
+ startsExpr
+ }),
+ bracketBarL: createToken("[|", {
+ beforeExpr,
+ startsExpr
+ }),
+ bracketR: createToken("]"),
+ bracketBarR: createToken("|]"),
+ braceL: createToken("{", {
+ beforeExpr,
+ startsExpr
+ }),
+ braceBarL: createToken("{|", {
+ beforeExpr,
+ startsExpr
+ }),
+ braceHashL: createToken("#{", {
+ beforeExpr,
+ startsExpr
+ }),
+ braceR: createToken("}", {
+ beforeExpr
+ }),
+ braceBarR: createToken("|}"),
+ parenL: createToken("(", {
+ beforeExpr,
+ startsExpr
+ }),
+ parenR: createToken(")"),
+ comma: createToken(",", {
+ beforeExpr
+ }),
+ semi: createToken(";", {
+ beforeExpr
+ }),
+ colon: createToken(":", {
+ beforeExpr
+ }),
+ doubleColon: createToken("::", {
+ beforeExpr
+ }),
+ dot: createToken("."),
+ question: createToken("?", {
+ beforeExpr
+ }),
+ questionDot: createToken("?."),
+ arrow: createToken("=>", {
+ beforeExpr
+ }),
+ template: createToken("template"),
+ ellipsis: createToken("...", {
+ beforeExpr
+ }),
+ backQuote: createToken("`", {
+ startsExpr
+ }),
+ dollarBraceL: createToken("${", {
+ beforeExpr,
+ startsExpr
+ }),
+ at: createToken("@"),
+ hash: createToken("#", {
+ startsExpr
+ }),
+ interpreterDirective: createToken("#!..."),
+ eq: createToken("=", {
+ beforeExpr,
+ isAssign
+ }),
+ assign: createToken("_=", {
+ beforeExpr,
+ isAssign
+ }),
+ slashAssign: createToken("_=", {
+ beforeExpr,
+ isAssign
+ }),
+ moduloAssign: createToken("_=", {
+ beforeExpr,
+ isAssign
+ }),
+ incDec: createToken("++/--", {
+ prefix,
+ postfix,
+ startsExpr
+ }),
+ bang: createToken("!", {
+ beforeExpr,
+ prefix,
+ startsExpr
+ }),
+ tilde: createToken("~", {
+ beforeExpr,
+ prefix,
+ startsExpr
+ }),
+ pipeline: createBinop("|>", 0),
+ nullishCoalescing: createBinop("??", 1),
+ logicalOR: createBinop("||", 1),
+ logicalAND: createBinop("&&", 2),
+ bitwiseOR: createBinop("|", 3),
+ bitwiseXOR: createBinop("^", 4),
+ bitwiseAND: createBinop("&", 5),
+ equality: createBinop("==/!=/===/!==", 6),
+ relational: createBinop("</>/<=/>=", 7),
+ bitShift: createBinop("<</>>/>>>", 8),
+ plusMin: createToken("+/-", {
+ beforeExpr,
+ binop: 9,
+ prefix,
+ startsExpr
+ }),
+ modulo: createToken("%", {
+ binop: 10,
+ startsExpr
+ }),
+ star: createToken("*", {
+ binop: 10
+ }),
+ slash: createBinop("/", 10),
+ exponent: createToken("**", {
+ beforeExpr,
+ binop: 11,
+ rightAssociative: true
+ }),
+ _in: createKeyword("in", {
+ beforeExpr,
+ binop: 7
+ }),
+ _instanceof: createKeyword("instanceof", {
+ beforeExpr,
+ binop: 7
+ }),
+ _break: createKeyword("break"),
+ _case: createKeyword("case", {
+ beforeExpr
+ }),
+ _catch: createKeyword("catch"),
+ _continue: createKeyword("continue"),
+ _debugger: createKeyword("debugger"),
+ _default: createKeyword("default", {
+ beforeExpr
+ }),
+ _else: createKeyword("else", {
+ beforeExpr
+ }),
+ _finally: createKeyword("finally"),
+ _function: createKeyword("function", {
+ startsExpr
+ }),
+ _if: createKeyword("if"),
+ _return: createKeyword("return", {
+ beforeExpr
+ }),
+ _switch: createKeyword("switch"),
+ _throw: createKeyword("throw", {
+ beforeExpr,
+ prefix,
+ startsExpr
+ }),
+ _try: createKeyword("try"),
+ _var: createKeyword("var"),
+ _const: createKeyword("const"),
+ _with: createKeyword("with"),
+ _new: createKeyword("new", {
+ beforeExpr,
+ startsExpr
+ }),
+ _this: createKeyword("this", {
+ startsExpr
+ }),
+ _super: createKeyword("super", {
+ startsExpr
+ }),
+ _class: createKeyword("class", {
+ startsExpr
+ }),
+ _extends: createKeyword("extends", {
+ beforeExpr
+ }),
+ _export: createKeyword("export"),
+ _import: createKeyword("import", {
+ startsExpr
+ }),
+ _null: createKeyword("null", {
+ startsExpr
+ }),
+ _true: createKeyword("true", {
+ startsExpr
+ }),
+ _false: createKeyword("false", {
+ startsExpr
+ }),
+ _typeof: createKeyword("typeof", {
+ beforeExpr,
+ prefix,
+ startsExpr
+ }),
+ _void: createKeyword("void", {
+ beforeExpr,
+ prefix,
+ startsExpr
+ }),
+ _delete: createKeyword("delete", {
+ beforeExpr,
+ prefix,
+ startsExpr
+ }),
+ _do: createKeyword("do", {
+ isLoop,
+ beforeExpr
+ }),
+ _for: createKeyword("for", {
+ isLoop
+ }),
+ _while: createKeyword("while", {
+ isLoop
+ }),
+ jsxName: createToken("jsxName"),
+ jsxText: createToken("jsxText", {
+ beforeExpr: true
+ }),
+ jsxTagStart: createToken("jsxTagStart", {
+ startsExpr: true
+ }),
+ jsxTagEnd: createToken("jsxTagEnd"),
+ placeholder: createToken("%%", {
+ startsExpr: true
+ })
+};
+function tokenComesBeforeExpression(token) {
+ return tokenBeforeExprs[token];
+}
+function tokenCanStartExpression(token) {
+ return tokenStartsExprs[token];
+}
+function tokenIsAssignment(token) {
+ return token >= 35 && token <= 38;
+}
+function tokenIsLoop(token) {
+ return token >= 89 && token <= 91;
+}
+function tokenIsKeyword(token) {
+ return token >= 57 && token <= 91;
+}
+function tokenIsOperator(token) {
+ return token >= 42 && token <= 58;
+}
+function tokenIsPostfix(token) {
+ return token === 39;
+}
+function tokenIsPrefix(token) {
+ return tokenPrefixes[token];
+}
+function tokenLabelName(token) {
+ return tokenLabels[token];
+}
+function tokenOperatorPrecedence(token) {
+ return tokenBinops[token];
+}
+function tokenIsRightAssociative(token) {
+ return token === 56;
+}
+function getExportedToken(token) {
+ return tokenTypes[token];
+}
+function isTokenType(obj) {
+ return typeof obj === "number";
+}
+{
+ tokenTypes[16].updateContext = context => {
+ context.pop();
+ };
+
+ tokenTypes[13].updateContext = tokenTypes[15].updateContext = tokenTypes[31].updateContext = context => {
+ context.push(types.brace);
+ };
+
+ tokenTypes[30].updateContext = context => {
+ if (context[context.length - 1] === types.template) {
+ context.pop();
+ } else {
+ context.push(types.template);
+ }
+ };
+
+ tokenTypes[94].updateContext = context => {
+ context.push(types.j_expr, types.j_oTag);
+ };
+}
+
+let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
+let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f";
+const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
+const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
+nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
+const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1070, 4050, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 46, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 482, 44, 11, 6, 17, 0, 322, 29, 19, 43, 1269, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4152, 8, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938];
+const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 357, 0, 62, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
+
+function isInAstralSet(code, set) {
+ let pos = 0x10000;
+
+ for (let i = 0, length = set.length; i < length; i += 2) {
+ pos += set[i];
+ if (pos > code) return false;
+ pos += set[i + 1];
+ if (pos >= code) return true;
+ }
+
+ return false;
+}
+
+function isIdentifierStart(code) {
+ if (code < 65) return code === 36;
+ if (code <= 90) return true;
+ if (code < 97) return code === 95;
+ if (code <= 122) return true;
+
+ if (code <= 0xffff) {
+ return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));
+ }
+
+ return isInAstralSet(code, astralIdentifierStartCodes);
+}
+function isIdentifierChar(code) {
+ if (code < 48) return code === 36;
+ if (code < 58) return true;
+ if (code < 65) return false;
+ if (code <= 90) return true;
+ if (code < 97) return code === 95;
+ if (code <= 122) return true;
+
+ if (code <= 0xffff) {
+ return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));
+ }
+
+ return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
+}
+
+const reservedWords = {
+ keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"],
+ strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
+ strictBind: ["eval", "arguments"]
+};
+const keywords = new Set(reservedWords.keyword);
+const reservedWordsStrictSet = new Set(reservedWords.strict);
+const reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
+function isReservedWord(word, inModule) {
+ return inModule && word === "await" || word === "enum";
+}
+function isStrictReservedWord(word, inModule) {
+ return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
+}
+function isStrictBindOnlyReservedWord(word) {
+ return reservedWordsStrictBindSet.has(word);
+}
+function isStrictBindReservedWord(word, inModule) {
+ return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
+}
+function isKeyword(word) {
+ return keywords.has(word);
+}
+
+function isIteratorStart(current, next) {
+ return current === 64 && next === 64;
+}
+const reservedWordLikeSet = new Set(["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete", "implements", "interface", "let", "package", "private", "protected", "public", "static", "yield", "eval", "arguments", "enum", "await"]);
+function canBeReservedWord(word) {
+ return reservedWordLikeSet.has(word);
+}
+
+const SCOPE_OTHER = 0b000000000,
+ SCOPE_PROGRAM = 0b000000001,
+ SCOPE_FUNCTION = 0b000000010,
+ SCOPE_ARROW = 0b000000100,
+ SCOPE_SIMPLE_CATCH = 0b000001000,
+ SCOPE_SUPER = 0b000010000,
+ SCOPE_DIRECT_SUPER = 0b000100000,
+ SCOPE_CLASS = 0b001000000,
+ SCOPE_STATIC_BLOCK = 0b010000000,
+ SCOPE_TS_MODULE = 0b100000000,
+ SCOPE_VAR = SCOPE_PROGRAM | SCOPE_FUNCTION | SCOPE_TS_MODULE;
+const BIND_KIND_VALUE = 0b000000000001,
+ BIND_KIND_TYPE = 0b000000000010,
+ BIND_SCOPE_VAR = 0b000000000100,
+ BIND_SCOPE_LEXICAL = 0b000000001000,
+ BIND_SCOPE_FUNCTION = 0b000000010000,
+ BIND_FLAGS_NONE = 0b000001000000,
+ BIND_FLAGS_CLASS = 0b000010000000,
+ BIND_FLAGS_TS_ENUM = 0b000100000000,
+ BIND_FLAGS_TS_CONST_ENUM = 0b001000000000,
+ BIND_FLAGS_TS_EXPORT_ONLY = 0b010000000000,
+ BIND_FLAGS_FLOW_DECLARE_FN = 0b100000000000;
+const BIND_CLASS = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_CLASS,
+ BIND_LEXICAL = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | 0,
+ BIND_VAR = BIND_KIND_VALUE | 0 | BIND_SCOPE_VAR | 0,
+ BIND_FUNCTION = BIND_KIND_VALUE | 0 | BIND_SCOPE_FUNCTION | 0,
+ BIND_TS_INTERFACE = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_CLASS,
+ BIND_TS_TYPE = 0 | BIND_KIND_TYPE | 0 | 0,
+ BIND_TS_ENUM = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_TS_ENUM,
+ BIND_TS_AMBIENT = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY,
+ BIND_NONE = 0 | 0 | 0 | BIND_FLAGS_NONE,
+ BIND_OUTSIDE = BIND_KIND_VALUE | 0 | 0 | BIND_FLAGS_NONE,
+ BIND_TS_CONST_ENUM = BIND_TS_ENUM | BIND_FLAGS_TS_CONST_ENUM,
+ BIND_TS_NAMESPACE = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY,
+ BIND_FLOW_DECLARE_FN = BIND_FLAGS_FLOW_DECLARE_FN;
+const CLASS_ELEMENT_FLAG_STATIC = 0b100,
+ CLASS_ELEMENT_KIND_GETTER = 0b010,
+ CLASS_ELEMENT_KIND_SETTER = 0b001,
+ CLASS_ELEMENT_KIND_ACCESSOR = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_KIND_SETTER;
+const CLASS_ELEMENT_STATIC_GETTER = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_FLAG_STATIC,
+ CLASS_ELEMENT_STATIC_SETTER = CLASS_ELEMENT_KIND_SETTER | CLASS_ELEMENT_FLAG_STATIC,
+ CLASS_ELEMENT_INSTANCE_GETTER = CLASS_ELEMENT_KIND_GETTER,
+ CLASS_ELEMENT_INSTANCE_SETTER = CLASS_ELEMENT_KIND_SETTER,
+ CLASS_ELEMENT_OTHER = 0;
+
+class Scope {
+ constructor(flags) {
+ this.var = new Set();
+ this.lexical = new Set();
+ this.functions = new Set();
+ this.flags = flags;
+ }
+
+}
+class ScopeHandler {
+ constructor(raise, inModule) {
+ this.scopeStack = [];
+ this.undefinedExports = new Map();
+ this.undefinedPrivateNames = new Map();
+ this.raise = raise;
+ this.inModule = inModule;
+ }
+
+ get inFunction() {
+ return (this.currentVarScopeFlags() & SCOPE_FUNCTION) > 0;
+ }
+
+ get allowSuper() {
+ return (this.currentThisScopeFlags() & SCOPE_SUPER) > 0;
+ }
+
+ get allowDirectSuper() {
+ return (this.currentThisScopeFlags() & SCOPE_DIRECT_SUPER) > 0;
+ }
+
+ get inClass() {
+ return (this.currentThisScopeFlags() & SCOPE_CLASS) > 0;
+ }
+
+ get inClassAndNotInNonArrowFunction() {
+ const flags = this.currentThisScopeFlags();
+ return (flags & SCOPE_CLASS) > 0 && (flags & SCOPE_FUNCTION) === 0;
+ }
+
+ get inStaticBlock() {
+ for (let i = this.scopeStack.length - 1;; i--) {
+ const {
+ flags
+ } = this.scopeStack[i];
+
+ if (flags & SCOPE_STATIC_BLOCK) {
+ return true;
+ }
+
+ if (flags & (SCOPE_VAR | SCOPE_CLASS)) {
+ return false;
+ }
+ }
+ }
+
+ get inNonArrowFunction() {
+ return (this.currentThisScopeFlags() & SCOPE_FUNCTION) > 0;
+ }
+
+ get treatFunctionsAsVar() {
+ return this.treatFunctionsAsVarInScope(this.currentScope());
+ }
+
+ createScope(flags) {
+ return new Scope(flags);
+ }
+
+ enter(flags) {
+ this.scopeStack.push(this.createScope(flags));
+ }
+
+ exit() {
+ this.scopeStack.pop();
+ }
+
+ treatFunctionsAsVarInScope(scope) {
+ return !!(scope.flags & SCOPE_FUNCTION || !this.inModule && scope.flags & SCOPE_PROGRAM);
+ }
+
+ declareName(name, bindingType, pos) {
+ let scope = this.currentScope();
+
+ if (bindingType & BIND_SCOPE_LEXICAL || bindingType & BIND_SCOPE_FUNCTION) {
+ this.checkRedeclarationInScope(scope, name, bindingType, pos);
+
+ if (bindingType & BIND_SCOPE_FUNCTION) {
+ scope.functions.add(name);
+ } else {
+ scope.lexical.add(name);
+ }
+
+ if (bindingType & BIND_SCOPE_LEXICAL) {
+ this.maybeExportDefined(scope, name);
+ }
+ } else if (bindingType & BIND_SCOPE_VAR) {
+ for (let i = this.scopeStack.length - 1; i >= 0; --i) {
+ scope = this.scopeStack[i];
+ this.checkRedeclarationInScope(scope, name, bindingType, pos);
+ scope.var.add(name);
+ this.maybeExportDefined(scope, name);
+ if (scope.flags & SCOPE_VAR) break;
+ }
+ }
+
+ if (this.inModule && scope.flags & SCOPE_PROGRAM) {
+ this.undefinedExports.delete(name);
+ }
+ }
+
+ maybeExportDefined(scope, name) {
+ if (this.inModule && scope.flags & SCOPE_PROGRAM) {
+ this.undefinedExports.delete(name);
+ }
+ }
+
+ checkRedeclarationInScope(scope, name, bindingType, pos) {
+ if (this.isRedeclaredInScope(scope, name, bindingType)) {
+ this.raise(pos, ErrorMessages.VarRedeclaration, name);
+ }
+ }
+
+ isRedeclaredInScope(scope, name, bindingType) {
+ if (!(bindingType & BIND_KIND_VALUE)) return false;
+
+ if (bindingType & BIND_SCOPE_LEXICAL) {
+ return scope.lexical.has(name) || scope.functions.has(name) || scope.var.has(name);
+ }
+
+ if (bindingType & BIND_SCOPE_FUNCTION) {
+ return scope.lexical.has(name) || !this.treatFunctionsAsVarInScope(scope) && scope.var.has(name);
+ }
+
+ return scope.lexical.has(name) && !(scope.flags & SCOPE_SIMPLE_CATCH && scope.lexical.values().next().value === name) || !this.treatFunctionsAsVarInScope(scope) && scope.functions.has(name);
+ }
+
+ checkLocalExport(id) {
+ const {
+ name
+ } = id;
+ const topLevelScope = this.scopeStack[0];
+
+ if (!topLevelScope.lexical.has(name) && !topLevelScope.var.has(name) && !topLevelScope.functions.has(name)) {
+ this.undefinedExports.set(name, id.start);
+ }
+ }
+
+ currentScope() {
+ return this.scopeStack[this.scopeStack.length - 1];
+ }
+
+ currentVarScopeFlags() {
+ for (let i = this.scopeStack.length - 1;; i--) {
+ const {
+ flags
+ } = this.scopeStack[i];
+
+ if (flags & SCOPE_VAR) {
+ return flags;
+ }
+ }
+ }
+
+ currentThisScopeFlags() {
+ for (let i = this.scopeStack.length - 1;; i--) {
+ const {
+ flags
+ } = this.scopeStack[i];
+
+ if (flags & (SCOPE_VAR | SCOPE_CLASS) && !(flags & SCOPE_ARROW)) {
+ return flags;
+ }
+ }
+ }
+
+}
+
+class FlowScope extends Scope {
+ constructor(...args) {
+ super(...args);
+ this.declareFunctions = new Set();
+ }
+
+}
+
+class FlowScopeHandler extends ScopeHandler {
+ createScope(flags) {
+ return new FlowScope(flags);
+ }
+
+ declareName(name, bindingType, pos) {
+ const scope = this.currentScope();
+
+ if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) {
+ this.checkRedeclarationInScope(scope, name, bindingType, pos);
+ this.maybeExportDefined(scope, name);
+ scope.declareFunctions.add(name);
+ return;
+ }
+
+ super.declareName(...arguments);
+ }
+
+ isRedeclaredInScope(scope, name, bindingType) {
+ if (super.isRedeclaredInScope(...arguments)) return true;
+
+ if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) {
+ return !scope.declareFunctions.has(name) && (scope.lexical.has(name) || scope.functions.has(name));
+ }
+
+ return false;
+ }
+
+ checkLocalExport(id) {
+ if (!this.scopeStack[0].declareFunctions.has(id.name)) {
+ super.checkLocalExport(id);
+ }
+ }
+
+}
+
+class State {
+ constructor() {
+ this.strict = void 0;
+ this.curLine = void 0;
+ this.startLoc = void 0;
+ this.endLoc = void 0;
+ this.errors = [];
+ this.potentialArrowAt = -1;
+ this.noArrowAt = [];
+ this.noArrowParamsConversionAt = [];
+ this.maybeInArrowParameters = false;
+ this.inType = false;
+ this.noAnonFunctionType = false;
+ this.inPropertyName = false;
+ this.hasFlowComment = false;
+ this.isAmbientContext = false;
+ this.inAbstractClass = false;
+ this.topicContext = {
+ maxNumOfResolvableTopics: 0,
+ maxTopicIndex: null
+ };
+ this.soloAwait = false;
+ this.inFSharpPipelineDirectBody = false;
+ this.labels = [];
+ this.decoratorStack = [[]];
+ this.comments = [];
+ this.commentStack = [];
+ this.pos = 0;
+ this.lineStart = 0;
+ this.type = 7;
+ this.value = null;
+ this.start = 0;
+ this.end = 0;
+ this.lastTokEndLoc = null;
+ this.lastTokStartLoc = null;
+ this.lastTokStart = 0;
+ this.lastTokEnd = 0;
+ this.context = [types.brace];
+ this.exprAllowed = true;
+ this.containsEsc = false;
+ this.strictErrors = new Map();
+ this.tokensLength = 0;
+ }
+
+ init(options) {
+ this.strict = options.strictMode === false ? false : options.strictMode === true ? true : options.sourceType === "module";
+ this.curLine = options.startLine;
+ this.startLoc = this.endLoc = this.curPosition();
+ }
+
+ curPosition() {
+ return new Position(this.curLine, this.pos - this.lineStart);
+ }
+
+ clone(skipArrays) {
+ const state = new State();
+ const keys = Object.keys(this);
+
+ for (let i = 0, length = keys.length; i < length; i++) {
+ const key = keys[i];
+ let val = this[key];
+
+ if (!skipArrays && Array.isArray(val)) {
+ val = val.slice();
+ }
+
+ state[key] = val;
+ }
+
+ return state;
+ }
+
+}
+
+var _isDigit = function isDigit(code) {
+ return code >= 48 && code <= 57;
+};
+const VALID_REGEX_FLAGS = new Set([103, 109, 115, 105, 121, 117, 100]);
+const forbiddenNumericSeparatorSiblings = {
+ decBinOct: [46, 66, 69, 79, 95, 98, 101, 111],
+ hex: [46, 88, 95, 120]
+};
+const allowedNumericSeparatorSiblings = {};
+allowedNumericSeparatorSiblings.bin = [48, 49];
+allowedNumericSeparatorSiblings.oct = [...allowedNumericSeparatorSiblings.bin, 50, 51, 52, 53, 54, 55];
+allowedNumericSeparatorSiblings.dec = [...allowedNumericSeparatorSiblings.oct, 56, 57];
+allowedNumericSeparatorSiblings.hex = [...allowedNumericSeparatorSiblings.dec, 65, 66, 67, 68, 69, 70, 97, 98, 99, 100, 101, 102];
+class Token {
+ constructor(state) {
+ this.type = state.type;
+ this.value = state.value;
+ this.start = state.start;
+ this.end = state.end;
+ this.loc = new SourceLocation(state.startLoc, state.endLoc);
+ }
+
+}
+class Tokenizer extends ParserError {
+ constructor(options, input) {
+ super();
+ this.isLookahead = void 0;
+ this.tokens = [];
+ this.state = new State();
+ this.state.init(options);
+ this.input = input;
+ this.length = input.length;
+ this.isLookahead = false;
+ }
+
+ pushToken(token) {
+ this.tokens.length = this.state.tokensLength;
+ this.tokens.push(token);
+ ++this.state.tokensLength;
+ }
+
+ next() {
+ this.checkKeywordEscapes();
+
+ if (this.options.tokens) {
+ this.pushToken(new Token(this.state));
+ }
+
+ this.state.lastTokEnd = this.state.end;
+ this.state.lastTokStart = this.state.start;
+ this.state.lastTokEndLoc = this.state.endLoc;
+ this.state.lastTokStartLoc = this.state.startLoc;
+ this.nextToken();
+ }
+
+ eat(type) {
+ if (this.match(type)) {
+ this.next();
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ match(type) {
+ return this.state.type === type;
+ }
+
+ createLookaheadState(state) {
+ return {
+ pos: state.pos,
+ value: null,
+ type: state.type,
+ start: state.start,
+ end: state.end,
+ lastTokEnd: state.end,
+ context: [this.curContext()],
+ inType: state.inType
+ };
+ }
+
+ lookahead() {
+ const old = this.state;
+ this.state = this.createLookaheadState(old);
+ this.isLookahead = true;
+ this.nextToken();
+ this.isLookahead = false;
+ const curr = this.state;
+ this.state = old;
+ return curr;
+ }
+
+ nextTokenStart() {
+ return this.nextTokenStartSince(this.state.pos);
+ }
+
+ nextTokenStartSince(pos) {
+ skipWhiteSpace.lastIndex = pos;
+ return skipWhiteSpace.test(this.input) ? skipWhiteSpace.lastIndex : pos;
+ }
+
+ lookaheadCharCode() {
+ return this.input.charCodeAt(this.nextTokenStart());
+ }
+
+ codePointAtPos(pos) {
+ let cp = this.input.charCodeAt(pos);
+
+ if ((cp & 0xfc00) === 0xd800 && ++pos < this.input.length) {
+ const trail = this.input.charCodeAt(pos);
+
+ if ((trail & 0xfc00) === 0xdc00) {
+ cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);
+ }
+ }
+
+ return cp;
+ }
+
+ setStrict(strict) {
+ this.state.strict = strict;
+
+ if (strict) {
+ this.state.strictErrors.forEach((message, pos) => this.raise(pos, message));
+ this.state.strictErrors.clear();
+ }
+ }
+
+ curContext() {
+ return this.state.context[this.state.context.length - 1];
+ }
+
+ nextToken() {
+ const curContext = this.curContext();
+ if (!curContext.preserveSpace) this.skipSpace();
+ this.state.start = this.state.pos;
+ if (!this.isLookahead) this.state.startLoc = this.state.curPosition();
+
+ if (this.state.pos >= this.length) {
+ this.finishToken(7);
+ return;
+ }
+
+ if (curContext === types.template) {
+ this.readTmplToken();
+ } else {
+ this.getTokenFromCode(this.codePointAtPos(this.state.pos));
+ }
+ }
+
+ skipBlockComment() {
+ let startLoc;
+ if (!this.isLookahead) startLoc = this.state.curPosition();
+ const start = this.state.pos;
+ const end = this.input.indexOf("*/", start + 2);
+ if (end === -1) throw this.raise(start, ErrorMessages.UnterminatedComment);
+ this.state.pos = end + 2;
+ lineBreakG.lastIndex = start + 2;
+
+ while (lineBreakG.test(this.input) && lineBreakG.lastIndex <= end) {
+ ++this.state.curLine;
+ this.state.lineStart = lineBreakG.lastIndex;
+ }
+
+ if (this.isLookahead) return;
+ const comment = {
+ type: "CommentBlock",
+ value: this.input.slice(start + 2, end),
+ start,
+ end: end + 2,
+ loc: new SourceLocation(startLoc, this.state.curPosition())
+ };
+ if (this.options.tokens) this.pushToken(comment);
+ return comment;
+ }
+
+ skipLineComment(startSkip) {
+ const start = this.state.pos;
+ let startLoc;
+ if (!this.isLookahead) startLoc = this.state.curPosition();
+ let ch = this.input.charCodeAt(this.state.pos += startSkip);
+
+ if (this.state.pos < this.length) {
+ while (!isNewLine(ch) && ++this.state.pos < this.length) {
+ ch = this.input.charCodeAt(this.state.pos);
+ }
+ }
+
+ if (this.isLookahead) return;
+ const end = this.state.pos;
+ const value = this.input.slice(start + startSkip, end);
+ const comment = {
+ type: "CommentLine",
+ value,
+ start,
+ end,
+ loc: new SourceLocation(startLoc, this.state.curPosition())
+ };
+ if (this.options.tokens) this.pushToken(comment);
+ return comment;
+ }
+
+ skipSpace() {
+ const spaceStart = this.state.pos;
+ const comments = [];
+
+ loop: while (this.state.pos < this.length) {
+ const ch = this.input.charCodeAt(this.state.pos);
+
+ switch (ch) {
+ case 32:
+ case 160:
+ case 9:
+ ++this.state.pos;
+ break;
+
+ case 13:
+ if (this.input.charCodeAt(this.state.pos + 1) === 10) {
+ ++this.state.pos;
+ }
+
+ case 10:
+ case 8232:
+ case 8233:
+ ++this.state.pos;
+ ++this.state.curLine;
+ this.state.lineStart = this.state.pos;
+ break;
+
+ case 47:
+ switch (this.input.charCodeAt(this.state.pos + 1)) {
+ case 42:
+ {
+ const comment = this.skipBlockComment();
+
+ if (comment !== undefined) {
+ this.addComment(comment);
+ if (this.options.attachComment) comments.push(comment);
+ }
+
+ break;
+ }
+
+ case 47:
+ {
+ const comment = this.skipLineComment(2);
+
+ if (comment !== undefined) {
+ this.addComment(comment);
+ if (this.options.attachComment) comments.push(comment);
+ }
+
+ break;
+ }
+
+ default:
+ break loop;
+ }
+
+ break;
+
+ default:
+ if (isWhitespace(ch)) {
+ ++this.state.pos;
+ } else if (ch === 45 && !this.inModule) {
+ const pos = this.state.pos;
+
+ if (this.input.charCodeAt(pos + 1) === 45 && this.input.charCodeAt(pos + 2) === 62 && (spaceStart === 0 || this.state.lineStart > spaceStart)) {
+ const comment = this.skipLineComment(3);
+
+ if (comment !== undefined) {
+ this.addComment(comment);
+ if (this.options.attachComment) comments.push(comment);
+ }
+ } else {
+ break loop;
+ }
+ } else if (ch === 60 && !this.inModule) {
+ const pos = this.state.pos;
+
+ if (this.input.charCodeAt(pos + 1) === 33 && this.input.charCodeAt(pos + 2) === 45 && this.input.charCodeAt(pos + 3) === 45) {
+ const comment = this.skipLineComment(4);
+
+ if (comment !== undefined) {
+ this.addComment(comment);
+ if (this.options.attachComment) comments.push(comment);
+ }
+ } else {
+ break loop;
+ }
+ } else {
+ break loop;
+ }
+
+ }
+ }
+
+ if (comments.length > 0) {
+ const end = this.state.pos;
+ const CommentWhitespace = {
+ start: spaceStart,
+ end,
+ comments,
+ leadingNode: null,
+ trailingNode: null,
+ containingNode: null
+ };
+ this.state.commentStack.push(CommentWhitespace);
+ }
+ }
+
+ finishToken(type, val) {
+ this.state.end = this.state.pos;
+ const prevType = this.state.type;
+ this.state.type = type;
+ this.state.value = val;
+
+ if (!this.isLookahead) {
+ this.state.endLoc = this.state.curPosition();
+ this.updateContext(prevType);
+ }
+ }
+
+ readToken_numberSign() {
+ if (this.state.pos === 0 && this.readToken_interpreter()) {
+ return;
+ }
+
+ const nextPos = this.state.pos + 1;
+ const next = this.codePointAtPos(nextPos);
+
+ if (next >= 48 && next <= 57) {
+ throw this.raise(this.state.pos, ErrorMessages.UnexpectedDigitAfterHash);
+ }
+
+ if (next === 123 || next === 91 && this.hasPlugin("recordAndTuple")) {
+ this.expectPlugin("recordAndTuple");
+
+ if (this.getPluginOption("recordAndTuple", "syntaxType") !== "hash") {
+ throw this.raise(this.state.pos, next === 123 ? ErrorMessages.RecordExpressionHashIncorrectStartSyntaxType : ErrorMessages.TupleExpressionHashIncorrectStartSyntaxType);
+ }
+
+ this.state.pos += 2;
+
+ if (next === 123) {
+ this.finishToken(15);
+ } else {
+ this.finishToken(9);
+ }
+ } else if (isIdentifierStart(next)) {
+ ++this.state.pos;
+ this.finishToken(6, this.readWord1(next));
+ } else if (next === 92) {
+ ++this.state.pos;
+ this.finishToken(6, this.readWord1());
+ } else {
+ this.finishOp(33, 1);
+ }
+ }
+
+ readToken_dot() {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next >= 48 && next <= 57) {
+ this.readNumber(true);
+ return;
+ }
+
+ if (next === 46 && this.input.charCodeAt(this.state.pos + 2) === 46) {
+ this.state.pos += 3;
+ this.finishToken(29);
+ } else {
+ ++this.state.pos;
+ this.finishToken(24);
+ }
+ }
+
+ readToken_slash() {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next === 61) {
+ this.finishOp(37, 2);
+ } else {
+ this.finishOp(55, 1);
+ }
+ }
+
+ readToken_interpreter() {
+ if (this.state.pos !== 0 || this.length < 2) return false;
+ let ch = this.input.charCodeAt(this.state.pos + 1);
+ if (ch !== 33) return false;
+ const start = this.state.pos;
+ this.state.pos += 1;
+
+ while (!isNewLine(ch) && ++this.state.pos < this.length) {
+ ch = this.input.charCodeAt(this.state.pos);
+ }
+
+ const value = this.input.slice(start + 2, this.state.pos);
+ this.finishToken(34, value);
+ return true;
+ }
+
+ readToken_mult_modulo(code) {
+ let type = code === 42 ? 54 : 53;
+ let width = 1;
+ let next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (code === 42 && next === 42) {
+ width++;
+ next = this.input.charCodeAt(this.state.pos + 2);
+ type = 56;
+ }
+
+ if (next === 61 && !this.state.inType) {
+ width++;
+ type = code === 37 ? 38 : 36;
+ }
+
+ this.finishOp(type, width);
+ }
+
+ readToken_pipe_amp(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next === code) {
+ if (this.input.charCodeAt(this.state.pos + 2) === 61) {
+ this.finishOp(36, 3);
+ } else {
+ this.finishOp(code === 124 ? 44 : 45, 2);
+ }
+
+ return;
+ }
+
+ if (code === 124) {
+ if (next === 62) {
+ this.finishOp(42, 2);
+ return;
+ }
+
+ if (this.hasPlugin("recordAndTuple") && next === 125) {
+ if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
+ throw this.raise(this.state.pos, ErrorMessages.RecordExpressionBarIncorrectEndSyntaxType);
+ }
+
+ this.state.pos += 2;
+ this.finishToken(17);
+ return;
+ }
+
+ if (this.hasPlugin("recordAndTuple") && next === 93) {
+ if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
+ throw this.raise(this.state.pos, ErrorMessages.TupleExpressionBarIncorrectEndSyntaxType);
+ }
+
+ this.state.pos += 2;
+ this.finishToken(12);
+ return;
+ }
+ }
+
+ if (next === 61) {
+ this.finishOp(36, 2);
+ return;
+ }
+
+ this.finishOp(code === 124 ? 46 : 48, 1);
+ }
+
+ readToken_caret() {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next === 61) {
+ this.finishOp(36, 2);
+ } else {
+ this.finishOp(47, 1);
+ }
+ }
+
+ readToken_plus_min(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next === code) {
+ this.finishOp(39, 2);
+ return;
+ }
+
+ if (next === 61) {
+ this.finishOp(36, 2);
+ } else {
+ this.finishOp(52, 1);
+ }
+ }
+
+ readToken_lt_gt(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+ let size = 1;
+
+ if (next === code) {
+ size = code === 62 && this.input.charCodeAt(this.state.pos + 2) === 62 ? 3 : 2;
+
+ if (this.input.charCodeAt(this.state.pos + size) === 61) {
+ this.finishOp(36, size + 1);
+ return;
+ }
+
+ this.finishOp(51, size);
+ return;
+ }
+
+ if (next === 61) {
+ size = 2;
+ }
+
+ this.finishOp(50, size);
+ }
+
+ readToken_eq_excl(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next === 61) {
+ this.finishOp(49, this.input.charCodeAt(this.state.pos + 2) === 61 ? 3 : 2);
+ return;
+ }
+
+ if (code === 61 && next === 62) {
+ this.state.pos += 2;
+ this.finishToken(27);
+ return;
+ }
+
+ this.finishOp(code === 61 ? 35 : 40, 1);
+ }
+
+ readToken_question() {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+ const next2 = this.input.charCodeAt(this.state.pos + 2);
+
+ if (next === 63) {
+ if (next2 === 61) {
+ this.finishOp(36, 3);
+ } else {
+ this.finishOp(43, 2);
+ }
+ } else if (next === 46 && !(next2 >= 48 && next2 <= 57)) {
+ this.state.pos += 2;
+ this.finishToken(26);
+ } else {
+ ++this.state.pos;
+ this.finishToken(25);
+ }
+ }
+
+ getTokenFromCode(code) {
+ switch (code) {
+ case 46:
+ this.readToken_dot();
+ return;
+
+ case 40:
+ ++this.state.pos;
+ this.finishToken(18);
+ return;
+
+ case 41:
+ ++this.state.pos;
+ this.finishToken(19);
+ return;
+
+ case 59:
+ ++this.state.pos;
+ this.finishToken(21);
+ return;
+
+ case 44:
+ ++this.state.pos;
+ this.finishToken(20);
+ return;
+
+ case 91:
+ if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) {
+ if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
+ throw this.raise(this.state.pos, ErrorMessages.TupleExpressionBarIncorrectStartSyntaxType);
+ }
+
+ this.state.pos += 2;
+ this.finishToken(10);
+ } else {
+ ++this.state.pos;
+ this.finishToken(8);
+ }
+
+ return;
+
+ case 93:
+ ++this.state.pos;
+ this.finishToken(11);
+ return;
+
+ case 123:
+ if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) {
+ if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
+ throw this.raise(this.state.pos, ErrorMessages.RecordExpressionBarIncorrectStartSyntaxType);
+ }
+
+ this.state.pos += 2;
+ this.finishToken(14);
+ } else {
+ ++this.state.pos;
+ this.finishToken(13);
+ }
+
+ return;
+
+ case 125:
+ ++this.state.pos;
+ this.finishToken(16);
+ return;
+
+ case 58:
+ if (this.hasPlugin("functionBind") && this.input.charCodeAt(this.state.pos + 1) === 58) {
+ this.finishOp(23, 2);
+ } else {
+ ++this.state.pos;
+ this.finishToken(22);
+ }
+
+ return;
+
+ case 63:
+ this.readToken_question();
+ return;
+
+ case 96:
+ ++this.state.pos;
+ this.finishToken(30);
+ return;
+
+ case 48:
+ {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next === 120 || next === 88) {
+ this.readRadixNumber(16);
+ return;
+ }
+
+ if (next === 111 || next === 79) {
+ this.readRadixNumber(8);
+ return;
+ }
+
+ if (next === 98 || next === 66) {
+ this.readRadixNumber(2);
+ return;
+ }
+ }
+
+ case 49:
+ case 50:
+ case 51:
+ case 52:
+ case 53:
+ case 54:
+ case 55:
+ case 56:
+ case 57:
+ this.readNumber(false);
+ return;
+
+ case 34:
+ case 39:
+ this.readString(code);
+ return;
+
+ case 47:
+ this.readToken_slash();
+ return;
+
+ case 37:
+ case 42:
+ this.readToken_mult_modulo(code);
+ return;
+
+ case 124:
+ case 38:
+ this.readToken_pipe_amp(code);
+ return;
+
+ case 94:
+ this.readToken_caret();
+ return;
+
+ case 43:
+ case 45:
+ this.readToken_plus_min(code);
+ return;
+
+ case 60:
+ case 62:
+ this.readToken_lt_gt(code);
+ return;
+
+ case 61:
+ case 33:
+ this.readToken_eq_excl(code);
+ return;
+
+ case 126:
+ this.finishOp(41, 1);
+ return;
+
+ case 64:
+ ++this.state.pos;
+ this.finishToken(32);
+ return;
+
+ case 35:
+ this.readToken_numberSign();
+ return;
+
+ case 92:
+ this.readWord();
+ return;
+
+ default:
+ if (isIdentifierStart(code)) {
+ this.readWord(code);
+ return;
+ }
+
+ }
+
+ throw this.raise(this.state.pos, ErrorMessages.InvalidOrUnexpectedToken, String.fromCodePoint(code));
+ }
+
+ finishOp(type, size) {
+ const str = this.input.slice(this.state.pos, this.state.pos + size);
+ this.state.pos += size;
+ this.finishToken(type, str);
+ }
+
+ readRegexp() {
+ const start = this.state.start + 1;
+ let escaped, inClass;
+ let {
+ pos
+ } = this.state;
+
+ for (;; ++pos) {
+ if (pos >= this.length) {
+ throw this.raise(start, ErrorMessages.UnterminatedRegExp);
+ }
+
+ const ch = this.input.charCodeAt(pos);
+
+ if (isNewLine(ch)) {
+ throw this.raise(start, ErrorMessages.UnterminatedRegExp);
+ }
+
+ if (escaped) {
+ escaped = false;
+ } else {
+ if (ch === 91) {
+ inClass = true;
+ } else if (ch === 93 && inClass) {
+ inClass = false;
+ } else if (ch === 47 && !inClass) {
+ break;
+ }
+
+ escaped = ch === 92;
+ }
+ }
+
+ const content = this.input.slice(start, pos);
+ ++pos;
+ let mods = "";
+
+ while (pos < this.length) {
+ const cp = this.codePointAtPos(pos);
+ const char = String.fromCharCode(cp);
+
+ if (VALID_REGEX_FLAGS.has(cp)) {
+ if (mods.includes(char)) {
+ this.raise(pos + 1, ErrorMessages.DuplicateRegExpFlags);
+ }
+ } else if (isIdentifierChar(cp) || cp === 92) {
+ this.raise(pos + 1, ErrorMessages.MalformedRegExpFlags);
+ } else {
+ break;
+ }
+
+ ++pos;
+ mods += char;
+ }
+
+ this.state.pos = pos;
+ this.finishToken(3, {
+ pattern: content,
+ flags: mods
+ });
+ }
+
+ readInt(radix, len, forceLen, allowNumSeparator = true) {
+ const start = this.state.pos;
+ const forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings.hex : forbiddenNumericSeparatorSiblings.decBinOct;
+ const allowedSiblings = radix === 16 ? allowedNumericSeparatorSiblings.hex : radix === 10 ? allowedNumericSeparatorSiblings.dec : radix === 8 ? allowedNumericSeparatorSiblings.oct : allowedNumericSeparatorSiblings.bin;
+ let invalid = false;
+ let total = 0;
+
+ for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) {
+ const code = this.input.charCodeAt(this.state.pos);
+ let val;
+
+ if (code === 95) {
+ const prev = this.input.charCodeAt(this.state.pos - 1);
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (allowedSiblings.indexOf(next) === -1) {
+ this.raise(this.state.pos, ErrorMessages.UnexpectedNumericSeparator);
+ } else if (forbiddenSiblings.indexOf(prev) > -1 || forbiddenSiblings.indexOf(next) > -1 || Number.isNaN(next)) {
+ this.raise(this.state.pos, ErrorMessages.UnexpectedNumericSeparator);
+ }
+
+ if (!allowNumSeparator) {
+ this.raise(this.state.pos, ErrorMessages.NumericSeparatorInEscapeSequence);
+ }
+
+ ++this.state.pos;
+ continue;
+ }
+
+ if (code >= 97) {
+ val = code - 97 + 10;
+ } else if (code >= 65) {
+ val = code - 65 + 10;
+ } else if (_isDigit(code)) {
+ val = code - 48;
+ } else {
+ val = Infinity;
+ }
+
+ if (val >= radix) {
+ if (this.options.errorRecovery && val <= 9) {
+ val = 0;
+ this.raise(this.state.start + i + 2, ErrorMessages.InvalidDigit, radix);
+ } else if (forceLen) {
+ val = 0;
+ invalid = true;
+ } else {
+ break;
+ }
+ }
+
+ ++this.state.pos;
+ total = total * radix + val;
+ }
+
+ if (this.state.pos === start || len != null && this.state.pos - start !== len || invalid) {
+ return null;
+ }
+
+ return total;
+ }
+
+ readRadixNumber(radix) {
+ const start = this.state.pos;
+ let isBigInt = false;
+ this.state.pos += 2;
+ const val = this.readInt(radix);
+
+ if (val == null) {
+ this.raise(this.state.start + 2, ErrorMessages.InvalidDigit, radix);
+ }
+
+ const next = this.input.charCodeAt(this.state.pos);
+
+ if (next === 110) {
+ ++this.state.pos;
+ isBigInt = true;
+ } else if (next === 109) {
+ throw this.raise(start, ErrorMessages.InvalidDecimal);
+ }
+
+ if (isIdentifierStart(this.codePointAtPos(this.state.pos))) {
+ throw this.raise(this.state.pos, ErrorMessages.NumberIdentifier);
+ }
+
+ if (isBigInt) {
+ const str = this.input.slice(start, this.state.pos).replace(/[_n]/g, "");
+ this.finishToken(1, str);
+ return;
+ }
+
+ this.finishToken(0, val);
+ }
+
+ readNumber(startsWithDot) {
+ const start = this.state.pos;
+ let isFloat = false;
+ let isBigInt = false;
+ let isDecimal = false;
+ let hasExponent = false;
+ let isOctal = false;
+
+ if (!startsWithDot && this.readInt(10) === null) {
+ this.raise(start, ErrorMessages.InvalidNumber);
+ }
+
+ const hasLeadingZero = this.state.pos - start >= 2 && this.input.charCodeAt(start) === 48;
+
+ if (hasLeadingZero) {
+ const integer = this.input.slice(start, this.state.pos);
+ this.recordStrictModeErrors(start, ErrorMessages.StrictOctalLiteral);
+
+ if (!this.state.strict) {
+ const underscorePos = integer.indexOf("_");
+
+ if (underscorePos > 0) {
+ this.raise(underscorePos + start, ErrorMessages.ZeroDigitNumericSeparator);
+ }
+ }
+
+ isOctal = hasLeadingZero && !/[89]/.test(integer);
+ }
+
+ let next = this.input.charCodeAt(this.state.pos);
+
+ if (next === 46 && !isOctal) {
+ ++this.state.pos;
+ this.readInt(10);
+ isFloat = true;
+ next = this.input.charCodeAt(this.state.pos);
+ }
+
+ if ((next === 69 || next === 101) && !isOctal) {
+ next = this.input.charCodeAt(++this.state.pos);
+
+ if (next === 43 || next === 45) {
+ ++this.state.pos;
+ }
+
+ if (this.readInt(10) === null) {
+ this.raise(start, ErrorMessages.InvalidOrMissingExponent);
+ }
+
+ isFloat = true;
+ hasExponent = true;
+ next = this.input.charCodeAt(this.state.pos);
+ }
+
+ if (next === 110) {
+ if (isFloat || hasLeadingZero) {
+ this.raise(start, ErrorMessages.InvalidBigIntLiteral);
+ }
+
+ ++this.state.pos;
+ isBigInt = true;
+ }
+
+ if (next === 109) {
+ this.expectPlugin("decimal", this.state.pos);
+
+ if (hasExponent || hasLeadingZero) {
+ this.raise(start, ErrorMessages.InvalidDecimal);
+ }
+
+ ++this.state.pos;
+ isDecimal = true;
+ }
+
+ if (isIdentifierStart(this.codePointAtPos(this.state.pos))) {
+ throw this.raise(this.state.pos, ErrorMessages.NumberIdentifier);
+ }
+
+ const str = this.input.slice(start, this.state.pos).replace(/[_mn]/g, "");
+
+ if (isBigInt) {
+ this.finishToken(1, str);
+ return;
+ }
+
+ if (isDecimal) {
+ this.finishToken(2, str);
+ return;
+ }
+
+ const val = isOctal ? parseInt(str, 8) : parseFloat(str);
+ this.finishToken(0, val);
+ }
+
+ readCodePoint(throwOnInvalid) {
+ const ch = this.input.charCodeAt(this.state.pos);
+ let code;
+
+ if (ch === 123) {
+ const codePos = ++this.state.pos;
+ code = this.readHexChar(this.input.indexOf("}", this.state.pos) - this.state.pos, true, throwOnInvalid);
+ ++this.state.pos;
+
+ if (code !== null && code > 0x10ffff) {
+ if (throwOnInvalid) {
+ this.raise(codePos, ErrorMessages.InvalidCodePoint);
+ } else {
+ return null;
+ }
+ }
+ } else {
+ code = this.readHexChar(4, false, throwOnInvalid);
+ }
+
+ return code;
+ }
+
+ readString(quote) {
+ let out = "",
+ chunkStart = ++this.state.pos;
+
+ for (;;) {
+ if (this.state.pos >= this.length) {
+ throw this.raise(this.state.start, ErrorMessages.UnterminatedString);
+ }
+
+ const ch = this.input.charCodeAt(this.state.pos);
+ if (ch === quote) break;
+
+ if (ch === 92) {
+ out += this.input.slice(chunkStart, this.state.pos);
+ out += this.readEscapedChar(false);
+ chunkStart = this.state.pos;
+ } else if (ch === 8232 || ch === 8233) {
+ ++this.state.pos;
+ ++this.state.curLine;
+ this.state.lineStart = this.state.pos;
+ } else if (isNewLine(ch)) {
+ throw this.raise(this.state.start, ErrorMessages.UnterminatedString);
+ } else {
+ ++this.state.pos;
+ }
+ }
+
+ out += this.input.slice(chunkStart, this.state.pos++);
+ this.finishToken(4, out);
+ }
+
+ readTmplToken() {
+ let out = "",
+ chunkStart = this.state.pos,
+ containsInvalid = false;
+
+ for (;;) {
+ if (this.state.pos >= this.length) {
+ throw this.raise(this.state.start, ErrorMessages.UnterminatedTemplate);
+ }
+
+ const ch = this.input.charCodeAt(this.state.pos);
+
+ if (ch === 96 || ch === 36 && this.input.charCodeAt(this.state.pos + 1) === 123) {
+ if (this.state.pos === this.state.start && this.match(28)) {
+ if (ch === 36) {
+ this.state.pos += 2;
+ this.finishToken(31);
+ return;
+ } else {
+ ++this.state.pos;
+ this.finishToken(30);
+ return;
+ }
+ }
+
+ out += this.input.slice(chunkStart, this.state.pos);
+ this.finishToken(28, containsInvalid ? null : out);
+ return;
+ }
+
+ if (ch === 92) {
+ out += this.input.slice(chunkStart, this.state.pos);
+ const escaped = this.readEscapedChar(true);
+
+ if (escaped === null) {
+ containsInvalid = true;
+ } else {
+ out += escaped;
+ }
+
+ chunkStart = this.state.pos;
+ } else if (isNewLine(ch)) {
+ out += this.input.slice(chunkStart, this.state.pos);
+ ++this.state.pos;
+
+ switch (ch) {
+ case 13:
+ if (this.input.charCodeAt(this.state.pos) === 10) {
+ ++this.state.pos;
+ }
+
+ case 10:
+ out += "\n";
+ break;
+
+ default:
+ out += String.fromCharCode(ch);
+ break;
+ }
+
+ ++this.state.curLine;
+ this.state.lineStart = this.state.pos;
+ chunkStart = this.state.pos;
+ } else {
+ ++this.state.pos;
+ }
+ }
+ }
+
+ recordStrictModeErrors(pos, message) {
+ if (this.state.strict && !this.state.strictErrors.has(pos)) {
+ this.raise(pos, message);
+ } else {
+ this.state.strictErrors.set(pos, message);
+ }
+ }
+
+ readEscapedChar(inTemplate) {
+ const throwOnInvalid = !inTemplate;
+ const ch = this.input.charCodeAt(++this.state.pos);
+ ++this.state.pos;
+
+ switch (ch) {
+ case 110:
+ return "\n";
+
+ case 114:
+ return "\r";
+
+ case 120:
+ {
+ const code = this.readHexChar(2, false, throwOnInvalid);
+ return code === null ? null : String.fromCharCode(code);
+ }
+
+ case 117:
+ {
+ const code = this.readCodePoint(throwOnInvalid);
+ return code === null ? null : String.fromCodePoint(code);
+ }
+
+ case 116:
+ return "\t";
+
+ case 98:
+ return "\b";
+
+ case 118:
+ return "\u000b";
+
+ case 102:
+ return "\f";
+
+ case 13:
+ if (this.input.charCodeAt(this.state.pos) === 10) {
+ ++this.state.pos;
+ }
+
+ case 10:
+ this.state.lineStart = this.state.pos;
+ ++this.state.curLine;
+
+ case 8232:
+ case 8233:
+ return "";
+
+ case 56:
+ case 57:
+ if (inTemplate) {
+ return null;
+ } else {
+ this.recordStrictModeErrors(this.state.pos - 1, ErrorMessages.StrictNumericEscape);
+ }
+
+ default:
+ if (ch >= 48 && ch <= 55) {
+ const codePos = this.state.pos - 1;
+ const match = this.input.substr(this.state.pos - 1, 3).match(/^[0-7]+/);
+ let octalStr = match[0];
+ let octal = parseInt(octalStr, 8);
+
+ if (octal > 255) {
+ octalStr = octalStr.slice(0, -1);
+ octal = parseInt(octalStr, 8);
+ }
+
+ this.state.pos += octalStr.length - 1;
+ const next = this.input.charCodeAt(this.state.pos);
+
+ if (octalStr !== "0" || next === 56 || next === 57) {
+ if (inTemplate) {
+ return null;
+ } else {
+ this.recordStrictModeErrors(codePos, ErrorMessages.StrictNumericEscape);
+ }
+ }
+
+ return String.fromCharCode(octal);
+ }
+
+ return String.fromCharCode(ch);
+ }
+ }
+
+ readHexChar(len, forceLen, throwOnInvalid) {
+ const codePos = this.state.pos;
+ const n = this.readInt(16, len, forceLen, false);
+
+ if (n === null) {
+ if (throwOnInvalid) {
+ this.raise(codePos, ErrorMessages.InvalidEscapeSequence);
+ } else {
+ this.state.pos = codePos - 1;
+ }
+ }
+
+ return n;
+ }
+
+ readWord1(firstCode) {
+ this.state.containsEsc = false;
+ let word = "";
+ const start = this.state.pos;
+ let chunkStart = this.state.pos;
+
+ if (firstCode !== undefined) {
+ this.state.pos += firstCode <= 0xffff ? 1 : 2;
+ }
+
+ while (this.state.pos < this.length) {
+ const ch = this.codePointAtPos(this.state.pos);
+
+ if (isIdentifierChar(ch)) {
+ this.state.pos += ch <= 0xffff ? 1 : 2;
+ } else if (ch === 92) {
+ this.state.containsEsc = true;
+ word += this.input.slice(chunkStart, this.state.pos);
+ const escStart = this.state.pos;
+ const identifierCheck = this.state.pos === start ? isIdentifierStart : isIdentifierChar;
+
+ if (this.input.charCodeAt(++this.state.pos) !== 117) {
+ this.raise(this.state.pos, ErrorMessages.MissingUnicodeEscape);
+ chunkStart = this.state.pos - 1;
+ continue;
+ }
+
+ ++this.state.pos;
+ const esc = this.readCodePoint(true);
+
+ if (esc !== null) {
+ if (!identifierCheck(esc)) {
+ this.raise(escStart, ErrorMessages.EscapedCharNotAnIdentifier);
+ }
+
+ word += String.fromCodePoint(esc);
+ }
+
+ chunkStart = this.state.pos;
+ } else {
+ break;
+ }
+ }
+
+ return word + this.input.slice(chunkStart, this.state.pos);
+ }
+
+ readWord(firstCode) {
+ const word = this.readWord1(firstCode);
+ const type = keywords$1.get(word) || 5;
+ this.finishToken(type, word);
+ }
+
+ checkKeywordEscapes() {
+ const {
+ type
+ } = this.state;
+
+ if (tokenIsKeyword(type) && this.state.containsEsc) {
+ this.raise(this.state.start, ErrorMessages.InvalidEscapedReservedWord, tokenLabelName(type));
+ }
+ }
+
+ updateContext(prevType) {
+ const {
+ context,
+ type
+ } = this.state;
+
+ switch (type) {
+ case 16:
+ context.pop();
+ break;
+
+ case 13:
+ case 15:
+ case 31:
+ context.push(types.brace);
+ break;
+
+ case 30:
+ if (context[context.length - 1] === types.template) {
+ context.pop();
+ } else {
+ context.push(types.template);
+ }
+
+ break;
+ }
+ }
+
+}
+
+class ClassScope {
+ constructor() {
+ this.privateNames = new Set();
+ this.loneAccessors = new Map();
+ this.undefinedPrivateNames = new Map();
+ }
+
+}
+class ClassScopeHandler {
+ constructor(raise) {
+ this.stack = [];
+ this.undefinedPrivateNames = new Map();
+ this.raise = raise;
+ }
+
+ current() {
+ return this.stack[this.stack.length - 1];
+ }
+
+ enter() {
+ this.stack.push(new ClassScope());
+ }
+
+ exit() {
+ const oldClassScope = this.stack.pop();
+ const current = this.current();
+
+ for (const [name, pos] of Array.from(oldClassScope.undefinedPrivateNames)) {
+ if (current) {
+ if (!current.undefinedPrivateNames.has(name)) {
+ current.undefinedPrivateNames.set(name, pos);
+ }
+ } else {
+ this.raise(pos, ErrorMessages.InvalidPrivateFieldResolution, name);
+ }
+ }
+ }
+
+ declarePrivateName(name, elementType, pos) {
+ const classScope = this.current();
+ let redefined = classScope.privateNames.has(name);
+
+ if (elementType & CLASS_ELEMENT_KIND_ACCESSOR) {
+ const accessor = redefined && classScope.loneAccessors.get(name);
+
+ if (accessor) {
+ const oldStatic = accessor & CLASS_ELEMENT_FLAG_STATIC;
+ const newStatic = elementType & CLASS_ELEMENT_FLAG_STATIC;
+ const oldKind = accessor & CLASS_ELEMENT_KIND_ACCESSOR;
+ const newKind = elementType & CLASS_ELEMENT_KIND_ACCESSOR;
+ redefined = oldKind === newKind || oldStatic !== newStatic;
+ if (!redefined) classScope.loneAccessors.delete(name);
+ } else if (!redefined) {
+ classScope.loneAccessors.set(name, elementType);
+ }
+ }
+
+ if (redefined) {
+ this.raise(pos, ErrorMessages.PrivateNameRedeclaration, name);
+ }
+
+ classScope.privateNames.add(name);
+ classScope.undefinedPrivateNames.delete(name);
+ }
+
+ usePrivateName(name, pos) {
+ let classScope;
+
+ for (classScope of this.stack) {
+ if (classScope.privateNames.has(name)) return;
+ }
+
+ if (classScope) {
+ classScope.undefinedPrivateNames.set(name, pos);
+ } else {
+ this.raise(pos, ErrorMessages.InvalidPrivateFieldResolution, name);
+ }
+ }
+
+}
+
+const kExpression = 0,
+ kMaybeArrowParameterDeclaration = 1,
+ kMaybeAsyncArrowParameterDeclaration = 2,
+ kParameterDeclaration = 3;
+
+class ExpressionScope {
+ constructor(type = kExpression) {
+ this.type = void 0;
+ this.type = type;
+ }
+
+ canBeArrowParameterDeclaration() {
+ return this.type === kMaybeAsyncArrowParameterDeclaration || this.type === kMaybeArrowParameterDeclaration;
+ }
+
+ isCertainlyParameterDeclaration() {
+ return this.type === kParameterDeclaration;
+ }
+
+}
+
+class ArrowHeadParsingScope extends ExpressionScope {
+ constructor(type) {
+ super(type);
+ this.errors = new Map();
+ }
+
+ recordDeclarationError(pos, template) {
+ this.errors.set(pos, template);
+ }
+
+ clearDeclarationError(pos) {
+ this.errors.delete(pos);
+ }
+
+ iterateErrors(iterator) {
+ this.errors.forEach(iterator);
+ }
+
+}
+
+class ExpressionScopeHandler {
+ constructor(raise) {
+ this.stack = [new ExpressionScope()];
+ this.raise = raise;
+ }
+
+ enter(scope) {
+ this.stack.push(scope);
+ }
+
+ exit() {
+ this.stack.pop();
+ }
+
+ recordParameterInitializerError(pos, template) {
+ const {
+ stack
+ } = this;
+ let i = stack.length - 1;
+ let scope = stack[i];
+
+ while (!scope.isCertainlyParameterDeclaration()) {
+ if (scope.canBeArrowParameterDeclaration()) {
+ scope.recordDeclarationError(pos, template);
+ } else {
+ return;
+ }
+
+ scope = stack[--i];
+ }
+
+ this.raise(pos, template);
+ }
+
+ recordParenthesizedIdentifierError(pos, template) {
+ const {
+ stack
+ } = this;
+ const scope = stack[stack.length - 1];
+
+ if (scope.isCertainlyParameterDeclaration()) {
+ this.raise(pos, template);
+ } else if (scope.canBeArrowParameterDeclaration()) {
+ scope.recordDeclarationError(pos, template);
+ } else {
+ return;
+ }
+ }
+
+ recordAsyncArrowParametersError(pos, template) {
+ const {
+ stack
+ } = this;
+ let i = stack.length - 1;
+ let scope = stack[i];
+
+ while (scope.canBeArrowParameterDeclaration()) {
+ if (scope.type === kMaybeAsyncArrowParameterDeclaration) {
+ scope.recordDeclarationError(pos, template);
+ }
+
+ scope = stack[--i];
+ }
+ }
+
+ validateAsPattern() {
+ const {
+ stack
+ } = this;
+ const currentScope = stack[stack.length - 1];
+ if (!currentScope.canBeArrowParameterDeclaration()) return;
+ currentScope.iterateErrors((template, pos) => {
+ this.raise(pos, template);
+ let i = stack.length - 2;
+ let scope = stack[i];
+
+ while (scope.canBeArrowParameterDeclaration()) {
+ scope.clearDeclarationError(pos);
+ scope = stack[--i];
+ }
+ });
+ }
+
+}
+function newParameterDeclarationScope() {
+ return new ExpressionScope(kParameterDeclaration);
+}
+function newArrowHeadScope() {
+ return new ArrowHeadParsingScope(kMaybeArrowParameterDeclaration);
+}
+function newAsyncArrowScope() {
+ return new ArrowHeadParsingScope(kMaybeAsyncArrowParameterDeclaration);
+}
+function newExpressionScope() {
+ return new ExpressionScope();
+}
+
+const PARAM = 0b0000,
+ PARAM_YIELD = 0b0001,
+ PARAM_AWAIT = 0b0010,
+ PARAM_RETURN = 0b0100,
+ PARAM_IN = 0b1000;
+class ProductionParameterHandler {
+ constructor() {
+ this.stacks = [];
+ }
+
+ enter(flags) {
+ this.stacks.push(flags);
+ }
+
+ exit() {
+ this.stacks.pop();
+ }
+
+ currentFlags() {
+ return this.stacks[this.stacks.length - 1];
+ }
+
+ get hasAwait() {
+ return (this.currentFlags() & PARAM_AWAIT) > 0;
+ }
+
+ get hasYield() {
+ return (this.currentFlags() & PARAM_YIELD) > 0;
+ }
+
+ get hasReturn() {
+ return (this.currentFlags() & PARAM_RETURN) > 0;
+ }
+
+ get hasIn() {
+ return (this.currentFlags() & PARAM_IN) > 0;
+ }
+
+}
+function functionFlags(isAsync, isGenerator) {
+ return (isAsync ? PARAM_AWAIT : 0) | (isGenerator ? PARAM_YIELD : 0);
+}
+
+class UtilParser extends Tokenizer {
+ addExtra(node, key, val) {
+ if (!node) return;
+ const extra = node.extra = node.extra || {};
+ extra[key] = val;
+ }
+
+ isRelational(op) {
+ return this.match(50) && this.state.value === op;
+ }
+
+ expectRelational(op) {
+ if (this.isRelational(op)) {
+ this.next();
+ } else {
+ this.unexpected(null, 50);
+ }
+ }
+
+ isContextual(name) {
+ return this.match(5) && this.state.value === name && !this.state.containsEsc;
+ }
+
+ isUnparsedContextual(nameStart, name) {
+ const nameEnd = nameStart + name.length;
+
+ if (this.input.slice(nameStart, nameEnd) === name) {
+ const nextCh = this.input.charCodeAt(nameEnd);
+ return !(isIdentifierChar(nextCh) || (nextCh & 0xfc00) === 0xd800);
+ }
+
+ return false;
+ }
+
+ isLookaheadContextual(name) {
+ const next = this.nextTokenStart();
+ return this.isUnparsedContextual(next, name);
+ }
+
+ eatContextual(name) {
+ return this.isContextual(name) && this.eat(5);
+ }
+
+ expectContextual(name, template) {
+ if (!this.eatContextual(name)) this.unexpected(null, template);
+ }
+
+ canInsertSemicolon() {
+ return this.match(7) || this.match(16) || this.hasPrecedingLineBreak();
+ }
+
+ hasPrecedingLineBreak() {
+ return lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start));
+ }
+
+ hasFollowingLineBreak() {
+ skipWhiteSpaceToLineBreak.lastIndex = this.state.end;
+ return skipWhiteSpaceToLineBreak.test(this.input);
+ }
+
+ isLineTerminator() {
+ return this.eat(21) || this.canInsertSemicolon();
+ }
+
+ semicolon(allowAsi = true) {
+ if (allowAsi ? this.isLineTerminator() : this.eat(21)) return;
+ this.raise(this.state.lastTokEnd, ErrorMessages.MissingSemicolon);
+ }
+
+ expect(type, pos) {
+ this.eat(type) || this.unexpected(pos, type);
+ }
+
+ assertNoSpace(message = "Unexpected space.") {
+ if (this.state.start > this.state.lastTokEnd) {
+ this.raise(this.state.lastTokEnd, {
+ code: ErrorCodes.SyntaxError,
+ reasonCode: "UnexpectedSpace",
+ template: message
+ });
+ }
+ }
+
+ unexpected(pos, messageOrType = {
+ code: ErrorCodes.SyntaxError,
+ reasonCode: "UnexpectedToken",
+ template: "Unexpected token"
+ }) {
+ if (isTokenType(messageOrType)) {
+ messageOrType = {
+ code: ErrorCodes.SyntaxError,
+ reasonCode: "UnexpectedToken",
+ template: `Unexpected token, expected "${tokenLabelName(messageOrType)}"`
+ };
+ }
+
+ throw this.raise(pos != null ? pos : this.state.start, messageOrType);
+ }
+
+ expectPlugin(name, pos) {
+ if (!this.hasPlugin(name)) {
+ throw this.raiseWithData(pos != null ? pos : this.state.start, {
+ missingPlugin: [name]
+ }, `This experimental syntax requires enabling the parser plugin: '${name}'`);
+ }
+
+ return true;
+ }
+
+ expectOnePlugin(names, pos) {
+ if (!names.some(n => this.hasPlugin(n))) {
+ throw this.raiseWithData(pos != null ? pos : this.state.start, {
+ missingPlugin: names
+ }, `This experimental syntax requires enabling one of the following parser plugin(s): '${names.join(", ")}'`);
+ }
+ }
+
+ tryParse(fn, oldState = this.state.clone()) {
+ const abortSignal = {
+ node: null
+ };
+
+ try {
+ const node = fn((node = null) => {
+ abortSignal.node = node;
+ throw abortSignal;
+ });
+
+ if (this.state.errors.length > oldState.errors.length) {
+ const failState = this.state;
+ this.state = oldState;
+ this.state.tokensLength = failState.tokensLength;
+ return {
+ node,
+ error: failState.errors[oldState.errors.length],
+ thrown: false,
+ aborted: false,
+ failState
+ };
+ }
+
+ return {
+ node,
+ error: null,
+ thrown: false,
+ aborted: false,
+ failState: null
+ };
+ } catch (error) {
+ const failState = this.state;
+ this.state = oldState;
+
+ if (error instanceof SyntaxError) {
+ return {
+ node: null,
+ error,
+ thrown: true,
+ aborted: false,
+ failState
+ };
+ }
+
+ if (error === abortSignal) {
+ return {
+ node: abortSignal.node,
+ error: null,
+ thrown: false,
+ aborted: true,
+ failState
+ };
+ }
+
+ throw error;
+ }
+ }
+
+ checkExpressionErrors(refExpressionErrors, andThrow) {
+ if (!refExpressionErrors) return false;
+ const {
+ shorthandAssign,
+ doubleProto,
+ optionalParameters
+ } = refExpressionErrors;
+
+ if (!andThrow) {
+ return shorthandAssign >= 0 || doubleProto >= 0 || optionalParameters >= 0;
+ }
+
+ if (shorthandAssign >= 0) {
+ this.unexpected(shorthandAssign);
+ }
+
+ if (doubleProto >= 0) {
+ this.raise(doubleProto, ErrorMessages.DuplicateProto);
+ }
+
+ if (optionalParameters >= 0) {
+ this.unexpected(optionalParameters);
+ }
+ }
+
+ isLiteralPropertyName() {
+ return this.match(5) || tokenIsKeyword(this.state.type) || this.match(4) || this.match(0) || this.match(1) || this.match(2);
+ }
+
+ isPrivateName(node) {
+ return node.type === "PrivateName";
+ }
+
+ getPrivateNameSV(node) {
+ return node.id.name;
+ }
+
+ hasPropertyAsPrivateName(node) {
+ return (node.type === "MemberExpression" || node.type === "OptionalMemberExpression") && this.isPrivateName(node.property);
+ }
+
+ isOptionalChain(node) {
+ return node.type === "OptionalMemberExpression" || node.type === "OptionalCallExpression";
+ }
+
+ isObjectProperty(node) {
+ return node.type === "ObjectProperty";
+ }
+
+ isObjectMethod(node) {
+ return node.type === "ObjectMethod";
+ }
+
+ initializeScopes(inModule = this.options.sourceType === "module") {
+ const oldLabels = this.state.labels;
+ this.state.labels = [];
+ const oldExportedIdentifiers = this.exportedIdentifiers;
+ this.exportedIdentifiers = new Set();
+ const oldInModule = this.inModule;
+ this.inModule = inModule;
+ const oldScope = this.scope;
+ const ScopeHandler = this.getScopeHandler();
+ this.scope = new ScopeHandler(this.raise.bind(this), this.inModule);
+ const oldProdParam = this.prodParam;
+ this.prodParam = new ProductionParameterHandler();
+ const oldClassScope = this.classScope;
+ this.classScope = new ClassScopeHandler(this.raise.bind(this));
+ const oldExpressionScope = this.expressionScope;
+ this.expressionScope = new ExpressionScopeHandler(this.raise.bind(this));
+ return () => {
+ this.state.labels = oldLabels;
+ this.exportedIdentifiers = oldExportedIdentifiers;
+ this.inModule = oldInModule;
+ this.scope = oldScope;
+ this.prodParam = oldProdParam;
+ this.classScope = oldClassScope;
+ this.expressionScope = oldExpressionScope;
+ };
+ }
+
+ enterInitialScopes() {
+ let paramFlags = PARAM;
+
+ if (this.inModule) {
+ paramFlags |= PARAM_AWAIT;
+ }
+
+ this.scope.enter(SCOPE_PROGRAM);
+ this.prodParam.enter(paramFlags);
+ }
+
+}
+class ExpressionErrors {
+ constructor() {
+ this.shorthandAssign = -1;
+ this.doubleProto = -1;
+ this.optionalParameters = -1;
+ }
+
+}
+
+class Node {
+ constructor(parser, pos, loc) {
+ this.type = "";
+ this.start = pos;
+ this.end = 0;
+ this.loc = new SourceLocation(loc);
+ if (parser != null && parser.options.ranges) this.range = [pos, 0];
+ if (parser != null && parser.filename) this.loc.filename = parser.filename;
+ }
+
+}
+
+const NodePrototype = Node.prototype;
+{
+ NodePrototype.__clone = function () {
+ const newNode = new Node();
+ const keys = Object.keys(this);
+
+ for (let i = 0, length = keys.length; i < length; i++) {
+ const key = keys[i];
+
+ if (key !== "leadingComments" && key !== "trailingComments" && key !== "innerComments") {
+ newNode[key] = this[key];
+ }
+ }
+
+ return newNode;
+ };
+}
+
+function clonePlaceholder(node) {
+ return cloneIdentifier(node);
+}
+
+function cloneIdentifier(node) {
+ const {
+ type,
+ start,
+ end,
+ loc,
+ range,
+ extra,
+ name
+ } = node;
+ const cloned = Object.create(NodePrototype);
+ cloned.type = type;
+ cloned.start = start;
+ cloned.end = end;
+ cloned.loc = loc;
+ cloned.range = range;
+ cloned.extra = extra;
+ cloned.name = name;
+
+ if (type === "Placeholder") {
+ cloned.expectedNode = node.expectedNode;
+ }
+
+ return cloned;
+}
+function cloneStringLiteral(node) {
+ const {
+ type,
+ start,
+ end,
+ loc,
+ range,
+ extra
+ } = node;
+
+ if (type === "Placeholder") {
+ return clonePlaceholder(node);
+ }
+
+ const cloned = Object.create(NodePrototype);
+ cloned.type = "StringLiteral";
+ cloned.start = start;
+ cloned.end = end;
+ cloned.loc = loc;
+ cloned.range = range;
+ cloned.extra = extra;
+ cloned.value = node.value;
+ return cloned;
+}
+class NodeUtils extends UtilParser {
+ startNode() {
+ return new Node(this, this.state.start, this.state.startLoc);
+ }
+
+ startNodeAt(pos, loc) {
+ return new Node(this, pos, loc);
+ }
+
+ startNodeAtNode(type) {
+ return this.startNodeAt(type.start, type.loc.start);
+ }
+
+ finishNode(node, type) {
+ return this.finishNodeAt(node, type, this.state.lastTokEnd, this.state.lastTokEndLoc);
+ }
+
+ finishNodeAt(node, type, pos, loc) {
+
+ node.type = type;
+ node.end = pos;
+ node.loc.end = loc;
+ if (this.options.ranges) node.range[1] = pos;
+ if (this.options.attachComment) this.processComment(node);
+ return node;
+ }
+
+ resetStartLocation(node, start, startLoc) {
+ node.start = start;
+ node.loc.start = startLoc;
+ if (this.options.ranges) node.range[0] = start;
+ }
+
+ resetEndLocation(node, end = this.state.lastTokEnd, endLoc = this.state.lastTokEndLoc) {
+ node.end = end;
+ node.loc.end = endLoc;
+ if (this.options.ranges) node.range[1] = end;
+ }
+
+ resetStartLocationFromNode(node, locationNode) {
+ this.resetStartLocation(node, locationNode.start, locationNode.loc.start);
+ }
+
+}
+
+const reservedTypes = new Set(["_", "any", "bool", "boolean", "empty", "extends", "false", "interface", "mixed", "null", "number", "static", "string", "true", "typeof", "void"]);
+const FlowErrors = makeErrorTemplates({
+ AmbiguousConditionalArrow: "Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",
+ AmbiguousDeclareModuleKind: "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",
+ AssignReservedType: "Cannot overwrite reserved type %0.",
+ DeclareClassElement: "The `declare` modifier can only appear on class fields.",
+ DeclareClassFieldInitializer: "Initializers are not allowed in fields with the `declare` modifier.",
+ DuplicateDeclareModuleExports: "Duplicate `declare module.exports` statement.",
+ EnumBooleanMemberNotInitialized: "Boolean enum members need to be initialized. Use either `%0 = true,` or `%0 = false,` in enum `%1`.",
+ EnumDuplicateMemberName: "Enum member names need to be unique, but the name `%0` has already been used before in enum `%1`.",
+ EnumInconsistentMemberValues: "Enum `%0` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.",
+ EnumInvalidExplicitType: "Enum type `%1` is not valid. Use one of `boolean`, `number`, `string`, or `symbol` in enum `%0`.",
+ EnumInvalidExplicitTypeUnknownSupplied: "Supplied enum type is not valid. Use one of `boolean`, `number`, `string`, or `symbol` in enum `%0`.",
+ EnumInvalidMemberInitializerPrimaryType: "Enum `%0` has type `%2`, so the initializer of `%1` needs to be a %2 literal.",
+ EnumInvalidMemberInitializerSymbolType: "Symbol enum members cannot be initialized. Use `%1,` in enum `%0`.",
+ EnumInvalidMemberInitializerUnknownType: "The enum member initializer for `%1` needs to be a literal (either a boolean, number, or string) in enum `%0`.",
+ EnumInvalidMemberName: "Enum member names cannot start with lowercase 'a' through 'z'. Instead of using `%0`, consider using `%1`, in enum `%2`.",
+ EnumNumberMemberNotInitialized: "Number enum members need to be initialized, e.g. `%1 = 1` in enum `%0`.",
+ EnumStringMemberInconsistentlyInitailized: "String enum members need to consistently either all use initializers, or use no initializers, in enum `%0`.",
+ GetterMayNotHaveThisParam: "A getter cannot have a `this` parameter.",
+ ImportTypeShorthandOnlyInPureImport: "The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",
+ InexactInsideExact: "Explicit inexact syntax cannot appear inside an explicit exact object type.",
+ InexactInsideNonObject: "Explicit inexact syntax cannot appear in class or interface definitions.",
+ InexactVariance: "Explicit inexact syntax cannot have variance.",
+ InvalidNonTypeImportInDeclareModule: "Imports within a `declare module` body must always be `import type` or `import typeof`.",
+ MissingTypeParamDefault: "Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",
+ NestedDeclareModule: "`declare module` cannot be used inside another `declare module`.",
+ NestedFlowComment: "Cannot have a flow comment inside another flow comment.",
+ PatternIsOptional: "A binding pattern parameter cannot be optional in an implementation signature.",
+ SetterMayNotHaveThisParam: "A setter cannot have a `this` parameter.",
+ SpreadVariance: "Spread properties cannot have variance.",
+ ThisParamAnnotationRequired: "A type annotation is required for the `this` parameter.",
+ ThisParamBannedInConstructor: "Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",
+ ThisParamMayNotBeOptional: "The `this` parameter cannot be optional.",
+ ThisParamMustBeFirst: "The `this` parameter must be the first function parameter.",
+ ThisParamNoDefault: "The `this` parameter may not have a default value.",
+ TypeBeforeInitializer: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",
+ TypeCastInPattern: "The type cast expression is expected to be wrapped with parenthesis.",
+ UnexpectedExplicitInexactInObject: "Explicit inexact syntax must appear at the end of an inexact object.",
+ UnexpectedReservedType: "Unexpected reserved type %0.",
+ UnexpectedReservedUnderscore: "`_` is only allowed as a type argument to call or new.",
+ UnexpectedSpaceBetweenModuloChecks: "Spaces between `%` and `checks` are not allowed here.",
+ UnexpectedSpreadType: "Spread operator cannot appear in class or interface definitions.",
+ UnexpectedSubtractionOperand: 'Unexpected token, expected "number" or "bigint".',
+ UnexpectedTokenAfterTypeParameter: "Expected an arrow function after this type parameter declaration.",
+ UnexpectedTypeParameterBeforeAsyncArrowFunction: "Type parameters must come after the async keyword, e.g. instead of `<T> async () => {}`, use `async <T>() => {}`.",
+ UnsupportedDeclareExportKind: "`declare export %0` is not supported. Use `%1` instead.",
+ UnsupportedStatementInDeclareModule: "Only declares and type imports are allowed inside declare module.",
+ UnterminatedFlowComment: "Unterminated flow-comment."
+}, ErrorCodes.SyntaxError, "flow");
+
+function isEsModuleType(bodyElement) {
+ return bodyElement.type === "DeclareExportAllDeclaration" || bodyElement.type === "DeclareExportDeclaration" && (!bodyElement.declaration || bodyElement.declaration.type !== "TypeAlias" && bodyElement.declaration.type !== "InterfaceDeclaration");
+}
+
+function hasTypeImportKind(node) {
+ return node.importKind === "type" || node.importKind === "typeof";
+}
+
+function isMaybeDefaultImport(state) {
+ return (state.type === 5 || tokenIsKeyword(state.type)) && state.value !== "from";
+}
+
+const exportSuggestions = {
+ const: "declare export var",
+ let: "declare export var",
+ type: "export type",
+ interface: "export interface"
+};
+
+function partition(list, test) {
+ const list1 = [];
+ const list2 = [];
+
+ for (let i = 0; i < list.length; i++) {
+ (test(list[i], i, list) ? list1 : list2).push(list[i]);
+ }
+
+ return [list1, list2];
+}
+
+const FLOW_PRAGMA_REGEX = /\*?\s*@((?:no)?flow)\b/;
+var flow = (superClass => class extends superClass {
+ constructor(...args) {
+ super(...args);
+ this.flowPragma = undefined;
+ }
+
+ getScopeHandler() {
+ return FlowScopeHandler;
+ }
+
+ shouldParseTypes() {
+ return this.getPluginOption("flow", "all") || this.flowPragma === "flow";
+ }
+
+ shouldParseEnums() {
+ return !!this.getPluginOption("flow", "enums");
+ }
+
+ finishToken(type, val) {
+ if (type !== 4 && type !== 21 && type !== 34) {
+ if (this.flowPragma === undefined) {
+ this.flowPragma = null;
+ }
+ }
+
+ return super.finishToken(type, val);
+ }
+
+ addComment(comment) {
+ if (this.flowPragma === undefined) {
+ const matches = FLOW_PRAGMA_REGEX.exec(comment.value);
+
+ if (!matches) ; else if (matches[1] === "flow") {
+ this.flowPragma = "flow";
+ } else if (matches[1] === "noflow") {
+ this.flowPragma = "noflow";
+ } else {
+ throw new Error("Unexpected flow pragma");
+ }
+ }
+
+ return super.addComment(comment);
+ }
+
+ flowParseTypeInitialiser(tok) {
+ const oldInType = this.state.inType;
+ this.state.inType = true;
+ this.expect(tok || 22);
+ const type = this.flowParseType();
+ this.state.inType = oldInType;
+ return type;
+ }
+
+ flowParsePredicate() {
+ const node = this.startNode();
+ const moduloPos = this.state.start;
+ this.next();
+ this.expectContextual("checks");
+
+ if (this.state.lastTokStart > moduloPos + 1) {
+ this.raise(moduloPos, FlowErrors.UnexpectedSpaceBetweenModuloChecks);
+ }
+
+ if (this.eat(18)) {
+ node.value = this.parseExpression();
+ this.expect(19);
+ return this.finishNode(node, "DeclaredPredicate");
+ } else {
+ return this.finishNode(node, "InferredPredicate");
+ }
+ }
+
+ flowParseTypeAndPredicateInitialiser() {
+ const oldInType = this.state.inType;
+ this.state.inType = true;
+ this.expect(22);
+ let type = null;
+ let predicate = null;
+
+ if (this.match(53)) {
+ this.state.inType = oldInType;
+ predicate = this.flowParsePredicate();
+ } else {
+ type = this.flowParseType();
+ this.state.inType = oldInType;
+
+ if (this.match(53)) {
+ predicate = this.flowParsePredicate();
+ }
+ }
+
+ return [type, predicate];
+ }
+
+ flowParseDeclareClass(node) {
+ this.next();
+ this.flowParseInterfaceish(node, true);
+ return this.finishNode(node, "DeclareClass");
+ }
+
+ flowParseDeclareFunction(node) {
+ this.next();
+ const id = node.id = this.parseIdentifier();
+ const typeNode = this.startNode();
+ const typeContainer = this.startNode();
+
+ if (this.isRelational("<")) {
+ typeNode.typeParameters = this.flowParseTypeParameterDeclaration();
+ } else {
+ typeNode.typeParameters = null;
+ }
+
+ this.expect(18);
+ const tmp = this.flowParseFunctionTypeParams();
+ typeNode.params = tmp.params;
+ typeNode.rest = tmp.rest;
+ typeNode.this = tmp._this;
+ this.expect(19);
+ [typeNode.returnType, node.predicate] = this.flowParseTypeAndPredicateInitialiser();
+ typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation");
+ id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation");
+ this.resetEndLocation(id);
+ this.semicolon();
+ this.scope.declareName(node.id.name, BIND_FLOW_DECLARE_FN, node.id.start);
+ return this.finishNode(node, "DeclareFunction");
+ }
+
+ flowParseDeclare(node, insideModule) {
+ if (this.match(79)) {
+ return this.flowParseDeclareClass(node);
+ } else if (this.match(67)) {
+ return this.flowParseDeclareFunction(node);
+ } else if (this.match(73)) {
+ return this.flowParseDeclareVariable(node);
+ } else if (this.eatContextual("module")) {
+ if (this.match(24)) {
+ return this.flowParseDeclareModuleExports(node);
+ } else {
+ if (insideModule) {
+ this.raise(this.state.lastTokStart, FlowErrors.NestedDeclareModule);
+ }
+
+ return this.flowParseDeclareModule(node);
+ }
+ } else if (this.isContextual("type")) {
+ return this.flowParseDeclareTypeAlias(node);
+ } else if (this.isContextual("opaque")) {
+ return this.flowParseDeclareOpaqueType(node);
+ } else if (this.isContextual("interface")) {
+ return this.flowParseDeclareInterface(node);
+ } else if (this.match(81)) {
+ return this.flowParseDeclareExportDeclaration(node, insideModule);
+ } else {
+ throw this.unexpected();
+ }
+ }
+
+ flowParseDeclareVariable(node) {
+ this.next();
+ node.id = this.flowParseTypeAnnotatableIdentifier(true);
+ this.scope.declareName(node.id.name, BIND_VAR, node.id.start);
+ this.semicolon();
+ return this.finishNode(node, "DeclareVariable");
+ }
+
+ flowParseDeclareModule(node) {
+ this.scope.enter(SCOPE_OTHER);
+
+ if (this.match(4)) {
+ node.id = this.parseExprAtom();
+ } else {
+ node.id = this.parseIdentifier();
+ }
+
+ const bodyNode = node.body = this.startNode();
+ const body = bodyNode.body = [];
+ this.expect(13);
+
+ while (!this.match(16)) {
+ let bodyNode = this.startNode();
+
+ if (this.match(82)) {
+ this.next();
+
+ if (!this.isContextual("type") && !this.match(86)) {
+ this.raise(this.state.lastTokStart, FlowErrors.InvalidNonTypeImportInDeclareModule);
+ }
+
+ this.parseImport(bodyNode);
+ } else {
+ this.expectContextual("declare", FlowErrors.UnsupportedStatementInDeclareModule);
+ bodyNode = this.flowParseDeclare(bodyNode, true);
+ }
+
+ body.push(bodyNode);
+ }
+
+ this.scope.exit();
+ this.expect(16);
+ this.finishNode(bodyNode, "BlockStatement");
+ let kind = null;
+ let hasModuleExport = false;
+ body.forEach(bodyElement => {
+ if (isEsModuleType(bodyElement)) {
+ if (kind === "CommonJS") {
+ this.raise(bodyElement.start, FlowErrors.AmbiguousDeclareModuleKind);
+ }
+
+ kind = "ES";
+ } else if (bodyElement.type === "DeclareModuleExports") {
+ if (hasModuleExport) {
+ this.raise(bodyElement.start, FlowErrors.DuplicateDeclareModuleExports);
+ }
+
+ if (kind === "ES") {
+ this.raise(bodyElement.start, FlowErrors.AmbiguousDeclareModuleKind);
+ }
+
+ kind = "CommonJS";
+ hasModuleExport = true;
+ }
+ });
+ node.kind = kind || "CommonJS";
+ return this.finishNode(node, "DeclareModule");
+ }
+
+ flowParseDeclareExportDeclaration(node, insideModule) {
+ this.expect(81);
+
+ if (this.eat(64)) {
+ if (this.match(67) || this.match(79)) {
+ node.declaration = this.flowParseDeclare(this.startNode());
+ } else {
+ node.declaration = this.flowParseType();
+ this.semicolon();
+ }
+
+ node.default = true;
+ return this.finishNode(node, "DeclareExportDeclaration");
+ } else {
+ if (this.match(74) || this.isLet() || (this.isContextual("type") || this.isContextual("interface")) && !insideModule) {
+ const label = this.state.value;
+ const suggestion = exportSuggestions[label];
+ throw this.raise(this.state.start, FlowErrors.UnsupportedDeclareExportKind, label, suggestion);
+ }
+
+ if (this.match(73) || this.match(67) || this.match(79) || this.isContextual("opaque")) {
+ node.declaration = this.flowParseDeclare(this.startNode());
+ node.default = false;
+ return this.finishNode(node, "DeclareExportDeclaration");
+ } else if (this.match(54) || this.match(13) || this.isContextual("interface") || this.isContextual("type") || this.isContextual("opaque")) {
+ node = this.parseExport(node);
+
+ if (node.type === "ExportNamedDeclaration") {
+ node.type = "ExportDeclaration";
+ node.default = false;
+ delete node.exportKind;
+ }
+
+ node.type = "Declare" + node.type;
+ return node;
+ }
+ }
+
+ throw this.unexpected();
+ }
+
+ flowParseDeclareModuleExports(node) {
+ this.next();
+ this.expectContextual("exports");
+ node.typeAnnotation = this.flowParseTypeAnnotation();
+ this.semicolon();
+ return this.finishNode(node, "DeclareModuleExports");
+ }
+
+ flowParseDeclareTypeAlias(node) {
+ this.next();
+ this.flowParseTypeAlias(node);
+ node.type = "DeclareTypeAlias";
+ return node;
+ }
+
+ flowParseDeclareOpaqueType(node) {
+ this.next();
+ this.flowParseOpaqueType(node, true);
+ node.type = "DeclareOpaqueType";
+ return node;
+ }
+
+ flowParseDeclareInterface(node) {
+ this.next();
+ this.flowParseInterfaceish(node);
+ return this.finishNode(node, "DeclareInterface");
+ }
+
+ flowParseInterfaceish(node, isClass = false) {
+ node.id = this.flowParseRestrictedIdentifier(!isClass, true);
+ this.scope.declareName(node.id.name, isClass ? BIND_FUNCTION : BIND_LEXICAL, node.id.start);
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ } else {
+ node.typeParameters = null;
+ }
+
+ node.extends = [];
+ node.implements = [];
+ node.mixins = [];
+
+ if (this.eat(80)) {
+ do {
+ node.extends.push(this.flowParseInterfaceExtends());
+ } while (!isClass && this.eat(20));
+ }
+
+ if (this.isContextual("mixins")) {
+ this.next();
+
+ do {
+ node.mixins.push(this.flowParseInterfaceExtends());
+ } while (this.eat(20));
+ }
+
+ if (this.isContextual("implements")) {
+ this.next();
+
+ do {
+ node.implements.push(this.flowParseInterfaceExtends());
+ } while (this.eat(20));
+ }
+
+ node.body = this.flowParseObjectType({
+ allowStatic: isClass,
+ allowExact: false,
+ allowSpread: false,
+ allowProto: isClass,
+ allowInexact: false
+ });
+ }
+
+ flowParseInterfaceExtends() {
+ const node = this.startNode();
+ node.id = this.flowParseQualifiedTypeIdentifier();
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterInstantiation();
+ } else {
+ node.typeParameters = null;
+ }
+
+ return this.finishNode(node, "InterfaceExtends");
+ }
+
+ flowParseInterface(node) {
+ this.flowParseInterfaceish(node);
+ return this.finishNode(node, "InterfaceDeclaration");
+ }
+
+ checkNotUnderscore(word) {
+ if (word === "_") {
+ this.raise(this.state.start, FlowErrors.UnexpectedReservedUnderscore);
+ }
+ }
+
+ checkReservedType(word, startLoc, declaration) {
+ if (!reservedTypes.has(word)) return;
+ this.raise(startLoc, declaration ? FlowErrors.AssignReservedType : FlowErrors.UnexpectedReservedType, word);
+ }
+
+ flowParseRestrictedIdentifier(liberal, declaration) {
+ this.checkReservedType(this.state.value, this.state.start, declaration);
+ return this.parseIdentifier(liberal);
+ }
+
+ flowParseTypeAlias(node) {
+ node.id = this.flowParseRestrictedIdentifier(false, true);
+ this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.start);
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ } else {
+ node.typeParameters = null;
+ }
+
+ node.right = this.flowParseTypeInitialiser(35);
+ this.semicolon();
+ return this.finishNode(node, "TypeAlias");
+ }
+
+ flowParseOpaqueType(node, declare) {
+ this.expectContextual("type");
+ node.id = this.flowParseRestrictedIdentifier(true, true);
+ this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.start);
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ } else {
+ node.typeParameters = null;
+ }
+
+ node.supertype = null;
+
+ if (this.match(22)) {
+ node.supertype = this.flowParseTypeInitialiser(22);
+ }
+
+ node.impltype = null;
+
+ if (!declare) {
+ node.impltype = this.flowParseTypeInitialiser(35);
+ }
+
+ this.semicolon();
+ return this.finishNode(node, "OpaqueType");
+ }
+
+ flowParseTypeParameter(requireDefault = false) {
+ const nodeStart = this.state.start;
+ const node = this.startNode();
+ const variance = this.flowParseVariance();
+ const ident = this.flowParseTypeAnnotatableIdentifier();
+ node.name = ident.name;
+ node.variance = variance;
+ node.bound = ident.typeAnnotation;
+
+ if (this.match(35)) {
+ this.eat(35);
+ node.default = this.flowParseType();
+ } else {
+ if (requireDefault) {
+ this.raise(nodeStart, FlowErrors.MissingTypeParamDefault);
+ }
+ }
+
+ return this.finishNode(node, "TypeParameter");
+ }
+
+ flowParseTypeParameterDeclaration() {
+ const oldInType = this.state.inType;
+ const node = this.startNode();
+ node.params = [];
+ this.state.inType = true;
+
+ if (this.isRelational("<") || this.match(94)) {
+ this.next();
+ } else {
+ this.unexpected();
+ }
+
+ let defaultRequired = false;
+
+ do {
+ const typeParameter = this.flowParseTypeParameter(defaultRequired);
+ node.params.push(typeParameter);
+
+ if (typeParameter.default) {
+ defaultRequired = true;
+ }
+
+ if (!this.isRelational(">")) {
+ this.expect(20);
+ }
+ } while (!this.isRelational(">"));
+
+ this.expectRelational(">");
+ this.state.inType = oldInType;
+ return this.finishNode(node, "TypeParameterDeclaration");
+ }
+
+ flowParseTypeParameterInstantiation() {
+ const node = this.startNode();
+ const oldInType = this.state.inType;
+ node.params = [];
+ this.state.inType = true;
+ this.expectRelational("<");
+ const oldNoAnonFunctionType = this.state.noAnonFunctionType;
+ this.state.noAnonFunctionType = false;
+
+ while (!this.isRelational(">")) {
+ node.params.push(this.flowParseType());
+
+ if (!this.isRelational(">")) {
+ this.expect(20);
+ }
+ }
+
+ this.state.noAnonFunctionType = oldNoAnonFunctionType;
+ this.expectRelational(">");
+ this.state.inType = oldInType;
+ return this.finishNode(node, "TypeParameterInstantiation");
+ }
+
+ flowParseTypeParameterInstantiationCallOrNew() {
+ const node = this.startNode();
+ const oldInType = this.state.inType;
+ node.params = [];
+ this.state.inType = true;
+ this.expectRelational("<");
+
+ while (!this.isRelational(">")) {
+ node.params.push(this.flowParseTypeOrImplicitInstantiation());
+
+ if (!this.isRelational(">")) {
+ this.expect(20);
+ }
+ }
+
+ this.expectRelational(">");
+ this.state.inType = oldInType;
+ return this.finishNode(node, "TypeParameterInstantiation");
+ }
+
+ flowParseInterfaceType() {
+ const node = this.startNode();
+ this.expectContextual("interface");
+ node.extends = [];
+
+ if (this.eat(80)) {
+ do {
+ node.extends.push(this.flowParseInterfaceExtends());
+ } while (this.eat(20));
+ }
+
+ node.body = this.flowParseObjectType({
+ allowStatic: false,
+ allowExact: false,
+ allowSpread: false,
+ allowProto: false,
+ allowInexact: false
+ });
+ return this.finishNode(node, "InterfaceTypeAnnotation");
+ }
+
+ flowParseObjectPropertyKey() {
+ return this.match(0) || this.match(4) ? this.parseExprAtom() : this.parseIdentifier(true);
+ }
+
+ flowParseObjectTypeIndexer(node, isStatic, variance) {
+ node.static = isStatic;
+
+ if (this.lookahead().type === 22) {
+ node.id = this.flowParseObjectPropertyKey();
+ node.key = this.flowParseTypeInitialiser();
+ } else {
+ node.id = null;
+ node.key = this.flowParseType();
+ }
+
+ this.expect(11);
+ node.value = this.flowParseTypeInitialiser();
+ node.variance = variance;
+ return this.finishNode(node, "ObjectTypeIndexer");
+ }
+
+ flowParseObjectTypeInternalSlot(node, isStatic) {
+ node.static = isStatic;
+ node.id = this.flowParseObjectPropertyKey();
+ this.expect(11);
+ this.expect(11);
+
+ if (this.isRelational("<") || this.match(18)) {
+ node.method = true;
+ node.optional = false;
+ node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.start, node.loc.start));
+ } else {
+ node.method = false;
+
+ if (this.eat(25)) {
+ node.optional = true;
+ }
+
+ node.value = this.flowParseTypeInitialiser();
+ }
+
+ return this.finishNode(node, "ObjectTypeInternalSlot");
+ }
+
+ flowParseObjectTypeMethodish(node) {
+ node.params = [];
+ node.rest = null;
+ node.typeParameters = null;
+ node.this = null;
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ }
+
+ this.expect(18);
+
+ if (this.match(77)) {
+ node.this = this.flowParseFunctionTypeParam(true);
+ node.this.name = null;
+
+ if (!this.match(19)) {
+ this.expect(20);
+ }
+ }
+
+ while (!this.match(19) && !this.match(29)) {
+ node.params.push(this.flowParseFunctionTypeParam(false));
+
+ if (!this.match(19)) {
+ this.expect(20);
+ }
+ }
+
+ if (this.eat(29)) {
+ node.rest = this.flowParseFunctionTypeParam(false);
+ }
+
+ this.expect(19);
+ node.returnType = this.flowParseTypeInitialiser();
+ return this.finishNode(node, "FunctionTypeAnnotation");
+ }
+
+ flowParseObjectTypeCallProperty(node, isStatic) {
+ const valueNode = this.startNode();
+ node.static = isStatic;
+ node.value = this.flowParseObjectTypeMethodish(valueNode);
+ return this.finishNode(node, "ObjectTypeCallProperty");
+ }
+
+ flowParseObjectType({
+ allowStatic,
+ allowExact,
+ allowSpread,
+ allowProto,
+ allowInexact
+ }) {
+ const oldInType = this.state.inType;
+ this.state.inType = true;
+ const nodeStart = this.startNode();
+ nodeStart.callProperties = [];
+ nodeStart.properties = [];
+ nodeStart.indexers = [];
+ nodeStart.internalSlots = [];
+ let endDelim;
+ let exact;
+ let inexact = false;
+
+ if (allowExact && this.match(14)) {
+ this.expect(14);
+ endDelim = 17;
+ exact = true;
+ } else {
+ this.expect(13);
+ endDelim = 16;
+ exact = false;
+ }
+
+ nodeStart.exact = exact;
+
+ while (!this.match(endDelim)) {
+ let isStatic = false;
+ let protoStart = null;
+ let inexactStart = null;
+ const node = this.startNode();
+
+ if (allowProto && this.isContextual("proto")) {
+ const lookahead = this.lookahead();
+
+ if (lookahead.type !== 22 && lookahead.type !== 25) {
+ this.next();
+ protoStart = this.state.start;
+ allowStatic = false;
+ }
+ }
+
+ if (allowStatic && this.isContextual("static")) {
+ const lookahead = this.lookahead();
+
+ if (lookahead.type !== 22 && lookahead.type !== 25) {
+ this.next();
+ isStatic = true;
+ }
+ }
+
+ const variance = this.flowParseVariance();
+
+ if (this.eat(8)) {
+ if (protoStart != null) {
+ this.unexpected(protoStart);
+ }
+
+ if (this.eat(8)) {
+ if (variance) {
+ this.unexpected(variance.start);
+ }
+
+ nodeStart.internalSlots.push(this.flowParseObjectTypeInternalSlot(node, isStatic));
+ } else {
+ nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance));
+ }
+ } else if (this.match(18) || this.isRelational("<")) {
+ if (protoStart != null) {
+ this.unexpected(protoStart);
+ }
+
+ if (variance) {
+ this.unexpected(variance.start);
+ }
+
+ nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic));
+ } else {
+ let kind = "init";
+
+ if (this.isContextual("get") || this.isContextual("set")) {
+ const lookahead = this.lookahead();
+
+ if (lookahead.type === 5 || lookahead.type === 4 || lookahead.type === 0) {
+ kind = this.state.value;
+ this.next();
+ }
+ }
+
+ const propOrInexact = this.flowParseObjectTypeProperty(node, isStatic, protoStart, variance, kind, allowSpread, allowInexact != null ? allowInexact : !exact);
+
+ if (propOrInexact === null) {
+ inexact = true;
+ inexactStart = this.state.lastTokStart;
+ } else {
+ nodeStart.properties.push(propOrInexact);
+ }
+ }
+
+ this.flowObjectTypeSemicolon();
+
+ if (inexactStart && !this.match(16) && !this.match(17)) {
+ this.raise(inexactStart, FlowErrors.UnexpectedExplicitInexactInObject);
+ }
+ }
+
+ this.expect(endDelim);
+
+ if (allowSpread) {
+ nodeStart.inexact = inexact;
+ }
+
+ const out = this.finishNode(nodeStart, "ObjectTypeAnnotation");
+ this.state.inType = oldInType;
+ return out;
+ }
+
+ flowParseObjectTypeProperty(node, isStatic, protoStart, variance, kind, allowSpread, allowInexact) {
+ if (this.eat(29)) {
+ const isInexactToken = this.match(20) || this.match(21) || this.match(16) || this.match(17);
+
+ if (isInexactToken) {
+ if (!allowSpread) {
+ this.raise(this.state.lastTokStart, FlowErrors.InexactInsideNonObject);
+ } else if (!allowInexact) {
+ this.raise(this.state.lastTokStart, FlowErrors.InexactInsideExact);
+ }
+
+ if (variance) {
+ this.raise(variance.start, FlowErrors.InexactVariance);
+ }
+
+ return null;
+ }
+
+ if (!allowSpread) {
+ this.raise(this.state.lastTokStart, FlowErrors.UnexpectedSpreadType);
+ }
+
+ if (protoStart != null) {
+ this.unexpected(protoStart);
+ }
+
+ if (variance) {
+ this.raise(variance.start, FlowErrors.SpreadVariance);
+ }
+
+ node.argument = this.flowParseType();
+ return this.finishNode(node, "ObjectTypeSpreadProperty");
+ } else {
+ node.key = this.flowParseObjectPropertyKey();
+ node.static = isStatic;
+ node.proto = protoStart != null;
+ node.kind = kind;
+ let optional = false;
+
+ if (this.isRelational("<") || this.match(18)) {
+ node.method = true;
+
+ if (protoStart != null) {
+ this.unexpected(protoStart);
+ }
+
+ if (variance) {
+ this.unexpected(variance.start);
+ }
+
+ node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.start, node.loc.start));
+
+ if (kind === "get" || kind === "set") {
+ this.flowCheckGetterSetterParams(node);
+ }
+
+ if (!allowSpread && node.key.name === "constructor" && node.value.this) {
+ this.raise(node.value.this.start, FlowErrors.ThisParamBannedInConstructor);
+ }
+ } else {
+ if (kind !== "init") this.unexpected();
+ node.method = false;
+
+ if (this.eat(25)) {
+ optional = true;
+ }
+
+ node.value = this.flowParseTypeInitialiser();
+ node.variance = variance;
+ }
+
+ node.optional = optional;
+ return this.finishNode(node, "ObjectTypeProperty");
+ }
+ }
+
+ flowCheckGetterSetterParams(property) {
+ const paramCount = property.kind === "get" ? 0 : 1;
+ const start = property.start;
+ const length = property.value.params.length + (property.value.rest ? 1 : 0);
+
+ if (property.value.this) {
+ this.raise(property.value.this.start, property.kind === "get" ? FlowErrors.GetterMayNotHaveThisParam : FlowErrors.SetterMayNotHaveThisParam);
+ }
+
+ if (length !== paramCount) {
+ if (property.kind === "get") {
+ this.raise(start, ErrorMessages.BadGetterArity);
+ } else {
+ this.raise(start, ErrorMessages.BadSetterArity);
+ }
+ }
+
+ if (property.kind === "set" && property.value.rest) {
+ this.raise(start, ErrorMessages.BadSetterRestParameter);
+ }
+ }
+
+ flowObjectTypeSemicolon() {
+ if (!this.eat(21) && !this.eat(20) && !this.match(16) && !this.match(17)) {
+ this.unexpected();
+ }
+ }
+
+ flowParseQualifiedTypeIdentifier(startPos, startLoc, id) {
+ startPos = startPos || this.state.start;
+ startLoc = startLoc || this.state.startLoc;
+ let node = id || this.flowParseRestrictedIdentifier(true);
+
+ while (this.eat(24)) {
+ const node2 = this.startNodeAt(startPos, startLoc);
+ node2.qualification = node;
+ node2.id = this.flowParseRestrictedIdentifier(true);
+ node = this.finishNode(node2, "QualifiedTypeIdentifier");
+ }
+
+ return node;
+ }
+
+ flowParseGenericType(startPos, startLoc, id) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.typeParameters = null;
+ node.id = this.flowParseQualifiedTypeIdentifier(startPos, startLoc, id);
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterInstantiation();
+ }
+
+ return this.finishNode(node, "GenericTypeAnnotation");
+ }
+
+ flowParseTypeofType() {
+ const node = this.startNode();
+ this.expect(86);
+ node.argument = this.flowParsePrimaryType();
+ return this.finishNode(node, "TypeofTypeAnnotation");
+ }
+
+ flowParseTupleType() {
+ const node = this.startNode();
+ node.types = [];
+ this.expect(8);
+
+ while (this.state.pos < this.length && !this.match(11)) {
+ node.types.push(this.flowParseType());
+ if (this.match(11)) break;
+ this.expect(20);
+ }
+
+ this.expect(11);
+ return this.finishNode(node, "TupleTypeAnnotation");
+ }
+
+ flowParseFunctionTypeParam(first) {
+ let name = null;
+ let optional = false;
+ let typeAnnotation = null;
+ const node = this.startNode();
+ const lh = this.lookahead();
+ const isThis = this.state.type === 77;
+
+ if (lh.type === 22 || lh.type === 25) {
+ if (isThis && !first) {
+ this.raise(node.start, FlowErrors.ThisParamMustBeFirst);
+ }
+
+ name = this.parseIdentifier(isThis);
+
+ if (this.eat(25)) {
+ optional = true;
+
+ if (isThis) {
+ this.raise(node.start, FlowErrors.ThisParamMayNotBeOptional);
+ }
+ }
+
+ typeAnnotation = this.flowParseTypeInitialiser();
+ } else {
+ typeAnnotation = this.flowParseType();
+ }
+
+ node.name = name;
+ node.optional = optional;
+ node.typeAnnotation = typeAnnotation;
+ return this.finishNode(node, "FunctionTypeParam");
+ }
+
+ reinterpretTypeAsFunctionTypeParam(type) {
+ const node = this.startNodeAt(type.start, type.loc.start);
+ node.name = null;
+ node.optional = false;
+ node.typeAnnotation = type;
+ return this.finishNode(node, "FunctionTypeParam");
+ }
+
+ flowParseFunctionTypeParams(params = []) {
+ let rest = null;
+ let _this = null;
+
+ if (this.match(77)) {
+ _this = this.flowParseFunctionTypeParam(true);
+ _this.name = null;
+
+ if (!this.match(19)) {
+ this.expect(20);
+ }
+ }
+
+ while (!this.match(19) && !this.match(29)) {
+ params.push(this.flowParseFunctionTypeParam(false));
+
+ if (!this.match(19)) {
+ this.expect(20);
+ }
+ }
+
+ if (this.eat(29)) {
+ rest = this.flowParseFunctionTypeParam(false);
+ }
+
+ return {
+ params,
+ rest,
+ _this
+ };
+ }
+
+ flowIdentToTypeAnnotation(startPos, startLoc, node, id) {
+ switch (id.name) {
+ case "any":
+ return this.finishNode(node, "AnyTypeAnnotation");
+
+ case "bool":
+ case "boolean":
+ return this.finishNode(node, "BooleanTypeAnnotation");
+
+ case "mixed":
+ return this.finishNode(node, "MixedTypeAnnotation");
+
+ case "empty":
+ return this.finishNode(node, "EmptyTypeAnnotation");
+
+ case "number":
+ return this.finishNode(node, "NumberTypeAnnotation");
+
+ case "string":
+ return this.finishNode(node, "StringTypeAnnotation");
+
+ case "symbol":
+ return this.finishNode(node, "SymbolTypeAnnotation");
+
+ default:
+ this.checkNotUnderscore(id.name);
+ return this.flowParseGenericType(startPos, startLoc, id);
+ }
+ }
+
+ flowParsePrimaryType() {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const node = this.startNode();
+ let tmp;
+ let type;
+ let isGroupedType = false;
+ const oldNoAnonFunctionType = this.state.noAnonFunctionType;
+
+ switch (this.state.type) {
+ case 5:
+ if (this.isContextual("interface")) {
+ return this.flowParseInterfaceType();
+ }
+
+ return this.flowIdentToTypeAnnotation(startPos, startLoc, node, this.parseIdentifier());
+
+ case 13:
+ return this.flowParseObjectType({
+ allowStatic: false,
+ allowExact: false,
+ allowSpread: true,
+ allowProto: false,
+ allowInexact: true
+ });
+
+ case 14:
+ return this.flowParseObjectType({
+ allowStatic: false,
+ allowExact: true,
+ allowSpread: true,
+ allowProto: false,
+ allowInexact: false
+ });
+
+ case 8:
+ this.state.noAnonFunctionType = false;
+ type = this.flowParseTupleType();
+ this.state.noAnonFunctionType = oldNoAnonFunctionType;
+ return type;
+
+ case 50:
+ if (this.state.value === "<") {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ this.expect(18);
+ tmp = this.flowParseFunctionTypeParams();
+ node.params = tmp.params;
+ node.rest = tmp.rest;
+ node.this = tmp._this;
+ this.expect(19);
+ this.expect(27);
+ node.returnType = this.flowParseType();
+ return this.finishNode(node, "FunctionTypeAnnotation");
+ }
+
+ break;
+
+ case 18:
+ this.next();
+
+ if (!this.match(19) && !this.match(29)) {
+ if (this.match(5) || this.match(77)) {
+ const token = this.lookahead().type;
+ isGroupedType = token !== 25 && token !== 22;
+ } else {
+ isGroupedType = true;
+ }
+ }
+
+ if (isGroupedType) {
+ this.state.noAnonFunctionType = false;
+ type = this.flowParseType();
+ this.state.noAnonFunctionType = oldNoAnonFunctionType;
+
+ if (this.state.noAnonFunctionType || !(this.match(20) || this.match(19) && this.lookahead().type === 27)) {
+ this.expect(19);
+ return type;
+ } else {
+ this.eat(20);
+ }
+ }
+
+ if (type) {
+ tmp = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type)]);
+ } else {
+ tmp = this.flowParseFunctionTypeParams();
+ }
+
+ node.params = tmp.params;
+ node.rest = tmp.rest;
+ node.this = tmp._this;
+ this.expect(19);
+ this.expect(27);
+ node.returnType = this.flowParseType();
+ node.typeParameters = null;
+ return this.finishNode(node, "FunctionTypeAnnotation");
+
+ case 4:
+ return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation");
+
+ case 84:
+ case 85:
+ node.value = this.match(84);
+ this.next();
+ return this.finishNode(node, "BooleanLiteralTypeAnnotation");
+
+ case 52:
+ if (this.state.value === "-") {
+ this.next();
+
+ if (this.match(0)) {
+ return this.parseLiteralAtNode(-this.state.value, "NumberLiteralTypeAnnotation", node);
+ }
+
+ if (this.match(1)) {
+ return this.parseLiteralAtNode(-this.state.value, "BigIntLiteralTypeAnnotation", node);
+ }
+
+ throw this.raise(this.state.start, FlowErrors.UnexpectedSubtractionOperand);
+ }
+
+ throw this.unexpected();
+
+ case 0:
+ return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation");
+
+ case 1:
+ return this.parseLiteral(this.state.value, "BigIntLiteralTypeAnnotation");
+
+ case 87:
+ this.next();
+ return this.finishNode(node, "VoidTypeAnnotation");
+
+ case 83:
+ this.next();
+ return this.finishNode(node, "NullLiteralTypeAnnotation");
+
+ case 77:
+ this.next();
+ return this.finishNode(node, "ThisTypeAnnotation");
+
+ case 54:
+ this.next();
+ return this.finishNode(node, "ExistsTypeAnnotation");
+
+ case 86:
+ return this.flowParseTypeofType();
+
+ default:
+ if (tokenIsKeyword(this.state.type)) {
+ const label = tokenLabelName(this.state.type);
+ this.next();
+ return super.createIdentifier(node, label);
+ }
+
+ }
+
+ throw this.unexpected();
+ }
+
+ flowParsePostfixType() {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ let type = this.flowParsePrimaryType();
+ let seenOptionalIndexedAccess = false;
+
+ while ((this.match(8) || this.match(26)) && !this.canInsertSemicolon()) {
+ const node = this.startNodeAt(startPos, startLoc);
+ const optional = this.eat(26);
+ seenOptionalIndexedAccess = seenOptionalIndexedAccess || optional;
+ this.expect(8);
+
+ if (!optional && this.match(11)) {
+ node.elementType = type;
+ this.next();
+ type = this.finishNode(node, "ArrayTypeAnnotation");
+ } else {
+ node.objectType = type;
+ node.indexType = this.flowParseType();
+ this.expect(11);
+
+ if (seenOptionalIndexedAccess) {
+ node.optional = optional;
+ type = this.finishNode(node, "OptionalIndexedAccessType");
+ } else {
+ type = this.finishNode(node, "IndexedAccessType");
+ }
+ }
+ }
+
+ return type;
+ }
+
+ flowParsePrefixType() {
+ const node = this.startNode();
+
+ if (this.eat(25)) {
+ node.typeAnnotation = this.flowParsePrefixType();
+ return this.finishNode(node, "NullableTypeAnnotation");
+ } else {
+ return this.flowParsePostfixType();
+ }
+ }
+
+ flowParseAnonFunctionWithoutParens() {
+ const param = this.flowParsePrefixType();
+
+ if (!this.state.noAnonFunctionType && this.eat(27)) {
+ const node = this.startNodeAt(param.start, param.loc.start);
+ node.params = [this.reinterpretTypeAsFunctionTypeParam(param)];
+ node.rest = null;
+ node.this = null;
+ node.returnType = this.flowParseType();
+ node.typeParameters = null;
+ return this.finishNode(node, "FunctionTypeAnnotation");
+ }
+
+ return param;
+ }
+
+ flowParseIntersectionType() {
+ const node = this.startNode();
+ this.eat(48);
+ const type = this.flowParseAnonFunctionWithoutParens();
+ node.types = [type];
+
+ while (this.eat(48)) {
+ node.types.push(this.flowParseAnonFunctionWithoutParens());
+ }
+
+ return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation");
+ }
+
+ flowParseUnionType() {
+ const node = this.startNode();
+ this.eat(46);
+ const type = this.flowParseIntersectionType();
+ node.types = [type];
+
+ while (this.eat(46)) {
+ node.types.push(this.flowParseIntersectionType());
+ }
+
+ return node.types.length === 1 ? type : this.finishNode(node, "UnionTypeAnnotation");
+ }
+
+ flowParseType() {
+ const oldInType = this.state.inType;
+ this.state.inType = true;
+ const type = this.flowParseUnionType();
+ this.state.inType = oldInType;
+ return type;
+ }
+
+ flowParseTypeOrImplicitInstantiation() {
+ if (this.state.type === 5 && this.state.value === "_") {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const node = this.parseIdentifier();
+ return this.flowParseGenericType(startPos, startLoc, node);
+ } else {
+ return this.flowParseType();
+ }
+ }
+
+ flowParseTypeAnnotation() {
+ const node = this.startNode();
+ node.typeAnnotation = this.flowParseTypeInitialiser();
+ return this.finishNode(node, "TypeAnnotation");
+ }
+
+ flowParseTypeAnnotatableIdentifier(allowPrimitiveOverride) {
+ const ident = allowPrimitiveOverride ? this.parseIdentifier() : this.flowParseRestrictedIdentifier();
+
+ if (this.match(22)) {
+ ident.typeAnnotation = this.flowParseTypeAnnotation();
+ this.resetEndLocation(ident);
+ }
+
+ return ident;
+ }
+
+ typeCastToParameter(node) {
+ node.expression.typeAnnotation = node.typeAnnotation;
+ this.resetEndLocation(node.expression, node.typeAnnotation.end, node.typeAnnotation.loc.end);
+ return node.expression;
+ }
+
+ flowParseVariance() {
+ let variance = null;
+
+ if (this.match(52)) {
+ variance = this.startNode();
+
+ if (this.state.value === "+") {
+ variance.kind = "plus";
+ } else {
+ variance.kind = "minus";
+ }
+
+ this.next();
+ this.finishNode(variance, "Variance");
+ }
+
+ return variance;
+ }
+
+ parseFunctionBody(node, allowExpressionBody, isMethod = false) {
+ if (allowExpressionBody) {
+ return this.forwardNoArrowParamsConversionAt(node, () => super.parseFunctionBody(node, true, isMethod));
+ }
+
+ return super.parseFunctionBody(node, false, isMethod);
+ }
+
+ parseFunctionBodyAndFinish(node, type, isMethod = false) {
+ if (this.match(22)) {
+ const typeNode = this.startNode();
+ [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser();
+ node.returnType = typeNode.typeAnnotation ? this.finishNode(typeNode, "TypeAnnotation") : null;
+ }
+
+ super.parseFunctionBodyAndFinish(node, type, isMethod);
+ }
+
+ parseStatement(context, topLevel) {
+ if (this.state.strict && this.match(5) && this.state.value === "interface") {
+ const lookahead = this.lookahead();
+
+ if (lookahead.type === 5 || isKeyword(lookahead.value)) {
+ const node = this.startNode();
+ this.next();
+ return this.flowParseInterface(node);
+ }
+ } else if (this.shouldParseEnums() && this.isContextual("enum")) {
+ const node = this.startNode();
+ this.next();
+ return this.flowParseEnumDeclaration(node);
+ }
+
+ const stmt = super.parseStatement(context, topLevel);
+
+ if (this.flowPragma === undefined && !this.isValidDirective(stmt)) {
+ this.flowPragma = null;
+ }
+
+ return stmt;
+ }
+
+ parseExpressionStatement(node, expr) {
+ if (expr.type === "Identifier") {
+ if (expr.name === "declare") {
+ if (this.match(79) || this.match(5) || this.match(67) || this.match(73) || this.match(81)) {
+ return this.flowParseDeclare(node);
+ }
+ } else if (this.match(5)) {
+ if (expr.name === "interface") {
+ return this.flowParseInterface(node);
+ } else if (expr.name === "type") {
+ return this.flowParseTypeAlias(node);
+ } else if (expr.name === "opaque") {
+ return this.flowParseOpaqueType(node, false);
+ }
+ }
+ }
+
+ return super.parseExpressionStatement(node, expr);
+ }
+
+ shouldParseExportDeclaration() {
+ return this.isContextual("type") || this.isContextual("interface") || this.isContextual("opaque") || this.shouldParseEnums() && this.isContextual("enum") || super.shouldParseExportDeclaration();
+ }
+
+ isExportDefaultSpecifier() {
+ if (this.match(5) && (this.state.value === "type" || this.state.value === "interface" || this.state.value === "opaque" || this.shouldParseEnums() && this.state.value === "enum")) {
+ return false;
+ }
+
+ return super.isExportDefaultSpecifier();
+ }
+
+ parseExportDefaultExpression() {
+ if (this.shouldParseEnums() && this.isContextual("enum")) {
+ const node = this.startNode();
+ this.next();
+ return this.flowParseEnumDeclaration(node);
+ }
+
+ return super.parseExportDefaultExpression();
+ }
+
+ parseConditional(expr, startPos, startLoc, refExpressionErrors) {
+ if (!this.match(25)) return expr;
+
+ if (this.state.maybeInArrowParameters) {
+ const nextCh = this.lookaheadCharCode();
+
+ if (nextCh === 44 || nextCh === 61 || nextCh === 58 || nextCh === 41) {
+ this.setOptionalParametersError(refExpressionErrors);
+ return expr;
+ }
+ }
+
+ this.expect(25);
+ const state = this.state.clone();
+ const originalNoArrowAt = this.state.noArrowAt;
+ const node = this.startNodeAt(startPos, startLoc);
+ let {
+ consequent,
+ failed
+ } = this.tryParseConditionalConsequent();
+ let [valid, invalid] = this.getArrowLikeExpressions(consequent);
+
+ if (failed || invalid.length > 0) {
+ const noArrowAt = [...originalNoArrowAt];
+
+ if (invalid.length > 0) {
+ this.state = state;
+ this.state.noArrowAt = noArrowAt;
+
+ for (let i = 0; i < invalid.length; i++) {
+ noArrowAt.push(invalid[i].start);
+ }
+
+ ({
+ consequent,
+ failed
+ } = this.tryParseConditionalConsequent());
+ [valid, invalid] = this.getArrowLikeExpressions(consequent);
+ }
+
+ if (failed && valid.length > 1) {
+ this.raise(state.start, FlowErrors.AmbiguousConditionalArrow);
+ }
+
+ if (failed && valid.length === 1) {
+ this.state = state;
+ noArrowAt.push(valid[0].start);
+ this.state.noArrowAt = noArrowAt;
+ ({
+ consequent,
+ failed
+ } = this.tryParseConditionalConsequent());
+ }
+ }
+
+ this.getArrowLikeExpressions(consequent, true);
+ this.state.noArrowAt = originalNoArrowAt;
+ this.expect(22);
+ node.test = expr;
+ node.consequent = consequent;
+ node.alternate = this.forwardNoArrowParamsConversionAt(node, () => this.parseMaybeAssign(undefined, undefined));
+ return this.finishNode(node, "ConditionalExpression");
+ }
+
+ tryParseConditionalConsequent() {
+ this.state.noArrowParamsConversionAt.push(this.state.start);
+ const consequent = this.parseMaybeAssignAllowIn();
+ const failed = !this.match(22);
+ this.state.noArrowParamsConversionAt.pop();
+ return {
+ consequent,
+ failed
+ };
+ }
+
+ getArrowLikeExpressions(node, disallowInvalid) {
+ const stack = [node];
+ const arrows = [];
+
+ while (stack.length !== 0) {
+ const node = stack.pop();
+
+ if (node.type === "ArrowFunctionExpression") {
+ if (node.typeParameters || !node.returnType) {
+ this.finishArrowValidation(node);
+ } else {
+ arrows.push(node);
+ }
+
+ stack.push(node.body);
+ } else if (node.type === "ConditionalExpression") {
+ stack.push(node.consequent);
+ stack.push(node.alternate);
+ }
+ }
+
+ if (disallowInvalid) {
+ arrows.forEach(node => this.finishArrowValidation(node));
+ return [arrows, []];
+ }
+
+ return partition(arrows, node => node.params.every(param => this.isAssignable(param, true)));
+ }
+
+ finishArrowValidation(node) {
+ var _node$extra;
+
+ this.toAssignableList(node.params, (_node$extra = node.extra) == null ? void 0 : _node$extra.trailingComma, false);
+ this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW);
+ super.checkParams(node, false, true);
+ this.scope.exit();
+ }
+
+ forwardNoArrowParamsConversionAt(node, parse) {
+ let result;
+
+ if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {
+ this.state.noArrowParamsConversionAt.push(this.state.start);
+ result = parse();
+ this.state.noArrowParamsConversionAt.pop();
+ } else {
+ result = parse();
+ }
+
+ return result;
+ }
+
+ parseParenItem(node, startPos, startLoc) {
+ node = super.parseParenItem(node, startPos, startLoc);
+
+ if (this.eat(25)) {
+ node.optional = true;
+ this.resetEndLocation(node);
+ }
+
+ if (this.match(22)) {
+ const typeCastNode = this.startNodeAt(startPos, startLoc);
+ typeCastNode.expression = node;
+ typeCastNode.typeAnnotation = this.flowParseTypeAnnotation();
+ return this.finishNode(typeCastNode, "TypeCastExpression");
+ }
+
+ return node;
+ }
+
+ assertModuleNodeAllowed(node) {
+ if (node.type === "ImportDeclaration" && (node.importKind === "type" || node.importKind === "typeof") || node.type === "ExportNamedDeclaration" && node.exportKind === "type" || node.type === "ExportAllDeclaration" && node.exportKind === "type") {
+ return;
+ }
+
+ super.assertModuleNodeAllowed(node);
+ }
+
+ parseExport(node) {
+ const decl = super.parseExport(node);
+
+ if (decl.type === "ExportNamedDeclaration" || decl.type === "ExportAllDeclaration") {
+ decl.exportKind = decl.exportKind || "value";
+ }
+
+ return decl;
+ }
+
+ parseExportDeclaration(node) {
+ if (this.isContextual("type")) {
+ node.exportKind = "type";
+ const declarationNode = this.startNode();
+ this.next();
+
+ if (this.match(13)) {
+ node.specifiers = this.parseExportSpecifiers();
+ this.parseExportFrom(node);
+ return null;
+ } else {
+ return this.flowParseTypeAlias(declarationNode);
+ }
+ } else if (this.isContextual("opaque")) {
+ node.exportKind = "type";
+ const declarationNode = this.startNode();
+ this.next();
+ return this.flowParseOpaqueType(declarationNode, false);
+ } else if (this.isContextual("interface")) {
+ node.exportKind = "type";
+ const declarationNode = this.startNode();
+ this.next();
+ return this.flowParseInterface(declarationNode);
+ } else if (this.shouldParseEnums() && this.isContextual("enum")) {
+ node.exportKind = "value";
+ const declarationNode = this.startNode();
+ this.next();
+ return this.flowParseEnumDeclaration(declarationNode);
+ } else {
+ return super.parseExportDeclaration(node);
+ }
+ }
+
+ eatExportStar(node) {
+ if (super.eatExportStar(...arguments)) return true;
+
+ if (this.isContextual("type") && this.lookahead().type === 54) {
+ node.exportKind = "type";
+ this.next();
+ this.next();
+ return true;
+ }
+
+ return false;
+ }
+
+ maybeParseExportNamespaceSpecifier(node) {
+ const pos = this.state.start;
+ const hasNamespace = super.maybeParseExportNamespaceSpecifier(node);
+
+ if (hasNamespace && node.exportKind === "type") {
+ this.unexpected(pos);
+ }
+
+ return hasNamespace;
+ }
+
+ parseClassId(node, isStatement, optionalId) {
+ super.parseClassId(node, isStatement, optionalId);
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ }
+ }
+
+ parseClassMember(classBody, member, state) {
+ const pos = this.state.start;
+
+ if (this.isContextual("declare")) {
+ if (this.parseClassMemberFromModifier(classBody, member)) {
+ return;
+ }
+
+ member.declare = true;
+ }
+
+ super.parseClassMember(classBody, member, state);
+
+ if (member.declare) {
+ if (member.type !== "ClassProperty" && member.type !== "ClassPrivateProperty" && member.type !== "PropertyDefinition") {
+ this.raise(pos, FlowErrors.DeclareClassElement);
+ } else if (member.value) {
+ this.raise(member.value.start, FlowErrors.DeclareClassFieldInitializer);
+ }
+ }
+ }
+
+ isIterator(word) {
+ return word === "iterator" || word === "asyncIterator";
+ }
+
+ readIterator() {
+ const word = super.readWord1();
+ const fullWord = "@@" + word;
+
+ if (!this.isIterator(word) || !this.state.inType) {
+ this.raise(this.state.pos, ErrorMessages.InvalidIdentifier, fullWord);
+ }
+
+ this.finishToken(5, fullWord);
+ }
+
+ getTokenFromCode(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (code === 123 && next === 124) {
+ return this.finishOp(14, 2);
+ } else if (this.state.inType && (code === 62 || code === 60)) {
+ return this.finishOp(50, 1);
+ } else if (this.state.inType && code === 63) {
+ if (next === 46) {
+ return this.finishOp(26, 2);
+ }
+
+ return this.finishOp(25, 1);
+ } else if (isIteratorStart(code, next)) {
+ this.state.pos += 2;
+ return this.readIterator();
+ } else {
+ return super.getTokenFromCode(code);
+ }
+ }
+
+ isAssignable(node, isBinding) {
+ if (node.type === "TypeCastExpression") {
+ return this.isAssignable(node.expression, isBinding);
+ } else {
+ return super.isAssignable(node, isBinding);
+ }
+ }
+
+ toAssignable(node, isLHS = false) {
+ if (node.type === "TypeCastExpression") {
+ return super.toAssignable(this.typeCastToParameter(node), isLHS);
+ } else {
+ return super.toAssignable(node, isLHS);
+ }
+ }
+
+ toAssignableList(exprList, trailingCommaPos, isLHS) {
+ for (let i = 0; i < exprList.length; i++) {
+ const expr = exprList[i];
+
+ if ((expr == null ? void 0 : expr.type) === "TypeCastExpression") {
+ exprList[i] = this.typeCastToParameter(expr);
+ }
+ }
+
+ return super.toAssignableList(exprList, trailingCommaPos, isLHS);
+ }
+
+ toReferencedList(exprList, isParenthesizedExpr) {
+ for (let i = 0; i < exprList.length; i++) {
+ var _expr$extra;
+
+ const expr = exprList[i];
+
+ if (expr && expr.type === "TypeCastExpression" && !((_expr$extra = expr.extra) != null && _expr$extra.parenthesized) && (exprList.length > 1 || !isParenthesizedExpr)) {
+ this.raise(expr.typeAnnotation.start, FlowErrors.TypeCastInPattern);
+ }
+ }
+
+ return exprList;
+ }
+
+ parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) {
+ const node = super.parseArrayLike(close, canBePattern, isTuple, refExpressionErrors);
+
+ if (canBePattern && !this.state.maybeInArrowParameters) {
+ this.toReferencedList(node.elements);
+ }
+
+ return node;
+ }
+
+ checkLVal(expr, ...args) {
+ if (expr.type !== "TypeCastExpression") {
+ return super.checkLVal(expr, ...args);
+ }
+ }
+
+ parseClassProperty(node) {
+ if (this.match(22)) {
+ node.typeAnnotation = this.flowParseTypeAnnotation();
+ }
+
+ return super.parseClassProperty(node);
+ }
+
+ parseClassPrivateProperty(node) {
+ if (this.match(22)) {
+ node.typeAnnotation = this.flowParseTypeAnnotation();
+ }
+
+ return super.parseClassPrivateProperty(node);
+ }
+
+ isClassMethod() {
+ return this.isRelational("<") || super.isClassMethod();
+ }
+
+ isClassProperty() {
+ return this.match(22) || super.isClassProperty();
+ }
+
+ isNonstaticConstructor(method) {
+ return !this.match(22) && super.isNonstaticConstructor(method);
+ }
+
+ pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
+ if (method.variance) {
+ this.unexpected(method.variance.start);
+ }
+
+ delete method.variance;
+
+ if (this.isRelational("<")) {
+ method.typeParameters = this.flowParseTypeParameterDeclaration();
+ }
+
+ super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper);
+
+ if (method.params && isConstructor) {
+ const params = method.params;
+
+ if (params.length > 0 && this.isThisParam(params[0])) {
+ this.raise(method.start, FlowErrors.ThisParamBannedInConstructor);
+ }
+ } else if (method.type === "MethodDefinition" && isConstructor && method.value.params) {
+ const params = method.value.params;
+
+ if (params.length > 0 && this.isThisParam(params[0])) {
+ this.raise(method.start, FlowErrors.ThisParamBannedInConstructor);
+ }
+ }
+ }
+
+ pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {
+ if (method.variance) {
+ this.unexpected(method.variance.start);
+ }
+
+ delete method.variance;
+
+ if (this.isRelational("<")) {
+ method.typeParameters = this.flowParseTypeParameterDeclaration();
+ }
+
+ super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);
+ }
+
+ parseClassSuper(node) {
+ super.parseClassSuper(node);
+
+ if (node.superClass && this.isRelational("<")) {
+ node.superTypeParameters = this.flowParseTypeParameterInstantiation();
+ }
+
+ if (this.isContextual("implements")) {
+ this.next();
+ const implemented = node.implements = [];
+
+ do {
+ const node = this.startNode();
+ node.id = this.flowParseRestrictedIdentifier(true);
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterInstantiation();
+ } else {
+ node.typeParameters = null;
+ }
+
+ implemented.push(this.finishNode(node, "ClassImplements"));
+ } while (this.eat(20));
+ }
+ }
+
+ checkGetterSetterParams(method) {
+ super.checkGetterSetterParams(method);
+ const params = this.getObjectOrClassMethodParams(method);
+
+ if (params.length > 0) {
+ const param = params[0];
+
+ if (this.isThisParam(param) && method.kind === "get") {
+ this.raise(param.start, FlowErrors.GetterMayNotHaveThisParam);
+ } else if (this.isThisParam(param)) {
+ this.raise(param.start, FlowErrors.SetterMayNotHaveThisParam);
+ }
+ }
+ }
+
+ parsePropertyName(node, isPrivateNameAllowed) {
+ const variance = this.flowParseVariance();
+ const key = super.parsePropertyName(node, isPrivateNameAllowed);
+ node.variance = variance;
+ return key;
+ }
+
+ parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) {
+ if (prop.variance) {
+ this.unexpected(prop.variance.start);
+ }
+
+ delete prop.variance;
+ let typeParameters;
+
+ if (this.isRelational("<") && !isAccessor) {
+ typeParameters = this.flowParseTypeParameterDeclaration();
+ if (!this.match(18)) this.unexpected();
+ }
+
+ super.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors);
+
+ if (typeParameters) {
+ (prop.value || prop).typeParameters = typeParameters;
+ }
+ }
+
+ parseAssignableListItemTypes(param) {
+ if (this.eat(25)) {
+ if (param.type !== "Identifier") {
+ this.raise(param.start, FlowErrors.PatternIsOptional);
+ }
+
+ if (this.isThisParam(param)) {
+ this.raise(param.start, FlowErrors.ThisParamMayNotBeOptional);
+ }
+
+ param.optional = true;
+ }
+
+ if (this.match(22)) {
+ param.typeAnnotation = this.flowParseTypeAnnotation();
+ } else if (this.isThisParam(param)) {
+ this.raise(param.start, FlowErrors.ThisParamAnnotationRequired);
+ }
+
+ if (this.match(35) && this.isThisParam(param)) {
+ this.raise(param.start, FlowErrors.ThisParamNoDefault);
+ }
+
+ this.resetEndLocation(param);
+ return param;
+ }
+
+ parseMaybeDefault(startPos, startLoc, left) {
+ const node = super.parseMaybeDefault(startPos, startLoc, left);
+
+ if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) {
+ this.raise(node.typeAnnotation.start, FlowErrors.TypeBeforeInitializer);
+ }
+
+ return node;
+ }
+
+ shouldParseDefaultImport(node) {
+ if (!hasTypeImportKind(node)) {
+ return super.shouldParseDefaultImport(node);
+ }
+
+ return isMaybeDefaultImport(this.state);
+ }
+
+ parseImportSpecifierLocal(node, specifier, type, contextDescription) {
+ specifier.local = hasTypeImportKind(node) ? this.flowParseRestrictedIdentifier(true, true) : this.parseIdentifier();
+ this.checkLVal(specifier.local, contextDescription, BIND_LEXICAL);
+ node.specifiers.push(this.finishNode(specifier, type));
+ }
+
+ maybeParseDefaultImportSpecifier(node) {
+ node.importKind = "value";
+ let kind = null;
+
+ if (this.match(86)) {
+ kind = "typeof";
+ } else if (this.isContextual("type")) {
+ kind = "type";
+ }
+
+ if (kind) {
+ const lh = this.lookahead();
+
+ if (kind === "type" && lh.type === 54) {
+ this.unexpected(lh.start);
+ }
+
+ if (isMaybeDefaultImport(lh) || lh.type === 13 || lh.type === 54) {
+ this.next();
+ node.importKind = kind;
+ }
+ }
+
+ return super.maybeParseDefaultImportSpecifier(node);
+ }
+
+ parseImportSpecifier(node) {
+ const specifier = this.startNode();
+ const firstIdentIsString = this.match(4);
+ const firstIdent = this.parseModuleExportName();
+ let specifierTypeKind = null;
+
+ if (firstIdent.type === "Identifier") {
+ if (firstIdent.name === "type") {
+ specifierTypeKind = "type";
+ } else if (firstIdent.name === "typeof") {
+ specifierTypeKind = "typeof";
+ }
+ }
+
+ let isBinding = false;
+
+ if (this.isContextual("as") && !this.isLookaheadContextual("as")) {
+ const as_ident = this.parseIdentifier(true);
+
+ if (specifierTypeKind !== null && !this.match(5) && !tokenIsKeyword(this.state.type)) {
+ specifier.imported = as_ident;
+ specifier.importKind = specifierTypeKind;
+ specifier.local = cloneIdentifier(as_ident);
+ } else {
+ specifier.imported = firstIdent;
+ specifier.importKind = null;
+ specifier.local = this.parseIdentifier();
+ }
+ } else {
+ if (specifierTypeKind !== null && (this.match(5) || tokenIsKeyword(this.state.type))) {
+ specifier.imported = this.parseIdentifier(true);
+ specifier.importKind = specifierTypeKind;
+ } else {
+ if (firstIdentIsString) {
+ throw this.raise(specifier.start, ErrorMessages.ImportBindingIsString, firstIdent.value);
+ }
+
+ specifier.imported = firstIdent;
+ specifier.importKind = null;
+ }
+
+ if (this.eatContextual("as")) {
+ specifier.local = this.parseIdentifier();
+ } else {
+ isBinding = true;
+ specifier.local = cloneIdentifier(specifier.imported);
+ }
+ }
+
+ const nodeIsTypeImport = hasTypeImportKind(node);
+ const specifierIsTypeImport = hasTypeImportKind(specifier);
+
+ if (nodeIsTypeImport && specifierIsTypeImport) {
+ this.raise(specifier.start, FlowErrors.ImportTypeShorthandOnlyInPureImport);
+ }
+
+ if (nodeIsTypeImport || specifierIsTypeImport) {
+ this.checkReservedType(specifier.local.name, specifier.local.start, true);
+ }
+
+ if (isBinding && !nodeIsTypeImport && !specifierIsTypeImport) {
+ this.checkReservedWord(specifier.local.name, specifier.start, true, true);
+ }
+
+ this.checkLVal(specifier.local, "import specifier", BIND_LEXICAL);
+ node.specifiers.push(this.finishNode(specifier, "ImportSpecifier"));
+ }
+
+ parseBindingAtom() {
+ switch (this.state.type) {
+ case 77:
+ return this.parseIdentifier(true);
+
+ default:
+ return super.parseBindingAtom();
+ }
+ }
+
+ parseFunctionParams(node, allowModifiers) {
+ const kind = node.kind;
+
+ if (kind !== "get" && kind !== "set" && this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ }
+
+ super.parseFunctionParams(node, allowModifiers);
+ }
+
+ parseVarId(decl, kind) {
+ super.parseVarId(decl, kind);
+
+ if (this.match(22)) {
+ decl.id.typeAnnotation = this.flowParseTypeAnnotation();
+ this.resetEndLocation(decl.id);
+ }
+ }
+
+ parseAsyncArrowFromCallExpression(node, call) {
+ if (this.match(22)) {
+ const oldNoAnonFunctionType = this.state.noAnonFunctionType;
+ this.state.noAnonFunctionType = true;
+ node.returnType = this.flowParseTypeAnnotation();
+ this.state.noAnonFunctionType = oldNoAnonFunctionType;
+ }
+
+ return super.parseAsyncArrowFromCallExpression(node, call);
+ }
+
+ shouldParseAsyncArrow() {
+ return this.match(22) || super.shouldParseAsyncArrow();
+ }
+
+ parseMaybeAssign(refExpressionErrors, afterLeftParse) {
+ var _jsx;
+
+ let state = null;
+ let jsx;
+
+ if (this.hasPlugin("jsx") && (this.match(94) || this.isRelational("<"))) {
+ state = this.state.clone();
+ jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state);
+ if (!jsx.error) return jsx.node;
+ const {
+ context
+ } = this.state;
+ const curContext = context[context.length - 1];
+
+ if (curContext === types.j_oTag) {
+ context.length -= 2;
+ } else if (curContext === types.j_expr) {
+ context.length -= 1;
+ }
+ }
+
+ if ((_jsx = jsx) != null && _jsx.error || this.isRelational("<")) {
+ var _jsx2, _jsx3;
+
+ state = state || this.state.clone();
+ let typeParameters;
+ const arrow = this.tryParse(abort => {
+ var _arrowExpression$extr;
+
+ typeParameters = this.flowParseTypeParameterDeclaration();
+ const arrowExpression = this.forwardNoArrowParamsConversionAt(typeParameters, () => {
+ const result = super.parseMaybeAssign(refExpressionErrors, afterLeftParse);
+ this.resetStartLocationFromNode(result, typeParameters);
+ return result;
+ });
+ if ((_arrowExpression$extr = arrowExpression.extra) != null && _arrowExpression$extr.parenthesized) abort();
+ const expr = this.maybeUnwrapTypeCastExpression(arrowExpression);
+ if (expr.type !== "ArrowFunctionExpression") abort();
+ expr.typeParameters = typeParameters;
+ this.resetStartLocationFromNode(expr, typeParameters);
+ return arrowExpression;
+ }, state);
+ let arrowExpression = null;
+
+ if (arrow.node && this.maybeUnwrapTypeCastExpression(arrow.node).type === "ArrowFunctionExpression") {
+ if (!arrow.error && !arrow.aborted) {
+ if (arrow.node.async) {
+ this.raise(typeParameters.start, FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction);
+ }
+
+ return arrow.node;
+ }
+
+ arrowExpression = arrow.node;
+ }
+
+ if ((_jsx2 = jsx) != null && _jsx2.node) {
+ this.state = jsx.failState;
+ return jsx.node;
+ }
+
+ if (arrowExpression) {
+ this.state = arrow.failState;
+ return arrowExpression;
+ }
+
+ if ((_jsx3 = jsx) != null && _jsx3.thrown) throw jsx.error;
+ if (arrow.thrown) throw arrow.error;
+ throw this.raise(typeParameters.start, FlowErrors.UnexpectedTokenAfterTypeParameter);
+ }
+
+ return super.parseMaybeAssign(refExpressionErrors, afterLeftParse);
+ }
+
+ parseArrow(node) {
+ if (this.match(22)) {
+ const result = this.tryParse(() => {
+ const oldNoAnonFunctionType = this.state.noAnonFunctionType;
+ this.state.noAnonFunctionType = true;
+ const typeNode = this.startNode();
+ [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser();
+ this.state.noAnonFunctionType = oldNoAnonFunctionType;
+ if (this.canInsertSemicolon()) this.unexpected();
+ if (!this.match(27)) this.unexpected();
+ return typeNode;
+ });
+ if (result.thrown) return null;
+ if (result.error) this.state = result.failState;
+ node.returnType = result.node.typeAnnotation ? this.finishNode(result.node, "TypeAnnotation") : null;
+ }
+
+ return super.parseArrow(node);
+ }
+
+ shouldParseArrow(params) {
+ return this.match(22) || super.shouldParseArrow(params);
+ }
+
+ setArrowFunctionParameters(node, params) {
+ if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {
+ node.params = params;
+ } else {
+ super.setArrowFunctionParameters(node, params);
+ }
+ }
+
+ checkParams(node, allowDuplicates, isArrowFunction) {
+ if (isArrowFunction && this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {
+ return;
+ }
+
+ for (let i = 0; i < node.params.length; i++) {
+ if (this.isThisParam(node.params[i]) && i > 0) {
+ this.raise(node.params[i].start, FlowErrors.ThisParamMustBeFirst);
+ }
+ }
+
+ return super.checkParams(...arguments);
+ }
+
+ parseParenAndDistinguishExpression(canBeArrow) {
+ return super.parseParenAndDistinguishExpression(canBeArrow && this.state.noArrowAt.indexOf(this.state.start) === -1);
+ }
+
+ parseSubscripts(base, startPos, startLoc, noCalls) {
+ if (base.type === "Identifier" && base.name === "async" && this.state.noArrowAt.indexOf(startPos) !== -1) {
+ this.next();
+ const node = this.startNodeAt(startPos, startLoc);
+ node.callee = base;
+ node.arguments = this.parseCallExpressionArguments(19, false);
+ base = this.finishNode(node, "CallExpression");
+ } else if (base.type === "Identifier" && base.name === "async" && this.isRelational("<")) {
+ const state = this.state.clone();
+ const arrow = this.tryParse(abort => this.parseAsyncArrowWithTypeParameters(startPos, startLoc) || abort(), state);
+ if (!arrow.error && !arrow.aborted) return arrow.node;
+ const result = this.tryParse(() => super.parseSubscripts(base, startPos, startLoc, noCalls), state);
+ if (result.node && !result.error) return result.node;
+
+ if (arrow.node) {
+ this.state = arrow.failState;
+ return arrow.node;
+ }
+
+ if (result.node) {
+ this.state = result.failState;
+ return result.node;
+ }
+
+ throw arrow.error || result.error;
+ }
+
+ return super.parseSubscripts(base, startPos, startLoc, noCalls);
+ }
+
+ parseSubscript(base, startPos, startLoc, noCalls, subscriptState) {
+ if (this.match(26) && this.isLookaheadToken_lt()) {
+ subscriptState.optionalChainMember = true;
+
+ if (noCalls) {
+ subscriptState.stop = true;
+ return base;
+ }
+
+ this.next();
+ const node = this.startNodeAt(startPos, startLoc);
+ node.callee = base;
+ node.typeArguments = this.flowParseTypeParameterInstantiation();
+ this.expect(18);
+ node.arguments = this.parseCallExpressionArguments(19, false);
+ node.optional = true;
+ return this.finishCallExpression(node, true);
+ } else if (!noCalls && this.shouldParseTypes() && this.isRelational("<")) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.callee = base;
+ const result = this.tryParse(() => {
+ node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew();
+ this.expect(18);
+ node.arguments = this.parseCallExpressionArguments(19, false);
+ if (subscriptState.optionalChainMember) node.optional = false;
+ return this.finishCallExpression(node, subscriptState.optionalChainMember);
+ });
+
+ if (result.node) {
+ if (result.error) this.state = result.failState;
+ return result.node;
+ }
+ }
+
+ return super.parseSubscript(base, startPos, startLoc, noCalls, subscriptState);
+ }
+
+ parseNewArguments(node) {
+ let targs = null;
+
+ if (this.shouldParseTypes() && this.isRelational("<")) {
+ targs = this.tryParse(() => this.flowParseTypeParameterInstantiationCallOrNew()).node;
+ }
+
+ node.typeArguments = targs;
+ super.parseNewArguments(node);
+ }
+
+ parseAsyncArrowWithTypeParameters(startPos, startLoc) {
+ const node = this.startNodeAt(startPos, startLoc);
+ this.parseFunctionParams(node);
+ if (!this.parseArrow(node)) return;
+ return this.parseArrowExpression(node, undefined, true);
+ }
+
+ readToken_mult_modulo(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (code === 42 && next === 47 && this.state.hasFlowComment) {
+ this.state.hasFlowComment = false;
+ this.state.pos += 2;
+ this.nextToken();
+ return;
+ }
+
+ super.readToken_mult_modulo(code);
+ }
+
+ readToken_pipe_amp(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (code === 124 && next === 125) {
+ this.finishOp(17, 2);
+ return;
+ }
+
+ super.readToken_pipe_amp(code);
+ }
+
+ parseTopLevel(file, program) {
+ const fileNode = super.parseTopLevel(file, program);
+
+ if (this.state.hasFlowComment) {
+ this.raise(this.state.pos, FlowErrors.UnterminatedFlowComment);
+ }
+
+ return fileNode;
+ }
+
+ skipBlockComment() {
+ if (this.hasPlugin("flowComments") && this.skipFlowComment()) {
+ if (this.state.hasFlowComment) {
+ this.unexpected(null, FlowErrors.NestedFlowComment);
+ }
+
+ this.hasFlowCommentCompletion();
+ this.state.pos += this.skipFlowComment();
+ this.state.hasFlowComment = true;
+ return;
+ }
+
+ if (this.state.hasFlowComment) {
+ const end = this.input.indexOf("*-/", this.state.pos += 2);
+
+ if (end === -1) {
+ throw this.raise(this.state.pos - 2, ErrorMessages.UnterminatedComment);
+ }
+
+ this.state.pos = end + 3;
+ return;
+ }
+
+ return super.skipBlockComment();
+ }
+
+ skipFlowComment() {
+ const {
+ pos
+ } = this.state;
+ let shiftToFirstNonWhiteSpace = 2;
+
+ while ([32, 9].includes(this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace))) {
+ shiftToFirstNonWhiteSpace++;
+ }
+
+ const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos);
+ const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1);
+
+ if (ch2 === 58 && ch3 === 58) {
+ return shiftToFirstNonWhiteSpace + 2;
+ }
+
+ if (this.input.slice(shiftToFirstNonWhiteSpace + pos, shiftToFirstNonWhiteSpace + pos + 12) === "flow-include") {
+ return shiftToFirstNonWhiteSpace + 12;
+ }
+
+ if (ch2 === 58 && ch3 !== 58) {
+ return shiftToFirstNonWhiteSpace;
+ }
+
+ return false;
+ }
+
+ hasFlowCommentCompletion() {
+ const end = this.input.indexOf("*/", this.state.pos);
+
+ if (end === -1) {
+ throw this.raise(this.state.pos, ErrorMessages.UnterminatedComment);
+ }
+ }
+
+ flowEnumErrorBooleanMemberNotInitialized(pos, {
+ enumName,
+ memberName
+ }) {
+ this.raise(pos, FlowErrors.EnumBooleanMemberNotInitialized, memberName, enumName);
+ }
+
+ flowEnumErrorInvalidMemberName(pos, {
+ enumName,
+ memberName
+ }) {
+ const suggestion = memberName[0].toUpperCase() + memberName.slice(1);
+ this.raise(pos, FlowErrors.EnumInvalidMemberName, memberName, suggestion, enumName);
+ }
+
+ flowEnumErrorDuplicateMemberName(pos, {
+ enumName,
+ memberName
+ }) {
+ this.raise(pos, FlowErrors.EnumDuplicateMemberName, memberName, enumName);
+ }
+
+ flowEnumErrorInconsistentMemberValues(pos, {
+ enumName
+ }) {
+ this.raise(pos, FlowErrors.EnumInconsistentMemberValues, enumName);
+ }
+
+ flowEnumErrorInvalidExplicitType(pos, {
+ enumName,
+ suppliedType
+ }) {
+ return this.raise(pos, suppliedType === null ? FlowErrors.EnumInvalidExplicitTypeUnknownSupplied : FlowErrors.EnumInvalidExplicitType, enumName, suppliedType);
+ }
+
+ flowEnumErrorInvalidMemberInitializer(pos, {
+ enumName,
+ explicitType,
+ memberName
+ }) {
+ let message = null;
+
+ switch (explicitType) {
+ case "boolean":
+ case "number":
+ case "string":
+ message = FlowErrors.EnumInvalidMemberInitializerPrimaryType;
+ break;
+
+ case "symbol":
+ message = FlowErrors.EnumInvalidMemberInitializerSymbolType;
+ break;
+
+ default:
+ message = FlowErrors.EnumInvalidMemberInitializerUnknownType;
+ }
+
+ return this.raise(pos, message, enumName, memberName, explicitType);
+ }
+
+ flowEnumErrorNumberMemberNotInitialized(pos, {
+ enumName,
+ memberName
+ }) {
+ this.raise(pos, FlowErrors.EnumNumberMemberNotInitialized, enumName, memberName);
+ }
+
+ flowEnumErrorStringMemberInconsistentlyInitailized(pos, {
+ enumName
+ }) {
+ this.raise(pos, FlowErrors.EnumStringMemberInconsistentlyInitailized, enumName);
+ }
+
+ flowEnumMemberInit() {
+ const startPos = this.state.start;
+
+ const endOfInit = () => this.match(20) || this.match(16);
+
+ switch (this.state.type) {
+ case 0:
+ {
+ const literal = this.parseNumericLiteral(this.state.value);
+
+ if (endOfInit()) {
+ return {
+ type: "number",
+ pos: literal.start,
+ value: literal
+ };
+ }
+
+ return {
+ type: "invalid",
+ pos: startPos
+ };
+ }
+
+ case 4:
+ {
+ const literal = this.parseStringLiteral(this.state.value);
+
+ if (endOfInit()) {
+ return {
+ type: "string",
+ pos: literal.start,
+ value: literal
+ };
+ }
+
+ return {
+ type: "invalid",
+ pos: startPos
+ };
+ }
+
+ case 84:
+ case 85:
+ {
+ const literal = this.parseBooleanLiteral(this.match(84));
+
+ if (endOfInit()) {
+ return {
+ type: "boolean",
+ pos: literal.start,
+ value: literal
+ };
+ }
+
+ return {
+ type: "invalid",
+ pos: startPos
+ };
+ }
+
+ default:
+ return {
+ type: "invalid",
+ pos: startPos
+ };
+ }
+ }
+
+ flowEnumMemberRaw() {
+ const pos = this.state.start;
+ const id = this.parseIdentifier(true);
+ const init = this.eat(35) ? this.flowEnumMemberInit() : {
+ type: "none",
+ pos
+ };
+ return {
+ id,
+ init
+ };
+ }
+
+ flowEnumCheckExplicitTypeMismatch(pos, context, expectedType) {
+ const {
+ explicitType
+ } = context;
+
+ if (explicitType === null) {
+ return;
+ }
+
+ if (explicitType !== expectedType) {
+ this.flowEnumErrorInvalidMemberInitializer(pos, context);
+ }
+ }
+
+ flowEnumMembers({
+ enumName,
+ explicitType
+ }) {
+ const seenNames = new Set();
+ const members = {
+ booleanMembers: [],
+ numberMembers: [],
+ stringMembers: [],
+ defaultedMembers: []
+ };
+ let hasUnknownMembers = false;
+
+ while (!this.match(16)) {
+ if (this.eat(29)) {
+ hasUnknownMembers = true;
+ break;
+ }
+
+ const memberNode = this.startNode();
+ const {
+ id,
+ init
+ } = this.flowEnumMemberRaw();
+ const memberName = id.name;
+
+ if (memberName === "") {
+ continue;
+ }
+
+ if (/^[a-z]/.test(memberName)) {
+ this.flowEnumErrorInvalidMemberName(id.start, {
+ enumName,
+ memberName
+ });
+ }
+
+ if (seenNames.has(memberName)) {
+ this.flowEnumErrorDuplicateMemberName(id.start, {
+ enumName,
+ memberName
+ });
+ }
+
+ seenNames.add(memberName);
+ const context = {
+ enumName,
+ explicitType,
+ memberName
+ };
+ memberNode.id = id;
+
+ switch (init.type) {
+ case "boolean":
+ {
+ this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "boolean");
+ memberNode.init = init.value;
+ members.booleanMembers.push(this.finishNode(memberNode, "EnumBooleanMember"));
+ break;
+ }
+
+ case "number":
+ {
+ this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "number");
+ memberNode.init = init.value;
+ members.numberMembers.push(this.finishNode(memberNode, "EnumNumberMember"));
+ break;
+ }
+
+ case "string":
+ {
+ this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "string");
+ memberNode.init = init.value;
+ members.stringMembers.push(this.finishNode(memberNode, "EnumStringMember"));
+ break;
+ }
+
+ case "invalid":
+ {
+ throw this.flowEnumErrorInvalidMemberInitializer(init.pos, context);
+ }
+
+ case "none":
+ {
+ switch (explicitType) {
+ case "boolean":
+ this.flowEnumErrorBooleanMemberNotInitialized(init.pos, context);
+ break;
+
+ case "number":
+ this.flowEnumErrorNumberMemberNotInitialized(init.pos, context);
+ break;
+
+ default:
+ members.defaultedMembers.push(this.finishNode(memberNode, "EnumDefaultedMember"));
+ }
+ }
+ }
+
+ if (!this.match(16)) {
+ this.expect(20);
+ }
+ }
+
+ return {
+ members,
+ hasUnknownMembers
+ };
+ }
+
+ flowEnumStringMembers(initializedMembers, defaultedMembers, {
+ enumName
+ }) {
+ if (initializedMembers.length === 0) {
+ return defaultedMembers;
+ } else if (defaultedMembers.length === 0) {
+ return initializedMembers;
+ } else if (defaultedMembers.length > initializedMembers.length) {
+ for (const member of initializedMembers) {
+ this.flowEnumErrorStringMemberInconsistentlyInitailized(member.start, {
+ enumName
+ });
+ }
+
+ return defaultedMembers;
+ } else {
+ for (const member of defaultedMembers) {
+ this.flowEnumErrorStringMemberInconsistentlyInitailized(member.start, {
+ enumName
+ });
+ }
+
+ return initializedMembers;
+ }
+ }
+
+ flowEnumParseExplicitType({
+ enumName
+ }) {
+ if (this.eatContextual("of")) {
+ if (!this.match(5)) {
+ throw this.flowEnumErrorInvalidExplicitType(this.state.start, {
+ enumName,
+ suppliedType: null
+ });
+ }
+
+ const {
+ value
+ } = this.state;
+ this.next();
+
+ if (value !== "boolean" && value !== "number" && value !== "string" && value !== "symbol") {
+ this.flowEnumErrorInvalidExplicitType(this.state.start, {
+ enumName,
+ suppliedType: value
+ });
+ }
+
+ return value;
+ }
+
+ return null;
+ }
+
+ flowEnumBody(node, {
+ enumName,
+ nameLoc
+ }) {
+ const explicitType = this.flowEnumParseExplicitType({
+ enumName
+ });
+ this.expect(13);
+ const {
+ members,
+ hasUnknownMembers
+ } = this.flowEnumMembers({
+ enumName,
+ explicitType
+ });
+ node.hasUnknownMembers = hasUnknownMembers;
+
+ switch (explicitType) {
+ case "boolean":
+ node.explicitType = true;
+ node.members = members.booleanMembers;
+ this.expect(16);
+ return this.finishNode(node, "EnumBooleanBody");
+
+ case "number":
+ node.explicitType = true;
+ node.members = members.numberMembers;
+ this.expect(16);
+ return this.finishNode(node, "EnumNumberBody");
+
+ case "string":
+ node.explicitType = true;
+ node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, {
+ enumName
+ });
+ this.expect(16);
+ return this.finishNode(node, "EnumStringBody");
+
+ case "symbol":
+ node.members = members.defaultedMembers;
+ this.expect(16);
+ return this.finishNode(node, "EnumSymbolBody");
+
+ default:
+ {
+ const empty = () => {
+ node.members = [];
+ this.expect(16);
+ return this.finishNode(node, "EnumStringBody");
+ };
+
+ node.explicitType = false;
+ const boolsLen = members.booleanMembers.length;
+ const numsLen = members.numberMembers.length;
+ const strsLen = members.stringMembers.length;
+ const defaultedLen = members.defaultedMembers.length;
+
+ if (!boolsLen && !numsLen && !strsLen && !defaultedLen) {
+ return empty();
+ } else if (!boolsLen && !numsLen) {
+ node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, {
+ enumName
+ });
+ this.expect(16);
+ return this.finishNode(node, "EnumStringBody");
+ } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) {
+ for (const member of members.defaultedMembers) {
+ this.flowEnumErrorBooleanMemberNotInitialized(member.start, {
+ enumName,
+ memberName: member.id.name
+ });
+ }
+
+ node.members = members.booleanMembers;
+ this.expect(16);
+ return this.finishNode(node, "EnumBooleanBody");
+ } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) {
+ for (const member of members.defaultedMembers) {
+ this.flowEnumErrorNumberMemberNotInitialized(member.start, {
+ enumName,
+ memberName: member.id.name
+ });
+ }
+
+ node.members = members.numberMembers;
+ this.expect(16);
+ return this.finishNode(node, "EnumNumberBody");
+ } else {
+ this.flowEnumErrorInconsistentMemberValues(nameLoc, {
+ enumName
+ });
+ return empty();
+ }
+ }
+ }
+ }
+
+ flowParseEnumDeclaration(node) {
+ const id = this.parseIdentifier();
+ node.id = id;
+ node.body = this.flowEnumBody(this.startNode(), {
+ enumName: id.name,
+ nameLoc: id.start
+ });
+ return this.finishNode(node, "EnumDeclaration");
+ }
+
+ isLookaheadToken_lt() {
+ const next = this.nextTokenStart();
+
+ if (this.input.charCodeAt(next) === 60) {
+ const afterNext = this.input.charCodeAt(next + 1);
+ return afterNext !== 60 && afterNext !== 61;
+ }
+
+ return false;
+ }
+
+ maybeUnwrapTypeCastExpression(node) {
+ return node.type === "TypeCastExpression" ? node.expression : node;
+ }
+
+});
+
+const entities = {
+ quot: "\u0022",
+ amp: "&",
+ apos: "\u0027",
+ lt: "<",
+ gt: ">",
+ nbsp: "\u00A0",
+ iexcl: "\u00A1",
+ cent: "\u00A2",
+ pound: "\u00A3",
+ curren: "\u00A4",
+ yen: "\u00A5",
+ brvbar: "\u00A6",
+ sect: "\u00A7",
+ uml: "\u00A8",
+ copy: "\u00A9",
+ ordf: "\u00AA",
+ laquo: "\u00AB",
+ not: "\u00AC",
+ shy: "\u00AD",
+ reg: "\u00AE",
+ macr: "\u00AF",
+ deg: "\u00B0",
+ plusmn: "\u00B1",
+ sup2: "\u00B2",
+ sup3: "\u00B3",
+ acute: "\u00B4",
+ micro: "\u00B5",
+ para: "\u00B6",
+ middot: "\u00B7",
+ cedil: "\u00B8",
+ sup1: "\u00B9",
+ ordm: "\u00BA",
+ raquo: "\u00BB",
+ frac14: "\u00BC",
+ frac12: "\u00BD",
+ frac34: "\u00BE",
+ iquest: "\u00BF",
+ Agrave: "\u00C0",
+ Aacute: "\u00C1",
+ Acirc: "\u00C2",
+ Atilde: "\u00C3",
+ Auml: "\u00C4",
+ Aring: "\u00C5",
+ AElig: "\u00C6",
+ Ccedil: "\u00C7",
+ Egrave: "\u00C8",
+ Eacute: "\u00C9",
+ Ecirc: "\u00CA",
+ Euml: "\u00CB",
+ Igrave: "\u00CC",
+ Iacute: "\u00CD",
+ Icirc: "\u00CE",
+ Iuml: "\u00CF",
+ ETH: "\u00D0",
+ Ntilde: "\u00D1",
+ Ograve: "\u00D2",
+ Oacute: "\u00D3",
+ Ocirc: "\u00D4",
+ Otilde: "\u00D5",
+ Ouml: "\u00D6",
+ times: "\u00D7",
+ Oslash: "\u00D8",
+ Ugrave: "\u00D9",
+ Uacute: "\u00DA",
+ Ucirc: "\u00DB",
+ Uuml: "\u00DC",
+ Yacute: "\u00DD",
+ THORN: "\u00DE",
+ szlig: "\u00DF",
+ agrave: "\u00E0",
+ aacute: "\u00E1",
+ acirc: "\u00E2",
+ atilde: "\u00E3",
+ auml: "\u00E4",
+ aring: "\u00E5",
+ aelig: "\u00E6",
+ ccedil: "\u00E7",
+ egrave: "\u00E8",
+ eacute: "\u00E9",
+ ecirc: "\u00EA",
+ euml: "\u00EB",
+ igrave: "\u00EC",
+ iacute: "\u00ED",
+ icirc: "\u00EE",
+ iuml: "\u00EF",
+ eth: "\u00F0",
+ ntilde: "\u00F1",
+ ograve: "\u00F2",
+ oacute: "\u00F3",
+ ocirc: "\u00F4",
+ otilde: "\u00F5",
+ ouml: "\u00F6",
+ divide: "\u00F7",
+ oslash: "\u00F8",
+ ugrave: "\u00F9",
+ uacute: "\u00FA",
+ ucirc: "\u00FB",
+ uuml: "\u00FC",
+ yacute: "\u00FD",
+ thorn: "\u00FE",
+ yuml: "\u00FF",
+ OElig: "\u0152",
+ oelig: "\u0153",
+ Scaron: "\u0160",
+ scaron: "\u0161",
+ Yuml: "\u0178",
+ fnof: "\u0192",
+ circ: "\u02C6",
+ tilde: "\u02DC",
+ Alpha: "\u0391",
+ Beta: "\u0392",
+ Gamma: "\u0393",
+ Delta: "\u0394",
+ Epsilon: "\u0395",
+ Zeta: "\u0396",
+ Eta: "\u0397",
+ Theta: "\u0398",
+ Iota: "\u0399",
+ Kappa: "\u039A",
+ Lambda: "\u039B",
+ Mu: "\u039C",
+ Nu: "\u039D",
+ Xi: "\u039E",
+ Omicron: "\u039F",
+ Pi: "\u03A0",
+ Rho: "\u03A1",
+ Sigma: "\u03A3",
+ Tau: "\u03A4",
+ Upsilon: "\u03A5",
+ Phi: "\u03A6",
+ Chi: "\u03A7",
+ Psi: "\u03A8",
+ Omega: "\u03A9",
+ alpha: "\u03B1",
+ beta: "\u03B2",
+ gamma: "\u03B3",
+ delta: "\u03B4",
+ epsilon: "\u03B5",
+ zeta: "\u03B6",
+ eta: "\u03B7",
+ theta: "\u03B8",
+ iota: "\u03B9",
+ kappa: "\u03BA",
+ lambda: "\u03BB",
+ mu: "\u03BC",
+ nu: "\u03BD",
+ xi: "\u03BE",
+ omicron: "\u03BF",
+ pi: "\u03C0",
+ rho: "\u03C1",
+ sigmaf: "\u03C2",
+ sigma: "\u03C3",
+ tau: "\u03C4",
+ upsilon: "\u03C5",
+ phi: "\u03C6",
+ chi: "\u03C7",
+ psi: "\u03C8",
+ omega: "\u03C9",
+ thetasym: "\u03D1",
+ upsih: "\u03D2",
+ piv: "\u03D6",
+ ensp: "\u2002",
+ emsp: "\u2003",
+ thinsp: "\u2009",
+ zwnj: "\u200C",
+ zwj: "\u200D",
+ lrm: "\u200E",
+ rlm: "\u200F",
+ ndash: "\u2013",
+ mdash: "\u2014",
+ lsquo: "\u2018",
+ rsquo: "\u2019",
+ sbquo: "\u201A",
+ ldquo: "\u201C",
+ rdquo: "\u201D",
+ bdquo: "\u201E",
+ dagger: "\u2020",
+ Dagger: "\u2021",
+ bull: "\u2022",
+ hellip: "\u2026",
+ permil: "\u2030",
+ prime: "\u2032",
+ Prime: "\u2033",
+ lsaquo: "\u2039",
+ rsaquo: "\u203A",
+ oline: "\u203E",
+ frasl: "\u2044",
+ euro: "\u20AC",
+ image: "\u2111",
+ weierp: "\u2118",
+ real: "\u211C",
+ trade: "\u2122",
+ alefsym: "\u2135",
+ larr: "\u2190",
+ uarr: "\u2191",
+ rarr: "\u2192",
+ darr: "\u2193",
+ harr: "\u2194",
+ crarr: "\u21B5",
+ lArr: "\u21D0",
+ uArr: "\u21D1",
+ rArr: "\u21D2",
+ dArr: "\u21D3",
+ hArr: "\u21D4",
+ forall: "\u2200",
+ part: "\u2202",
+ exist: "\u2203",
+ empty: "\u2205",
+ nabla: "\u2207",
+ isin: "\u2208",
+ notin: "\u2209",
+ ni: "\u220B",
+ prod: "\u220F",
+ sum: "\u2211",
+ minus: "\u2212",
+ lowast: "\u2217",
+ radic: "\u221A",
+ prop: "\u221D",
+ infin: "\u221E",
+ ang: "\u2220",
+ and: "\u2227",
+ or: "\u2228",
+ cap: "\u2229",
+ cup: "\u222A",
+ int: "\u222B",
+ there4: "\u2234",
+ sim: "\u223C",
+ cong: "\u2245",
+ asymp: "\u2248",
+ ne: "\u2260",
+ equiv: "\u2261",
+ le: "\u2264",
+ ge: "\u2265",
+ sub: "\u2282",
+ sup: "\u2283",
+ nsub: "\u2284",
+ sube: "\u2286",
+ supe: "\u2287",
+ oplus: "\u2295",
+ otimes: "\u2297",
+ perp: "\u22A5",
+ sdot: "\u22C5",
+ lceil: "\u2308",
+ rceil: "\u2309",
+ lfloor: "\u230A",
+ rfloor: "\u230B",
+ lang: "\u2329",
+ rang: "\u232A",
+ loz: "\u25CA",
+ spades: "\u2660",
+ clubs: "\u2663",
+ hearts: "\u2665",
+ diams: "\u2666"
+};
+
+const HEX_NUMBER = /^[\da-fA-F]+$/;
+const DECIMAL_NUMBER = /^\d+$/;
+const JsxErrors = makeErrorTemplates({
+ AttributeIsEmpty: "JSX attributes must only be assigned a non-empty expression.",
+ MissingClosingTagElement: "Expected corresponding JSX closing tag for <%0>.",
+ MissingClosingTagFragment: "Expected corresponding JSX closing tag for <>.",
+ UnexpectedSequenceExpression: "Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",
+ UnsupportedJsxValue: "JSX value should be either an expression or a quoted JSX text.",
+ UnterminatedJsxContent: "Unterminated JSX contents.",
+ UnwrappedAdjacentJSXElements: "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?"
+}, ErrorCodes.SyntaxError, "jsx");
+types.j_oTag = new TokContext("<tag");
+types.j_cTag = new TokContext("</tag");
+types.j_expr = new TokContext("<tag>...</tag>", true);
+
+function isFragment(object) {
+ return object ? object.type === "JSXOpeningFragment" || object.type === "JSXClosingFragment" : false;
+}
+
+function getQualifiedJSXName(object) {
+ if (object.type === "JSXIdentifier") {
+ return object.name;
+ }
+
+ if (object.type === "JSXNamespacedName") {
+ return object.namespace.name + ":" + object.name.name;
+ }
+
+ if (object.type === "JSXMemberExpression") {
+ return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property);
+ }
+
+ throw new Error("Node had unexpected type: " + object.type);
+}
+
+var jsx = (superClass => class extends superClass {
+ jsxReadToken() {
+ let out = "";
+ let chunkStart = this.state.pos;
+
+ for (;;) {
+ if (this.state.pos >= this.length) {
+ throw this.raise(this.state.start, JsxErrors.UnterminatedJsxContent);
+ }
+
+ const ch = this.input.charCodeAt(this.state.pos);
+
+ switch (ch) {
+ case 60:
+ case 123:
+ if (this.state.pos === this.state.start) {
+ if (ch === 60 && this.state.exprAllowed) {
+ ++this.state.pos;
+ return this.finishToken(94);
+ }
+
+ return super.getTokenFromCode(ch);
+ }
+
+ out += this.input.slice(chunkStart, this.state.pos);
+ return this.finishToken(93, out);
+
+ case 38:
+ out += this.input.slice(chunkStart, this.state.pos);
+ out += this.jsxReadEntity();
+ chunkStart = this.state.pos;
+ break;
+
+ case 62:
+ case 125:
+
+ default:
+ if (isNewLine(ch)) {
+ out += this.input.slice(chunkStart, this.state.pos);
+ out += this.jsxReadNewLine(true);
+ chunkStart = this.state.pos;
+ } else {
+ ++this.state.pos;
+ }
+
+ }
+ }
+ }
+
+ jsxReadNewLine(normalizeCRLF) {
+ const ch = this.input.charCodeAt(this.state.pos);
+ let out;
+ ++this.state.pos;
+
+ if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) {
+ ++this.state.pos;
+ out = normalizeCRLF ? "\n" : "\r\n";
+ } else {
+ out = String.fromCharCode(ch);
+ }
+
+ ++this.state.curLine;
+ this.state.lineStart = this.state.pos;
+ return out;
+ }
+
+ jsxReadString(quote) {
+ let out = "";
+ let chunkStart = ++this.state.pos;
+
+ for (;;) {
+ if (this.state.pos >= this.length) {
+ throw this.raise(this.state.start, ErrorMessages.UnterminatedString);
+ }
+
+ const ch = this.input.charCodeAt(this.state.pos);
+ if (ch === quote) break;
+
+ if (ch === 38) {
+ out += this.input.slice(chunkStart, this.state.pos);
+ out += this.jsxReadEntity();
+ chunkStart = this.state.pos;
+ } else if (isNewLine(ch)) {
+ out += this.input.slice(chunkStart, this.state.pos);
+ out += this.jsxReadNewLine(false);
+ chunkStart = this.state.pos;
+ } else {
+ ++this.state.pos;
+ }
+ }
+
+ out += this.input.slice(chunkStart, this.state.pos++);
+ return this.finishToken(4, out);
+ }
+
+ jsxReadEntity() {
+ let str = "";
+ let count = 0;
+ let entity;
+ let ch = this.input[this.state.pos];
+ const startPos = ++this.state.pos;
+
+ while (this.state.pos < this.length && count++ < 10) {
+ ch = this.input[this.state.pos++];
+
+ if (ch === ";") {
+ if (str[0] === "#") {
+ if (str[1] === "x") {
+ str = str.substr(2);
+
+ if (HEX_NUMBER.test(str)) {
+ entity = String.fromCodePoint(parseInt(str, 16));
+ }
+ } else {
+ str = str.substr(1);
+
+ if (DECIMAL_NUMBER.test(str)) {
+ entity = String.fromCodePoint(parseInt(str, 10));
+ }
+ }
+ } else {
+ entity = entities[str];
+ }
+
+ break;
+ }
+
+ str += ch;
+ }
+
+ if (!entity) {
+ this.state.pos = startPos;
+ return "&";
+ }
+
+ return entity;
+ }
+
+ jsxReadWord() {
+ let ch;
+ const start = this.state.pos;
+
+ do {
+ ch = this.input.charCodeAt(++this.state.pos);
+ } while (isIdentifierChar(ch) || ch === 45);
+
+ return this.finishToken(92, this.input.slice(start, this.state.pos));
+ }
+
+ jsxParseIdentifier() {
+ const node = this.startNode();
+
+ if (this.match(92)) {
+ node.name = this.state.value;
+ } else if (tokenIsKeyword(this.state.type)) {
+ node.name = tokenLabelName(this.state.type);
+ } else {
+ this.unexpected();
+ }
+
+ this.next();
+ return this.finishNode(node, "JSXIdentifier");
+ }
+
+ jsxParseNamespacedName() {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const name = this.jsxParseIdentifier();
+ if (!this.eat(22)) return name;
+ const node = this.startNodeAt(startPos, startLoc);
+ node.namespace = name;
+ node.name = this.jsxParseIdentifier();
+ return this.finishNode(node, "JSXNamespacedName");
+ }
+
+ jsxParseElementName() {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ let node = this.jsxParseNamespacedName();
+
+ if (node.type === "JSXNamespacedName") {
+ return node;
+ }
+
+ while (this.eat(24)) {
+ const newNode = this.startNodeAt(startPos, startLoc);
+ newNode.object = node;
+ newNode.property = this.jsxParseIdentifier();
+ node = this.finishNode(newNode, "JSXMemberExpression");
+ }
+
+ return node;
+ }
+
+ jsxParseAttributeValue() {
+ let node;
+
+ switch (this.state.type) {
+ case 13:
+ node = this.startNode();
+ this.next();
+ node = this.jsxParseExpressionContainer(node);
+
+ if (node.expression.type === "JSXEmptyExpression") {
+ this.raise(node.start, JsxErrors.AttributeIsEmpty);
+ }
+
+ return node;
+
+ case 94:
+ case 4:
+ return this.parseExprAtom();
+
+ default:
+ throw this.raise(this.state.start, JsxErrors.UnsupportedJsxValue);
+ }
+ }
+
+ jsxParseEmptyExpression() {
+ const node = this.startNodeAt(this.state.lastTokEnd, this.state.lastTokEndLoc);
+ return this.finishNodeAt(node, "JSXEmptyExpression", this.state.start, this.state.startLoc);
+ }
+
+ jsxParseSpreadChild(node) {
+ this.next();
+ node.expression = this.parseExpression();
+ this.expect(16);
+ return this.finishNode(node, "JSXSpreadChild");
+ }
+
+ jsxParseExpressionContainer(node) {
+ if (this.match(16)) {
+ node.expression = this.jsxParseEmptyExpression();
+ } else {
+ const expression = this.parseExpression();
+ node.expression = expression;
+ }
+
+ this.expect(16);
+ return this.finishNode(node, "JSXExpressionContainer");
+ }
+
+ jsxParseAttribute() {
+ const node = this.startNode();
+
+ if (this.eat(13)) {
+ this.expect(29);
+ node.argument = this.parseMaybeAssignAllowIn();
+ this.expect(16);
+ return this.finishNode(node, "JSXSpreadAttribute");
+ }
+
+ node.name = this.jsxParseNamespacedName();
+ node.value = this.eat(35) ? this.jsxParseAttributeValue() : null;
+ return this.finishNode(node, "JSXAttribute");
+ }
+
+ jsxParseOpeningElementAt(startPos, startLoc) {
+ const node = this.startNodeAt(startPos, startLoc);
+
+ if (this.match(95)) {
+ this.expect(95);
+ return this.finishNode(node, "JSXOpeningFragment");
+ }
+
+ node.name = this.jsxParseElementName();
+ return this.jsxParseOpeningElementAfterName(node);
+ }
+
+ jsxParseOpeningElementAfterName(node) {
+ const attributes = [];
+
+ while (!this.match(55) && !this.match(95)) {
+ attributes.push(this.jsxParseAttribute());
+ }
+
+ node.attributes = attributes;
+ node.selfClosing = this.eat(55);
+ this.expect(95);
+ return this.finishNode(node, "JSXOpeningElement");
+ }
+
+ jsxParseClosingElementAt(startPos, startLoc) {
+ const node = this.startNodeAt(startPos, startLoc);
+
+ if (this.match(95)) {
+ this.expect(95);
+ return this.finishNode(node, "JSXClosingFragment");
+ }
+
+ node.name = this.jsxParseElementName();
+ this.expect(95);
+ return this.finishNode(node, "JSXClosingElement");
+ }
+
+ jsxParseElementAt(startPos, startLoc) {
+ const node = this.startNodeAt(startPos, startLoc);
+ const children = [];
+ const openingElement = this.jsxParseOpeningElementAt(startPos, startLoc);
+ let closingElement = null;
+
+ if (!openingElement.selfClosing) {
+ contents: for (;;) {
+ switch (this.state.type) {
+ case 94:
+ startPos = this.state.start;
+ startLoc = this.state.startLoc;
+ this.next();
+
+ if (this.eat(55)) {
+ closingElement = this.jsxParseClosingElementAt(startPos, startLoc);
+ break contents;
+ }
+
+ children.push(this.jsxParseElementAt(startPos, startLoc));
+ break;
+
+ case 93:
+ children.push(this.parseExprAtom());
+ break;
+
+ case 13:
+ {
+ const node = this.startNode();
+ this.next();
+
+ if (this.match(29)) {
+ children.push(this.jsxParseSpreadChild(node));
+ } else {
+ children.push(this.jsxParseExpressionContainer(node));
+ }
+
+ break;
+ }
+
+ default:
+ throw this.unexpected();
+ }
+ }
+
+ if (isFragment(openingElement) && !isFragment(closingElement)) {
+ this.raise(closingElement.start, JsxErrors.MissingClosingTagFragment);
+ } else if (!isFragment(openingElement) && isFragment(closingElement)) {
+ this.raise(closingElement.start, JsxErrors.MissingClosingTagElement, getQualifiedJSXName(openingElement.name));
+ } else if (!isFragment(openingElement) && !isFragment(closingElement)) {
+ if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) {
+ this.raise(closingElement.start, JsxErrors.MissingClosingTagElement, getQualifiedJSXName(openingElement.name));
+ }
+ }
+ }
+
+ if (isFragment(openingElement)) {
+ node.openingFragment = openingElement;
+ node.closingFragment = closingElement;
+ } else {
+ node.openingElement = openingElement;
+ node.closingElement = closingElement;
+ }
+
+ node.children = children;
+
+ if (this.isRelational("<")) {
+ throw this.raise(this.state.start, JsxErrors.UnwrappedAdjacentJSXElements);
+ }
+
+ return isFragment(openingElement) ? this.finishNode(node, "JSXFragment") : this.finishNode(node, "JSXElement");
+ }
+
+ jsxParseElement() {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ this.next();
+ return this.jsxParseElementAt(startPos, startLoc);
+ }
+
+ parseExprAtom(refExpressionErrors) {
+ if (this.match(93)) {
+ return this.parseLiteral(this.state.value, "JSXText");
+ } else if (this.match(94)) {
+ return this.jsxParseElement();
+ } else if (this.isRelational("<") && this.input.charCodeAt(this.state.pos) !== 33) {
+ this.finishToken(94);
+ return this.jsxParseElement();
+ } else {
+ return super.parseExprAtom(refExpressionErrors);
+ }
+ }
+
+ createLookaheadState(state) {
+ const lookaheadState = super.createLookaheadState(state);
+ lookaheadState.inPropertyName = state.inPropertyName;
+ return lookaheadState;
+ }
+
+ getTokenFromCode(code) {
+ if (this.state.inPropertyName) return super.getTokenFromCode(code);
+ const context = this.curContext();
+
+ if (context === types.j_expr) {
+ return this.jsxReadToken();
+ }
+
+ if (context === types.j_oTag || context === types.j_cTag) {
+ if (isIdentifierStart(code)) {
+ return this.jsxReadWord();
+ }
+
+ if (code === 62) {
+ ++this.state.pos;
+ return this.finishToken(95);
+ }
+
+ if ((code === 34 || code === 39) && context === types.j_oTag) {
+ return this.jsxReadString(code);
+ }
+ }
+
+ if (code === 60 && this.state.exprAllowed && this.input.charCodeAt(this.state.pos + 1) !== 33) {
+ ++this.state.pos;
+ return this.finishToken(94);
+ }
+
+ return super.getTokenFromCode(code);
+ }
+
+ updateContext(prevType) {
+ super.updateContext(prevType);
+ const {
+ context,
+ type
+ } = this.state;
+
+ if (type === 55 && prevType === 94) {
+ context.splice(-2, 2, types.j_cTag);
+ this.state.exprAllowed = false;
+ } else if (type === 94) {
+ context.push(types.j_expr, types.j_oTag);
+ } else if (type === 95) {
+ const out = context.pop();
+
+ if (out === types.j_oTag && prevType === 55 || out === types.j_cTag) {
+ context.pop();
+ this.state.exprAllowed = context[context.length - 1] === types.j_expr;
+ } else {
+ this.state.exprAllowed = true;
+ }
+ } else if (tokenIsKeyword(type) && (prevType === 24 || prevType === 26)) {
+ this.state.exprAllowed = false;
+ } else {
+ this.state.exprAllowed = tokenComesBeforeExpression(type);
+ }
+ }
+
+});
+
+class TypeScriptScope extends Scope {
+ constructor(...args) {
+ super(...args);
+ this.types = new Set();
+ this.enums = new Set();
+ this.constEnums = new Set();
+ this.classes = new Set();
+ this.exportOnlyBindings = new Set();
+ }
+
+}
+
+class TypeScriptScopeHandler extends ScopeHandler {
+ createScope(flags) {
+ return new TypeScriptScope(flags);
+ }
+
+ declareName(name, bindingType, pos) {
+ const scope = this.currentScope();
+
+ if (bindingType & BIND_FLAGS_TS_EXPORT_ONLY) {
+ this.maybeExportDefined(scope, name);
+ scope.exportOnlyBindings.add(name);
+ return;
+ }
+
+ super.declareName(...arguments);
+
+ if (bindingType & BIND_KIND_TYPE) {
+ if (!(bindingType & BIND_KIND_VALUE)) {
+ this.checkRedeclarationInScope(scope, name, bindingType, pos);
+ this.maybeExportDefined(scope, name);
+ }
+
+ scope.types.add(name);
+ }
+
+ if (bindingType & BIND_FLAGS_TS_ENUM) scope.enums.add(name);
+ if (bindingType & BIND_FLAGS_TS_CONST_ENUM) scope.constEnums.add(name);
+ if (bindingType & BIND_FLAGS_CLASS) scope.classes.add(name);
+ }
+
+ isRedeclaredInScope(scope, name, bindingType) {
+ if (scope.enums.has(name)) {
+ if (bindingType & BIND_FLAGS_TS_ENUM) {
+ const isConst = !!(bindingType & BIND_FLAGS_TS_CONST_ENUM);
+ const wasConst = scope.constEnums.has(name);
+ return isConst !== wasConst;
+ }
+
+ return true;
+ }
+
+ if (bindingType & BIND_FLAGS_CLASS && scope.classes.has(name)) {
+ if (scope.lexical.has(name)) {
+ return !!(bindingType & BIND_KIND_VALUE);
+ } else {
+ return false;
+ }
+ }
+
+ if (bindingType & BIND_KIND_TYPE && scope.types.has(name)) {
+ return true;
+ }
+
+ return super.isRedeclaredInScope(...arguments);
+ }
+
+ checkLocalExport(id) {
+ const topLevelScope = this.scopeStack[0];
+ const {
+ name
+ } = id;
+
+ if (!topLevelScope.types.has(name) && !topLevelScope.exportOnlyBindings.has(name)) {
+ super.checkLocalExport(id);
+ }
+ }
+
+}
+
+function nonNull(x) {
+ if (x == null) {
+ throw new Error(`Unexpected ${x} value.`);
+ }
+
+ return x;
+}
+
+function assert(x) {
+ if (!x) {
+ throw new Error("Assert fail");
+ }
+}
+
+const TSErrors = makeErrorTemplates({
+ AbstractMethodHasImplementation: "Method '%0' cannot have an implementation because it is marked abstract.",
+ AbstractPropertyHasInitializer: "Property '%0' cannot have an initializer because it is marked abstract.",
+ AccesorCannotDeclareThisParameter: "'get' and 'set' accessors cannot declare 'this' parameters.",
+ AccesorCannotHaveTypeParameters: "An accessor cannot have type parameters.",
+ ClassMethodHasDeclare: "Class methods cannot have the 'declare' modifier.",
+ ClassMethodHasReadonly: "Class methods cannot have the 'readonly' modifier.",
+ ConstructorHasTypeParameters: "Type parameters cannot appear on a constructor declaration.",
+ DeclareAccessor: "'declare' is not allowed in %0ters.",
+ DeclareClassFieldHasInitializer: "Initializers are not allowed in ambient contexts.",
+ DeclareFunctionHasImplementation: "An implementation cannot be declared in ambient contexts.",
+ DuplicateAccessibilityModifier: "Accessibility modifier already seen.",
+ DuplicateModifier: "Duplicate modifier: '%0'.",
+ EmptyHeritageClauseType: "'%0' list cannot be empty.",
+ EmptyTypeArguments: "Type argument list cannot be empty.",
+ EmptyTypeParameters: "Type parameter list cannot be empty.",
+ ExpectedAmbientAfterExportDeclare: "'export declare' must be followed by an ambient declaration.",
+ ImportAliasHasImportType: "An import alias can not use 'import type'.",
+ IncompatibleModifiers: "'%0' modifier cannot be used with '%1' modifier.",
+ IndexSignatureHasAbstract: "Index signatures cannot have the 'abstract' modifier.",
+ IndexSignatureHasAccessibility: "Index signatures cannot have an accessibility modifier ('%0').",
+ IndexSignatureHasDeclare: "Index signatures cannot have the 'declare' modifier.",
+ IndexSignatureHasOverride: "'override' modifier cannot appear on an index signature.",
+ IndexSignatureHasStatic: "Index signatures cannot have the 'static' modifier.",
+ InvalidModifierOnTypeMember: "'%0' modifier cannot appear on a type member.",
+ InvalidModifiersOrder: "'%0' modifier must precede '%1' modifier.",
+ InvalidTupleMemberLabel: "Tuple members must be labeled with a simple identifier.",
+ MissingInterfaceName: "'interface' declarations must be followed by an identifier.",
+ MixedLabeledAndUnlabeledElements: "Tuple members must all have names or all not have names.",
+ NonAbstractClassHasAbstractMethod: "Abstract methods can only appear within an abstract class.",
+ NonClassMethodPropertyHasAbstractModifer: "'abstract' modifier can only appear on a class, method, or property declaration.",
+ OptionalTypeBeforeRequired: "A required element cannot follow an optional element.",
+ OverrideNotInSubClass: "This member cannot have an 'override' modifier because its containing class does not extend another class.",
+ PatternIsOptional: "A binding pattern parameter cannot be optional in an implementation signature.",
+ PrivateElementHasAbstract: "Private elements cannot have the 'abstract' modifier.",
+ PrivateElementHasAccessibility: "Private elements cannot have an accessibility modifier ('%0').",
+ ReadonlyForMethodSignature: "'readonly' modifier can only appear on a property declaration or index signature.",
+ SetAccesorCannotHaveOptionalParameter: "A 'set' accessor cannot have an optional parameter.",
+ SetAccesorCannotHaveRestParameter: "A 'set' accessor cannot have rest parameter.",
+ SetAccesorCannotHaveReturnType: "A 'set' accessor cannot have a return type annotation.",
+ StaticBlockCannotHaveModifier: "Static class blocks cannot have any modifier.",
+ TypeAnnotationAfterAssign: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",
+ TypeImportCannotSpecifyDefaultAndNamed: "A type-only import can specify a default import or named bindings, but not both.",
+ UnexpectedParameterModifier: "A parameter property is only allowed in a constructor implementation.",
+ UnexpectedReadonly: "'readonly' type modifier is only permitted on array and tuple literal types.",
+ UnexpectedTypeAnnotation: "Did not expect a type annotation here.",
+ UnexpectedTypeCastInParameter: "Unexpected type cast in parameter position.",
+ UnsupportedImportTypeArgument: "Argument in a type import must be a string literal.",
+ UnsupportedParameterPropertyKind: "A parameter property may not be declared using a binding pattern.",
+ UnsupportedSignatureParameterKind: "Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got %0."
+}, ErrorCodes.SyntaxError, "typescript");
+
+function keywordTypeFromName(value) {
+ switch (value) {
+ case "any":
+ return "TSAnyKeyword";
+
+ case "boolean":
+ return "TSBooleanKeyword";
+
+ case "bigint":
+ return "TSBigIntKeyword";
+
+ case "never":
+ return "TSNeverKeyword";
+
+ case "number":
+ return "TSNumberKeyword";
+
+ case "object":
+ return "TSObjectKeyword";
+
+ case "string":
+ return "TSStringKeyword";
+
+ case "symbol":
+ return "TSSymbolKeyword";
+
+ case "undefined":
+ return "TSUndefinedKeyword";
+
+ case "unknown":
+ return "TSUnknownKeyword";
+
+ default:
+ return undefined;
+ }
+}
+
+function tsIsAccessModifier(modifier) {
+ return modifier === "private" || modifier === "public" || modifier === "protected";
+}
+
+var typescript = (superClass => class extends superClass {
+ getScopeHandler() {
+ return TypeScriptScopeHandler;
+ }
+
+ tsIsIdentifier() {
+ return this.match(5);
+ }
+
+ tsTokenCanFollowModifier() {
+ return (this.match(8) || this.match(13) || this.match(54) || this.match(29) || this.match(6) || this.isLiteralPropertyName()) && !this.hasPrecedingLineBreak();
+ }
+
+ tsNextTokenCanFollowModifier() {
+ this.next();
+ return this.tsTokenCanFollowModifier();
+ }
+
+ tsParseModifier(allowedModifiers, stopOnStartOfClassStaticBlock) {
+ if (!this.match(5)) {
+ return undefined;
+ }
+
+ const modifier = this.state.value;
+
+ if (allowedModifiers.indexOf(modifier) !== -1) {
+ if (stopOnStartOfClassStaticBlock && this.tsIsStartOfStaticBlocks()) {
+ return undefined;
+ }
+
+ if (this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) {
+ return modifier;
+ }
+ }
+
+ return undefined;
+ }
+
+ tsParseModifiers(modified, allowedModifiers, disallowedModifiers, errorTemplate, stopOnStartOfClassStaticBlock) {
+ const enforceOrder = (pos, modifier, before, after) => {
+ if (modifier === before && modified[after]) {
+ this.raise(pos, TSErrors.InvalidModifiersOrder, before, after);
+ }
+ };
+
+ const incompatible = (pos, modifier, mod1, mod2) => {
+ if (modified[mod1] && modifier === mod2 || modified[mod2] && modifier === mod1) {
+ this.raise(pos, TSErrors.IncompatibleModifiers, mod1, mod2);
+ }
+ };
+
+ for (;;) {
+ const startPos = this.state.start;
+ const modifier = this.tsParseModifier(allowedModifiers.concat(disallowedModifiers != null ? disallowedModifiers : []), stopOnStartOfClassStaticBlock);
+ if (!modifier) break;
+
+ if (tsIsAccessModifier(modifier)) {
+ if (modified.accessibility) {
+ this.raise(startPos, TSErrors.DuplicateAccessibilityModifier);
+ } else {
+ enforceOrder(startPos, modifier, modifier, "override");
+ enforceOrder(startPos, modifier, modifier, "static");
+ enforceOrder(startPos, modifier, modifier, "readonly");
+ modified.accessibility = modifier;
+ }
+ } else {
+ if (Object.hasOwnProperty.call(modified, modifier)) {
+ this.raise(startPos, TSErrors.DuplicateModifier, modifier);
+ } else {
+ enforceOrder(startPos, modifier, "static", "readonly");
+ enforceOrder(startPos, modifier, "static", "override");
+ enforceOrder(startPos, modifier, "override", "readonly");
+ enforceOrder(startPos, modifier, "abstract", "override");
+ incompatible(startPos, modifier, "declare", "override");
+ incompatible(startPos, modifier, "static", "abstract");
+ }
+
+ modified[modifier] = true;
+ }
+
+ if (disallowedModifiers != null && disallowedModifiers.includes(modifier)) {
+ this.raise(startPos, errorTemplate, modifier);
+ }
+ }
+ }
+
+ tsIsListTerminator(kind) {
+ switch (kind) {
+ case "EnumMembers":
+ case "TypeMembers":
+ return this.match(16);
+
+ case "HeritageClauseElement":
+ return this.match(13);
+
+ case "TupleElementTypes":
+ return this.match(11);
+
+ case "TypeParametersOrArguments":
+ return this.isRelational(">");
+ }
+
+ throw new Error("Unreachable");
+ }
+
+ tsParseList(kind, parseElement) {
+ const result = [];
+
+ while (!this.tsIsListTerminator(kind)) {
+ result.push(parseElement());
+ }
+
+ return result;
+ }
+
+ tsParseDelimitedList(kind, parseElement) {
+ return nonNull(this.tsParseDelimitedListWorker(kind, parseElement, true));
+ }
+
+ tsParseDelimitedListWorker(kind, parseElement, expectSuccess) {
+ const result = [];
+
+ for (;;) {
+ if (this.tsIsListTerminator(kind)) {
+ break;
+ }
+
+ const element = parseElement();
+
+ if (element == null) {
+ return undefined;
+ }
+
+ result.push(element);
+
+ if (this.eat(20)) {
+ continue;
+ }
+
+ if (this.tsIsListTerminator(kind)) {
+ break;
+ }
+
+ if (expectSuccess) {
+ this.expect(20);
+ }
+
+ return undefined;
+ }
+
+ return result;
+ }
+
+ tsParseBracketedList(kind, parseElement, bracket, skipFirstToken) {
+ if (!skipFirstToken) {
+ if (bracket) {
+ this.expect(8);
+ } else {
+ this.expectRelational("<");
+ }
+ }
+
+ const result = this.tsParseDelimitedList(kind, parseElement);
+
+ if (bracket) {
+ this.expect(11);
+ } else {
+ this.expectRelational(">");
+ }
+
+ return result;
+ }
+
+ tsParseImportType() {
+ const node = this.startNode();
+ this.expect(82);
+ this.expect(18);
+
+ if (!this.match(4)) {
+ this.raise(this.state.start, TSErrors.UnsupportedImportTypeArgument);
+ }
+
+ node.argument = this.parseExprAtom();
+ this.expect(19);
+
+ if (this.eat(24)) {
+ node.qualifier = this.tsParseEntityName(true);
+ }
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.tsParseTypeArguments();
+ }
+
+ return this.finishNode(node, "TSImportType");
+ }
+
+ tsParseEntityName(allowReservedWords) {
+ let entity = this.parseIdentifier();
+
+ while (this.eat(24)) {
+ const node = this.startNodeAtNode(entity);
+ node.left = entity;
+ node.right = this.parseIdentifier(allowReservedWords);
+ entity = this.finishNode(node, "TSQualifiedName");
+ }
+
+ return entity;
+ }
+
+ tsParseTypeReference() {
+ const node = this.startNode();
+ node.typeName = this.tsParseEntityName(false);
+
+ if (!this.hasPrecedingLineBreak() && this.isRelational("<")) {
+ node.typeParameters = this.tsParseTypeArguments();
+ }
+
+ return this.finishNode(node, "TSTypeReference");
+ }
+
+ tsParseThisTypePredicate(lhs) {
+ this.next();
+ const node = this.startNodeAtNode(lhs);
+ node.parameterName = lhs;
+ node.typeAnnotation = this.tsParseTypeAnnotation(false);
+ node.asserts = false;
+ return this.finishNode(node, "TSTypePredicate");
+ }
+
+ tsParseThisTypeNode() {
+ const node = this.startNode();
+ this.next();
+ return this.finishNode(node, "TSThisType");
+ }
+
+ tsParseTypeQuery() {
+ const node = this.startNode();
+ this.expect(86);
+
+ if (this.match(82)) {
+ node.exprName = this.tsParseImportType();
+ } else {
+ node.exprName = this.tsParseEntityName(true);
+ }
+
+ return this.finishNode(node, "TSTypeQuery");
+ }
+
+ tsParseTypeParameter() {
+ const node = this.startNode();
+ node.name = this.tsParseTypeParameterName();
+ node.constraint = this.tsEatThenParseType(80);
+ node.default = this.tsEatThenParseType(35);
+ return this.finishNode(node, "TSTypeParameter");
+ }
+
+ tsTryParseTypeParameters() {
+ if (this.isRelational("<")) {
+ return this.tsParseTypeParameters();
+ }
+ }
+
+ tsParseTypeParameters() {
+ const node = this.startNode();
+
+ if (this.isRelational("<") || this.match(94)) {
+ this.next();
+ } else {
+ this.unexpected();
+ }
+
+ node.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this), false, true);
+
+ if (node.params.length === 0) {
+ this.raise(node.start, TSErrors.EmptyTypeParameters);
+ }
+
+ return this.finishNode(node, "TSTypeParameterDeclaration");
+ }
+
+ tsTryNextParseConstantContext() {
+ if (this.lookahead().type === 74) {
+ this.next();
+ return this.tsParseTypeReference();
+ }
+
+ return null;
+ }
+
+ tsFillSignature(returnToken, signature) {
+ const returnTokenRequired = returnToken === 27;
+ signature.typeParameters = this.tsTryParseTypeParameters();
+ this.expect(18);
+ signature.parameters = this.tsParseBindingListForSignature();
+
+ if (returnTokenRequired) {
+ signature.typeAnnotation = this.tsParseTypeOrTypePredicateAnnotation(returnToken);
+ } else if (this.match(returnToken)) {
+ signature.typeAnnotation = this.tsParseTypeOrTypePredicateAnnotation(returnToken);
+ }
+ }
+
+ tsParseBindingListForSignature() {
+ return this.parseBindingList(19, 41).map(pattern => {
+ if (pattern.type !== "Identifier" && pattern.type !== "RestElement" && pattern.type !== "ObjectPattern" && pattern.type !== "ArrayPattern") {
+ this.raise(pattern.start, TSErrors.UnsupportedSignatureParameterKind, pattern.type);
+ }
+
+ return pattern;
+ });
+ }
+
+ tsParseTypeMemberSemicolon() {
+ if (!this.eat(20) && !this.isLineTerminator()) {
+ this.expect(21);
+ }
+ }
+
+ tsParseSignatureMember(kind, node) {
+ this.tsFillSignature(22, node);
+ this.tsParseTypeMemberSemicolon();
+ return this.finishNode(node, kind);
+ }
+
+ tsIsUnambiguouslyIndexSignature() {
+ this.next();
+ return this.eat(5) && this.match(22);
+ }
+
+ tsTryParseIndexSignature(node) {
+ if (!(this.match(8) && this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this)))) {
+ return undefined;
+ }
+
+ this.expect(8);
+ const id = this.parseIdentifier();
+ id.typeAnnotation = this.tsParseTypeAnnotation();
+ this.resetEndLocation(id);
+ this.expect(11);
+ node.parameters = [id];
+ const type = this.tsTryParseTypeAnnotation();
+ if (type) node.typeAnnotation = type;
+ this.tsParseTypeMemberSemicolon();
+ return this.finishNode(node, "TSIndexSignature");
+ }
+
+ tsParsePropertyOrMethodSignature(node, readonly) {
+ if (this.eat(25)) node.optional = true;
+ const nodeAny = node;
+
+ if (this.match(18) || this.isRelational("<")) {
+ if (readonly) {
+ this.raise(node.start, TSErrors.ReadonlyForMethodSignature);
+ }
+
+ const method = nodeAny;
+
+ if (method.kind && this.isRelational("<")) {
+ this.raise(this.state.pos, TSErrors.AccesorCannotHaveTypeParameters);
+ }
+
+ this.tsFillSignature(22, method);
+ this.tsParseTypeMemberSemicolon();
+
+ if (method.kind === "get") {
+ if (method.parameters.length > 0) {
+ this.raise(this.state.pos, ErrorMessages.BadGetterArity);
+
+ if (this.isThisParam(method.parameters[0])) {
+ this.raise(this.state.pos, TSErrors.AccesorCannotDeclareThisParameter);
+ }
+ }
+ } else if (method.kind === "set") {
+ if (method.parameters.length !== 1) {
+ this.raise(this.state.pos, ErrorMessages.BadSetterArity);
+ } else {
+ const firstParameter = method.parameters[0];
+
+ if (this.isThisParam(firstParameter)) {
+ this.raise(this.state.pos, TSErrors.AccesorCannotDeclareThisParameter);
+ }
+
+ if (firstParameter.type === "Identifier" && firstParameter.optional) {
+ this.raise(this.state.pos, TSErrors.SetAccesorCannotHaveOptionalParameter);
+ }
+
+ if (firstParameter.type === "RestElement") {
+ this.raise(this.state.pos, TSErrors.SetAccesorCannotHaveRestParameter);
+ }
+ }
+
+ if (method.typeAnnotation) {
+ this.raise(method.typeAnnotation.start, TSErrors.SetAccesorCannotHaveReturnType);
+ }
+ } else {
+ method.kind = "method";
+ }
+
+ return this.finishNode(method, "TSMethodSignature");
+ } else {
+ const property = nodeAny;
+ if (readonly) property.readonly = true;
+ const type = this.tsTryParseTypeAnnotation();
+ if (type) property.typeAnnotation = type;
+ this.tsParseTypeMemberSemicolon();
+ return this.finishNode(property, "TSPropertySignature");
+ }
+ }
+
+ tsParseTypeMember() {
+ const node = this.startNode();
+
+ if (this.match(18) || this.isRelational("<")) {
+ return this.tsParseSignatureMember("TSCallSignatureDeclaration", node);
+ }
+
+ if (this.match(76)) {
+ const id = this.startNode();
+ this.next();
+
+ if (this.match(18) || this.isRelational("<")) {
+ return this.tsParseSignatureMember("TSConstructSignatureDeclaration", node);
+ } else {
+ node.key = this.createIdentifier(id, "new");
+ return this.tsParsePropertyOrMethodSignature(node, false);
+ }
+ }
+
+ this.tsParseModifiers(node, ["readonly"], ["declare", "abstract", "private", "protected", "public", "static", "override"], TSErrors.InvalidModifierOnTypeMember);
+ const idx = this.tsTryParseIndexSignature(node);
+
+ if (idx) {
+ return idx;
+ }
+
+ this.parsePropertyName(node, false);
+
+ if (!node.computed && node.key.type === "Identifier" && (node.key.name === "get" || node.key.name === "set") && this.tsTokenCanFollowModifier()) {
+ node.kind = node.key.name;
+ this.parsePropertyName(node, false);
+ }
+
+ return this.tsParsePropertyOrMethodSignature(node, !!node.readonly);
+ }
+
+ tsParseTypeLiteral() {
+ const node = this.startNode();
+ node.members = this.tsParseObjectTypeMembers();
+ return this.finishNode(node, "TSTypeLiteral");
+ }
+
+ tsParseObjectTypeMembers() {
+ this.expect(13);
+ const members = this.tsParseList("TypeMembers", this.tsParseTypeMember.bind(this));
+ this.expect(16);
+ return members;
+ }
+
+ tsIsStartOfMappedType() {
+ this.next();
+
+ if (this.eat(52)) {
+ return this.isContextual("readonly");
+ }
+
+ if (this.isContextual("readonly")) {
+ this.next();
+ }
+
+ if (!this.match(8)) {
+ return false;
+ }
+
+ this.next();
+
+ if (!this.tsIsIdentifier()) {
+ return false;
+ }
+
+ this.next();
+ return this.match(57);
+ }
+
+ tsParseMappedTypeParameter() {
+ const node = this.startNode();
+ node.name = this.tsParseTypeParameterName();
+ node.constraint = this.tsExpectThenParseType(57);
+ return this.finishNode(node, "TSTypeParameter");
+ }
+
+ tsParseMappedType() {
+ const node = this.startNode();
+ this.expect(13);
+
+ if (this.match(52)) {
+ node.readonly = this.state.value;
+ this.next();
+ this.expectContextual("readonly");
+ } else if (this.eatContextual("readonly")) {
+ node.readonly = true;
+ }
+
+ this.expect(8);
+ node.typeParameter = this.tsParseMappedTypeParameter();
+ node.nameType = this.eatContextual("as") ? this.tsParseType() : null;
+ this.expect(11);
+
+ if (this.match(52)) {
+ node.optional = this.state.value;
+ this.next();
+ this.expect(25);
+ } else if (this.eat(25)) {
+ node.optional = true;
+ }
+
+ node.typeAnnotation = this.tsTryParseType();
+ this.semicolon();
+ this.expect(16);
+ return this.finishNode(node, "TSMappedType");
+ }
+
+ tsParseTupleType() {
+ const node = this.startNode();
+ node.elementTypes = this.tsParseBracketedList("TupleElementTypes", this.tsParseTupleElementType.bind(this), true, false);
+ let seenOptionalElement = false;
+ let labeledElements = null;
+ node.elementTypes.forEach(elementNode => {
+ var _labeledElements;
+
+ let {
+ type
+ } = elementNode;
+
+ if (seenOptionalElement && type !== "TSRestType" && type !== "TSOptionalType" && !(type === "TSNamedTupleMember" && elementNode.optional)) {
+ this.raise(elementNode.start, TSErrors.OptionalTypeBeforeRequired);
+ }
+
+ seenOptionalElement = seenOptionalElement || type === "TSNamedTupleMember" && elementNode.optional || type === "TSOptionalType";
+
+ if (type === "TSRestType") {
+ elementNode = elementNode.typeAnnotation;
+ type = elementNode.type;
+ }
+
+ const isLabeled = type === "TSNamedTupleMember";
+ labeledElements = (_labeledElements = labeledElements) != null ? _labeledElements : isLabeled;
+
+ if (labeledElements !== isLabeled) {
+ this.raise(elementNode.start, TSErrors.MixedLabeledAndUnlabeledElements);
+ }
+ });
+ return this.finishNode(node, "TSTupleType");
+ }
+
+ tsParseTupleElementType() {
+ const {
+ start: startPos,
+ startLoc
+ } = this.state;
+ const rest = this.eat(29);
+ let type = this.tsParseType();
+ const optional = this.eat(25);
+ const labeled = this.eat(22);
+
+ if (labeled) {
+ const labeledNode = this.startNodeAtNode(type);
+ labeledNode.optional = optional;
+
+ if (type.type === "TSTypeReference" && !type.typeParameters && type.typeName.type === "Identifier") {
+ labeledNode.label = type.typeName;
+ } else {
+ this.raise(type.start, TSErrors.InvalidTupleMemberLabel);
+ labeledNode.label = type;
+ }
+
+ labeledNode.elementType = this.tsParseType();
+ type = this.finishNode(labeledNode, "TSNamedTupleMember");
+ } else if (optional) {
+ const optionalTypeNode = this.startNodeAtNode(type);
+ optionalTypeNode.typeAnnotation = type;
+ type = this.finishNode(optionalTypeNode, "TSOptionalType");
+ }
+
+ if (rest) {
+ const restNode = this.startNodeAt(startPos, startLoc);
+ restNode.typeAnnotation = type;
+ type = this.finishNode(restNode, "TSRestType");
+ }
+
+ return type;
+ }
+
+ tsParseParenthesizedType() {
+ const node = this.startNode();
+ this.expect(18);
+ node.typeAnnotation = this.tsParseType();
+ this.expect(19);
+ return this.finishNode(node, "TSParenthesizedType");
+ }
+
+ tsParseFunctionOrConstructorType(type, abstract) {
+ const node = this.startNode();
+
+ if (type === "TSConstructorType") {
+ node.abstract = !!abstract;
+ if (abstract) this.next();
+ this.next();
+ }
+
+ this.tsFillSignature(27, node);
+ return this.finishNode(node, type);
+ }
+
+ tsParseLiteralTypeNode() {
+ const node = this.startNode();
+
+ node.literal = (() => {
+ switch (this.state.type) {
+ case 0:
+ case 1:
+ case 4:
+ case 84:
+ case 85:
+ return this.parseExprAtom();
+
+ default:
+ throw this.unexpected();
+ }
+ })();
+
+ return this.finishNode(node, "TSLiteralType");
+ }
+
+ tsParseTemplateLiteralType() {
+ const node = this.startNode();
+ node.literal = this.parseTemplate(false);
+ return this.finishNode(node, "TSLiteralType");
+ }
+
+ parseTemplateSubstitution() {
+ if (this.state.inType) return this.tsParseType();
+ return super.parseTemplateSubstitution();
+ }
+
+ tsParseThisTypeOrThisTypePredicate() {
+ const thisKeyword = this.tsParseThisTypeNode();
+
+ if (this.isContextual("is") && !this.hasPrecedingLineBreak()) {
+ return this.tsParseThisTypePredicate(thisKeyword);
+ } else {
+ return thisKeyword;
+ }
+ }
+
+ tsParseNonArrayType() {
+ switch (this.state.type) {
+ case 5:
+ case 87:
+ case 83:
+ {
+ const type = this.match(87) ? "TSVoidKeyword" : this.match(83) ? "TSNullKeyword" : keywordTypeFromName(this.state.value);
+
+ if (type !== undefined && this.lookaheadCharCode() !== 46) {
+ const node = this.startNode();
+ this.next();
+ return this.finishNode(node, type);
+ }
+
+ return this.tsParseTypeReference();
+ }
+
+ case 4:
+ case 0:
+ case 1:
+ case 84:
+ case 85:
+ return this.tsParseLiteralTypeNode();
+
+ case 52:
+ if (this.state.value === "-") {
+ const node = this.startNode();
+ const nextToken = this.lookahead();
+
+ if (nextToken.type !== 0 && nextToken.type !== 1) {
+ throw this.unexpected();
+ }
+
+ node.literal = this.parseMaybeUnary();
+ return this.finishNode(node, "TSLiteralType");
+ }
+
+ break;
+
+ case 77:
+ return this.tsParseThisTypeOrThisTypePredicate();
+
+ case 86:
+ return this.tsParseTypeQuery();
+
+ case 82:
+ return this.tsParseImportType();
+
+ case 13:
+ return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this)) ? this.tsParseMappedType() : this.tsParseTypeLiteral();
+
+ case 8:
+ return this.tsParseTupleType();
+
+ case 18:
+ return this.tsParseParenthesizedType();
+
+ case 30:
+ return this.tsParseTemplateLiteralType();
+ }
+
+ throw this.unexpected();
+ }
+
+ tsParseArrayTypeOrHigher() {
+ let type = this.tsParseNonArrayType();
+
+ while (!this.hasPrecedingLineBreak() && this.eat(8)) {
+ if (this.match(11)) {
+ const node = this.startNodeAtNode(type);
+ node.elementType = type;
+ this.expect(11);
+ type = this.finishNode(node, "TSArrayType");
+ } else {
+ const node = this.startNodeAtNode(type);
+ node.objectType = type;
+ node.indexType = this.tsParseType();
+ this.expect(11);
+ type = this.finishNode(node, "TSIndexedAccessType");
+ }
+ }
+
+ return type;
+ }
+
+ tsParseTypeOperator(operator) {
+ const node = this.startNode();
+ this.expectContextual(operator);
+ node.operator = operator;
+ node.typeAnnotation = this.tsParseTypeOperatorOrHigher();
+
+ if (operator === "readonly") {
+ this.tsCheckTypeAnnotationForReadOnly(node);
+ }
+
+ return this.finishNode(node, "TSTypeOperator");
+ }
+
+ tsCheckTypeAnnotationForReadOnly(node) {
+ switch (node.typeAnnotation.type) {
+ case "TSTupleType":
+ case "TSArrayType":
+ return;
+
+ default:
+ this.raise(node.start, TSErrors.UnexpectedReadonly);
+ }
+ }
+
+ tsParseInferType() {
+ const node = this.startNode();
+ this.expectContextual("infer");
+ const typeParameter = this.startNode();
+ typeParameter.name = this.tsParseTypeParameterName();
+ node.typeParameter = this.finishNode(typeParameter, "TSTypeParameter");
+ return this.finishNode(node, "TSInferType");
+ }
+
+ tsParseTypeOperatorOrHigher() {
+ const operator = ["keyof", "unique", "readonly"].find(kw => this.isContextual(kw));
+ return operator ? this.tsParseTypeOperator(operator) : this.isContextual("infer") ? this.tsParseInferType() : this.tsParseArrayTypeOrHigher();
+ }
+
+ tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {
+ const node = this.startNode();
+ const hasLeadingOperator = this.eat(operator);
+ const types = [];
+
+ do {
+ types.push(parseConstituentType());
+ } while (this.eat(operator));
+
+ if (types.length === 1 && !hasLeadingOperator) {
+ return types[0];
+ }
+
+ node.types = types;
+ return this.finishNode(node, kind);
+ }
+
+ tsParseIntersectionTypeOrHigher() {
+ return this.tsParseUnionOrIntersectionType("TSIntersectionType", this.tsParseTypeOperatorOrHigher.bind(this), 48);
+ }
+
+ tsParseUnionTypeOrHigher() {
+ return this.tsParseUnionOrIntersectionType("TSUnionType", this.tsParseIntersectionTypeOrHigher.bind(this), 46);
+ }
+
+ tsIsStartOfFunctionType() {
+ if (this.isRelational("<")) {
+ return true;
+ }
+
+ return this.match(18) && this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this));
+ }
+
+ tsSkipParameterStart() {
+ if (this.match(5) || this.match(77)) {
+ this.next();
+ return true;
+ }
+
+ if (this.match(13)) {
+ let braceStackCounter = 1;
+ this.next();
+
+ while (braceStackCounter > 0) {
+ if (this.match(13)) {
+ ++braceStackCounter;
+ } else if (this.match(16)) {
+ --braceStackCounter;
+ }
+
+ this.next();
+ }
+
+ return true;
+ }
+
+ if (this.match(8)) {
+ let braceStackCounter = 1;
+ this.next();
+
+ while (braceStackCounter > 0) {
+ if (this.match(8)) {
+ ++braceStackCounter;
+ } else if (this.match(11)) {
+ --braceStackCounter;
+ }
+
+ this.next();
+ }
+
+ return true;
+ }
+
+ return false;
+ }
+
+ tsIsUnambiguouslyStartOfFunctionType() {
+ this.next();
+
+ if (this.match(19) || this.match(29)) {
+ return true;
+ }
+
+ if (this.tsSkipParameterStart()) {
+ if (this.match(22) || this.match(20) || this.match(25) || this.match(35)) {
+ return true;
+ }
+
+ if (this.match(19)) {
+ this.next();
+
+ if (this.match(27)) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ tsParseTypeOrTypePredicateAnnotation(returnToken) {
+ return this.tsInType(() => {
+ const t = this.startNode();
+ this.expect(returnToken);
+ const node = this.startNode();
+ const asserts = !!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));
+
+ if (asserts && this.match(77)) {
+ let thisTypePredicate = this.tsParseThisTypeOrThisTypePredicate();
+
+ if (thisTypePredicate.type === "TSThisType") {
+ node.parameterName = thisTypePredicate;
+ node.asserts = true;
+ node.typeAnnotation = null;
+ thisTypePredicate = this.finishNode(node, "TSTypePredicate");
+ } else {
+ this.resetStartLocationFromNode(thisTypePredicate, node);
+ thisTypePredicate.asserts = true;
+ }
+
+ t.typeAnnotation = thisTypePredicate;
+ return this.finishNode(t, "TSTypeAnnotation");
+ }
+
+ const typePredicateVariable = this.tsIsIdentifier() && this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));
+
+ if (!typePredicateVariable) {
+ if (!asserts) {
+ return this.tsParseTypeAnnotation(false, t);
+ }
+
+ node.parameterName = this.parseIdentifier();
+ node.asserts = asserts;
+ node.typeAnnotation = null;
+ t.typeAnnotation = this.finishNode(node, "TSTypePredicate");
+ return this.finishNode(t, "TSTypeAnnotation");
+ }
+
+ const type = this.tsParseTypeAnnotation(false);
+ node.parameterName = typePredicateVariable;
+ node.typeAnnotation = type;
+ node.asserts = asserts;
+ t.typeAnnotation = this.finishNode(node, "TSTypePredicate");
+ return this.finishNode(t, "TSTypeAnnotation");
+ });
+ }
+
+ tsTryParseTypeOrTypePredicateAnnotation() {
+ return this.match(22) ? this.tsParseTypeOrTypePredicateAnnotation(22) : undefined;
+ }
+
+ tsTryParseTypeAnnotation() {
+ return this.match(22) ? this.tsParseTypeAnnotation() : undefined;
+ }
+
+ tsTryParseType() {
+ return this.tsEatThenParseType(22);
+ }
+
+ tsParseTypePredicatePrefix() {
+ const id = this.parseIdentifier();
+
+ if (this.isContextual("is") && !this.hasPrecedingLineBreak()) {
+ this.next();
+ return id;
+ }
+ }
+
+ tsParseTypePredicateAsserts() {
+ if (!this.match(5) || this.state.value !== "asserts") {
+ return false;
+ }
+
+ const containsEsc = this.state.containsEsc;
+ this.next();
+
+ if (!this.match(5) && !this.match(77)) {
+ return false;
+ }
+
+ if (containsEsc) {
+ this.raise(this.state.lastTokStart, ErrorMessages.InvalidEscapedReservedWord, "asserts");
+ }
+
+ return true;
+ }
+
+ tsParseTypeAnnotation(eatColon = true, t = this.startNode()) {
+ this.tsInType(() => {
+ if (eatColon) this.expect(22);
+ t.typeAnnotation = this.tsParseType();
+ });
+ return this.finishNode(t, "TSTypeAnnotation");
+ }
+
+ tsParseType() {
+ assert(this.state.inType);
+ const type = this.tsParseNonConditionalType();
+
+ if (this.hasPrecedingLineBreak() || !this.eat(80)) {
+ return type;
+ }
+
+ const node = this.startNodeAtNode(type);
+ node.checkType = type;
+ node.extendsType = this.tsParseNonConditionalType();
+ this.expect(25);
+ node.trueType = this.tsParseType();
+ this.expect(22);
+ node.falseType = this.tsParseType();
+ return this.finishNode(node, "TSConditionalType");
+ }
+
+ isAbstractConstructorSignature() {
+ return this.isContextual("abstract") && this.lookahead().type === 76;
+ }
+
+ tsParseNonConditionalType() {
+ if (this.tsIsStartOfFunctionType()) {
+ return this.tsParseFunctionOrConstructorType("TSFunctionType");
+ }
+
+ if (this.match(76)) {
+ return this.tsParseFunctionOrConstructorType("TSConstructorType");
+ } else if (this.isAbstractConstructorSignature()) {
+ return this.tsParseFunctionOrConstructorType("TSConstructorType", true);
+ }
+
+ return this.tsParseUnionTypeOrHigher();
+ }
+
+ tsParseTypeAssertion() {
+ const node = this.startNode();
+
+ const _const = this.tsTryNextParseConstantContext();
+
+ node.typeAnnotation = _const || this.tsNextThenParseType();
+ this.expectRelational(">");
+ node.expression = this.parseMaybeUnary();
+ return this.finishNode(node, "TSTypeAssertion");
+ }
+
+ tsParseHeritageClause(descriptor) {
+ const originalStart = this.state.start;
+ const delimitedList = this.tsParseDelimitedList("HeritageClauseElement", this.tsParseExpressionWithTypeArguments.bind(this));
+
+ if (!delimitedList.length) {
+ this.raise(originalStart, TSErrors.EmptyHeritageClauseType, descriptor);
+ }
+
+ return delimitedList;
+ }
+
+ tsParseExpressionWithTypeArguments() {
+ const node = this.startNode();
+ node.expression = this.tsParseEntityName(false);
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.tsParseTypeArguments();
+ }
+
+ return this.finishNode(node, "TSExpressionWithTypeArguments");
+ }
+
+ tsParseInterfaceDeclaration(node) {
+ if (this.match(5)) {
+ node.id = this.parseIdentifier();
+ this.checkLVal(node.id, "typescript interface declaration", BIND_TS_INTERFACE);
+ } else {
+ node.id = null;
+ this.raise(this.state.start, TSErrors.MissingInterfaceName);
+ }
+
+ node.typeParameters = this.tsTryParseTypeParameters();
+
+ if (this.eat(80)) {
+ node.extends = this.tsParseHeritageClause("extends");
+ }
+
+ const body = this.startNode();
+ body.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this));
+ node.body = this.finishNode(body, "TSInterfaceBody");
+ return this.finishNode(node, "TSInterfaceDeclaration");
+ }
+
+ tsParseTypeAliasDeclaration(node) {
+ node.id = this.parseIdentifier();
+ this.checkLVal(node.id, "typescript type alias", BIND_TS_TYPE);
+ node.typeParameters = this.tsTryParseTypeParameters();
+ node.typeAnnotation = this.tsInType(() => {
+ this.expect(35);
+
+ if (this.isContextual("intrinsic") && this.lookahead().type !== 24) {
+ const node = this.startNode();
+ this.next();
+ return this.finishNode(node, "TSIntrinsicKeyword");
+ }
+
+ return this.tsParseType();
+ });
+ this.semicolon();
+ return this.finishNode(node, "TSTypeAliasDeclaration");
+ }
+
+ tsInNoContext(cb) {
+ const oldContext = this.state.context;
+ this.state.context = [oldContext[0]];
+
+ try {
+ return cb();
+ } finally {
+ this.state.context = oldContext;
+ }
+ }
+
+ tsInType(cb) {
+ const oldInType = this.state.inType;
+ this.state.inType = true;
+
+ try {
+ return cb();
+ } finally {
+ this.state.inType = oldInType;
+ }
+ }
+
+ tsEatThenParseType(token) {
+ return !this.match(token) ? undefined : this.tsNextThenParseType();
+ }
+
+ tsExpectThenParseType(token) {
+ return this.tsDoThenParseType(() => this.expect(token));
+ }
+
+ tsNextThenParseType() {
+ return this.tsDoThenParseType(() => this.next());
+ }
+
+ tsDoThenParseType(cb) {
+ return this.tsInType(() => {
+ cb();
+ return this.tsParseType();
+ });
+ }
+
+ tsParseEnumMember() {
+ const node = this.startNode();
+ node.id = this.match(4) ? this.parseExprAtom() : this.parseIdentifier(true);
+
+ if (this.eat(35)) {
+ node.initializer = this.parseMaybeAssignAllowIn();
+ }
+
+ return this.finishNode(node, "TSEnumMember");
+ }
+
+ tsParseEnumDeclaration(node, isConst) {
+ if (isConst) node.const = true;
+ node.id = this.parseIdentifier();
+ this.checkLVal(node.id, "typescript enum declaration", isConst ? BIND_TS_CONST_ENUM : BIND_TS_ENUM);
+ this.expect(13);
+ node.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this));
+ this.expect(16);
+ return this.finishNode(node, "TSEnumDeclaration");
+ }
+
+ tsParseModuleBlock() {
+ const node = this.startNode();
+ this.scope.enter(SCOPE_OTHER);
+ this.expect(13);
+ this.parseBlockOrModuleBlockBody(node.body = [], undefined, true, 16);
+ this.scope.exit();
+ return this.finishNode(node, "TSModuleBlock");
+ }
+
+ tsParseModuleOrNamespaceDeclaration(node, nested = false) {
+ node.id = this.parseIdentifier();
+
+ if (!nested) {
+ this.checkLVal(node.id, "module or namespace declaration", BIND_TS_NAMESPACE);
+ }
+
+ if (this.eat(24)) {
+ const inner = this.startNode();
+ this.tsParseModuleOrNamespaceDeclaration(inner, true);
+ node.body = inner;
+ } else {
+ this.scope.enter(SCOPE_TS_MODULE);
+ this.prodParam.enter(PARAM);
+ node.body = this.tsParseModuleBlock();
+ this.prodParam.exit();
+ this.scope.exit();
+ }
+
+ return this.finishNode(node, "TSModuleDeclaration");
+ }
+
+ tsParseAmbientExternalModuleDeclaration(node) {
+ if (this.isContextual("global")) {
+ node.global = true;
+ node.id = this.parseIdentifier();
+ } else if (this.match(4)) {
+ node.id = this.parseExprAtom();
+ } else {
+ this.unexpected();
+ }
+
+ if (this.match(13)) {
+ this.scope.enter(SCOPE_TS_MODULE);
+ this.prodParam.enter(PARAM);
+ node.body = this.tsParseModuleBlock();
+ this.prodParam.exit();
+ this.scope.exit();
+ } else {
+ this.semicolon();
+ }
+
+ return this.finishNode(node, "TSModuleDeclaration");
+ }
+
+ tsParseImportEqualsDeclaration(node, isExport) {
+ node.isExport = isExport || false;
+ node.id = this.parseIdentifier();
+ this.checkLVal(node.id, "import equals declaration", BIND_LEXICAL);
+ this.expect(35);
+ const moduleReference = this.tsParseModuleReference();
+
+ if (node.importKind === "type" && moduleReference.type !== "TSExternalModuleReference") {
+ this.raise(moduleReference.start, TSErrors.ImportAliasHasImportType);
+ }
+
+ node.moduleReference = moduleReference;
+ this.semicolon();
+ return this.finishNode(node, "TSImportEqualsDeclaration");
+ }
+
+ tsIsExternalModuleReference() {
+ return this.isContextual("require") && this.lookaheadCharCode() === 40;
+ }
+
+ tsParseModuleReference() {
+ return this.tsIsExternalModuleReference() ? this.tsParseExternalModuleReference() : this.tsParseEntityName(false);
+ }
+
+ tsParseExternalModuleReference() {
+ const node = this.startNode();
+ this.expectContextual("require");
+ this.expect(18);
+
+ if (!this.match(4)) {
+ throw this.unexpected();
+ }
+
+ node.expression = this.parseExprAtom();
+ this.expect(19);
+ return this.finishNode(node, "TSExternalModuleReference");
+ }
+
+ tsLookAhead(f) {
+ const state = this.state.clone();
+ const res = f();
+ this.state = state;
+ return res;
+ }
+
+ tsTryParseAndCatch(f) {
+ const result = this.tryParse(abort => f() || abort());
+ if (result.aborted || !result.node) return undefined;
+ if (result.error) this.state = result.failState;
+ return result.node;
+ }
+
+ tsTryParse(f) {
+ const state = this.state.clone();
+ const result = f();
+
+ if (result !== undefined && result !== false) {
+ return result;
+ } else {
+ this.state = state;
+ return undefined;
+ }
+ }
+
+ tsTryParseDeclare(nany) {
+ if (this.isLineTerminator()) {
+ return;
+ }
+
+ let starttype = this.state.type;
+ let kind;
+
+ if (this.isContextual("let")) {
+ starttype = 73;
+ kind = "let";
+ }
+
+ return this.tsInAmbientContext(() => {
+ switch (starttype) {
+ case 67:
+ nany.declare = true;
+ return this.parseFunctionStatement(nany, false, true);
+
+ case 79:
+ nany.declare = true;
+ return this.parseClass(nany, true, false);
+
+ case 74:
+ if (this.match(74) && this.isLookaheadContextual("enum")) {
+ this.expect(74);
+ this.expectContextual("enum");
+ return this.tsParseEnumDeclaration(nany, true);
+ }
+
+ case 73:
+ kind = kind || this.state.value;
+ return this.parseVarStatement(nany, kind);
+
+ case 5:
+ {
+ const value = this.state.value;
+
+ if (value === "global") {
+ return this.tsParseAmbientExternalModuleDeclaration(nany);
+ } else {
+ return this.tsParseDeclaration(nany, value, true);
+ }
+ }
+ }
+ });
+ }
+
+ tsTryParseExportDeclaration() {
+ return this.tsParseDeclaration(this.startNode(), this.state.value, true);
+ }
+
+ tsParseExpressionStatement(node, expr) {
+ switch (expr.name) {
+ case "declare":
+ {
+ const declaration = this.tsTryParseDeclare(node);
+
+ if (declaration) {
+ declaration.declare = true;
+ return declaration;
+ }
+
+ break;
+ }
+
+ case "global":
+ if (this.match(13)) {
+ this.scope.enter(SCOPE_TS_MODULE);
+ this.prodParam.enter(PARAM);
+ const mod = node;
+ mod.global = true;
+ mod.id = expr;
+ mod.body = this.tsParseModuleBlock();
+ this.scope.exit();
+ this.prodParam.exit();
+ return this.finishNode(mod, "TSModuleDeclaration");
+ }
+
+ break;
+
+ default:
+ return this.tsParseDeclaration(node, expr.name, false);
+ }
+ }
+
+ tsParseDeclaration(node, value, next) {
+ switch (value) {
+ case "abstract":
+ if (this.tsCheckLineTerminator(next) && (this.match(79) || this.match(5))) {
+ return this.tsParseAbstractDeclaration(node);
+ }
+
+ break;
+
+ case "enum":
+ if (next || this.match(5)) {
+ if (next) this.next();
+ return this.tsParseEnumDeclaration(node, false);
+ }
+
+ break;
+
+ case "interface":
+ if (this.tsCheckLineTerminator(next) && this.match(5)) {
+ return this.tsParseInterfaceDeclaration(node);
+ }
+
+ break;
+
+ case "module":
+ if (this.tsCheckLineTerminator(next)) {
+ if (this.match(4)) {
+ return this.tsParseAmbientExternalModuleDeclaration(node);
+ } else if (this.match(5)) {
+ return this.tsParseModuleOrNamespaceDeclaration(node);
+ }
+ }
+
+ break;
+
+ case "namespace":
+ if (this.tsCheckLineTerminator(next) && this.match(5)) {
+ return this.tsParseModuleOrNamespaceDeclaration(node);
+ }
+
+ break;
+
+ case "type":
+ if (this.tsCheckLineTerminator(next) && this.match(5)) {
+ return this.tsParseTypeAliasDeclaration(node);
+ }
+
+ break;
+ }
+ }
+
+ tsCheckLineTerminator(next) {
+ if (next) {
+ if (this.hasFollowingLineBreak()) return false;
+ this.next();
+ return true;
+ }
+
+ return !this.isLineTerminator();
+ }
+
+ tsTryParseGenericAsyncArrowFunction(startPos, startLoc) {
+ if (!this.isRelational("<")) {
+ return undefined;
+ }
+
+ const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+ this.state.maybeInArrowParameters = true;
+ const res = this.tsTryParseAndCatch(() => {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.typeParameters = this.tsParseTypeParameters();
+ super.parseFunctionParams(node);
+ node.returnType = this.tsTryParseTypeOrTypePredicateAnnotation();
+ this.expect(27);
+ return node;
+ });
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+
+ if (!res) {
+ return undefined;
+ }
+
+ return this.parseArrowExpression(res, null, true);
+ }
+
+ tsParseTypeArguments() {
+ const node = this.startNode();
+ node.params = this.tsInType(() => this.tsInNoContext(() => {
+ this.expectRelational("<");
+ return this.tsParseDelimitedList("TypeParametersOrArguments", this.tsParseType.bind(this));
+ }));
+
+ if (node.params.length === 0) {
+ this.raise(node.start, TSErrors.EmptyTypeArguments);
+ }
+
+ this.expectRelational(">");
+ return this.finishNode(node, "TSTypeParameterInstantiation");
+ }
+
+ tsIsDeclarationStart() {
+ if (this.match(5)) {
+ switch (this.state.value) {
+ case "abstract":
+ case "declare":
+ case "enum":
+ case "interface":
+ case "module":
+ case "namespace":
+ case "type":
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ isExportDefaultSpecifier() {
+ if (this.tsIsDeclarationStart()) return false;
+ return super.isExportDefaultSpecifier();
+ }
+
+ parseAssignableListItem(allowModifiers, decorators) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ let accessibility;
+ let readonly = false;
+ let override = false;
+
+ if (allowModifiers !== undefined) {
+ const modified = {};
+ this.tsParseModifiers(modified, ["public", "private", "protected", "override", "readonly"]);
+ accessibility = modified.accessibility;
+ override = modified.override;
+ readonly = modified.readonly;
+
+ if (allowModifiers === false && (accessibility || readonly || override)) {
+ this.raise(startPos, TSErrors.UnexpectedParameterModifier);
+ }
+ }
+
+ const left = this.parseMaybeDefault();
+ this.parseAssignableListItemTypes(left);
+ const elt = this.parseMaybeDefault(left.start, left.loc.start, left);
+
+ if (accessibility || readonly || override) {
+ const pp = this.startNodeAt(startPos, startLoc);
+
+ if (decorators.length) {
+ pp.decorators = decorators;
+ }
+
+ if (accessibility) pp.accessibility = accessibility;
+ if (readonly) pp.readonly = readonly;
+ if (override) pp.override = override;
+
+ if (elt.type !== "Identifier" && elt.type !== "AssignmentPattern") {
+ this.raise(pp.start, TSErrors.UnsupportedParameterPropertyKind);
+ }
+
+ pp.parameter = elt;
+ return this.finishNode(pp, "TSParameterProperty");
+ }
+
+ if (decorators.length) {
+ left.decorators = decorators;
+ }
+
+ return elt;
+ }
+
+ parseFunctionBodyAndFinish(node, type, isMethod = false) {
+ if (this.match(22)) {
+ node.returnType = this.tsParseTypeOrTypePredicateAnnotation(22);
+ }
+
+ const bodilessType = type === "FunctionDeclaration" ? "TSDeclareFunction" : type === "ClassMethod" ? "TSDeclareMethod" : undefined;
+
+ if (bodilessType && !this.match(13) && this.isLineTerminator()) {
+ this.finishNode(node, bodilessType);
+ return;
+ }
+
+ if (bodilessType === "TSDeclareFunction" && this.state.isAmbientContext) {
+ this.raise(node.start, TSErrors.DeclareFunctionHasImplementation);
+
+ if (node.declare) {
+ super.parseFunctionBodyAndFinish(node, bodilessType, isMethod);
+ return;
+ }
+ }
+
+ super.parseFunctionBodyAndFinish(node, type, isMethod);
+ }
+
+ registerFunctionStatementId(node) {
+ if (!node.body && node.id) {
+ this.checkLVal(node.id, "function name", BIND_TS_AMBIENT);
+ } else {
+ super.registerFunctionStatementId(...arguments);
+ }
+ }
+
+ tsCheckForInvalidTypeCasts(items) {
+ items.forEach(node => {
+ if ((node == null ? void 0 : node.type) === "TSTypeCastExpression") {
+ this.raise(node.typeAnnotation.start, TSErrors.UnexpectedTypeAnnotation);
+ }
+ });
+ }
+
+ toReferencedList(exprList, isInParens) {
+ this.tsCheckForInvalidTypeCasts(exprList);
+ return exprList;
+ }
+
+ parseArrayLike(...args) {
+ const node = super.parseArrayLike(...args);
+
+ if (node.type === "ArrayExpression") {
+ this.tsCheckForInvalidTypeCasts(node.elements);
+ }
+
+ return node;
+ }
+
+ parseSubscript(base, startPos, startLoc, noCalls, state) {
+ if (!this.hasPrecedingLineBreak() && this.match(40)) {
+ this.state.exprAllowed = false;
+ this.next();
+ const nonNullExpression = this.startNodeAt(startPos, startLoc);
+ nonNullExpression.expression = base;
+ return this.finishNode(nonNullExpression, "TSNonNullExpression");
+ }
+
+ let isOptionalCall = false;
+
+ if (this.match(26) && this.lookaheadCharCode() === 60) {
+ if (noCalls) {
+ state.stop = true;
+ return base;
+ }
+
+ state.optionalChainMember = isOptionalCall = true;
+ this.next();
+ }
+
+ if (this.isRelational("<")) {
+ let missingParenErrorPos;
+ const result = this.tsTryParseAndCatch(() => {
+ if (!noCalls && this.atPossibleAsyncArrow(base)) {
+ const asyncArrowFn = this.tsTryParseGenericAsyncArrowFunction(startPos, startLoc);
+
+ if (asyncArrowFn) {
+ return asyncArrowFn;
+ }
+ }
+
+ const node = this.startNodeAt(startPos, startLoc);
+ node.callee = base;
+ const typeArguments = this.tsParseTypeArguments();
+
+ if (typeArguments) {
+ if (isOptionalCall && !this.match(18)) {
+ missingParenErrorPos = this.state.pos;
+ this.unexpected();
+ }
+
+ if (!noCalls && this.eat(18)) {
+ node.arguments = this.parseCallExpressionArguments(19, false);
+ this.tsCheckForInvalidTypeCasts(node.arguments);
+ node.typeParameters = typeArguments;
+
+ if (state.optionalChainMember) {
+ node.optional = isOptionalCall;
+ }
+
+ return this.finishCallExpression(node, state.optionalChainMember);
+ } else if (this.match(30)) {
+ const result = this.parseTaggedTemplateExpression(base, startPos, startLoc, state);
+ result.typeParameters = typeArguments;
+ return result;
+ }
+ }
+
+ this.unexpected();
+ });
+
+ if (missingParenErrorPos) {
+ this.unexpected(missingParenErrorPos, 18);
+ }
+
+ if (result) return result;
+ }
+
+ return super.parseSubscript(base, startPos, startLoc, noCalls, state);
+ }
+
+ parseNewArguments(node) {
+ if (this.isRelational("<")) {
+ const typeParameters = this.tsTryParseAndCatch(() => {
+ const args = this.tsParseTypeArguments();
+ if (!this.match(18)) this.unexpected();
+ return args;
+ });
+
+ if (typeParameters) {
+ node.typeParameters = typeParameters;
+ }
+ }
+
+ super.parseNewArguments(node);
+ }
+
+ parseExprOp(left, leftStartPos, leftStartLoc, minPrec) {
+ if (tokenOperatorPrecedence(57) > minPrec && !this.hasPrecedingLineBreak() && this.isContextual("as")) {
+ const node = this.startNodeAt(leftStartPos, leftStartLoc);
+ node.expression = left;
+
+ const _const = this.tsTryNextParseConstantContext();
+
+ if (_const) {
+ node.typeAnnotation = _const;
+ } else {
+ node.typeAnnotation = this.tsNextThenParseType();
+ }
+
+ this.finishNode(node, "TSAsExpression");
+ this.reScan_lt_gt();
+ return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec);
+ }
+
+ return super.parseExprOp(left, leftStartPos, leftStartLoc, minPrec);
+ }
+
+ checkReservedWord(word, startLoc, checkKeywords, isBinding) {}
+
+ checkDuplicateExports() {}
+
+ parseImport(node) {
+ node.importKind = "value";
+
+ if (this.match(5) || this.match(54) || this.match(13)) {
+ let ahead = this.lookahead();
+
+ if (this.isContextual("type") && ahead.type !== 20 && !(ahead.type === 5 && ahead.value === "from") && ahead.type !== 35) {
+ node.importKind = "type";
+ this.next();
+ ahead = this.lookahead();
+ }
+
+ if (this.match(5) && ahead.type === 35) {
+ return this.tsParseImportEqualsDeclaration(node);
+ }
+ }
+
+ const importNode = super.parseImport(node);
+
+ if (importNode.importKind === "type" && importNode.specifiers.length > 1 && importNode.specifiers[0].type === "ImportDefaultSpecifier") {
+ this.raise(importNode.start, TSErrors.TypeImportCannotSpecifyDefaultAndNamed);
+ }
+
+ return importNode;
+ }
+
+ parseExport(node) {
+ if (this.match(82)) {
+ this.next();
+
+ if (this.isContextual("type") && this.lookaheadCharCode() !== 61) {
+ node.importKind = "type";
+ this.next();
+ } else {
+ node.importKind = "value";
+ }
+
+ return this.tsParseImportEqualsDeclaration(node, true);
+ } else if (this.eat(35)) {
+ const assign = node;
+ assign.expression = this.parseExpression();
+ this.semicolon();
+ return this.finishNode(assign, "TSExportAssignment");
+ } else if (this.eatContextual("as")) {
+ const decl = node;
+ this.expectContextual("namespace");
+ decl.id = this.parseIdentifier();
+ this.semicolon();
+ return this.finishNode(decl, "TSNamespaceExportDeclaration");
+ } else {
+ if (this.isContextual("type") && this.lookahead().type === 13) {
+ this.next();
+ node.exportKind = "type";
+ } else {
+ node.exportKind = "value";
+ }
+
+ return super.parseExport(node);
+ }
+ }
+
+ isAbstractClass() {
+ return this.isContextual("abstract") && this.lookahead().type === 79;
+ }
+
+ parseExportDefaultExpression() {
+ if (this.isAbstractClass()) {
+ const cls = this.startNode();
+ this.next();
+ cls.abstract = true;
+ this.parseClass(cls, true, true);
+ return cls;
+ }
+
+ if (this.state.value === "interface") {
+ const interfaceNode = this.startNode();
+ this.next();
+ const result = this.tsParseInterfaceDeclaration(interfaceNode);
+ if (result) return result;
+ }
+
+ return super.parseExportDefaultExpression();
+ }
+
+ parseStatementContent(context, topLevel) {
+ if (this.state.type === 74) {
+ const ahead = this.lookahead();
+
+ if (ahead.type === 5 && ahead.value === "enum") {
+ const node = this.startNode();
+ this.expect(74);
+ this.expectContextual("enum");
+ return this.tsParseEnumDeclaration(node, true);
+ }
+ }
+
+ return super.parseStatementContent(context, topLevel);
+ }
+
+ parseAccessModifier() {
+ return this.tsParseModifier(["public", "protected", "private"]);
+ }
+
+ tsHasSomeModifiers(member, modifiers) {
+ return modifiers.some(modifier => {
+ if (tsIsAccessModifier(modifier)) {
+ return member.accessibility === modifier;
+ }
+
+ return !!member[modifier];
+ });
+ }
+
+ tsIsStartOfStaticBlocks() {
+ return this.isContextual("static") && this.lookaheadCharCode() === 123;
+ }
+
+ parseClassMember(classBody, member, state) {
+ const modifiers = ["declare", "private", "public", "protected", "override", "abstract", "readonly", "static"];
+ this.tsParseModifiers(member, modifiers, undefined, undefined, true);
+
+ const callParseClassMemberWithIsStatic = () => {
+ if (this.tsIsStartOfStaticBlocks()) {
+ this.next();
+ this.next();
+
+ if (this.tsHasSomeModifiers(member, modifiers)) {
+ this.raise(this.state.pos, TSErrors.StaticBlockCannotHaveModifier);
+ }
+
+ this.parseClassStaticBlock(classBody, member);
+ } else {
+ this.parseClassMemberWithIsStatic(classBody, member, state, !!member.static);
+ }
+ };
+
+ if (member.declare) {
+ this.tsInAmbientContext(callParseClassMemberWithIsStatic);
+ } else {
+ callParseClassMemberWithIsStatic();
+ }
+ }
+
+ parseClassMemberWithIsStatic(classBody, member, state, isStatic) {
+ const idx = this.tsTryParseIndexSignature(member);
+
+ if (idx) {
+ classBody.body.push(idx);
+
+ if (member.abstract) {
+ this.raise(member.start, TSErrors.IndexSignatureHasAbstract);
+ }
+
+ if (member.accessibility) {
+ this.raise(member.start, TSErrors.IndexSignatureHasAccessibility, member.accessibility);
+ }
+
+ if (member.declare) {
+ this.raise(member.start, TSErrors.IndexSignatureHasDeclare);
+ }
+
+ if (member.override) {
+ this.raise(member.start, TSErrors.IndexSignatureHasOverride);
+ }
+
+ return;
+ }
+
+ if (!this.state.inAbstractClass && member.abstract) {
+ this.raise(member.start, TSErrors.NonAbstractClassHasAbstractMethod);
+ }
+
+ if (member.override) {
+ if (!state.hadSuperClass) {
+ this.raise(member.start, TSErrors.OverrideNotInSubClass);
+ }
+ }
+
+ super.parseClassMemberWithIsStatic(classBody, member, state, isStatic);
+ }
+
+ parsePostMemberNameModifiers(methodOrProp) {
+ const optional = this.eat(25);
+ if (optional) methodOrProp.optional = true;
+
+ if (methodOrProp.readonly && this.match(18)) {
+ this.raise(methodOrProp.start, TSErrors.ClassMethodHasReadonly);
+ }
+
+ if (methodOrProp.declare && this.match(18)) {
+ this.raise(methodOrProp.start, TSErrors.ClassMethodHasDeclare);
+ }
+ }
+
+ parseExpressionStatement(node, expr) {
+ const decl = expr.type === "Identifier" ? this.tsParseExpressionStatement(node, expr) : undefined;
+ return decl || super.parseExpressionStatement(node, expr);
+ }
+
+ shouldParseExportDeclaration() {
+ if (this.tsIsDeclarationStart()) return true;
+ return super.shouldParseExportDeclaration();
+ }
+
+ parseConditional(expr, startPos, startLoc, refExpressionErrors) {
+ if (!this.state.maybeInArrowParameters || !this.match(25)) {
+ return super.parseConditional(expr, startPos, startLoc, refExpressionErrors);
+ }
+
+ const result = this.tryParse(() => super.parseConditional(expr, startPos, startLoc));
+
+ if (!result.node) {
+ if (result.error) {
+ super.setOptionalParametersError(refExpressionErrors, result.error);
+ }
+
+ return expr;
+ }
+
+ if (result.error) this.state = result.failState;
+ return result.node;
+ }
+
+ parseParenItem(node, startPos, startLoc) {
+ node = super.parseParenItem(node, startPos, startLoc);
+
+ if (this.eat(25)) {
+ node.optional = true;
+ this.resetEndLocation(node);
+ }
+
+ if (this.match(22)) {
+ const typeCastNode = this.startNodeAt(startPos, startLoc);
+ typeCastNode.expression = node;
+ typeCastNode.typeAnnotation = this.tsParseTypeAnnotation();
+ return this.finishNode(typeCastNode, "TSTypeCastExpression");
+ }
+
+ return node;
+ }
+
+ parseExportDeclaration(node) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const isDeclare = this.eatContextual("declare");
+
+ if (isDeclare && (this.isContextual("declare") || !this.shouldParseExportDeclaration())) {
+ throw this.raise(this.state.start, TSErrors.ExpectedAmbientAfterExportDeclare);
+ }
+
+ let declaration;
+
+ if (this.match(5)) {
+ declaration = this.tsTryParseExportDeclaration();
+ }
+
+ if (!declaration) {
+ declaration = super.parseExportDeclaration(node);
+ }
+
+ if (declaration && (declaration.type === "TSInterfaceDeclaration" || declaration.type === "TSTypeAliasDeclaration" || isDeclare)) {
+ node.exportKind = "type";
+ }
+
+ if (declaration && isDeclare) {
+ this.resetStartLocation(declaration, startPos, startLoc);
+ declaration.declare = true;
+ }
+
+ return declaration;
+ }
+
+ parseClassId(node, isStatement, optionalId) {
+ if ((!isStatement || optionalId) && this.isContextual("implements")) {
+ return;
+ }
+
+ super.parseClassId(node, isStatement, optionalId, node.declare ? BIND_TS_AMBIENT : BIND_CLASS);
+ const typeParameters = this.tsTryParseTypeParameters();
+ if (typeParameters) node.typeParameters = typeParameters;
+ }
+
+ parseClassPropertyAnnotation(node) {
+ if (!node.optional && this.eat(40)) {
+ node.definite = true;
+ }
+
+ const type = this.tsTryParseTypeAnnotation();
+ if (type) node.typeAnnotation = type;
+ }
+
+ parseClassProperty(node) {
+ this.parseClassPropertyAnnotation(node);
+
+ if (this.state.isAmbientContext && this.match(35)) {
+ this.raise(this.state.start, TSErrors.DeclareClassFieldHasInitializer);
+ }
+
+ if (node.abstract && this.match(35)) {
+ const {
+ key
+ } = node;
+ this.raise(this.state.start, TSErrors.AbstractPropertyHasInitializer, key.type === "Identifier" && !node.computed ? key.name : `[${this.input.slice(key.start, key.end)}]`);
+ }
+
+ return super.parseClassProperty(node);
+ }
+
+ parseClassPrivateProperty(node) {
+ if (node.abstract) {
+ this.raise(node.start, TSErrors.PrivateElementHasAbstract);
+ }
+
+ if (node.accessibility) {
+ this.raise(node.start, TSErrors.PrivateElementHasAccessibility, node.accessibility);
+ }
+
+ this.parseClassPropertyAnnotation(node);
+ return super.parseClassPrivateProperty(node);
+ }
+
+ pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
+ const typeParameters = this.tsTryParseTypeParameters();
+
+ if (typeParameters && isConstructor) {
+ this.raise(typeParameters.start, TSErrors.ConstructorHasTypeParameters);
+ }
+
+ if (method.declare && (method.kind === "get" || method.kind === "set")) {
+ this.raise(method.start, TSErrors.DeclareAccessor, method.kind);
+ }
+
+ if (typeParameters) method.typeParameters = typeParameters;
+ super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper);
+ }
+
+ pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {
+ const typeParameters = this.tsTryParseTypeParameters();
+ if (typeParameters) method.typeParameters = typeParameters;
+ super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);
+ }
+
+ parseClassSuper(node) {
+ super.parseClassSuper(node);
+
+ if (node.superClass && this.isRelational("<")) {
+ node.superTypeParameters = this.tsParseTypeArguments();
+ }
+
+ if (this.eatContextual("implements")) {
+ node.implements = this.tsParseHeritageClause("implements");
+ }
+ }
+
+ parseObjPropValue(prop, ...args) {
+ const typeParameters = this.tsTryParseTypeParameters();
+ if (typeParameters) prop.typeParameters = typeParameters;
+ super.parseObjPropValue(prop, ...args);
+ }
+
+ parseFunctionParams(node, allowModifiers) {
+ const typeParameters = this.tsTryParseTypeParameters();
+ if (typeParameters) node.typeParameters = typeParameters;
+ super.parseFunctionParams(node, allowModifiers);
+ }
+
+ parseVarId(decl, kind) {
+ super.parseVarId(decl, kind);
+
+ if (decl.id.type === "Identifier" && this.eat(40)) {
+ decl.definite = true;
+ }
+
+ const type = this.tsTryParseTypeAnnotation();
+
+ if (type) {
+ decl.id.typeAnnotation = type;
+ this.resetEndLocation(decl.id);
+ }
+ }
+
+ parseAsyncArrowFromCallExpression(node, call) {
+ if (this.match(22)) {
+ node.returnType = this.tsParseTypeAnnotation();
+ }
+
+ return super.parseAsyncArrowFromCallExpression(node, call);
+ }
+
+ parseMaybeAssign(...args) {
+ var _jsx, _jsx2, _typeCast, _jsx3, _typeCast2, _jsx4, _typeCast3;
+
+ let state;
+ let jsx;
+ let typeCast;
+
+ if (this.hasPlugin("jsx") && (this.match(94) || this.isRelational("<"))) {
+ state = this.state.clone();
+ jsx = this.tryParse(() => super.parseMaybeAssign(...args), state);
+ if (!jsx.error) return jsx.node;
+ const {
+ context
+ } = this.state;
+
+ if (context[context.length - 1] === types.j_oTag) {
+ context.length -= 2;
+ } else if (context[context.length - 1] === types.j_expr) {
+ context.length -= 1;
+ }
+ }
+
+ if (!((_jsx = jsx) != null && _jsx.error) && !this.isRelational("<")) {
+ return super.parseMaybeAssign(...args);
+ }
+
+ let typeParameters;
+ state = state || this.state.clone();
+ const arrow = this.tryParse(abort => {
+ var _expr$extra, _typeParameters;
+
+ typeParameters = this.tsParseTypeParameters();
+ const expr = super.parseMaybeAssign(...args);
+
+ if (expr.type !== "ArrowFunctionExpression" || (_expr$extra = expr.extra) != null && _expr$extra.parenthesized) {
+ abort();
+ }
+
+ if (((_typeParameters = typeParameters) == null ? void 0 : _typeParameters.params.length) !== 0) {
+ this.resetStartLocationFromNode(expr, typeParameters);
+ }
+
+ expr.typeParameters = typeParameters;
+ return expr;
+ }, state);
+ if (!arrow.error && !arrow.aborted) return arrow.node;
+
+ if (!jsx) {
+ assert(!this.hasPlugin("jsx"));
+ typeCast = this.tryParse(() => super.parseMaybeAssign(...args), state);
+ if (!typeCast.error) return typeCast.node;
+ }
+
+ if ((_jsx2 = jsx) != null && _jsx2.node) {
+ this.state = jsx.failState;
+ return jsx.node;
+ }
+
+ if (arrow.node) {
+ this.state = arrow.failState;
+ return arrow.node;
+ }
+
+ if ((_typeCast = typeCast) != null && _typeCast.node) {
+ this.state = typeCast.failState;
+ return typeCast.node;
+ }
+
+ if ((_jsx3 = jsx) != null && _jsx3.thrown) throw jsx.error;
+ if (arrow.thrown) throw arrow.error;
+ if ((_typeCast2 = typeCast) != null && _typeCast2.thrown) throw typeCast.error;
+ throw ((_jsx4 = jsx) == null ? void 0 : _jsx4.error) || arrow.error || ((_typeCast3 = typeCast) == null ? void 0 : _typeCast3.error);
+ }
+
+ parseMaybeUnary(refExpressionErrors) {
+ if (!this.hasPlugin("jsx") && this.isRelational("<")) {
+ return this.tsParseTypeAssertion();
+ } else {
+ return super.parseMaybeUnary(refExpressionErrors);
+ }
+ }
+
+ parseArrow(node) {
+ if (this.match(22)) {
+ const result = this.tryParse(abort => {
+ const returnType = this.tsParseTypeOrTypePredicateAnnotation(22);
+ if (this.canInsertSemicolon() || !this.match(27)) abort();
+ return returnType;
+ });
+ if (result.aborted) return;
+
+ if (!result.thrown) {
+ if (result.error) this.state = result.failState;
+ node.returnType = result.node;
+ }
+ }
+
+ return super.parseArrow(node);
+ }
+
+ parseAssignableListItemTypes(param) {
+ if (this.eat(25)) {
+ if (param.type !== "Identifier" && !this.state.isAmbientContext && !this.state.inType) {
+ this.raise(param.start, TSErrors.PatternIsOptional);
+ }
+
+ param.optional = true;
+ }
+
+ const type = this.tsTryParseTypeAnnotation();
+ if (type) param.typeAnnotation = type;
+ this.resetEndLocation(param);
+ return param;
+ }
+
+ isAssignable(node, isBinding) {
+ switch (node.type) {
+ case "TSTypeCastExpression":
+ return this.isAssignable(node.expression, isBinding);
+
+ case "TSParameterProperty":
+ return true;
+
+ default:
+ return super.isAssignable(node, isBinding);
+ }
+ }
+
+ toAssignable(node, isLHS = false) {
+ switch (node.type) {
+ case "TSTypeCastExpression":
+ return super.toAssignable(this.typeCastToParameter(node), isLHS);
+
+ case "TSParameterProperty":
+ return super.toAssignable(node, isLHS);
+
+ case "ParenthesizedExpression":
+ return this.toAssignableParenthesizedExpression(node, isLHS);
+
+ case "TSAsExpression":
+ case "TSNonNullExpression":
+ case "TSTypeAssertion":
+ node.expression = this.toAssignable(node.expression, isLHS);
+ return node;
+
+ default:
+ return super.toAssignable(node, isLHS);
+ }
+ }
+
+ toAssignableParenthesizedExpression(node, isLHS) {
+ switch (node.expression.type) {
+ case "TSAsExpression":
+ case "TSNonNullExpression":
+ case "TSTypeAssertion":
+ case "ParenthesizedExpression":
+ node.expression = this.toAssignable(node.expression, isLHS);
+ return node;
+
+ default:
+ return super.toAssignable(node, isLHS);
+ }
+ }
+
+ checkLVal(expr, contextDescription, ...args) {
+ var _expr$extra2;
+
+ switch (expr.type) {
+ case "TSTypeCastExpression":
+ return;
+
+ case "TSParameterProperty":
+ this.checkLVal(expr.parameter, "parameter property", ...args);
+ return;
+
+ case "TSAsExpression":
+ case "TSTypeAssertion":
+ if (!args[0] && contextDescription !== "parenthesized expression" && !((_expr$extra2 = expr.extra) != null && _expr$extra2.parenthesized)) {
+ this.raise(expr.start, ErrorMessages.InvalidLhs, contextDescription);
+ break;
+ }
+
+ this.checkLVal(expr.expression, "parenthesized expression", ...args);
+ return;
+
+ case "TSNonNullExpression":
+ this.checkLVal(expr.expression, contextDescription, ...args);
+ return;
+
+ default:
+ super.checkLVal(expr, contextDescription, ...args);
+ return;
+ }
+ }
+
+ parseBindingAtom() {
+ switch (this.state.type) {
+ case 77:
+ return this.parseIdentifier(true);
+
+ default:
+ return super.parseBindingAtom();
+ }
+ }
+
+ parseMaybeDecoratorArguments(expr) {
+ if (this.isRelational("<")) {
+ const typeArguments = this.tsParseTypeArguments();
+
+ if (this.match(18)) {
+ const call = super.parseMaybeDecoratorArguments(expr);
+ call.typeParameters = typeArguments;
+ return call;
+ }
+
+ this.unexpected(this.state.start, 18);
+ }
+
+ return super.parseMaybeDecoratorArguments(expr);
+ }
+
+ checkCommaAfterRest(close) {
+ if (this.state.isAmbientContext && this.match(20) && this.lookaheadCharCode() === close) {
+ this.next();
+ } else {
+ super.checkCommaAfterRest(close);
+ }
+ }
+
+ isClassMethod() {
+ return this.isRelational("<") || super.isClassMethod();
+ }
+
+ isClassProperty() {
+ return this.match(40) || this.match(22) || super.isClassProperty();
+ }
+
+ parseMaybeDefault(...args) {
+ const node = super.parseMaybeDefault(...args);
+
+ if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) {
+ this.raise(node.typeAnnotation.start, TSErrors.TypeAnnotationAfterAssign);
+ }
+
+ return node;
+ }
+
+ getTokenFromCode(code) {
+ if (this.state.inType && (code === 62 || code === 60)) {
+ return this.finishOp(50, 1);
+ } else {
+ return super.getTokenFromCode(code);
+ }
+ }
+
+ reScan_lt_gt() {
+ if (this.match(50)) {
+ const code = this.input.charCodeAt(this.state.start);
+
+ if (code === 60 || code === 62) {
+ this.state.pos -= 1;
+ this.readToken_lt_gt(code);
+ }
+ }
+ }
+
+ toAssignableList(exprList) {
+ for (let i = 0; i < exprList.length; i++) {
+ const expr = exprList[i];
+ if (!expr) continue;
+
+ switch (expr.type) {
+ case "TSTypeCastExpression":
+ exprList[i] = this.typeCastToParameter(expr);
+ break;
+
+ case "TSAsExpression":
+ case "TSTypeAssertion":
+ if (!this.state.maybeInArrowParameters) {
+ exprList[i] = this.typeCastToParameter(expr);
+ } else {
+ this.raise(expr.start, TSErrors.UnexpectedTypeCastInParameter);
+ }
+
+ break;
+ }
+ }
+
+ return super.toAssignableList(...arguments);
+ }
+
+ typeCastToParameter(node) {
+ node.expression.typeAnnotation = node.typeAnnotation;
+ this.resetEndLocation(node.expression, node.typeAnnotation.end, node.typeAnnotation.loc.end);
+ return node.expression;
+ }
+
+ shouldParseArrow(params) {
+ if (this.match(22)) {
+ return params.every(expr => this.isAssignable(expr, true));
+ }
+
+ return super.shouldParseArrow(params);
+ }
+
+ shouldParseAsyncArrow() {
+ return this.match(22) || super.shouldParseAsyncArrow();
+ }
+
+ canHaveLeadingDecorator() {
+ return super.canHaveLeadingDecorator() || this.isAbstractClass();
+ }
+
+ jsxParseOpeningElementAfterName(node) {
+ if (this.isRelational("<")) {
+ const typeArguments = this.tsTryParseAndCatch(() => this.tsParseTypeArguments());
+ if (typeArguments) node.typeParameters = typeArguments;
+ }
+
+ return super.jsxParseOpeningElementAfterName(node);
+ }
+
+ getGetterSetterExpectedParamCount(method) {
+ const baseCount = super.getGetterSetterExpectedParamCount(method);
+ const params = this.getObjectOrClassMethodParams(method);
+ const firstParam = params[0];
+ const hasContextParam = firstParam && this.isThisParam(firstParam);
+ return hasContextParam ? baseCount + 1 : baseCount;
+ }
+
+ parseCatchClauseParam() {
+ const param = super.parseCatchClauseParam();
+ const type = this.tsTryParseTypeAnnotation();
+
+ if (type) {
+ param.typeAnnotation = type;
+ this.resetEndLocation(param);
+ }
+
+ return param;
+ }
+
+ tsInAmbientContext(cb) {
+ const oldIsAmbientContext = this.state.isAmbientContext;
+ this.state.isAmbientContext = true;
+
+ try {
+ return cb();
+ } finally {
+ this.state.isAmbientContext = oldIsAmbientContext;
+ }
+ }
+
+ parseClass(node, ...args) {
+ const oldInAbstractClass = this.state.inAbstractClass;
+ this.state.inAbstractClass = !!node.abstract;
+
+ try {
+ return super.parseClass(node, ...args);
+ } finally {
+ this.state.inAbstractClass = oldInAbstractClass;
+ }
+ }
+
+ tsParseAbstractDeclaration(node) {
+ if (this.match(79)) {
+ node.abstract = true;
+ return this.parseClass(node, true, false);
+ } else if (this.isContextual("interface")) {
+ if (!this.hasFollowingLineBreak()) {
+ node.abstract = true;
+ this.raise(node.start, TSErrors.NonClassMethodPropertyHasAbstractModifer);
+ this.next();
+ return this.tsParseInterfaceDeclaration(node);
+ }
+ } else {
+ this.unexpected(null, 79);
+ }
+ }
+
+ parseMethod(...args) {
+ const method = super.parseMethod(...args);
+
+ if (method.abstract) {
+ const hasBody = this.hasPlugin("estree") ? !!method.value.body : !!method.body;
+
+ if (hasBody) {
+ const {
+ key
+ } = method;
+ this.raise(method.start, TSErrors.AbstractMethodHasImplementation, key.type === "Identifier" && !method.computed ? key.name : `[${this.input.slice(key.start, key.end)}]`);
+ }
+ }
+
+ return method;
+ }
+
+ tsParseTypeParameterName() {
+ const typeName = this.parseIdentifier();
+ return typeName.name;
+ }
+
+ shouldParseAsAmbientContext() {
+ return !!this.getPluginOption("typescript", "dts");
+ }
+
+ parse() {
+ if (this.shouldParseAsAmbientContext()) {
+ this.state.isAmbientContext = true;
+ }
+
+ return super.parse();
+ }
+
+ getExpression() {
+ if (this.shouldParseAsAmbientContext()) {
+ this.state.isAmbientContext = true;
+ }
+
+ return super.getExpression();
+ }
+
+});
+
+const PlaceHolderErrors = makeErrorTemplates({
+ ClassNameIsRequired: "A class name is required."
+}, ErrorCodes.SyntaxError);
+var placeholders = (superClass => class extends superClass {
+ parsePlaceholder(expectedNode) {
+ if (this.match(96)) {
+ const node = this.startNode();
+ this.next();
+ this.assertNoSpace("Unexpected space in placeholder.");
+ node.name = super.parseIdentifier(true);
+ this.assertNoSpace("Unexpected space in placeholder.");
+ this.expect(96);
+ return this.finishPlaceholder(node, expectedNode);
+ }
+ }
+
+ finishPlaceholder(node, expectedNode) {
+ const isFinished = !!(node.expectedNode && node.type === "Placeholder");
+ node.expectedNode = expectedNode;
+ return isFinished ? node : this.finishNode(node, "Placeholder");
+ }
+
+ getTokenFromCode(code) {
+ if (code === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) {
+ return this.finishOp(96, 2);
+ }
+
+ return super.getTokenFromCode(...arguments);
+ }
+
+ parseExprAtom() {
+ return this.parsePlaceholder("Expression") || super.parseExprAtom(...arguments);
+ }
+
+ parseIdentifier() {
+ return this.parsePlaceholder("Identifier") || super.parseIdentifier(...arguments);
+ }
+
+ checkReservedWord(word) {
+ if (word !== undefined) super.checkReservedWord(...arguments);
+ }
+
+ parseBindingAtom() {
+ return this.parsePlaceholder("Pattern") || super.parseBindingAtom(...arguments);
+ }
+
+ checkLVal(expr) {
+ if (expr.type !== "Placeholder") super.checkLVal(...arguments);
+ }
+
+ toAssignable(node) {
+ if (node && node.type === "Placeholder" && node.expectedNode === "Expression") {
+ node.expectedNode = "Pattern";
+ return node;
+ }
+
+ return super.toAssignable(...arguments);
+ }
+
+ isLet(context) {
+ if (super.isLet(context)) {
+ return true;
+ }
+
+ if (!this.isContextual("let")) {
+ return false;
+ }
+
+ if (context) return false;
+ const nextToken = this.lookahead();
+
+ if (nextToken.type === 96) {
+ return true;
+ }
+
+ return false;
+ }
+
+ verifyBreakContinue(node) {
+ if (node.label && node.label.type === "Placeholder") return;
+ super.verifyBreakContinue(...arguments);
+ }
+
+ parseExpressionStatement(node, expr) {
+ if (expr.type !== "Placeholder" || expr.extra && expr.extra.parenthesized) {
+ return super.parseExpressionStatement(...arguments);
+ }
+
+ if (this.match(22)) {
+ const stmt = node;
+ stmt.label = this.finishPlaceholder(expr, "Identifier");
+ this.next();
+ stmt.body = this.parseStatement("label");
+ return this.finishNode(stmt, "LabeledStatement");
+ }
+
+ this.semicolon();
+ node.name = expr.name;
+ return this.finishPlaceholder(node, "Statement");
+ }
+
+ parseBlock() {
+ return this.parsePlaceholder("BlockStatement") || super.parseBlock(...arguments);
+ }
+
+ parseFunctionId() {
+ return this.parsePlaceholder("Identifier") || super.parseFunctionId(...arguments);
+ }
+
+ parseClass(node, isStatement, optionalId) {
+ const type = isStatement ? "ClassDeclaration" : "ClassExpression";
+ this.next();
+ this.takeDecorators(node);
+ const oldStrict = this.state.strict;
+ const placeholder = this.parsePlaceholder("Identifier");
+
+ if (placeholder) {
+ if (this.match(80) || this.match(96) || this.match(13)) {
+ node.id = placeholder;
+ } else if (optionalId || !isStatement) {
+ node.id = null;
+ node.body = this.finishPlaceholder(placeholder, "ClassBody");
+ return this.finishNode(node, type);
+ } else {
+ this.unexpected(null, PlaceHolderErrors.ClassNameIsRequired);
+ }
+ } else {
+ this.parseClassId(node, isStatement, optionalId);
+ }
+
+ this.parseClassSuper(node);
+ node.body = this.parsePlaceholder("ClassBody") || this.parseClassBody(!!node.superClass, oldStrict);
+ return this.finishNode(node, type);
+ }
+
+ parseExport(node) {
+ const placeholder = this.parsePlaceholder("Identifier");
+ if (!placeholder) return super.parseExport(...arguments);
+
+ if (!this.isContextual("from") && !this.match(20)) {
+ node.specifiers = [];
+ node.source = null;
+ node.declaration = this.finishPlaceholder(placeholder, "Declaration");
+ return this.finishNode(node, "ExportNamedDeclaration");
+ }
+
+ this.expectPlugin("exportDefaultFrom");
+ const specifier = this.startNode();
+ specifier.exported = placeholder;
+ node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")];
+ return super.parseExport(node);
+ }
+
+ isExportDefaultSpecifier() {
+ if (this.match(64)) {
+ const next = this.nextTokenStart();
+
+ if (this.isUnparsedContextual(next, "from")) {
+ if (this.input.startsWith(tokenLabelName(96), this.nextTokenStartSince(next + 4))) {
+ return true;
+ }
+ }
+ }
+
+ return super.isExportDefaultSpecifier();
+ }
+
+ maybeParseExportDefaultSpecifier(node) {
+ if (node.specifiers && node.specifiers.length > 0) {
+ return true;
+ }
+
+ return super.maybeParseExportDefaultSpecifier(...arguments);
+ }
+
+ checkExport(node) {
+ const {
+ specifiers
+ } = node;
+
+ if (specifiers != null && specifiers.length) {
+ node.specifiers = specifiers.filter(node => node.exported.type === "Placeholder");
+ }
+
+ super.checkExport(node);
+ node.specifiers = specifiers;
+ }
+
+ parseImport(node) {
+ const placeholder = this.parsePlaceholder("Identifier");
+ if (!placeholder) return super.parseImport(...arguments);
+ node.specifiers = [];
+
+ if (!this.isContextual("from") && !this.match(20)) {
+ node.source = this.finishPlaceholder(placeholder, "StringLiteral");
+ this.semicolon();
+ return this.finishNode(node, "ImportDeclaration");
+ }
+
+ const specifier = this.startNodeAtNode(placeholder);
+ specifier.local = placeholder;
+ this.finishNode(specifier, "ImportDefaultSpecifier");
+ node.specifiers.push(specifier);
+
+ if (this.eat(20)) {
+ const hasStarImport = this.maybeParseStarImportSpecifier(node);
+ if (!hasStarImport) this.parseNamedImportSpecifiers(node);
+ }
+
+ this.expectContextual("from");
+ node.source = this.parseImportSource();
+ this.semicolon();
+ return this.finishNode(node, "ImportDeclaration");
+ }
+
+ parseImportSource() {
+ return this.parsePlaceholder("StringLiteral") || super.parseImportSource(...arguments);
+ }
+
+});
+
+var v8intrinsic = (superClass => class extends superClass {
+ parseV8Intrinsic() {
+ if (this.match(53)) {
+ const v8IntrinsicStart = this.state.start;
+ const node = this.startNode();
+ this.eat(53);
+
+ if (this.match(5)) {
+ const name = this.parseIdentifierName(this.state.start);
+ const identifier = this.createIdentifier(node, name);
+ identifier.type = "V8IntrinsicIdentifier";
+
+ if (this.match(18)) {
+ return identifier;
+ }
+ }
+
+ this.unexpected(v8IntrinsicStart);
+ }
+ }
+
+ parseExprAtom() {
+ return this.parseV8Intrinsic() || super.parseExprAtom(...arguments);
+ }
+
+});
+
+function hasPlugin(plugins, name) {
+ return plugins.some(plugin => {
+ if (Array.isArray(plugin)) {
+ return plugin[0] === name;
+ } else {
+ return plugin === name;
+ }
+ });
+}
+function getPluginOption(plugins, name, option) {
+ const plugin = plugins.find(plugin => {
+ if (Array.isArray(plugin)) {
+ return plugin[0] === name;
+ } else {
+ return plugin === name;
+ }
+ });
+
+ if (plugin && Array.isArray(plugin)) {
+ return plugin[1][option];
+ }
+
+ return null;
+}
+const PIPELINE_PROPOSALS = ["minimal", "fsharp", "hack", "smart"];
+const TOPIC_TOKENS = ["%", "#"];
+const RECORD_AND_TUPLE_SYNTAX_TYPES = ["hash", "bar"];
+function validatePlugins(plugins) {
+ if (hasPlugin(plugins, "decorators")) {
+ if (hasPlugin(plugins, "decorators-legacy")) {
+ throw new Error("Cannot use the decorators and decorators-legacy plugin together");
+ }
+
+ const decoratorsBeforeExport = getPluginOption(plugins, "decorators", "decoratorsBeforeExport");
+
+ if (decoratorsBeforeExport == null) {
+ throw new Error("The 'decorators' plugin requires a 'decoratorsBeforeExport' option," + " whose value must be a boolean. If you are migrating from" + " Babylon/Babel 6 or want to use the old decorators proposal, you" + " should use the 'decorators-legacy' plugin instead of 'decorators'.");
+ } else if (typeof decoratorsBeforeExport !== "boolean") {
+ throw new Error("'decoratorsBeforeExport' must be a boolean.");
+ }
+ }
+
+ if (hasPlugin(plugins, "flow") && hasPlugin(plugins, "typescript")) {
+ throw new Error("Cannot combine flow and typescript plugins.");
+ }
+
+ if (hasPlugin(plugins, "placeholders") && hasPlugin(plugins, "v8intrinsic")) {
+ throw new Error("Cannot combine placeholders and v8intrinsic plugins.");
+ }
+
+ if (hasPlugin(plugins, "pipelineOperator")) {
+ const proposal = getPluginOption(plugins, "pipelineOperator", "proposal");
+
+ if (!PIPELINE_PROPOSALS.includes(proposal)) {
+ const proposalList = PIPELINE_PROPOSALS.map(p => `"${p}"`).join(", ");
+ throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${proposalList}.`);
+ }
+
+ const tupleSyntaxIsHash = hasPlugin(plugins, "recordAndTuple") && getPluginOption(plugins, "recordAndTuple", "syntaxType") === "hash";
+
+ if (proposal === "hack") {
+ if (hasPlugin(plugins, "placeholders")) {
+ throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");
+ }
+
+ if (hasPlugin(plugins, "v8intrinsic")) {
+ throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");
+ }
+
+ const topicToken = getPluginOption(plugins, "pipelineOperator", "topicToken");
+
+ if (!TOPIC_TOKENS.includes(topicToken)) {
+ const tokenList = TOPIC_TOKENS.map(t => `"${t}"`).join(", ");
+ throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${tokenList}.`);
+ }
+
+ if (topicToken === "#" && tupleSyntaxIsHash) {
+ throw new Error('Plugin conflict between `["pipelineOperator", { proposal: "hack", topicToken: "#" }]` and `["recordAndtuple", { syntaxType: "hash"}]`.');
+ }
+ } else if (proposal === "smart" && tupleSyntaxIsHash) {
+ throw new Error('Plugin conflict between `["pipelineOperator", { proposal: "smart" }]` and `["recordAndtuple", { syntaxType: "hash"}]`.');
+ }
+ }
+
+ if (hasPlugin(plugins, "moduleAttributes")) {
+ {
+ if (hasPlugin(plugins, "importAssertions")) {
+ throw new Error("Cannot combine importAssertions and moduleAttributes plugins.");
+ }
+
+ const moduleAttributesVerionPluginOption = getPluginOption(plugins, "moduleAttributes", "version");
+
+ if (moduleAttributesVerionPluginOption !== "may-2020") {
+ throw new Error("The 'moduleAttributes' plugin requires a 'version' option," + " representing the last proposal update. Currently, the" + " only supported value is 'may-2020'.");
+ }
+ }
+ }
+
+ if (hasPlugin(plugins, "recordAndTuple") && !RECORD_AND_TUPLE_SYNTAX_TYPES.includes(getPluginOption(plugins, "recordAndTuple", "syntaxType"))) {
+ throw new Error("'recordAndTuple' requires 'syntaxType' option whose value should be one of: " + RECORD_AND_TUPLE_SYNTAX_TYPES.map(p => `'${p}'`).join(", "));
+ }
+
+ if (hasPlugin(plugins, "asyncDoExpressions") && !hasPlugin(plugins, "doExpressions")) {
+ const error = new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");
+ error.missingPlugins = "doExpressions";
+ throw error;
+ }
+}
+const mixinPlugins = {
+ estree,
+ jsx,
+ flow,
+ typescript,
+ v8intrinsic,
+ placeholders
+};
+const mixinPluginNames = Object.keys(mixinPlugins);
+
+const defaultOptions = {
+ sourceType: "script",
+ sourceFilename: undefined,
+ startLine: 1,
+ allowAwaitOutsideFunction: false,
+ allowReturnOutsideFunction: false,
+ allowImportExportEverywhere: false,
+ allowSuperOutsideMethod: false,
+ allowUndeclaredExports: false,
+ plugins: [],
+ strictMode: null,
+ ranges: false,
+ tokens: false,
+ createParenthesizedExpressions: false,
+ errorRecovery: false,
+ attachComment: true
+};
+function getOptions(opts) {
+ const options = {};
+
+ for (const key of Object.keys(defaultOptions)) {
+ options[key] = opts && opts[key] != null ? opts[key] : defaultOptions[key];
+ }
+
+ return options;
+}
+
+const unwrapParenthesizedExpression = node => {
+ return node.type === "ParenthesizedExpression" ? unwrapParenthesizedExpression(node.expression) : node;
+};
+
+class LValParser extends NodeUtils {
+ toAssignable(node, isLHS = false) {
+ var _node$extra, _node$extra3;
+
+ let parenthesized = undefined;
+
+ if (node.type === "ParenthesizedExpression" || (_node$extra = node.extra) != null && _node$extra.parenthesized) {
+ parenthesized = unwrapParenthesizedExpression(node);
+
+ if (isLHS) {
+ if (parenthesized.type === "Identifier") {
+ this.expressionScope.recordParenthesizedIdentifierError(node.start, ErrorMessages.InvalidParenthesizedAssignment);
+ } else if (parenthesized.type !== "MemberExpression") {
+ this.raise(node.start, ErrorMessages.InvalidParenthesizedAssignment);
+ }
+ } else {
+ this.raise(node.start, ErrorMessages.InvalidParenthesizedAssignment);
+ }
+ }
+
+ switch (node.type) {
+ case "Identifier":
+ case "ObjectPattern":
+ case "ArrayPattern":
+ case "AssignmentPattern":
+ case "RestElement":
+ break;
+
+ case "ObjectExpression":
+ node.type = "ObjectPattern";
+
+ for (let i = 0, length = node.properties.length, last = length - 1; i < length; i++) {
+ var _node$extra2;
+
+ const prop = node.properties[i];
+ const isLast = i === last;
+ this.toAssignableObjectExpressionProp(prop, isLast, isLHS);
+
+ if (isLast && prop.type === "RestElement" && (_node$extra2 = node.extra) != null && _node$extra2.trailingComma) {
+ this.raiseRestNotLast(node.extra.trailingComma);
+ }
+ }
+
+ break;
+
+ case "ObjectProperty":
+ this.toAssignable(node.value, isLHS);
+ break;
+
+ case "SpreadElement":
+ {
+ this.checkToRestConversion(node);
+ node.type = "RestElement";
+ const arg = node.argument;
+ this.toAssignable(arg, isLHS);
+ break;
+ }
+
+ case "ArrayExpression":
+ node.type = "ArrayPattern";
+ this.toAssignableList(node.elements, (_node$extra3 = node.extra) == null ? void 0 : _node$extra3.trailingComma, isLHS);
+ break;
+
+ case "AssignmentExpression":
+ if (node.operator !== "=") {
+ this.raise(node.left.end, ErrorMessages.MissingEqInAssignment);
+ }
+
+ node.type = "AssignmentPattern";
+ delete node.operator;
+ this.toAssignable(node.left, isLHS);
+ break;
+
+ case "ParenthesizedExpression":
+ this.toAssignable(parenthesized, isLHS);
+ break;
+ }
+
+ return node;
+ }
+
+ toAssignableObjectExpressionProp(prop, isLast, isLHS) {
+ if (prop.type === "ObjectMethod") {
+ const error = prop.kind === "get" || prop.kind === "set" ? ErrorMessages.PatternHasAccessor : ErrorMessages.PatternHasMethod;
+ this.raise(prop.key.start, error);
+ } else if (prop.type === "SpreadElement" && !isLast) {
+ this.raiseRestNotLast(prop.start);
+ } else {
+ this.toAssignable(prop, isLHS);
+ }
+ }
+
+ toAssignableList(exprList, trailingCommaPos, isLHS) {
+ let end = exprList.length;
+
+ if (end) {
+ const last = exprList[end - 1];
+
+ if ((last == null ? void 0 : last.type) === "RestElement") {
+ --end;
+ } else if ((last == null ? void 0 : last.type) === "SpreadElement") {
+ last.type = "RestElement";
+ let arg = last.argument;
+ this.toAssignable(arg, isLHS);
+ arg = unwrapParenthesizedExpression(arg);
+
+ if (arg.type !== "Identifier" && arg.type !== "MemberExpression" && arg.type !== "ArrayPattern" && arg.type !== "ObjectPattern") {
+ this.unexpected(arg.start);
+ }
+
+ if (trailingCommaPos) {
+ this.raiseTrailingCommaAfterRest(trailingCommaPos);
+ }
+
+ --end;
+ }
+ }
+
+ for (let i = 0; i < end; i++) {
+ const elt = exprList[i];
+
+ if (elt) {
+ this.toAssignable(elt, isLHS);
+
+ if (elt.type === "RestElement") {
+ this.raiseRestNotLast(elt.start);
+ }
+ }
+ }
+
+ return exprList;
+ }
+
+ isAssignable(node, isBinding) {
+ switch (node.type) {
+ case "Identifier":
+ case "ObjectPattern":
+ case "ArrayPattern":
+ case "AssignmentPattern":
+ case "RestElement":
+ return true;
+
+ case "ObjectExpression":
+ {
+ const last = node.properties.length - 1;
+ return node.properties.every((prop, i) => {
+ return prop.type !== "ObjectMethod" && (i === last || prop.type !== "SpreadElement") && this.isAssignable(prop);
+ });
+ }
+
+ case "ObjectProperty":
+ return this.isAssignable(node.value);
+
+ case "SpreadElement":
+ return this.isAssignable(node.argument);
+
+ case "ArrayExpression":
+ return node.elements.every(element => element === null || this.isAssignable(element));
+
+ case "AssignmentExpression":
+ return node.operator === "=";
+
+ case "ParenthesizedExpression":
+ return this.isAssignable(node.expression);
+
+ case "MemberExpression":
+ case "OptionalMemberExpression":
+ return !isBinding;
+
+ default:
+ return false;
+ }
+ }
+
+ toReferencedList(exprList, isParenthesizedExpr) {
+ return exprList;
+ }
+
+ toReferencedListDeep(exprList, isParenthesizedExpr) {
+ this.toReferencedList(exprList, isParenthesizedExpr);
+
+ for (const expr of exprList) {
+ if ((expr == null ? void 0 : expr.type) === "ArrayExpression") {
+ this.toReferencedListDeep(expr.elements);
+ }
+ }
+ }
+
+ parseSpread(refExpressionErrors, refNeedsArrowPos) {
+ const node = this.startNode();
+ this.next();
+ node.argument = this.parseMaybeAssignAllowIn(refExpressionErrors, undefined, refNeedsArrowPos);
+ return this.finishNode(node, "SpreadElement");
+ }
+
+ parseRestBinding() {
+ const node = this.startNode();
+ this.next();
+ node.argument = this.parseBindingAtom();
+ return this.finishNode(node, "RestElement");
+ }
+
+ parseBindingAtom() {
+ switch (this.state.type) {
+ case 8:
+ {
+ const node = this.startNode();
+ this.next();
+ node.elements = this.parseBindingList(11, 93, true);
+ return this.finishNode(node, "ArrayPattern");
+ }
+
+ case 13:
+ return this.parseObjectLike(16, true);
+ }
+
+ return this.parseIdentifier();
+ }
+
+ parseBindingList(close, closeCharCode, allowEmpty, allowModifiers) {
+ const elts = [];
+ let first = true;
+
+ while (!this.eat(close)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(20);
+ }
+
+ if (allowEmpty && this.match(20)) {
+ elts.push(null);
+ } else if (this.eat(close)) {
+ break;
+ } else if (this.match(29)) {
+ elts.push(this.parseAssignableListItemTypes(this.parseRestBinding()));
+ this.checkCommaAfterRest(closeCharCode);
+ this.expect(close);
+ break;
+ } else {
+ const decorators = [];
+
+ if (this.match(32) && this.hasPlugin("decorators")) {
+ this.raise(this.state.start, ErrorMessages.UnsupportedParameterDecorator);
+ }
+
+ while (this.match(32)) {
+ decorators.push(this.parseDecorator());
+ }
+
+ elts.push(this.parseAssignableListItem(allowModifiers, decorators));
+ }
+ }
+
+ return elts;
+ }
+
+ parseAssignableListItem(allowModifiers, decorators) {
+ const left = this.parseMaybeDefault();
+ this.parseAssignableListItemTypes(left);
+ const elt = this.parseMaybeDefault(left.start, left.loc.start, left);
+
+ if (decorators.length) {
+ left.decorators = decorators;
+ }
+
+ return elt;
+ }
+
+ parseAssignableListItemTypes(param) {
+ return param;
+ }
+
+ parseMaybeDefault(startPos, startLoc, left) {
+ var _startLoc, _startPos, _left;
+
+ startLoc = (_startLoc = startLoc) != null ? _startLoc : this.state.startLoc;
+ startPos = (_startPos = startPos) != null ? _startPos : this.state.start;
+ left = (_left = left) != null ? _left : this.parseBindingAtom();
+ if (!this.eat(35)) return left;
+ const node = this.startNodeAt(startPos, startLoc);
+ node.left = left;
+ node.right = this.parseMaybeAssignAllowIn();
+ return this.finishNode(node, "AssignmentPattern");
+ }
+
+ checkLVal(expr, contextDescription, bindingType = BIND_NONE, checkClashes, disallowLetBinding, strictModeChanged = false) {
+ switch (expr.type) {
+ case "Identifier":
+ {
+ const {
+ name
+ } = expr;
+
+ if (this.state.strict && (strictModeChanged ? isStrictBindReservedWord(name, this.inModule) : isStrictBindOnlyReservedWord(name))) {
+ this.raise(expr.start, bindingType === BIND_NONE ? ErrorMessages.StrictEvalArguments : ErrorMessages.StrictEvalArgumentsBinding, name);
+ }
+
+ if (checkClashes) {
+ if (checkClashes.has(name)) {
+ this.raise(expr.start, ErrorMessages.ParamDupe);
+ } else {
+ checkClashes.add(name);
+ }
+ }
+
+ if (disallowLetBinding && name === "let") {
+ this.raise(expr.start, ErrorMessages.LetInLexicalBinding);
+ }
+
+ if (!(bindingType & BIND_NONE)) {
+ this.scope.declareName(name, bindingType, expr.start);
+ }
+
+ break;
+ }
+
+ case "MemberExpression":
+ if (bindingType !== BIND_NONE) {
+ this.raise(expr.start, ErrorMessages.InvalidPropertyBindingPattern);
+ }
+
+ break;
+
+ case "ObjectPattern":
+ for (let prop of expr.properties) {
+ if (this.isObjectProperty(prop)) prop = prop.value;else if (this.isObjectMethod(prop)) continue;
+ this.checkLVal(prop, "object destructuring pattern", bindingType, checkClashes, disallowLetBinding);
+ }
+
+ break;
+
+ case "ArrayPattern":
+ for (const elem of expr.elements) {
+ if (elem) {
+ this.checkLVal(elem, "array destructuring pattern", bindingType, checkClashes, disallowLetBinding);
+ }
+ }
+
+ break;
+
+ case "AssignmentPattern":
+ this.checkLVal(expr.left, "assignment pattern", bindingType, checkClashes);
+ break;
+
+ case "RestElement":
+ this.checkLVal(expr.argument, "rest element", bindingType, checkClashes);
+ break;
+
+ case "ParenthesizedExpression":
+ this.checkLVal(expr.expression, "parenthesized expression", bindingType, checkClashes);
+ break;
+
+ default:
+ {
+ this.raise(expr.start, bindingType === BIND_NONE ? ErrorMessages.InvalidLhs : ErrorMessages.InvalidLhsBinding, contextDescription);
+ }
+ }
+ }
+
+ checkToRestConversion(node) {
+ if (node.argument.type !== "Identifier" && node.argument.type !== "MemberExpression") {
+ this.raise(node.argument.start, ErrorMessages.InvalidRestAssignmentPattern);
+ }
+ }
+
+ checkCommaAfterRest(close) {
+ if (this.match(20)) {
+ if (this.lookaheadCharCode() === close) {
+ this.raiseTrailingCommaAfterRest(this.state.start);
+ } else {
+ this.raiseRestNotLast(this.state.start);
+ }
+ }
+ }
+
+ raiseRestNotLast(pos) {
+ throw this.raise(pos, ErrorMessages.ElementAfterRest);
+ }
+
+ raiseTrailingCommaAfterRest(pos) {
+ this.raise(pos, ErrorMessages.RestTrailingComma);
+ }
+
+}
+
+const invalidHackPipeBodies = new Map([["ArrowFunctionExpression", "arrow function"], ["AssignmentExpression", "assignment"], ["ConditionalExpression", "conditional"], ["YieldExpression", "yield"]]);
+class ExpressionParser extends LValParser {
+ checkProto(prop, isRecord, protoRef, refExpressionErrors) {
+ if (prop.type === "SpreadElement" || this.isObjectMethod(prop) || prop.computed || prop.shorthand) {
+ return;
+ }
+
+ const key = prop.key;
+ const name = key.type === "Identifier" ? key.name : key.value;
+
+ if (name === "__proto__") {
+ if (isRecord) {
+ this.raise(key.start, ErrorMessages.RecordNoProto);
+ return;
+ }
+
+ if (protoRef.used) {
+ if (refExpressionErrors) {
+ if (refExpressionErrors.doubleProto === -1) {
+ refExpressionErrors.doubleProto = key.start;
+ }
+ } else {
+ this.raise(key.start, ErrorMessages.DuplicateProto);
+ }
+ }
+
+ protoRef.used = true;
+ }
+ }
+
+ shouldExitDescending(expr, potentialArrowAt) {
+ return expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt;
+ }
+
+ getExpression() {
+ this.enterInitialScopes();
+ this.nextToken();
+ const expr = this.parseExpression();
+
+ if (!this.match(7)) {
+ this.unexpected();
+ }
+
+ this.finalizeRemainingComments();
+ expr.comments = this.state.comments;
+ expr.errors = this.state.errors;
+
+ if (this.options.tokens) {
+ expr.tokens = this.tokens;
+ }
+
+ return expr;
+ }
+
+ parseExpression(disallowIn, refExpressionErrors) {
+ if (disallowIn) {
+ return this.disallowInAnd(() => this.parseExpressionBase(refExpressionErrors));
+ }
+
+ return this.allowInAnd(() => this.parseExpressionBase(refExpressionErrors));
+ }
+
+ parseExpressionBase(refExpressionErrors) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const expr = this.parseMaybeAssign(refExpressionErrors);
+
+ if (this.match(20)) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.expressions = [expr];
+
+ while (this.eat(20)) {
+ node.expressions.push(this.parseMaybeAssign(refExpressionErrors));
+ }
+
+ this.toReferencedList(node.expressions);
+ return this.finishNode(node, "SequenceExpression");
+ }
+
+ return expr;
+ }
+
+ parseMaybeAssignDisallowIn(refExpressionErrors, afterLeftParse) {
+ return this.disallowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse));
+ }
+
+ parseMaybeAssignAllowIn(refExpressionErrors, afterLeftParse) {
+ return this.allowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse));
+ }
+
+ setOptionalParametersError(refExpressionErrors, resultError) {
+ var _resultError$pos;
+
+ refExpressionErrors.optionalParameters = (_resultError$pos = resultError == null ? void 0 : resultError.pos) != null ? _resultError$pos : this.state.start;
+ }
+
+ parseMaybeAssign(refExpressionErrors, afterLeftParse) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+
+ if (this.isContextual("yield")) {
+ if (this.prodParam.hasYield) {
+ let left = this.parseYield();
+
+ if (afterLeftParse) {
+ left = afterLeftParse.call(this, left, startPos, startLoc);
+ }
+
+ return left;
+ }
+ }
+
+ let ownExpressionErrors;
+
+ if (refExpressionErrors) {
+ ownExpressionErrors = false;
+ } else {
+ refExpressionErrors = new ExpressionErrors();
+ ownExpressionErrors = true;
+ }
+
+ if (this.match(18) || this.match(5)) {
+ this.state.potentialArrowAt = this.state.start;
+ }
+
+ let left = this.parseMaybeConditional(refExpressionErrors);
+
+ if (afterLeftParse) {
+ left = afterLeftParse.call(this, left, startPos, startLoc);
+ }
+
+ if (tokenIsAssignment(this.state.type)) {
+ const node = this.startNodeAt(startPos, startLoc);
+ const operator = this.state.value;
+ node.operator = operator;
+
+ if (this.match(35)) {
+ node.left = this.toAssignable(left, true);
+ refExpressionErrors.doubleProto = -1;
+ } else {
+ node.left = left;
+ }
+
+ if (refExpressionErrors.shorthandAssign >= node.left.start) {
+ refExpressionErrors.shorthandAssign = -1;
+ }
+
+ this.checkLVal(left, "assignment expression");
+ this.next();
+ node.right = this.parseMaybeAssign();
+ return this.finishNode(node, "AssignmentExpression");
+ } else if (ownExpressionErrors) {
+ this.checkExpressionErrors(refExpressionErrors, true);
+ }
+
+ return left;
+ }
+
+ parseMaybeConditional(refExpressionErrors) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const potentialArrowAt = this.state.potentialArrowAt;
+ const expr = this.parseExprOps(refExpressionErrors);
+
+ if (this.shouldExitDescending(expr, potentialArrowAt)) {
+ return expr;
+ }
+
+ return this.parseConditional(expr, startPos, startLoc, refExpressionErrors);
+ }
+
+ parseConditional(expr, startPos, startLoc, refExpressionErrors) {
+ if (this.eat(25)) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.test = expr;
+ node.consequent = this.parseMaybeAssignAllowIn();
+ this.expect(22);
+ node.alternate = this.parseMaybeAssign();
+ return this.finishNode(node, "ConditionalExpression");
+ }
+
+ return expr;
+ }
+
+ parseMaybeUnaryOrPrivate(refExpressionErrors) {
+ return this.match(6) ? this.parsePrivateName() : this.parseMaybeUnary(refExpressionErrors);
+ }
+
+ parseExprOps(refExpressionErrors) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const potentialArrowAt = this.state.potentialArrowAt;
+ const expr = this.parseMaybeUnaryOrPrivate(refExpressionErrors);
+
+ if (this.shouldExitDescending(expr, potentialArrowAt)) {
+ return expr;
+ }
+
+ return this.parseExprOp(expr, startPos, startLoc, -1);
+ }
+
+ parseExprOp(left, leftStartPos, leftStartLoc, minPrec) {
+ if (this.isPrivateName(left)) {
+ const value = this.getPrivateNameSV(left);
+ const {
+ start
+ } = left;
+
+ if (minPrec >= tokenOperatorPrecedence(57) || !this.prodParam.hasIn || !this.match(57)) {
+ this.raise(start, ErrorMessages.PrivateInExpectedIn, value);
+ }
+
+ this.classScope.usePrivateName(value, start);
+ }
+
+ const op = this.state.type;
+
+ if (tokenIsOperator(op) && (this.prodParam.hasIn || !this.match(57))) {
+ let prec = tokenOperatorPrecedence(op);
+
+ if (prec > minPrec) {
+ if (op === 42) {
+ this.expectPlugin("pipelineOperator");
+
+ if (this.state.inFSharpPipelineDirectBody) {
+ return left;
+ }
+
+ this.checkPipelineAtInfixOperator(left, leftStartPos);
+ }
+
+ const node = this.startNodeAt(leftStartPos, leftStartLoc);
+ node.left = left;
+ node.operator = this.state.value;
+ const logical = op === 44 || op === 45;
+ const coalesce = op === 43;
+
+ if (coalesce) {
+ prec = tokenOperatorPrecedence(45);
+ }
+
+ this.next();
+
+ if (op === 42 && this.getPluginOption("pipelineOperator", "proposal") === "minimal") {
+ if (this.match(5) && this.state.value === "await" && this.prodParam.hasAwait) {
+ throw this.raise(this.state.start, ErrorMessages.UnexpectedAwaitAfterPipelineBody);
+ }
+ }
+
+ node.right = this.parseExprOpRightExpr(op, prec);
+ this.finishNode(node, logical || coalesce ? "LogicalExpression" : "BinaryExpression");
+ const nextOp = this.state.type;
+
+ if (coalesce && (nextOp === 44 || nextOp === 45) || logical && nextOp === 43) {
+ throw this.raise(this.state.start, ErrorMessages.MixingCoalesceWithLogical);
+ }
+
+ return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec);
+ }
+ }
+
+ return left;
+ }
+
+ parseExprOpRightExpr(op, prec) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+
+ switch (op) {
+ case 42:
+ switch (this.getPluginOption("pipelineOperator", "proposal")) {
+ case "hack":
+ return this.withTopicBindingContext(() => {
+ return this.parseHackPipeBody();
+ });
+
+ case "smart":
+ return this.withTopicBindingContext(() => {
+ if (this.prodParam.hasYield && this.isContextual("yield")) {
+ throw this.raise(this.state.start, ErrorMessages.PipeBodyIsTighter, this.state.value);
+ }
+
+ return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(op, prec), startPos, startLoc);
+ });
+
+ case "fsharp":
+ return this.withSoloAwaitPermittingContext(() => {
+ return this.parseFSharpPipelineBody(prec);
+ });
+ }
+
+ default:
+ return this.parseExprOpBaseRightExpr(op, prec);
+ }
+ }
+
+ parseExprOpBaseRightExpr(op, prec) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ return this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startPos, startLoc, tokenIsRightAssociative(op) ? prec - 1 : prec);
+ }
+
+ parseHackPipeBody() {
+ var _body$extra;
+
+ const {
+ start
+ } = this.state;
+ const body = this.parseMaybeAssign();
+
+ if (invalidHackPipeBodies.has(body.type) && !((_body$extra = body.extra) != null && _body$extra.parenthesized)) {
+ this.raise(start, ErrorMessages.PipeUnparenthesizedBody, invalidHackPipeBodies.get(body.type));
+ }
+
+ if (!this.topicReferenceWasUsedInCurrentContext()) {
+ this.raise(start, ErrorMessages.PipeTopicUnused);
+ }
+
+ return body;
+ }
+
+ checkExponentialAfterUnary(node) {
+ if (this.match(56)) {
+ this.raise(node.argument.start, ErrorMessages.UnexpectedTokenUnaryExponentiation);
+ }
+ }
+
+ parseMaybeUnary(refExpressionErrors, sawUnary) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const isAwait = this.isContextual("await");
+
+ if (isAwait && this.isAwaitAllowed()) {
+ this.next();
+ const expr = this.parseAwait(startPos, startLoc);
+ if (!sawUnary) this.checkExponentialAfterUnary(expr);
+ return expr;
+ }
+
+ const update = this.match(39);
+ const node = this.startNode();
+
+ if (tokenIsPrefix(this.state.type)) {
+ node.operator = this.state.value;
+ node.prefix = true;
+
+ if (this.match(71)) {
+ this.expectPlugin("throwExpressions");
+ }
+
+ const isDelete = this.match(88);
+ this.next();
+ node.argument = this.parseMaybeUnary(null, true);
+ this.checkExpressionErrors(refExpressionErrors, true);
+
+ if (this.state.strict && isDelete) {
+ const arg = node.argument;
+
+ if (arg.type === "Identifier") {
+ this.raise(node.start, ErrorMessages.StrictDelete);
+ } else if (this.hasPropertyAsPrivateName(arg)) {
+ this.raise(node.start, ErrorMessages.DeletePrivateField);
+ }
+ }
+
+ if (!update) {
+ if (!sawUnary) this.checkExponentialAfterUnary(node);
+ return this.finishNode(node, "UnaryExpression");
+ }
+ }
+
+ const expr = this.parseUpdate(node, update, refExpressionErrors);
+
+ if (isAwait) {
+ const {
+ type
+ } = this.state;
+ const startsExpr = this.hasPlugin("v8intrinsic") ? tokenCanStartExpression(type) : tokenCanStartExpression(type) && !this.match(53);
+
+ if (startsExpr && !this.isAmbiguousAwait()) {
+ this.raiseOverwrite(startPos, ErrorMessages.AwaitNotInAsyncContext);
+ return this.parseAwait(startPos, startLoc);
+ }
+ }
+
+ return expr;
+ }
+
+ parseUpdate(node, update, refExpressionErrors) {
+ if (update) {
+ this.checkLVal(node.argument, "prefix operation");
+ return this.finishNode(node, "UpdateExpression");
+ }
+
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ let expr = this.parseExprSubscripts(refExpressionErrors);
+ if (this.checkExpressionErrors(refExpressionErrors, false)) return expr;
+
+ while (tokenIsPostfix(this.state.type) && !this.canInsertSemicolon()) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.operator = this.state.value;
+ node.prefix = false;
+ node.argument = expr;
+ this.checkLVal(expr, "postfix operation");
+ this.next();
+ expr = this.finishNode(node, "UpdateExpression");
+ }
+
+ return expr;
+ }
+
+ parseExprSubscripts(refExpressionErrors) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const potentialArrowAt = this.state.potentialArrowAt;
+ const expr = this.parseExprAtom(refExpressionErrors);
+
+ if (this.shouldExitDescending(expr, potentialArrowAt)) {
+ return expr;
+ }
+
+ return this.parseSubscripts(expr, startPos, startLoc);
+ }
+
+ parseSubscripts(base, startPos, startLoc, noCalls) {
+ const state = {
+ optionalChainMember: false,
+ maybeAsyncArrow: this.atPossibleAsyncArrow(base),
+ stop: false
+ };
+
+ do {
+ base = this.parseSubscript(base, startPos, startLoc, noCalls, state);
+ state.maybeAsyncArrow = false;
+ } while (!state.stop);
+
+ return base;
+ }
+
+ parseSubscript(base, startPos, startLoc, noCalls, state) {
+ if (!noCalls && this.eat(23)) {
+ return this.parseBind(base, startPos, startLoc, noCalls, state);
+ } else if (this.match(30)) {
+ return this.parseTaggedTemplateExpression(base, startPos, startLoc, state);
+ }
+
+ let optional = false;
+
+ if (this.match(26)) {
+ if (noCalls && this.lookaheadCharCode() === 40) {
+ state.stop = true;
+ return base;
+ }
+
+ state.optionalChainMember = optional = true;
+ this.next();
+ }
+
+ if (!noCalls && this.match(18)) {
+ return this.parseCoverCallAndAsyncArrowHead(base, startPos, startLoc, state, optional);
+ } else {
+ const computed = this.eat(8);
+
+ if (computed || optional || this.eat(24)) {
+ return this.parseMember(base, startPos, startLoc, state, computed, optional);
+ } else {
+ state.stop = true;
+ return base;
+ }
+ }
+ }
+
+ parseMember(base, startPos, startLoc, state, computed, optional) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.object = base;
+ node.computed = computed;
+ const privateName = !computed && this.match(6) && this.state.value;
+ const property = computed ? this.parseExpression() : privateName ? this.parsePrivateName() : this.parseIdentifier(true);
+
+ if (privateName !== false) {
+ if (node.object.type === "Super") {
+ this.raise(startPos, ErrorMessages.SuperPrivateField);
+ }
+
+ this.classScope.usePrivateName(privateName, property.start);
+ }
+
+ node.property = property;
+
+ if (computed) {
+ this.expect(11);
+ }
+
+ if (state.optionalChainMember) {
+ node.optional = optional;
+ return this.finishNode(node, "OptionalMemberExpression");
+ } else {
+ return this.finishNode(node, "MemberExpression");
+ }
+ }
+
+ parseBind(base, startPos, startLoc, noCalls, state) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.object = base;
+ node.callee = this.parseNoCallExpr();
+ state.stop = true;
+ return this.parseSubscripts(this.finishNode(node, "BindExpression"), startPos, startLoc, noCalls);
+ }
+
+ parseCoverCallAndAsyncArrowHead(base, startPos, startLoc, state, optional) {
+ const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+ let refExpressionErrors = null;
+ this.state.maybeInArrowParameters = true;
+ this.next();
+ let node = this.startNodeAt(startPos, startLoc);
+ node.callee = base;
+
+ if (state.maybeAsyncArrow) {
+ this.expressionScope.enter(newAsyncArrowScope());
+ refExpressionErrors = new ExpressionErrors();
+ }
+
+ if (state.optionalChainMember) {
+ node.optional = optional;
+ }
+
+ if (optional) {
+ node.arguments = this.parseCallExpressionArguments(19);
+ } else {
+ node.arguments = this.parseCallExpressionArguments(19, base.type === "Import", base.type !== "Super", node, refExpressionErrors);
+ }
+
+ this.finishCallExpression(node, state.optionalChainMember);
+
+ if (state.maybeAsyncArrow && this.shouldParseAsyncArrow() && !optional) {
+ state.stop = true;
+ this.expressionScope.validateAsPattern();
+ this.expressionScope.exit();
+ node = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startPos, startLoc), node);
+ } else {
+ if (state.maybeAsyncArrow) {
+ this.checkExpressionErrors(refExpressionErrors, true);
+ this.expressionScope.exit();
+ }
+
+ this.toReferencedArguments(node);
+ }
+
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+ return node;
+ }
+
+ toReferencedArguments(node, isParenthesizedExpr) {
+ this.toReferencedListDeep(node.arguments, isParenthesizedExpr);
+ }
+
+ parseTaggedTemplateExpression(base, startPos, startLoc, state) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.tag = base;
+ node.quasi = this.parseTemplate(true);
+
+ if (state.optionalChainMember) {
+ this.raise(startPos, ErrorMessages.OptionalChainingNoTemplate);
+ }
+
+ return this.finishNode(node, "TaggedTemplateExpression");
+ }
+
+ atPossibleAsyncArrow(base) {
+ return base.type === "Identifier" && base.name === "async" && this.state.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && base.start === this.state.potentialArrowAt;
+ }
+
+ finishCallExpression(node, optional) {
+ if (node.callee.type === "Import") {
+ if (node.arguments.length === 2) {
+ {
+ if (!this.hasPlugin("moduleAttributes")) {
+ this.expectPlugin("importAssertions");
+ }
+ }
+ }
+
+ if (node.arguments.length === 0 || node.arguments.length > 2) {
+ this.raise(node.start, ErrorMessages.ImportCallArity, this.hasPlugin("importAssertions") || this.hasPlugin("moduleAttributes") ? "one or two arguments" : "one argument");
+ } else {
+ for (const arg of node.arguments) {
+ if (arg.type === "SpreadElement") {
+ this.raise(arg.start, ErrorMessages.ImportCallSpreadArgument);
+ }
+ }
+ }
+ }
+
+ return this.finishNode(node, optional ? "OptionalCallExpression" : "CallExpression");
+ }
+
+ parseCallExpressionArguments(close, dynamicImport, allowPlaceholder, nodeForExtra, refExpressionErrors) {
+ const elts = [];
+ let first = true;
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ this.state.inFSharpPipelineDirectBody = false;
+
+ while (!this.eat(close)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(20);
+
+ if (this.match(close)) {
+ if (dynamicImport && !this.hasPlugin("importAssertions") && !this.hasPlugin("moduleAttributes")) {
+ this.raise(this.state.lastTokStart, ErrorMessages.ImportCallArgumentTrailingComma);
+ }
+
+ if (nodeForExtra) {
+ this.addExtra(nodeForExtra, "trailingComma", this.state.lastTokStart);
+ }
+
+ this.next();
+ break;
+ }
+ }
+
+ elts.push(this.parseExprListItem(false, refExpressionErrors, allowPlaceholder));
+ }
+
+ this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
+ return elts;
+ }
+
+ shouldParseAsyncArrow() {
+ return this.match(27) && !this.canInsertSemicolon();
+ }
+
+ parseAsyncArrowFromCallExpression(node, call) {
+ var _call$extra;
+
+ this.resetPreviousNodeTrailingComments(call);
+ this.expect(27);
+ this.parseArrowExpression(node, call.arguments, true, (_call$extra = call.extra) == null ? void 0 : _call$extra.trailingComma);
+ setInnerComments(node, call.innerComments);
+ setInnerComments(node, call.callee.trailingComments);
+ return node;
+ }
+
+ parseNoCallExpr() {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ return this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true);
+ }
+
+ parseExprAtom(refExpressionErrors) {
+ let node;
+
+ switch (this.state.type) {
+ case 78:
+ return this.parseSuper();
+
+ case 82:
+ node = this.startNode();
+ this.next();
+
+ if (this.match(24)) {
+ return this.parseImportMetaProperty(node);
+ }
+
+ if (!this.match(18)) {
+ this.raise(this.state.lastTokStart, ErrorMessages.UnsupportedImport);
+ }
+
+ return this.finishNode(node, "Import");
+
+ case 77:
+ node = this.startNode();
+ this.next();
+ return this.finishNode(node, "ThisExpression");
+
+ case 5:
+ {
+ if (this.isContextual("module") && this.lookaheadCharCode() === 123 && !this.hasFollowingLineBreak()) {
+ return this.parseModuleExpression();
+ }
+
+ const canBeArrow = this.state.potentialArrowAt === this.state.start;
+ const containsEsc = this.state.containsEsc;
+ const id = this.parseIdentifier();
+
+ if (!containsEsc && id.name === "async" && !this.canInsertSemicolon()) {
+ if (this.match(67)) {
+ this.resetPreviousNodeTrailingComments(id);
+ this.next();
+ return this.parseFunction(this.startNodeAtNode(id), undefined, true);
+ } else if (this.match(5)) {
+ if (this.lookaheadCharCode() === 61) {
+ return this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(id));
+ } else {
+ return id;
+ }
+ } else if (this.match(89)) {
+ this.resetPreviousNodeTrailingComments(id);
+ return this.parseDo(this.startNodeAtNode(id), true);
+ }
+ }
+
+ if (canBeArrow && this.match(27) && !this.canInsertSemicolon()) {
+ this.next();
+ return this.parseArrowExpression(this.startNodeAtNode(id), [id], false);
+ }
+
+ return id;
+ }
+
+ case 89:
+ {
+ return this.parseDo(this.startNode(), false);
+ }
+
+ case 55:
+ case 37:
+ {
+ this.readRegexp();
+ return this.parseRegExpLiteral(this.state.value);
+ }
+
+ case 0:
+ return this.parseNumericLiteral(this.state.value);
+
+ case 1:
+ return this.parseBigIntLiteral(this.state.value);
+
+ case 2:
+ return this.parseDecimalLiteral(this.state.value);
+
+ case 4:
+ return this.parseStringLiteral(this.state.value);
+
+ case 83:
+ return this.parseNullLiteral();
+
+ case 84:
+ return this.parseBooleanLiteral(true);
+
+ case 85:
+ return this.parseBooleanLiteral(false);
+
+ case 18:
+ {
+ const canBeArrow = this.state.potentialArrowAt === this.state.start;
+ return this.parseParenAndDistinguishExpression(canBeArrow);
+ }
+
+ case 10:
+ case 9:
+ {
+ return this.parseArrayLike(this.state.type === 10 ? 12 : 11, false, true, refExpressionErrors);
+ }
+
+ case 8:
+ {
+ return this.parseArrayLike(11, true, false, refExpressionErrors);
+ }
+
+ case 14:
+ case 15:
+ {
+ return this.parseObjectLike(this.state.type === 14 ? 17 : 16, false, true, refExpressionErrors);
+ }
+
+ case 13:
+ {
+ return this.parseObjectLike(16, false, false, refExpressionErrors);
+ }
+
+ case 67:
+ return this.parseFunctionOrFunctionSent();
+
+ case 32:
+ this.parseDecorators();
+
+ case 79:
+ node = this.startNode();
+ this.takeDecorators(node);
+ return this.parseClass(node, false);
+
+ case 76:
+ return this.parseNewOrNewTarget();
+
+ case 30:
+ return this.parseTemplate(false);
+
+ case 23:
+ {
+ node = this.startNode();
+ this.next();
+ node.object = null;
+ const callee = node.callee = this.parseNoCallExpr();
+
+ if (callee.type === "MemberExpression") {
+ return this.finishNode(node, "BindExpression");
+ } else {
+ throw this.raise(callee.start, ErrorMessages.UnsupportedBind);
+ }
+ }
+
+ case 6:
+ {
+ this.raise(this.state.start, ErrorMessages.PrivateInExpectedIn, this.state.value);
+ return this.parsePrivateName();
+ }
+
+ case 38:
+ if (this.getPluginOption("pipelineOperator", "proposal") === "hack" && this.getPluginOption("pipelineOperator", "topicToken") === "%") {
+ this.state.value = "%";
+ this.state.type = 53;
+ this.state.pos--;
+ this.state.end--;
+ this.state.endLoc.column--;
+ } else {
+ throw this.unexpected();
+ }
+
+ case 53:
+ case 33:
+ {
+ const pipeProposal = this.getPluginOption("pipelineOperator", "proposal");
+
+ if (pipeProposal) {
+ node = this.startNode();
+ const start = this.state.start;
+ const tokenType = this.state.type;
+ this.next();
+ return this.finishTopicReference(node, start, pipeProposal, tokenType);
+ }
+ }
+
+ case 50:
+ {
+ if (this.state.value === "<") {
+ const lookaheadCh = this.input.codePointAt(this.nextTokenStart());
+
+ if (isIdentifierStart(lookaheadCh) || lookaheadCh === 62) {
+ this.expectOnePlugin(["jsx", "flow", "typescript"]);
+ }
+ }
+ }
+
+ default:
+ throw this.unexpected();
+ }
+ }
+
+ finishTopicReference(node, start, pipeProposal, tokenType) {
+ if (this.testTopicReferenceConfiguration(pipeProposal, start, tokenType)) {
+ let nodeType;
+
+ if (pipeProposal === "smart") {
+ nodeType = "PipelinePrimaryTopicReference";
+ } else {
+ nodeType = "TopicReference";
+ }
+
+ if (!this.topicReferenceIsAllowedInCurrentContext()) {
+ if (pipeProposal === "smart") {
+ this.raise(start, ErrorMessages.PrimaryTopicNotAllowed);
+ } else {
+ this.raise(start, ErrorMessages.PipeTopicUnbound);
+ }
+ }
+
+ this.registerTopicReference();
+ return this.finishNode(node, nodeType);
+ } else {
+ throw this.raise(start, ErrorMessages.PipeTopicUnconfiguredToken, tokenLabelName(tokenType));
+ }
+ }
+
+ testTopicReferenceConfiguration(pipeProposal, start, tokenType) {
+ switch (pipeProposal) {
+ case "hack":
+ {
+ const pluginTopicToken = this.getPluginOption("pipelineOperator", "topicToken");
+ return tokenLabelName(tokenType) === pluginTopicToken;
+ }
+
+ case "smart":
+ return tokenType === 33;
+
+ default:
+ throw this.raise(start, ErrorMessages.PipeTopicRequiresHackPipes);
+ }
+ }
+
+ parseAsyncArrowUnaryFunction(node) {
+ this.prodParam.enter(functionFlags(true, this.prodParam.hasYield));
+ const params = [this.parseIdentifier()];
+ this.prodParam.exit();
+
+ if (this.hasPrecedingLineBreak()) {
+ this.raise(this.state.pos, ErrorMessages.LineTerminatorBeforeArrow);
+ }
+
+ this.expect(27);
+ this.parseArrowExpression(node, params, true);
+ return node;
+ }
+
+ parseDo(node, isAsync) {
+ this.expectPlugin("doExpressions");
+
+ if (isAsync) {
+ this.expectPlugin("asyncDoExpressions");
+ }
+
+ node.async = isAsync;
+ this.next();
+ const oldLabels = this.state.labels;
+ this.state.labels = [];
+
+ if (isAsync) {
+ this.prodParam.enter(PARAM_AWAIT);
+ node.body = this.parseBlock();
+ this.prodParam.exit();
+ } else {
+ node.body = this.parseBlock();
+ }
+
+ this.state.labels = oldLabels;
+ return this.finishNode(node, "DoExpression");
+ }
+
+ parseSuper() {
+ const node = this.startNode();
+ this.next();
+
+ if (this.match(18) && !this.scope.allowDirectSuper && !this.options.allowSuperOutsideMethod) {
+ this.raise(node.start, ErrorMessages.SuperNotAllowed);
+ } else if (!this.scope.allowSuper && !this.options.allowSuperOutsideMethod) {
+ this.raise(node.start, ErrorMessages.UnexpectedSuper);
+ }
+
+ if (!this.match(18) && !this.match(8) && !this.match(24)) {
+ this.raise(node.start, ErrorMessages.UnsupportedSuper);
+ }
+
+ return this.finishNode(node, "Super");
+ }
+
+ parseMaybePrivateName(isPrivateNameAllowed) {
+ const isPrivate = this.match(6);
+
+ if (isPrivate) {
+ if (!isPrivateNameAllowed) {
+ this.raise(this.state.start + 1, ErrorMessages.UnexpectedPrivateField);
+ }
+
+ return this.parsePrivateName();
+ } else {
+ return this.parseIdentifier(true);
+ }
+ }
+
+ parsePrivateName() {
+ const node = this.startNode();
+ const id = this.startNodeAt(this.state.start + 1, new Position(this.state.curLine, this.state.start + 1 - this.state.lineStart));
+ const name = this.state.value;
+ this.next();
+ node.id = this.createIdentifier(id, name);
+ return this.finishNode(node, "PrivateName");
+ }
+
+ parseFunctionOrFunctionSent() {
+ const node = this.startNode();
+ this.next();
+
+ if (this.prodParam.hasYield && this.match(24)) {
+ const meta = this.createIdentifier(this.startNodeAtNode(node), "function");
+ this.next();
+ return this.parseMetaProperty(node, meta, "sent");
+ }
+
+ return this.parseFunction(node);
+ }
+
+ parseMetaProperty(node, meta, propertyName) {
+ node.meta = meta;
+
+ if (meta.name === "function" && propertyName === "sent") {
+ if (this.isContextual(propertyName)) {
+ this.expectPlugin("functionSent");
+ } else if (!this.hasPlugin("functionSent")) {
+ this.unexpected();
+ }
+ }
+
+ const containsEsc = this.state.containsEsc;
+ node.property = this.parseIdentifier(true);
+
+ if (node.property.name !== propertyName || containsEsc) {
+ this.raise(node.property.start, ErrorMessages.UnsupportedMetaProperty, meta.name, propertyName);
+ }
+
+ return this.finishNode(node, "MetaProperty");
+ }
+
+ parseImportMetaProperty(node) {
+ const id = this.createIdentifier(this.startNodeAtNode(node), "import");
+ this.next();
+
+ if (this.isContextual("meta")) {
+ if (!this.inModule) {
+ this.raise(id.start, SourceTypeModuleErrorMessages.ImportMetaOutsideModule);
+ }
+
+ this.sawUnambiguousESM = true;
+ }
+
+ return this.parseMetaProperty(node, id, "meta");
+ }
+
+ parseLiteralAtNode(value, type, node) {
+ this.addExtra(node, "rawValue", value);
+ this.addExtra(node, "raw", this.input.slice(node.start, this.state.end));
+ node.value = value;
+ this.next();
+ return this.finishNode(node, type);
+ }
+
+ parseLiteral(value, type) {
+ const node = this.startNode();
+ return this.parseLiteralAtNode(value, type, node);
+ }
+
+ parseStringLiteral(value) {
+ return this.parseLiteral(value, "StringLiteral");
+ }
+
+ parseNumericLiteral(value) {
+ return this.parseLiteral(value, "NumericLiteral");
+ }
+
+ parseBigIntLiteral(value) {
+ return this.parseLiteral(value, "BigIntLiteral");
+ }
+
+ parseDecimalLiteral(value) {
+ return this.parseLiteral(value, "DecimalLiteral");
+ }
+
+ parseRegExpLiteral(value) {
+ const node = this.parseLiteral(value.value, "RegExpLiteral");
+ node.pattern = value.pattern;
+ node.flags = value.flags;
+ return node;
+ }
+
+ parseBooleanLiteral(value) {
+ const node = this.startNode();
+ node.value = value;
+ this.next();
+ return this.finishNode(node, "BooleanLiteral");
+ }
+
+ parseNullLiteral() {
+ const node = this.startNode();
+ this.next();
+ return this.finishNode(node, "NullLiteral");
+ }
+
+ parseParenAndDistinguishExpression(canBeArrow) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ let val;
+ this.next();
+ this.expressionScope.enter(newArrowHeadScope());
+ const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ this.state.maybeInArrowParameters = true;
+ this.state.inFSharpPipelineDirectBody = false;
+ const innerStartPos = this.state.start;
+ const innerStartLoc = this.state.startLoc;
+ const exprList = [];
+ const refExpressionErrors = new ExpressionErrors();
+ let first = true;
+ let spreadStart;
+ let optionalCommaStart;
+
+ while (!this.match(19)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(20, refExpressionErrors.optionalParameters === -1 ? null : refExpressionErrors.optionalParameters);
+
+ if (this.match(19)) {
+ optionalCommaStart = this.state.start;
+ break;
+ }
+ }
+
+ if (this.match(29)) {
+ const spreadNodeStartPos = this.state.start;
+ const spreadNodeStartLoc = this.state.startLoc;
+ spreadStart = this.state.start;
+ exprList.push(this.parseParenItem(this.parseRestBinding(), spreadNodeStartPos, spreadNodeStartLoc));
+ this.checkCommaAfterRest(41);
+ break;
+ } else {
+ exprList.push(this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem));
+ }
+ }
+
+ const innerEndPos = this.state.lastTokEnd;
+ const innerEndLoc = this.state.lastTokEndLoc;
+ this.expect(19);
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+ this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
+ let arrowNode = this.startNodeAt(startPos, startLoc);
+
+ if (canBeArrow && this.shouldParseArrow(exprList) && (arrowNode = this.parseArrow(arrowNode))) {
+ this.expressionScope.validateAsPattern();
+ this.expressionScope.exit();
+ this.parseArrowExpression(arrowNode, exprList, false);
+ return arrowNode;
+ }
+
+ this.expressionScope.exit();
+
+ if (!exprList.length) {
+ this.unexpected(this.state.lastTokStart);
+ }
+
+ if (optionalCommaStart) this.unexpected(optionalCommaStart);
+ if (spreadStart) this.unexpected(spreadStart);
+ this.checkExpressionErrors(refExpressionErrors, true);
+ this.toReferencedListDeep(exprList, true);
+
+ if (exprList.length > 1) {
+ val = this.startNodeAt(innerStartPos, innerStartLoc);
+ val.expressions = exprList;
+ this.finishNode(val, "SequenceExpression");
+ this.resetEndLocation(val, innerEndPos, innerEndLoc);
+ } else {
+ val = exprList[0];
+ }
+
+ if (!this.options.createParenthesizedExpressions) {
+ this.addExtra(val, "parenthesized", true);
+ this.addExtra(val, "parenStart", startPos);
+ return val;
+ }
+
+ const parenExpression = this.startNodeAt(startPos, startLoc);
+ parenExpression.expression = val;
+ this.finishNode(parenExpression, "ParenthesizedExpression");
+ return parenExpression;
+ }
+
+ shouldParseArrow(params) {
+ return !this.canInsertSemicolon();
+ }
+
+ parseArrow(node) {
+ if (this.eat(27)) {
+ return node;
+ }
+ }
+
+ parseParenItem(node, startPos, startLoc) {
+ return node;
+ }
+
+ parseNewOrNewTarget() {
+ const node = this.startNode();
+ this.next();
+
+ if (this.match(24)) {
+ const meta = this.createIdentifier(this.startNodeAtNode(node), "new");
+ this.next();
+ const metaProp = this.parseMetaProperty(node, meta, "target");
+
+ if (!this.scope.inNonArrowFunction && !this.scope.inClass) {
+ this.raise(metaProp.start, ErrorMessages.UnexpectedNewTarget);
+ }
+
+ return metaProp;
+ }
+
+ return this.parseNew(node);
+ }
+
+ parseNew(node) {
+ node.callee = this.parseNoCallExpr();
+
+ if (node.callee.type === "Import") {
+ this.raise(node.callee.start, ErrorMessages.ImportCallNotNewExpression);
+ } else if (this.isOptionalChain(node.callee)) {
+ this.raise(this.state.lastTokEnd, ErrorMessages.OptionalChainingNoNew);
+ } else if (this.eat(26)) {
+ this.raise(this.state.start, ErrorMessages.OptionalChainingNoNew);
+ }
+
+ this.parseNewArguments(node);
+ return this.finishNode(node, "NewExpression");
+ }
+
+ parseNewArguments(node) {
+ if (this.eat(18)) {
+ const args = this.parseExprList(19);
+ this.toReferencedList(args);
+ node.arguments = args;
+ } else {
+ node.arguments = [];
+ }
+ }
+
+ parseTemplateElement(isTagged) {
+ const elem = this.startNode();
+
+ if (this.state.value === null) {
+ if (!isTagged) {
+ this.raise(this.state.start + 1, ErrorMessages.InvalidEscapeSequenceTemplate);
+ }
+ }
+
+ elem.value = {
+ raw: this.input.slice(this.state.start, this.state.end).replace(/\r\n?/g, "\n"),
+ cooked: this.state.value
+ };
+ this.next();
+ elem.tail = this.match(30);
+ return this.finishNode(elem, "TemplateElement");
+ }
+
+ parseTemplate(isTagged) {
+ const node = this.startNode();
+ this.next();
+ node.expressions = [];
+ let curElt = this.parseTemplateElement(isTagged);
+ node.quasis = [curElt];
+
+ while (!curElt.tail) {
+ this.expect(31);
+ node.expressions.push(this.parseTemplateSubstitution());
+ this.expect(16);
+ node.quasis.push(curElt = this.parseTemplateElement(isTagged));
+ }
+
+ this.next();
+ return this.finishNode(node, "TemplateLiteral");
+ }
+
+ parseTemplateSubstitution() {
+ return this.parseExpression();
+ }
+
+ parseObjectLike(close, isPattern, isRecord, refExpressionErrors) {
+ if (isRecord) {
+ this.expectPlugin("recordAndTuple");
+ }
+
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ this.state.inFSharpPipelineDirectBody = false;
+ const propHash = Object.create(null);
+ let first = true;
+ const node = this.startNode();
+ node.properties = [];
+ this.next();
+
+ while (!this.match(close)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(20);
+
+ if (this.match(close)) {
+ this.addExtra(node, "trailingComma", this.state.lastTokStart);
+ break;
+ }
+ }
+
+ const prop = this.parsePropertyDefinition(isPattern, refExpressionErrors);
+
+ if (!isPattern) {
+ this.checkProto(prop, isRecord, propHash, refExpressionErrors);
+ }
+
+ if (isRecord && !this.isObjectProperty(prop) && prop.type !== "SpreadElement") {
+ this.raise(prop.start, ErrorMessages.InvalidRecordProperty);
+ }
+
+ if (prop.shorthand) {
+ this.addExtra(prop, "shorthand", true);
+ }
+
+ node.properties.push(prop);
+ }
+
+ this.next();
+ this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
+ let type = "ObjectExpression";
+
+ if (isPattern) {
+ type = "ObjectPattern";
+ } else if (isRecord) {
+ type = "RecordExpression";
+ }
+
+ return this.finishNode(node, type);
+ }
+
+ maybeAsyncOrAccessorProp(prop) {
+ return !prop.computed && prop.key.type === "Identifier" && (this.isLiteralPropertyName() || this.match(8) || this.match(54));
+ }
+
+ parsePropertyDefinition(isPattern, refExpressionErrors) {
+ let decorators = [];
+
+ if (this.match(32)) {
+ if (this.hasPlugin("decorators")) {
+ this.raise(this.state.start, ErrorMessages.UnsupportedPropertyDecorator);
+ }
+
+ while (this.match(32)) {
+ decorators.push(this.parseDecorator());
+ }
+ }
+
+ const prop = this.startNode();
+ let isGenerator = false;
+ let isAsync = false;
+ let isAccessor = false;
+ let startPos;
+ let startLoc;
+
+ if (this.match(29)) {
+ if (decorators.length) this.unexpected();
+
+ if (isPattern) {
+ this.next();
+ prop.argument = this.parseIdentifier();
+ this.checkCommaAfterRest(125);
+ return this.finishNode(prop, "RestElement");
+ }
+
+ return this.parseSpread();
+ }
+
+ if (decorators.length) {
+ prop.decorators = decorators;
+ decorators = [];
+ }
+
+ prop.method = false;
+
+ if (isPattern || refExpressionErrors) {
+ startPos = this.state.start;
+ startLoc = this.state.startLoc;
+ }
+
+ if (!isPattern) {
+ isGenerator = this.eat(54);
+ }
+
+ const containsEsc = this.state.containsEsc;
+ const key = this.parsePropertyName(prop, false);
+
+ if (!isPattern && !isGenerator && !containsEsc && this.maybeAsyncOrAccessorProp(prop)) {
+ const keyName = key.name;
+
+ if (keyName === "async" && !this.hasPrecedingLineBreak()) {
+ isAsync = true;
+ this.resetPreviousNodeTrailingComments(key);
+ isGenerator = this.eat(54);
+ this.parsePropertyName(prop, false);
+ }
+
+ if (keyName === "get" || keyName === "set") {
+ isAccessor = true;
+ this.resetPreviousNodeTrailingComments(key);
+ prop.kind = keyName;
+
+ if (this.match(54)) {
+ isGenerator = true;
+ this.raise(this.state.pos, ErrorMessages.AccessorIsGenerator, keyName);
+ this.next();
+ }
+
+ this.parsePropertyName(prop, false);
+ }
+ }
+
+ this.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors);
+ return prop;
+ }
+
+ getGetterSetterExpectedParamCount(method) {
+ return method.kind === "get" ? 0 : 1;
+ }
+
+ getObjectOrClassMethodParams(method) {
+ return method.params;
+ }
+
+ checkGetterSetterParams(method) {
+ var _params;
+
+ const paramCount = this.getGetterSetterExpectedParamCount(method);
+ const params = this.getObjectOrClassMethodParams(method);
+ const start = method.start;
+
+ if (params.length !== paramCount) {
+ if (method.kind === "get") {
+ this.raise(start, ErrorMessages.BadGetterArity);
+ } else {
+ this.raise(start, ErrorMessages.BadSetterArity);
+ }
+ }
+
+ if (method.kind === "set" && ((_params = params[params.length - 1]) == null ? void 0 : _params.type) === "RestElement") {
+ this.raise(start, ErrorMessages.BadSetterRestParameter);
+ }
+ }
+
+ parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) {
+ if (isAccessor) {
+ this.parseMethod(prop, isGenerator, false, false, false, "ObjectMethod");
+ this.checkGetterSetterParams(prop);
+ return prop;
+ }
+
+ if (isAsync || isGenerator || this.match(18)) {
+ if (isPattern) this.unexpected();
+ prop.kind = "method";
+ prop.method = true;
+ return this.parseMethod(prop, isGenerator, isAsync, false, false, "ObjectMethod");
+ }
+ }
+
+ parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors) {
+ prop.shorthand = false;
+
+ if (this.eat(22)) {
+ prop.value = isPattern ? this.parseMaybeDefault(this.state.start, this.state.startLoc) : this.parseMaybeAssignAllowIn(refExpressionErrors);
+ return this.finishNode(prop, "ObjectProperty");
+ }
+
+ if (!prop.computed && prop.key.type === "Identifier") {
+ this.checkReservedWord(prop.key.name, prop.key.start, true, false);
+
+ if (isPattern) {
+ prop.value = this.parseMaybeDefault(startPos, startLoc, cloneIdentifier(prop.key));
+ } else if (this.match(35) && refExpressionErrors) {
+ if (refExpressionErrors.shorthandAssign === -1) {
+ refExpressionErrors.shorthandAssign = this.state.start;
+ }
+
+ prop.value = this.parseMaybeDefault(startPos, startLoc, cloneIdentifier(prop.key));
+ } else {
+ prop.value = cloneIdentifier(prop.key);
+ }
+
+ prop.shorthand = true;
+ return this.finishNode(prop, "ObjectProperty");
+ }
+ }
+
+ parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) {
+ const node = this.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) || this.parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors);
+ if (!node) this.unexpected();
+ return node;
+ }
+
+ parsePropertyName(prop, isPrivateNameAllowed) {
+ if (this.eat(8)) {
+ prop.computed = true;
+ prop.key = this.parseMaybeAssignAllowIn();
+ this.expect(11);
+ } else {
+ const oldInPropertyName = this.state.inPropertyName;
+ this.state.inPropertyName = true;
+ const type = this.state.type;
+ prop.key = type === 0 || type === 4 || type === 1 || type === 2 ? this.parseExprAtom() : this.parseMaybePrivateName(isPrivateNameAllowed);
+
+ if (type !== 6) {
+ prop.computed = false;
+ }
+
+ this.state.inPropertyName = oldInPropertyName;
+ }
+
+ return prop.key;
+ }
+
+ initFunction(node, isAsync) {
+ node.id = null;
+ node.generator = false;
+ node.async = !!isAsync;
+ }
+
+ parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) {
+ this.initFunction(node, isAsync);
+ node.generator = !!isGenerator;
+ const allowModifiers = isConstructor;
+ this.scope.enter(SCOPE_FUNCTION | SCOPE_SUPER | (inClassScope ? SCOPE_CLASS : 0) | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0));
+ this.prodParam.enter(functionFlags(isAsync, node.generator));
+ this.parseFunctionParams(node, allowModifiers);
+ this.parseFunctionBodyAndFinish(node, type, true);
+ this.prodParam.exit();
+ this.scope.exit();
+ return node;
+ }
+
+ parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) {
+ if (isTuple) {
+ this.expectPlugin("recordAndTuple");
+ }
+
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ this.state.inFSharpPipelineDirectBody = false;
+ const node = this.startNode();
+ this.next();
+ node.elements = this.parseExprList(close, !isTuple, refExpressionErrors, node);
+ this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
+ return this.finishNode(node, isTuple ? "TupleExpression" : "ArrayExpression");
+ }
+
+ parseArrowExpression(node, params, isAsync, trailingCommaPos) {
+ this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW);
+ let flags = functionFlags(isAsync, false);
+
+ if (!this.match(8) && this.prodParam.hasIn) {
+ flags |= PARAM_IN;
+ }
+
+ this.prodParam.enter(flags);
+ this.initFunction(node, isAsync);
+ const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+
+ if (params) {
+ this.state.maybeInArrowParameters = true;
+ this.setArrowFunctionParameters(node, params, trailingCommaPos);
+ }
+
+ this.state.maybeInArrowParameters = false;
+ this.parseFunctionBody(node, true);
+ this.prodParam.exit();
+ this.scope.exit();
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+ return this.finishNode(node, "ArrowFunctionExpression");
+ }
+
+ setArrowFunctionParameters(node, params, trailingCommaPos) {
+ node.params = this.toAssignableList(params, trailingCommaPos, false);
+ }
+
+ parseFunctionBodyAndFinish(node, type, isMethod = false) {
+ this.parseFunctionBody(node, false, isMethod);
+ this.finishNode(node, type);
+ }
+
+ parseFunctionBody(node, allowExpression, isMethod = false) {
+ const isExpression = allowExpression && !this.match(13);
+ this.expressionScope.enter(newExpressionScope());
+
+ if (isExpression) {
+ node.body = this.parseMaybeAssign();
+ this.checkParams(node, false, allowExpression, false);
+ } else {
+ const oldStrict = this.state.strict;
+ const oldLabels = this.state.labels;
+ this.state.labels = [];
+ this.prodParam.enter(this.prodParam.currentFlags() | PARAM_RETURN);
+ node.body = this.parseBlock(true, false, hasStrictModeDirective => {
+ const nonSimple = !this.isSimpleParamList(node.params);
+
+ if (hasStrictModeDirective && nonSimple) {
+ const errorPos = (node.kind === "method" || node.kind === "constructor") && !!node.key ? node.key.end : node.start;
+ this.raise(errorPos, ErrorMessages.IllegalLanguageModeDirective);
+ }
+
+ const strictModeChanged = !oldStrict && this.state.strict;
+ this.checkParams(node, !this.state.strict && !allowExpression && !isMethod && !nonSimple, allowExpression, strictModeChanged);
+
+ if (this.state.strict && node.id) {
+ this.checkLVal(node.id, "function name", BIND_OUTSIDE, undefined, undefined, strictModeChanged);
+ }
+ });
+ this.prodParam.exit();
+ this.expressionScope.exit();
+ this.state.labels = oldLabels;
+ }
+ }
+
+ isSimpleParamList(params) {
+ for (let i = 0, len = params.length; i < len; i++) {
+ if (params[i].type !== "Identifier") return false;
+ }
+
+ return true;
+ }
+
+ checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) {
+ const checkClashes = new Set();
+
+ for (const param of node.params) {
+ this.checkLVal(param, "function parameter list", BIND_VAR, allowDuplicates ? null : checkClashes, undefined, strictModeChanged);
+ }
+ }
+
+ parseExprList(close, allowEmpty, refExpressionErrors, nodeForExtra) {
+ const elts = [];
+ let first = true;
+
+ while (!this.eat(close)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(20);
+
+ if (this.match(close)) {
+ if (nodeForExtra) {
+ this.addExtra(nodeForExtra, "trailingComma", this.state.lastTokStart);
+ }
+
+ this.next();
+ break;
+ }
+ }
+
+ elts.push(this.parseExprListItem(allowEmpty, refExpressionErrors));
+ }
+
+ return elts;
+ }
+
+ parseExprListItem(allowEmpty, refExpressionErrors, allowPlaceholder) {
+ let elt;
+
+ if (this.match(20)) {
+ if (!allowEmpty) {
+ this.raise(this.state.pos, ErrorMessages.UnexpectedToken, ",");
+ }
+
+ elt = null;
+ } else if (this.match(29)) {
+ const spreadNodeStartPos = this.state.start;
+ const spreadNodeStartLoc = this.state.startLoc;
+ elt = this.parseParenItem(this.parseSpread(refExpressionErrors), spreadNodeStartPos, spreadNodeStartLoc);
+ } else if (this.match(25)) {
+ this.expectPlugin("partialApplication");
+
+ if (!allowPlaceholder) {
+ this.raise(this.state.start, ErrorMessages.UnexpectedArgumentPlaceholder);
+ }
+
+ const node = this.startNode();
+ this.next();
+ elt = this.finishNode(node, "ArgumentPlaceholder");
+ } else {
+ elt = this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem);
+ }
+
+ return elt;
+ }
+
+ parseIdentifier(liberal) {
+ const node = this.startNode();
+ const name = this.parseIdentifierName(node.start, liberal);
+ return this.createIdentifier(node, name);
+ }
+
+ createIdentifier(node, name) {
+ node.name = name;
+ node.loc.identifierName = name;
+ return this.finishNode(node, "Identifier");
+ }
+
+ parseIdentifierName(pos, liberal) {
+ let name;
+ const {
+ start,
+ type
+ } = this.state;
+
+ if (type === 5) {
+ name = this.state.value;
+ } else if (tokenIsKeyword(type)) {
+ name = tokenLabelName(type);
+ } else {
+ throw this.unexpected();
+ }
+
+ if (liberal) {
+ this.state.type = 5;
+ } else {
+ this.checkReservedWord(name, start, tokenIsKeyword(type), false);
+ }
+
+ this.next();
+ return name;
+ }
+
+ checkReservedWord(word, startLoc, checkKeywords, isBinding) {
+ if (word.length > 10) {
+ return;
+ }
+
+ if (!canBeReservedWord(word)) {
+ return;
+ }
+
+ if (word === "yield") {
+ if (this.prodParam.hasYield) {
+ this.raise(startLoc, ErrorMessages.YieldBindingIdentifier);
+ return;
+ }
+ } else if (word === "await") {
+ if (this.prodParam.hasAwait) {
+ this.raise(startLoc, ErrorMessages.AwaitBindingIdentifier);
+ return;
+ } else if (this.scope.inStaticBlock) {
+ this.raise(startLoc, ErrorMessages.AwaitBindingIdentifierInStaticBlock);
+ return;
+ } else {
+ this.expressionScope.recordAsyncArrowParametersError(startLoc, ErrorMessages.AwaitBindingIdentifier);
+ }
+ } else if (word === "arguments") {
+ if (this.scope.inClassAndNotInNonArrowFunction) {
+ this.raise(startLoc, ErrorMessages.ArgumentsInClass);
+ return;
+ }
+ }
+
+ if (checkKeywords && isKeyword(word)) {
+ this.raise(startLoc, ErrorMessages.UnexpectedKeyword, word);
+ return;
+ }
+
+ const reservedTest = !this.state.strict ? isReservedWord : isBinding ? isStrictBindReservedWord : isStrictReservedWord;
+
+ if (reservedTest(word, this.inModule)) {
+ this.raise(startLoc, ErrorMessages.UnexpectedReservedWord, word);
+ }
+ }
+
+ isAwaitAllowed() {
+ if (this.prodParam.hasAwait) return true;
+
+ if (this.options.allowAwaitOutsideFunction && !this.scope.inFunction) {
+ return true;
+ }
+
+ return false;
+ }
+
+ parseAwait(startPos, startLoc) {
+ const node = this.startNodeAt(startPos, startLoc);
+ this.expressionScope.recordParameterInitializerError(node.start, ErrorMessages.AwaitExpressionFormalParameter);
+
+ if (this.eat(54)) {
+ this.raise(node.start, ErrorMessages.ObsoleteAwaitStar);
+ }
+
+ if (!this.scope.inFunction && !this.options.allowAwaitOutsideFunction) {
+ if (this.isAmbiguousAwait()) {
+ this.ambiguousScriptDifferentAst = true;
+ } else {
+ this.sawUnambiguousESM = true;
+ }
+ }
+
+ if (!this.state.soloAwait) {
+ node.argument = this.parseMaybeUnary(null, true);
+ }
+
+ return this.finishNode(node, "AwaitExpression");
+ }
+
+ isAmbiguousAwait() {
+ return this.hasPrecedingLineBreak() || this.match(52) || this.match(18) || this.match(8) || this.match(30) || this.match(3) || this.match(55) || this.hasPlugin("v8intrinsic") && this.match(53);
+ }
+
+ parseYield() {
+ const node = this.startNode();
+ this.expressionScope.recordParameterInitializerError(node.start, ErrorMessages.YieldInParameter);
+ this.next();
+ let delegating = false;
+ let argument = null;
+
+ if (!this.hasPrecedingLineBreak()) {
+ delegating = this.eat(54);
+
+ switch (this.state.type) {
+ case 21:
+ case 7:
+ case 16:
+ case 19:
+ case 11:
+ case 17:
+ case 22:
+ case 20:
+ if (!delegating) break;
+
+ default:
+ argument = this.parseMaybeAssign();
+ }
+ }
+
+ node.delegate = delegating;
+ node.argument = argument;
+ return this.finishNode(node, "YieldExpression");
+ }
+
+ checkPipelineAtInfixOperator(left, leftStartPos) {
+ if (this.getPluginOption("pipelineOperator", "proposal") === "smart") {
+ if (left.type === "SequenceExpression") {
+ this.raise(leftStartPos, ErrorMessages.PipelineHeadSequenceExpression);
+ }
+ }
+ }
+
+ checkHackPipeBodyEarlyErrors(startPos) {
+ if (!this.topicReferenceWasUsedInCurrentContext()) {
+ this.raise(startPos, ErrorMessages.PipeTopicUnused);
+ }
+ }
+
+ parseSmartPipelineBodyInStyle(childExpr, startPos, startLoc) {
+ const bodyNode = this.startNodeAt(startPos, startLoc);
+
+ if (this.isSimpleReference(childExpr)) {
+ bodyNode.callee = childExpr;
+ return this.finishNode(bodyNode, "PipelineBareFunction");
+ } else {
+ this.checkSmartPipeTopicBodyEarlyErrors(startPos);
+ bodyNode.expression = childExpr;
+ return this.finishNode(bodyNode, "PipelineTopicExpression");
+ }
+ }
+
+ isSimpleReference(expression) {
+ switch (expression.type) {
+ case "MemberExpression":
+ return !expression.computed && this.isSimpleReference(expression.object);
+
+ case "Identifier":
+ return true;
+
+ default:
+ return false;
+ }
+ }
+
+ checkSmartPipeTopicBodyEarlyErrors(startPos) {
+ if (this.match(27)) {
+ throw this.raise(this.state.start, ErrorMessages.PipelineBodyNoArrow);
+ } else if (!this.topicReferenceWasUsedInCurrentContext()) {
+ this.raise(startPos, ErrorMessages.PipelineTopicUnused);
+ }
+ }
+
+ withTopicBindingContext(callback) {
+ const outerContextTopicState = this.state.topicContext;
+ this.state.topicContext = {
+ maxNumOfResolvableTopics: 1,
+ maxTopicIndex: null
+ };
+
+ try {
+ return callback();
+ } finally {
+ this.state.topicContext = outerContextTopicState;
+ }
+ }
+
+ withSmartMixTopicForbiddingContext(callback) {
+ const proposal = this.getPluginOption("pipelineOperator", "proposal");
+
+ if (proposal === "smart") {
+ const outerContextTopicState = this.state.topicContext;
+ this.state.topicContext = {
+ maxNumOfResolvableTopics: 0,
+ maxTopicIndex: null
+ };
+
+ try {
+ return callback();
+ } finally {
+ this.state.topicContext = outerContextTopicState;
+ }
+ } else {
+ return callback();
+ }
+ }
+
+ withSoloAwaitPermittingContext(callback) {
+ const outerContextSoloAwaitState = this.state.soloAwait;
+ this.state.soloAwait = true;
+
+ try {
+ return callback();
+ } finally {
+ this.state.soloAwait = outerContextSoloAwaitState;
+ }
+ }
+
+ allowInAnd(callback) {
+ const flags = this.prodParam.currentFlags();
+ const prodParamToSet = PARAM_IN & ~flags;
+
+ if (prodParamToSet) {
+ this.prodParam.enter(flags | PARAM_IN);
+
+ try {
+ return callback();
+ } finally {
+ this.prodParam.exit();
+ }
+ }
+
+ return callback();
+ }
+
+ disallowInAnd(callback) {
+ const flags = this.prodParam.currentFlags();
+ const prodParamToClear = PARAM_IN & flags;
+
+ if (prodParamToClear) {
+ this.prodParam.enter(flags & ~PARAM_IN);
+
+ try {
+ return callback();
+ } finally {
+ this.prodParam.exit();
+ }
+ }
+
+ return callback();
+ }
+
+ registerTopicReference() {
+ this.state.topicContext.maxTopicIndex = 0;
+ }
+
+ topicReferenceIsAllowedInCurrentContext() {
+ return this.state.topicContext.maxNumOfResolvableTopics >= 1;
+ }
+
+ topicReferenceWasUsedInCurrentContext() {
+ return this.state.topicContext.maxTopicIndex != null && this.state.topicContext.maxTopicIndex >= 0;
+ }
+
+ parseFSharpPipelineBody(prec) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ this.state.potentialArrowAt = this.state.start;
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ this.state.inFSharpPipelineDirectBody = true;
+ const ret = this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startPos, startLoc, prec);
+ this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
+ return ret;
+ }
+
+ parseModuleExpression() {
+ this.expectPlugin("moduleBlocks");
+ const node = this.startNode();
+ this.next();
+ this.eat(13);
+ const revertScopes = this.initializeScopes(true);
+ this.enterInitialScopes();
+ const program = this.startNode();
+
+ try {
+ node.body = this.parseProgram(program, 16, "module");
+ } finally {
+ revertScopes();
+ }
+
+ this.eat(16);
+ return this.finishNode(node, "ModuleExpression");
+ }
+
+}
+
+const loopLabel = {
+ kind: "loop"
+},
+ switchLabel = {
+ kind: "switch"
+};
+const FUNC_NO_FLAGS = 0b000,
+ FUNC_STATEMENT = 0b001,
+ FUNC_HANGING_STATEMENT = 0b010,
+ FUNC_NULLABLE_ID = 0b100;
+const loneSurrogate = /[\uD800-\uDFFF]/u;
+const keywordRelationalOperator = /in(?:stanceof)?/y;
+
+function babel7CompatTokens(tokens) {
+ for (let i = 0; i < tokens.length; i++) {
+ const token = tokens[i];
+ const {
+ type
+ } = token;
+
+ if (type === 6) {
+ {
+ const {
+ loc,
+ start,
+ value,
+ end
+ } = token;
+ const hashEndPos = start + 1;
+ const hashEndLoc = new Position(loc.start.line, loc.start.column + 1);
+ tokens.splice(i, 1, new Token({
+ type: getExportedToken(33),
+ value: "#",
+ start: start,
+ end: hashEndPos,
+ startLoc: loc.start,
+ endLoc: hashEndLoc
+ }), new Token({
+ type: getExportedToken(5),
+ value: value,
+ start: hashEndPos,
+ end: end,
+ startLoc: hashEndLoc,
+ endLoc: loc.end
+ }));
+ i++;
+ continue;
+ }
+ }
+
+ if (typeof type === "number") {
+ token.type = getExportedToken(type);
+ }
+ }
+
+ return tokens;
+}
+
+class StatementParser extends ExpressionParser {
+ parseTopLevel(file, program) {
+ file.program = this.parseProgram(program);
+ file.comments = this.state.comments;
+ if (this.options.tokens) file.tokens = babel7CompatTokens(this.tokens);
+ return this.finishNode(file, "File");
+ }
+
+ parseProgram(program, end = 7, sourceType = this.options.sourceType) {
+ program.sourceType = sourceType;
+ program.interpreter = this.parseInterpreterDirective();
+ this.parseBlockBody(program, true, true, end);
+
+ if (this.inModule && !this.options.allowUndeclaredExports && this.scope.undefinedExports.size > 0) {
+ for (const [name] of Array.from(this.scope.undefinedExports)) {
+ const pos = this.scope.undefinedExports.get(name);
+ this.raise(pos, ErrorMessages.ModuleExportUndefined, name);
+ }
+ }
+
+ return this.finishNode(program, "Program");
+ }
+
+ stmtToDirective(stmt) {
+ const directive = stmt;
+ directive.type = "Directive";
+ directive.value = directive.expression;
+ delete directive.expression;
+ const directiveLiteral = directive.value;
+ const raw = this.input.slice(directiveLiteral.start, directiveLiteral.end);
+ const val = directiveLiteral.value = raw.slice(1, -1);
+ this.addExtra(directiveLiteral, "raw", raw);
+ this.addExtra(directiveLiteral, "rawValue", val);
+ directiveLiteral.type = "DirectiveLiteral";
+ return directive;
+ }
+
+ parseInterpreterDirective() {
+ if (!this.match(34)) {
+ return null;
+ }
+
+ const node = this.startNode();
+ node.value = this.state.value;
+ this.next();
+ return this.finishNode(node, "InterpreterDirective");
+ }
+
+ isLet(context) {
+ if (!this.isContextual("let")) {
+ return false;
+ }
+
+ return this.isLetKeyword(context);
+ }
+
+ isLetKeyword(context) {
+ const next = this.nextTokenStart();
+ const nextCh = this.codePointAtPos(next);
+
+ if (nextCh === 92 || nextCh === 91) {
+ return true;
+ }
+
+ if (context) return false;
+ if (nextCh === 123) return true;
+
+ if (isIdentifierStart(nextCh)) {
+ keywordRelationalOperator.lastIndex = next;
+
+ if (keywordRelationalOperator.test(this.input)) {
+ const endCh = this.codePointAtPos(keywordRelationalOperator.lastIndex);
+
+ if (!isIdentifierChar(endCh) && endCh !== 92) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ return false;
+ }
+
+ parseStatement(context, topLevel) {
+ if (this.match(32)) {
+ this.parseDecorators(true);
+ }
+
+ return this.parseStatementContent(context, topLevel);
+ }
+
+ parseStatementContent(context, topLevel) {
+ let starttype = this.state.type;
+ const node = this.startNode();
+ let kind;
+
+ if (this.isLet(context)) {
+ starttype = 73;
+ kind = "let";
+ }
+
+ switch (starttype) {
+ case 59:
+ return this.parseBreakContinueStatement(node, true);
+
+ case 62:
+ return this.parseBreakContinueStatement(node, false);
+
+ case 63:
+ return this.parseDebuggerStatement(node);
+
+ case 89:
+ return this.parseDoStatement(node);
+
+ case 90:
+ return this.parseForStatement(node);
+
+ case 67:
+ if (this.lookaheadCharCode() === 46) break;
+
+ if (context) {
+ if (this.state.strict) {
+ this.raise(this.state.start, ErrorMessages.StrictFunction);
+ } else if (context !== "if" && context !== "label") {
+ this.raise(this.state.start, ErrorMessages.SloppyFunction);
+ }
+ }
+
+ return this.parseFunctionStatement(node, false, !context);
+
+ case 79:
+ if (context) this.unexpected();
+ return this.parseClass(node, true);
+
+ case 68:
+ return this.parseIfStatement(node);
+
+ case 69:
+ return this.parseReturnStatement(node);
+
+ case 70:
+ return this.parseSwitchStatement(node);
+
+ case 71:
+ return this.parseThrowStatement(node);
+
+ case 72:
+ return this.parseTryStatement(node);
+
+ case 74:
+ case 73:
+ kind = kind || this.state.value;
+
+ if (context && kind !== "var") {
+ this.raise(this.state.start, ErrorMessages.UnexpectedLexicalDeclaration);
+ }
+
+ return this.parseVarStatement(node, kind);
+
+ case 91:
+ return this.parseWhileStatement(node);
+
+ case 75:
+ return this.parseWithStatement(node);
+
+ case 13:
+ return this.parseBlock();
+
+ case 21:
+ return this.parseEmptyStatement(node);
+
+ case 82:
+ {
+ const nextTokenCharCode = this.lookaheadCharCode();
+
+ if (nextTokenCharCode === 40 || nextTokenCharCode === 46) {
+ break;
+ }
+ }
+
+ case 81:
+ {
+ if (!this.options.allowImportExportEverywhere && !topLevel) {
+ this.raise(this.state.start, ErrorMessages.UnexpectedImportExport);
+ }
+
+ this.next();
+ let result;
+
+ if (starttype === 82) {
+ result = this.parseImport(node);
+
+ if (result.type === "ImportDeclaration" && (!result.importKind || result.importKind === "value")) {
+ this.sawUnambiguousESM = true;
+ }
+ } else {
+ result = this.parseExport(node);
+
+ if (result.type === "ExportNamedDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportAllDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportDefaultDeclaration") {
+ this.sawUnambiguousESM = true;
+ }
+ }
+
+ this.assertModuleNodeAllowed(node);
+ return result;
+ }
+
+ default:
+ {
+ if (this.isAsyncFunction()) {
+ if (context) {
+ this.raise(this.state.start, ErrorMessages.AsyncFunctionInSingleStatementContext);
+ }
+
+ this.next();
+ return this.parseFunctionStatement(node, true, !context);
+ }
+ }
+ }
+
+ const maybeName = this.state.value;
+ const expr = this.parseExpression();
+
+ if (starttype === 5 && expr.type === "Identifier" && this.eat(22)) {
+ return this.parseLabeledStatement(node, maybeName, expr, context);
+ } else {
+ return this.parseExpressionStatement(node, expr);
+ }
+ }
+
+ assertModuleNodeAllowed(node) {
+ if (!this.options.allowImportExportEverywhere && !this.inModule) {
+ this.raise(node.start, SourceTypeModuleErrorMessages.ImportOutsideModule);
+ }
+ }
+
+ takeDecorators(node) {
+ const decorators = this.state.decoratorStack[this.state.decoratorStack.length - 1];
+
+ if (decorators.length) {
+ node.decorators = decorators;
+ this.resetStartLocationFromNode(node, decorators[0]);
+ this.state.decoratorStack[this.state.decoratorStack.length - 1] = [];
+ }
+ }
+
+ canHaveLeadingDecorator() {
+ return this.match(79);
+ }
+
+ parseDecorators(allowExport) {
+ const currentContextDecorators = this.state.decoratorStack[this.state.decoratorStack.length - 1];
+
+ while (this.match(32)) {
+ const decorator = this.parseDecorator();
+ currentContextDecorators.push(decorator);
+ }
+
+ if (this.match(81)) {
+ if (!allowExport) {
+ this.unexpected();
+ }
+
+ if (this.hasPlugin("decorators") && !this.getPluginOption("decorators", "decoratorsBeforeExport")) {
+ this.raise(this.state.start, ErrorMessages.DecoratorExportClass);
+ }
+ } else if (!this.canHaveLeadingDecorator()) {
+ throw this.raise(this.state.start, ErrorMessages.UnexpectedLeadingDecorator);
+ }
+ }
+
+ parseDecorator() {
+ this.expectOnePlugin(["decorators-legacy", "decorators"]);
+ const node = this.startNode();
+ this.next();
+
+ if (this.hasPlugin("decorators")) {
+ this.state.decoratorStack.push([]);
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ let expr;
+
+ if (this.eat(18)) {
+ expr = this.parseExpression();
+ this.expect(19);
+ } else {
+ expr = this.parseIdentifier(false);
+
+ while (this.eat(24)) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.object = expr;
+ node.property = this.parseIdentifier(true);
+ node.computed = false;
+ expr = this.finishNode(node, "MemberExpression");
+ }
+ }
+
+ node.expression = this.parseMaybeDecoratorArguments(expr);
+ this.state.decoratorStack.pop();
+ } else {
+ node.expression = this.parseExprSubscripts();
+ }
+
+ return this.finishNode(node, "Decorator");
+ }
+
+ parseMaybeDecoratorArguments(expr) {
+ if (this.eat(18)) {
+ const node = this.startNodeAtNode(expr);
+ node.callee = expr;
+ node.arguments = this.parseCallExpressionArguments(19, false);
+ this.toReferencedList(node.arguments);
+ return this.finishNode(node, "CallExpression");
+ }
+
+ return expr;
+ }
+
+ parseBreakContinueStatement(node, isBreak) {
+ this.next();
+
+ if (this.isLineTerminator()) {
+ node.label = null;
+ } else {
+ node.label = this.parseIdentifier();
+ this.semicolon();
+ }
+
+ this.verifyBreakContinue(node, isBreak);
+ return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement");
+ }
+
+ verifyBreakContinue(node, isBreak) {
+ let i;
+
+ for (i = 0; i < this.state.labels.length; ++i) {
+ const lab = this.state.labels[i];
+
+ if (node.label == null || lab.name === node.label.name) {
+ if (lab.kind != null && (isBreak || lab.kind === "loop")) break;
+ if (node.label && isBreak) break;
+ }
+ }
+
+ if (i === this.state.labels.length) {
+ this.raise(node.start, ErrorMessages.IllegalBreakContinue, isBreak ? "break" : "continue");
+ }
+ }
+
+ parseDebuggerStatement(node) {
+ this.next();
+ this.semicolon();
+ return this.finishNode(node, "DebuggerStatement");
+ }
+
+ parseHeaderExpression() {
+ this.expect(18);
+ const val = this.parseExpression();
+ this.expect(19);
+ return val;
+ }
+
+ parseDoStatement(node) {
+ this.next();
+ this.state.labels.push(loopLabel);
+ node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement("do"));
+ this.state.labels.pop();
+ this.expect(91);
+ node.test = this.parseHeaderExpression();
+ this.eat(21);
+ return this.finishNode(node, "DoWhileStatement");
+ }
+
+ parseForStatement(node) {
+ this.next();
+ this.state.labels.push(loopLabel);
+ let awaitAt = -1;
+
+ if (this.isAwaitAllowed() && this.eatContextual("await")) {
+ awaitAt = this.state.lastTokStart;
+ }
+
+ this.scope.enter(SCOPE_OTHER);
+ this.expect(18);
+
+ if (this.match(21)) {
+ if (awaitAt > -1) {
+ this.unexpected(awaitAt);
+ }
+
+ return this.parseFor(node, null);
+ }
+
+ const startsWithLet = this.isContextual("let");
+ const isLet = startsWithLet && this.isLetKeyword();
+
+ if (this.match(73) || this.match(74) || isLet) {
+ const init = this.startNode();
+ const kind = isLet ? "let" : this.state.value;
+ this.next();
+ this.parseVar(init, true, kind);
+ this.finishNode(init, "VariableDeclaration");
+
+ if ((this.match(57) || this.isContextual("of")) && init.declarations.length === 1) {
+ return this.parseForIn(node, init, awaitAt);
+ }
+
+ if (awaitAt > -1) {
+ this.unexpected(awaitAt);
+ }
+
+ return this.parseFor(node, init);
+ }
+
+ const startsWithUnescapedName = this.match(5) && !this.state.containsEsc;
+ const refExpressionErrors = new ExpressionErrors();
+ const init = this.parseExpression(true, refExpressionErrors);
+ const isForOf = this.isContextual("of");
+
+ if (isForOf) {
+ if (startsWithLet) {
+ this.raise(init.start, ErrorMessages.ForOfLet);
+ } else if (awaitAt === -1 && startsWithUnescapedName && init.type === "Identifier" && init.name === "async") {
+ this.raise(init.start, ErrorMessages.ForOfAsync);
+ }
+ }
+
+ if (isForOf || this.match(57)) {
+ this.toAssignable(init, true);
+ const description = isForOf ? "for-of statement" : "for-in statement";
+ this.checkLVal(init, description);
+ return this.parseForIn(node, init, awaitAt);
+ } else {
+ this.checkExpressionErrors(refExpressionErrors, true);
+ }
+
+ if (awaitAt > -1) {
+ this.unexpected(awaitAt);
+ }
+
+ return this.parseFor(node, init);
+ }
+
+ parseFunctionStatement(node, isAsync, declarationPosition) {
+ this.next();
+ return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), isAsync);
+ }
+
+ parseIfStatement(node) {
+ this.next();
+ node.test = this.parseHeaderExpression();
+ node.consequent = this.parseStatement("if");
+ node.alternate = this.eat(65) ? this.parseStatement("if") : null;
+ return this.finishNode(node, "IfStatement");
+ }
+
+ parseReturnStatement(node) {
+ if (!this.prodParam.hasReturn && !this.options.allowReturnOutsideFunction) {
+ this.raise(this.state.start, ErrorMessages.IllegalReturn);
+ }
+
+ this.next();
+
+ if (this.isLineTerminator()) {
+ node.argument = null;
+ } else {
+ node.argument = this.parseExpression();
+ this.semicolon();
+ }
+
+ return this.finishNode(node, "ReturnStatement");
+ }
+
+ parseSwitchStatement(node) {
+ this.next();
+ node.discriminant = this.parseHeaderExpression();
+ const cases = node.cases = [];
+ this.expect(13);
+ this.state.labels.push(switchLabel);
+ this.scope.enter(SCOPE_OTHER);
+ let cur;
+
+ for (let sawDefault; !this.match(16);) {
+ if (this.match(60) || this.match(64)) {
+ const isCase = this.match(60);
+ if (cur) this.finishNode(cur, "SwitchCase");
+ cases.push(cur = this.startNode());
+ cur.consequent = [];
+ this.next();
+
+ if (isCase) {
+ cur.test = this.parseExpression();
+ } else {
+ if (sawDefault) {
+ this.raise(this.state.lastTokStart, ErrorMessages.MultipleDefaultsInSwitch);
+ }
+
+ sawDefault = true;
+ cur.test = null;
+ }
+
+ this.expect(22);
+ } else {
+ if (cur) {
+ cur.consequent.push(this.parseStatement(null));
+ } else {
+ this.unexpected();
+ }
+ }
+ }
+
+ this.scope.exit();
+ if (cur) this.finishNode(cur, "SwitchCase");
+ this.next();
+ this.state.labels.pop();
+ return this.finishNode(node, "SwitchStatement");
+ }
+
+ parseThrowStatement(node) {
+ this.next();
+
+ if (this.hasPrecedingLineBreak()) {
+ this.raise(this.state.lastTokEnd, ErrorMessages.NewlineAfterThrow);
+ }
+
+ node.argument = this.parseExpression();
+ this.semicolon();
+ return this.finishNode(node, "ThrowStatement");
+ }
+
+ parseCatchClauseParam() {
+ const param = this.parseBindingAtom();
+ const simple = param.type === "Identifier";
+ this.scope.enter(simple ? SCOPE_SIMPLE_CATCH : 0);
+ this.checkLVal(param, "catch clause", BIND_LEXICAL);
+ return param;
+ }
+
+ parseTryStatement(node) {
+ this.next();
+ node.block = this.parseBlock();
+ node.handler = null;
+
+ if (this.match(61)) {
+ const clause = this.startNode();
+ this.next();
+
+ if (this.match(18)) {
+ this.expect(18);
+ clause.param = this.parseCatchClauseParam();
+ this.expect(19);
+ } else {
+ clause.param = null;
+ this.scope.enter(SCOPE_OTHER);
+ }
+
+ clause.body = this.withSmartMixTopicForbiddingContext(() => this.parseBlock(false, false));
+ this.scope.exit();
+ node.handler = this.finishNode(clause, "CatchClause");
+ }
+
+ node.finalizer = this.eat(66) ? this.parseBlock() : null;
+
+ if (!node.handler && !node.finalizer) {
+ this.raise(node.start, ErrorMessages.NoCatchOrFinally);
+ }
+
+ return this.finishNode(node, "TryStatement");
+ }
+
+ parseVarStatement(node, kind) {
+ this.next();
+ this.parseVar(node, false, kind);
+ this.semicolon();
+ return this.finishNode(node, "VariableDeclaration");
+ }
+
+ parseWhileStatement(node) {
+ this.next();
+ node.test = this.parseHeaderExpression();
+ this.state.labels.push(loopLabel);
+ node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement("while"));
+ this.state.labels.pop();
+ return this.finishNode(node, "WhileStatement");
+ }
+
+ parseWithStatement(node) {
+ if (this.state.strict) {
+ this.raise(this.state.start, ErrorMessages.StrictWith);
+ }
+
+ this.next();
+ node.object = this.parseHeaderExpression();
+ node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement("with"));
+ return this.finishNode(node, "WithStatement");
+ }
+
+ parseEmptyStatement(node) {
+ this.next();
+ return this.finishNode(node, "EmptyStatement");
+ }
+
+ parseLabeledStatement(node, maybeName, expr, context) {
+ for (const label of this.state.labels) {
+ if (label.name === maybeName) {
+ this.raise(expr.start, ErrorMessages.LabelRedeclaration, maybeName);
+ }
+ }
+
+ const kind = tokenIsLoop(this.state.type) ? "loop" : this.match(70) ? "switch" : null;
+
+ for (let i = this.state.labels.length - 1; i >= 0; i--) {
+ const label = this.state.labels[i];
+
+ if (label.statementStart === node.start) {
+ label.statementStart = this.state.start;
+ label.kind = kind;
+ } else {
+ break;
+ }
+ }
+
+ this.state.labels.push({
+ name: maybeName,
+ kind: kind,
+ statementStart: this.state.start
+ });
+ node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label");
+ this.state.labels.pop();
+ node.label = expr;
+ return this.finishNode(node, "LabeledStatement");
+ }
+
+ parseExpressionStatement(node, expr) {
+ node.expression = expr;
+ this.semicolon();
+ return this.finishNode(node, "ExpressionStatement");
+ }
+
+ parseBlock(allowDirectives = false, createNewLexicalScope = true, afterBlockParse) {
+ const node = this.startNode();
+
+ if (allowDirectives) {
+ this.state.strictErrors.clear();
+ }
+
+ this.expect(13);
+
+ if (createNewLexicalScope) {
+ this.scope.enter(SCOPE_OTHER);
+ }
+
+ this.parseBlockBody(node, allowDirectives, false, 16, afterBlockParse);
+
+ if (createNewLexicalScope) {
+ this.scope.exit();
+ }
+
+ return this.finishNode(node, "BlockStatement");
+ }
+
+ isValidDirective(stmt) {
+ return stmt.type === "ExpressionStatement" && stmt.expression.type === "StringLiteral" && !stmt.expression.extra.parenthesized;
+ }
+
+ parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) {
+ const body = node.body = [];
+ const directives = node.directives = [];
+ this.parseBlockOrModuleBlockBody(body, allowDirectives ? directives : undefined, topLevel, end, afterBlockParse);
+ }
+
+ parseBlockOrModuleBlockBody(body, directives, topLevel, end, afterBlockParse) {
+ const oldStrict = this.state.strict;
+ let hasStrictModeDirective = false;
+ let parsedNonDirective = false;
+
+ while (!this.match(end)) {
+ const stmt = this.parseStatement(null, topLevel);
+
+ if (directives && !parsedNonDirective) {
+ if (this.isValidDirective(stmt)) {
+ const directive = this.stmtToDirective(stmt);
+ directives.push(directive);
+
+ if (!hasStrictModeDirective && directive.value.value === "use strict") {
+ hasStrictModeDirective = true;
+ this.setStrict(true);
+ }
+
+ continue;
+ }
+
+ parsedNonDirective = true;
+ this.state.strictErrors.clear();
+ }
+
+ body.push(stmt);
+ }
+
+ if (afterBlockParse) {
+ afterBlockParse.call(this, hasStrictModeDirective);
+ }
+
+ if (!oldStrict) {
+ this.setStrict(false);
+ }
+
+ this.next();
+ }
+
+ parseFor(node, init) {
+ node.init = init;
+ this.semicolon(false);
+ node.test = this.match(21) ? null : this.parseExpression();
+ this.semicolon(false);
+ node.update = this.match(19) ? null : this.parseExpression();
+ this.expect(19);
+ node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement("for"));
+ this.scope.exit();
+ this.state.labels.pop();
+ return this.finishNode(node, "ForStatement");
+ }
+
+ parseForIn(node, init, awaitAt) {
+ const isForIn = this.match(57);
+ this.next();
+
+ if (isForIn) {
+ if (awaitAt > -1) this.unexpected(awaitAt);
+ } else {
+ node.await = awaitAt > -1;
+ }
+
+ if (init.type === "VariableDeclaration" && init.declarations[0].init != null && (!isForIn || this.state.strict || init.kind !== "var" || init.declarations[0].id.type !== "Identifier")) {
+ this.raise(init.start, ErrorMessages.ForInOfLoopInitializer, isForIn ? "for-in" : "for-of");
+ } else if (init.type === "AssignmentPattern") {
+ this.raise(init.start, ErrorMessages.InvalidLhs, "for-loop");
+ }
+
+ node.left = init;
+ node.right = isForIn ? this.parseExpression() : this.parseMaybeAssignAllowIn();
+ this.expect(19);
+ node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement("for"));
+ this.scope.exit();
+ this.state.labels.pop();
+ return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement");
+ }
+
+ parseVar(node, isFor, kind) {
+ const declarations = node.declarations = [];
+ const isTypescript = this.hasPlugin("typescript");
+ node.kind = kind;
+
+ for (;;) {
+ const decl = this.startNode();
+ this.parseVarId(decl, kind);
+
+ if (this.eat(35)) {
+ decl.init = isFor ? this.parseMaybeAssignDisallowIn() : this.parseMaybeAssignAllowIn();
+ } else {
+ if (kind === "const" && !(this.match(57) || this.isContextual("of"))) {
+ if (!isTypescript) {
+ this.raise(this.state.lastTokEnd, ErrorMessages.DeclarationMissingInitializer, "Const declarations");
+ }
+ } else if (decl.id.type !== "Identifier" && !(isFor && (this.match(57) || this.isContextual("of")))) {
+ this.raise(this.state.lastTokEnd, ErrorMessages.DeclarationMissingInitializer, "Complex binding patterns");
+ }
+
+ decl.init = null;
+ }
+
+ declarations.push(this.finishNode(decl, "VariableDeclarator"));
+ if (!this.eat(20)) break;
+ }
+
+ return node;
+ }
+
+ parseVarId(decl, kind) {
+ decl.id = this.parseBindingAtom();
+ this.checkLVal(decl.id, "variable declaration", kind === "var" ? BIND_VAR : BIND_LEXICAL, undefined, kind !== "var");
+ }
+
+ parseFunction(node, statement = FUNC_NO_FLAGS, isAsync = false) {
+ const isStatement = statement & FUNC_STATEMENT;
+ const isHangingStatement = statement & FUNC_HANGING_STATEMENT;
+ const requireId = !!isStatement && !(statement & FUNC_NULLABLE_ID);
+ this.initFunction(node, isAsync);
+
+ if (this.match(54) && isHangingStatement) {
+ this.raise(this.state.start, ErrorMessages.GeneratorInSingleStatementContext);
+ }
+
+ node.generator = this.eat(54);
+
+ if (isStatement) {
+ node.id = this.parseFunctionId(requireId);
+ }
+
+ const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+ this.state.maybeInArrowParameters = false;
+ this.scope.enter(SCOPE_FUNCTION);
+ this.prodParam.enter(functionFlags(isAsync, node.generator));
+
+ if (!isStatement) {
+ node.id = this.parseFunctionId();
+ }
+
+ this.parseFunctionParams(node, false);
+ this.withSmartMixTopicForbiddingContext(() => {
+ this.parseFunctionBodyAndFinish(node, isStatement ? "FunctionDeclaration" : "FunctionExpression");
+ });
+ this.prodParam.exit();
+ this.scope.exit();
+
+ if (isStatement && !isHangingStatement) {
+ this.registerFunctionStatementId(node);
+ }
+
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+ return node;
+ }
+
+ parseFunctionId(requireId) {
+ return requireId || this.match(5) ? this.parseIdentifier() : null;
+ }
+
+ parseFunctionParams(node, allowModifiers) {
+ this.expect(18);
+ this.expressionScope.enter(newParameterDeclarationScope());
+ node.params = this.parseBindingList(19, 41, false, allowModifiers);
+ this.expressionScope.exit();
+ }
+
+ registerFunctionStatementId(node) {
+ if (!node.id) return;
+ this.scope.declareName(node.id.name, this.state.strict || node.generator || node.async ? this.scope.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION, node.id.start);
+ }
+
+ parseClass(node, isStatement, optionalId) {
+ this.next();
+ this.takeDecorators(node);
+ const oldStrict = this.state.strict;
+ this.state.strict = true;
+ this.parseClassId(node, isStatement, optionalId);
+ this.parseClassSuper(node);
+ node.body = this.parseClassBody(!!node.superClass, oldStrict);
+ return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression");
+ }
+
+ isClassProperty() {
+ return this.match(35) || this.match(21) || this.match(16);
+ }
+
+ isClassMethod() {
+ return this.match(18);
+ }
+
+ isNonstaticConstructor(method) {
+ return !method.computed && !method.static && (method.key.name === "constructor" || method.key.value === "constructor");
+ }
+
+ parseClassBody(hadSuperClass, oldStrict) {
+ this.classScope.enter();
+ const state = {
+ hadConstructor: false,
+ hadSuperClass
+ };
+ let decorators = [];
+ const classBody = this.startNode();
+ classBody.body = [];
+ this.expect(13);
+ this.withSmartMixTopicForbiddingContext(() => {
+ while (!this.match(16)) {
+ if (this.eat(21)) {
+ if (decorators.length > 0) {
+ throw this.raise(this.state.lastTokEnd, ErrorMessages.DecoratorSemicolon);
+ }
+
+ continue;
+ }
+
+ if (this.match(32)) {
+ decorators.push(this.parseDecorator());
+ continue;
+ }
+
+ const member = this.startNode();
+
+ if (decorators.length) {
+ member.decorators = decorators;
+ this.resetStartLocationFromNode(member, decorators[0]);
+ decorators = [];
+ }
+
+ this.parseClassMember(classBody, member, state);
+
+ if (member.kind === "constructor" && member.decorators && member.decorators.length > 0) {
+ this.raise(member.start, ErrorMessages.DecoratorConstructor);
+ }
+ }
+ });
+ this.state.strict = oldStrict;
+ this.next();
+
+ if (decorators.length) {
+ throw this.raise(this.state.start, ErrorMessages.TrailingDecorator);
+ }
+
+ this.classScope.exit();
+ return this.finishNode(classBody, "ClassBody");
+ }
+
+ parseClassMemberFromModifier(classBody, member) {
+ const key = this.parseIdentifier(true);
+
+ if (this.isClassMethod()) {
+ const method = member;
+ method.kind = "method";
+ method.computed = false;
+ method.key = key;
+ method.static = false;
+ this.pushClassMethod(classBody, method, false, false, false, false);
+ return true;
+ } else if (this.isClassProperty()) {
+ const prop = member;
+ prop.computed = false;
+ prop.key = key;
+ prop.static = false;
+ classBody.body.push(this.parseClassProperty(prop));
+ return true;
+ }
+
+ this.resetPreviousNodeTrailingComments(key);
+ return false;
+ }
+
+ parseClassMember(classBody, member, state) {
+ const isStatic = this.isContextual("static");
+
+ if (isStatic) {
+ if (this.parseClassMemberFromModifier(classBody, member)) {
+ return;
+ }
+
+ if (this.eat(13)) {
+ this.parseClassStaticBlock(classBody, member);
+ return;
+ }
+ }
+
+ this.parseClassMemberWithIsStatic(classBody, member, state, isStatic);
+ }
+
+ parseClassMemberWithIsStatic(classBody, member, state, isStatic) {
+ const publicMethod = member;
+ const privateMethod = member;
+ const publicProp = member;
+ const privateProp = member;
+ const method = publicMethod;
+ const publicMember = publicMethod;
+ member.static = isStatic;
+
+ if (this.eat(54)) {
+ method.kind = "method";
+ const isPrivateName = this.match(6);
+ this.parseClassElementName(method);
+
+ if (isPrivateName) {
+ this.pushClassPrivateMethod(classBody, privateMethod, true, false);
+ return;
+ }
+
+ if (this.isNonstaticConstructor(publicMethod)) {
+ this.raise(publicMethod.key.start, ErrorMessages.ConstructorIsGenerator);
+ }
+
+ this.pushClassMethod(classBody, publicMethod, true, false, false, false);
+ return;
+ }
+
+ const isContextual = this.match(5) && !this.state.containsEsc;
+ const isPrivate = this.match(6);
+ const key = this.parseClassElementName(member);
+ const maybeQuestionTokenStart = this.state.start;
+ this.parsePostMemberNameModifiers(publicMember);
+
+ if (this.isClassMethod()) {
+ method.kind = "method";
+
+ if (isPrivate) {
+ this.pushClassPrivateMethod(classBody, privateMethod, false, false);
+ return;
+ }
+
+ const isConstructor = this.isNonstaticConstructor(publicMethod);
+ let allowsDirectSuper = false;
+
+ if (isConstructor) {
+ publicMethod.kind = "constructor";
+
+ if (state.hadConstructor && !this.hasPlugin("typescript")) {
+ this.raise(key.start, ErrorMessages.DuplicateConstructor);
+ }
+
+ if (isConstructor && this.hasPlugin("typescript") && member.override) {
+ this.raise(key.start, ErrorMessages.OverrideOnConstructor);
+ }
+
+ state.hadConstructor = true;
+ allowsDirectSuper = state.hadSuperClass;
+ }
+
+ this.pushClassMethod(classBody, publicMethod, false, false, isConstructor, allowsDirectSuper);
+ } else if (this.isClassProperty()) {
+ if (isPrivate) {
+ this.pushClassPrivateProperty(classBody, privateProp);
+ } else {
+ this.pushClassProperty(classBody, publicProp);
+ }
+ } else if (isContextual && key.name === "async" && !this.isLineTerminator()) {
+ this.resetPreviousNodeTrailingComments(key);
+ const isGenerator = this.eat(54);
+
+ if (publicMember.optional) {
+ this.unexpected(maybeQuestionTokenStart);
+ }
+
+ method.kind = "method";
+ const isPrivate = this.match(6);
+ this.parseClassElementName(method);
+ this.parsePostMemberNameModifiers(publicMember);
+
+ if (isPrivate) {
+ this.pushClassPrivateMethod(classBody, privateMethod, isGenerator, true);
+ } else {
+ if (this.isNonstaticConstructor(publicMethod)) {
+ this.raise(publicMethod.key.start, ErrorMessages.ConstructorIsAsync);
+ }
+
+ this.pushClassMethod(classBody, publicMethod, isGenerator, true, false, false);
+ }
+ } else if (isContextual && (key.name === "get" || key.name === "set") && !(this.match(54) && this.isLineTerminator())) {
+ this.resetPreviousNodeTrailingComments(key);
+ method.kind = key.name;
+ const isPrivate = this.match(6);
+ this.parseClassElementName(publicMethod);
+
+ if (isPrivate) {
+ this.pushClassPrivateMethod(classBody, privateMethod, false, false);
+ } else {
+ if (this.isNonstaticConstructor(publicMethod)) {
+ this.raise(publicMethod.key.start, ErrorMessages.ConstructorIsAccessor);
+ }
+
+ this.pushClassMethod(classBody, publicMethod, false, false, false, false);
+ }
+
+ this.checkGetterSetterParams(publicMethod);
+ } else if (this.isLineTerminator()) {
+ if (isPrivate) {
+ this.pushClassPrivateProperty(classBody, privateProp);
+ } else {
+ this.pushClassProperty(classBody, publicProp);
+ }
+ } else {
+ this.unexpected();
+ }
+ }
+
+ parseClassElementName(member) {
+ const {
+ type,
+ value,
+ start
+ } = this.state;
+
+ if ((type === 5 || type === 4) && member.static && value === "prototype") {
+ this.raise(start, ErrorMessages.StaticPrototype);
+ }
+
+ if (type === 6 && value === "constructor") {
+ this.raise(start, ErrorMessages.ConstructorClassPrivateField);
+ }
+
+ return this.parsePropertyName(member, true);
+ }
+
+ parseClassStaticBlock(classBody, member) {
+ var _member$decorators;
+
+ this.expectPlugin("classStaticBlock", member.start);
+ this.scope.enter(SCOPE_CLASS | SCOPE_STATIC_BLOCK | SCOPE_SUPER);
+ const oldLabels = this.state.labels;
+ this.state.labels = [];
+ this.prodParam.enter(PARAM);
+ const body = member.body = [];
+ this.parseBlockOrModuleBlockBody(body, undefined, false, 16);
+ this.prodParam.exit();
+ this.scope.exit();
+ this.state.labels = oldLabels;
+ classBody.body.push(this.finishNode(member, "StaticBlock"));
+
+ if ((_member$decorators = member.decorators) != null && _member$decorators.length) {
+ this.raise(member.start, ErrorMessages.DecoratorStaticBlock);
+ }
+ }
+
+ pushClassProperty(classBody, prop) {
+ if (!prop.computed && (prop.key.name === "constructor" || prop.key.value === "constructor")) {
+ this.raise(prop.key.start, ErrorMessages.ConstructorClassField);
+ }
+
+ classBody.body.push(this.parseClassProperty(prop));
+ }
+
+ pushClassPrivateProperty(classBody, prop) {
+ const node = this.parseClassPrivateProperty(prop);
+ classBody.body.push(node);
+ this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), CLASS_ELEMENT_OTHER, node.key.start);
+ }
+
+ pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
+ classBody.body.push(this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true));
+ }
+
+ pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {
+ const node = this.parseMethod(method, isGenerator, isAsync, false, false, "ClassPrivateMethod", true);
+ classBody.body.push(node);
+ const kind = node.kind === "get" ? node.static ? CLASS_ELEMENT_STATIC_GETTER : CLASS_ELEMENT_INSTANCE_GETTER : node.kind === "set" ? node.static ? CLASS_ELEMENT_STATIC_SETTER : CLASS_ELEMENT_INSTANCE_SETTER : CLASS_ELEMENT_OTHER;
+ this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), kind, node.key.start);
+ }
+
+ parsePostMemberNameModifiers(methodOrProp) {}
+
+ parseClassPrivateProperty(node) {
+ this.parseInitializer(node);
+ this.semicolon();
+ return this.finishNode(node, "ClassPrivateProperty");
+ }
+
+ parseClassProperty(node) {
+ this.parseInitializer(node);
+ this.semicolon();
+ return this.finishNode(node, "ClassProperty");
+ }
+
+ parseInitializer(node) {
+ this.scope.enter(SCOPE_CLASS | SCOPE_SUPER);
+ this.expressionScope.enter(newExpressionScope());
+ this.prodParam.enter(PARAM);
+ node.value = this.eat(35) ? this.parseMaybeAssignAllowIn() : null;
+ this.expressionScope.exit();
+ this.prodParam.exit();
+ this.scope.exit();
+ }
+
+ parseClassId(node, isStatement, optionalId, bindingType = BIND_CLASS) {
+ if (this.match(5)) {
+ node.id = this.parseIdentifier();
+
+ if (isStatement) {
+ this.checkLVal(node.id, "class name", bindingType);
+ }
+ } else {
+ if (optionalId || !isStatement) {
+ node.id = null;
+ } else {
+ this.unexpected(null, ErrorMessages.MissingClassName);
+ }
+ }
+ }
+
+ parseClassSuper(node) {
+ node.superClass = this.eat(80) ? this.parseExprSubscripts() : null;
+ }
+
+ parseExport(node) {
+ const hasDefault = this.maybeParseExportDefaultSpecifier(node);
+ const parseAfterDefault = !hasDefault || this.eat(20);
+ const hasStar = parseAfterDefault && this.eatExportStar(node);
+ const hasNamespace = hasStar && this.maybeParseExportNamespaceSpecifier(node);
+ const parseAfterNamespace = parseAfterDefault && (!hasNamespace || this.eat(20));
+ const isFromRequired = hasDefault || hasStar;
+
+ if (hasStar && !hasNamespace) {
+ if (hasDefault) this.unexpected();
+ this.parseExportFrom(node, true);
+ return this.finishNode(node, "ExportAllDeclaration");
+ }
+
+ const hasSpecifiers = this.maybeParseExportNamedSpecifiers(node);
+
+ if (hasDefault && parseAfterDefault && !hasStar && !hasSpecifiers || hasNamespace && parseAfterNamespace && !hasSpecifiers) {
+ throw this.unexpected(null, 13);
+ }
+
+ let hasDeclaration;
+
+ if (isFromRequired || hasSpecifiers) {
+ hasDeclaration = false;
+ this.parseExportFrom(node, isFromRequired);
+ } else {
+ hasDeclaration = this.maybeParseExportDeclaration(node);
+ }
+
+ if (isFromRequired || hasSpecifiers || hasDeclaration) {
+ this.checkExport(node, true, false, !!node.source);
+ return this.finishNode(node, "ExportNamedDeclaration");
+ }
+
+ if (this.eat(64)) {
+ node.declaration = this.parseExportDefaultExpression();
+ this.checkExport(node, true, true);
+ return this.finishNode(node, "ExportDefaultDeclaration");
+ }
+
+ throw this.unexpected(null, 13);
+ }
+
+ eatExportStar(node) {
+ return this.eat(54);
+ }
+
+ maybeParseExportDefaultSpecifier(node) {
+ if (this.isExportDefaultSpecifier()) {
+ this.expectPlugin("exportDefaultFrom");
+ const specifier = this.startNode();
+ specifier.exported = this.parseIdentifier(true);
+ node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")];
+ return true;
+ }
+
+ return false;
+ }
+
+ maybeParseExportNamespaceSpecifier(node) {
+ if (this.isContextual("as")) {
+ if (!node.specifiers) node.specifiers = [];
+ const specifier = this.startNodeAt(this.state.lastTokStart, this.state.lastTokStartLoc);
+ this.next();
+ specifier.exported = this.parseModuleExportName();
+ node.specifiers.push(this.finishNode(specifier, "ExportNamespaceSpecifier"));
+ return true;
+ }
+
+ return false;
+ }
+
+ maybeParseExportNamedSpecifiers(node) {
+ if (this.match(13)) {
+ if (!node.specifiers) node.specifiers = [];
+ node.specifiers.push(...this.parseExportSpecifiers());
+ node.source = null;
+ node.declaration = null;
+ return true;
+ }
+
+ return false;
+ }
+
+ maybeParseExportDeclaration(node) {
+ if (this.shouldParseExportDeclaration()) {
+ node.specifiers = [];
+ node.source = null;
+ node.declaration = this.parseExportDeclaration(node);
+ return true;
+ }
+
+ return false;
+ }
+
+ isAsyncFunction() {
+ if (!this.isContextual("async")) return false;
+ const next = this.nextTokenStart();
+ return !lineBreak.test(this.input.slice(this.state.pos, next)) && this.isUnparsedContextual(next, "function");
+ }
+
+ parseExportDefaultExpression() {
+ const expr = this.startNode();
+ const isAsync = this.isAsyncFunction();
+
+ if (this.match(67) || isAsync) {
+ this.next();
+
+ if (isAsync) {
+ this.next();
+ }
+
+ return this.parseFunction(expr, FUNC_STATEMENT | FUNC_NULLABLE_ID, isAsync);
+ } else if (this.match(79)) {
+ return this.parseClass(expr, true, true);
+ } else if (this.match(32)) {
+ if (this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport")) {
+ this.raise(this.state.start, ErrorMessages.DecoratorBeforeExport);
+ }
+
+ this.parseDecorators(false);
+ return this.parseClass(expr, true, true);
+ } else if (this.match(74) || this.match(73) || this.isLet()) {
+ throw this.raise(this.state.start, ErrorMessages.UnsupportedDefaultExport);
+ } else {
+ const res = this.parseMaybeAssignAllowIn();
+ this.semicolon();
+ return res;
+ }
+ }
+
+ parseExportDeclaration(node) {
+ return this.parseStatement(null);
+ }
+
+ isExportDefaultSpecifier() {
+ if (this.match(5)) {
+ const value = this.state.value;
+
+ if (value === "async" && !this.state.containsEsc || value === "let") {
+ return false;
+ }
+
+ if ((value === "type" || value === "interface") && !this.state.containsEsc) {
+ const l = this.lookahead();
+
+ if (l.type === 5 && l.value !== "from" || l.type === 13) {
+ this.expectOnePlugin(["flow", "typescript"]);
+ return false;
+ }
+ }
+ } else if (!this.match(64)) {
+ return false;
+ }
+
+ const next = this.nextTokenStart();
+ const hasFrom = this.isUnparsedContextual(next, "from");
+
+ if (this.input.charCodeAt(next) === 44 || this.match(5) && hasFrom) {
+ return true;
+ }
+
+ if (this.match(64) && hasFrom) {
+ const nextAfterFrom = this.input.charCodeAt(this.nextTokenStartSince(next + 4));
+ return nextAfterFrom === 34 || nextAfterFrom === 39;
+ }
+
+ return false;
+ }
+
+ parseExportFrom(node, expect) {
+ if (this.eatContextual("from")) {
+ node.source = this.parseImportSource();
+ this.checkExport(node);
+ const assertions = this.maybeParseImportAssertions();
+
+ if (assertions) {
+ node.assertions = assertions;
+ }
+ } else {
+ if (expect) {
+ this.unexpected();
+ } else {
+ node.source = null;
+ }
+ }
+
+ this.semicolon();
+ }
+
+ shouldParseExportDeclaration() {
+ const {
+ type
+ } = this.state;
+
+ if (type === 32) {
+ this.expectOnePlugin(["decorators", "decorators-legacy"]);
+
+ if (this.hasPlugin("decorators")) {
+ if (this.getPluginOption("decorators", "decoratorsBeforeExport")) {
+ this.unexpected(this.state.start, ErrorMessages.DecoratorBeforeExport);
+ } else {
+ return true;
+ }
+ }
+ }
+
+ return type === 73 || type === 74 || type === 67 || type === 79 || this.isLet() || this.isAsyncFunction();
+ }
+
+ checkExport(node, checkNames, isDefault, isFrom) {
+ if (checkNames) {
+ if (isDefault) {
+ this.checkDuplicateExports(node, "default");
+
+ if (this.hasPlugin("exportDefaultFrom")) {
+ var _declaration$extra;
+
+ const declaration = node.declaration;
+
+ if (declaration.type === "Identifier" && declaration.name === "from" && declaration.end - declaration.start === 4 && !((_declaration$extra = declaration.extra) != null && _declaration$extra.parenthesized)) {
+ this.raise(declaration.start, ErrorMessages.ExportDefaultFromAsIdentifier);
+ }
+ }
+ } else if (node.specifiers && node.specifiers.length) {
+ for (const specifier of node.specifiers) {
+ const {
+ exported
+ } = specifier;
+ const exportedName = exported.type === "Identifier" ? exported.name : exported.value;
+ this.checkDuplicateExports(specifier, exportedName);
+
+ if (!isFrom && specifier.local) {
+ const {
+ local
+ } = specifier;
+
+ if (local.type !== "Identifier") {
+ this.raise(specifier.start, ErrorMessages.ExportBindingIsString, local.value, exportedName);
+ } else {
+ this.checkReservedWord(local.name, local.start, true, false);
+ this.scope.checkLocalExport(local);
+ }
+ }
+ }
+ } else if (node.declaration) {
+ if (node.declaration.type === "FunctionDeclaration" || node.declaration.type === "ClassDeclaration") {
+ const id = node.declaration.id;
+ if (!id) throw new Error("Assertion failure");
+ this.checkDuplicateExports(node, id.name);
+ } else if (node.declaration.type === "VariableDeclaration") {
+ for (const declaration of node.declaration.declarations) {
+ this.checkDeclaration(declaration.id);
+ }
+ }
+ }
+ }
+
+ const currentContextDecorators = this.state.decoratorStack[this.state.decoratorStack.length - 1];
+
+ if (currentContextDecorators.length) {
+ throw this.raise(node.start, ErrorMessages.UnsupportedDecoratorExport);
+ }
+ }
+
+ checkDeclaration(node) {
+ if (node.type === "Identifier") {
+ this.checkDuplicateExports(node, node.name);
+ } else if (node.type === "ObjectPattern") {
+ for (const prop of node.properties) {
+ this.checkDeclaration(prop);
+ }
+ } else if (node.type === "ArrayPattern") {
+ for (const elem of node.elements) {
+ if (elem) {
+ this.checkDeclaration(elem);
+ }
+ }
+ } else if (node.type === "ObjectProperty") {
+ this.checkDeclaration(node.value);
+ } else if (node.type === "RestElement") {
+ this.checkDeclaration(node.argument);
+ } else if (node.type === "AssignmentPattern") {
+ this.checkDeclaration(node.left);
+ }
+ }
+
+ checkDuplicateExports(node, name) {
+ if (this.exportedIdentifiers.has(name)) {
+ this.raise(node.start, name === "default" ? ErrorMessages.DuplicateDefaultExport : ErrorMessages.DuplicateExport, name);
+ }
+
+ this.exportedIdentifiers.add(name);
+ }
+
+ parseExportSpecifiers() {
+ const nodes = [];
+ let first = true;
+ this.expect(13);
+
+ while (!this.eat(16)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(20);
+ if (this.eat(16)) break;
+ }
+
+ const node = this.startNode();
+ const isString = this.match(4);
+ const local = this.parseModuleExportName();
+ node.local = local;
+
+ if (this.eatContextual("as")) {
+ node.exported = this.parseModuleExportName();
+ } else if (isString) {
+ node.exported = cloneStringLiteral(local);
+ } else {
+ node.exported = cloneIdentifier(local);
+ }
+
+ nodes.push(this.finishNode(node, "ExportSpecifier"));
+ }
+
+ return nodes;
+ }
+
+ parseModuleExportName() {
+ if (this.match(4)) {
+ const result = this.parseStringLiteral(this.state.value);
+ const surrogate = result.value.match(loneSurrogate);
+
+ if (surrogate) {
+ this.raise(result.start, ErrorMessages.ModuleExportNameHasLoneSurrogate, surrogate[0].charCodeAt(0).toString(16));
+ }
+
+ return result;
+ }
+
+ return this.parseIdentifier(true);
+ }
+
+ parseImport(node) {
+ node.specifiers = [];
+
+ if (!this.match(4)) {
+ const hasDefault = this.maybeParseDefaultImportSpecifier(node);
+ const parseNext = !hasDefault || this.eat(20);
+ const hasStar = parseNext && this.maybeParseStarImportSpecifier(node);
+ if (parseNext && !hasStar) this.parseNamedImportSpecifiers(node);
+ this.expectContextual("from");
+ }
+
+ node.source = this.parseImportSource();
+ const assertions = this.maybeParseImportAssertions();
+
+ if (assertions) {
+ node.assertions = assertions;
+ } else {
+ const attributes = this.maybeParseModuleAttributes();
+
+ if (attributes) {
+ node.attributes = attributes;
+ }
+ }
+
+ this.semicolon();
+ return this.finishNode(node, "ImportDeclaration");
+ }
+
+ parseImportSource() {
+ if (!this.match(4)) this.unexpected();
+ return this.parseExprAtom();
+ }
+
+ shouldParseDefaultImport(node) {
+ return this.match(5);
+ }
+
+ parseImportSpecifierLocal(node, specifier, type, contextDescription) {
+ specifier.local = this.parseIdentifier();
+ this.checkLVal(specifier.local, contextDescription, BIND_LEXICAL);
+ node.specifiers.push(this.finishNode(specifier, type));
+ }
+
+ parseAssertEntries() {
+ const attrs = [];
+ const attrNames = new Set();
+
+ do {
+ if (this.match(16)) {
+ break;
+ }
+
+ const node = this.startNode();
+ const keyName = this.state.value;
+
+ if (attrNames.has(keyName)) {
+ this.raise(this.state.start, ErrorMessages.ModuleAttributesWithDuplicateKeys, keyName);
+ }
+
+ attrNames.add(keyName);
+
+ if (this.match(4)) {
+ node.key = this.parseStringLiteral(keyName);
+ } else {
+ node.key = this.parseIdentifier(true);
+ }
+
+ this.expect(22);
+
+ if (!this.match(4)) {
+ throw this.unexpected(this.state.start, ErrorMessages.ModuleAttributeInvalidValue);
+ }
+
+ node.value = this.parseStringLiteral(this.state.value);
+ this.finishNode(node, "ImportAttribute");
+ attrs.push(node);
+ } while (this.eat(20));
+
+ return attrs;
+ }
+
+ maybeParseModuleAttributes() {
+ if (this.match(75) && !this.hasPrecedingLineBreak()) {
+ this.expectPlugin("moduleAttributes");
+ this.next();
+ } else {
+ if (this.hasPlugin("moduleAttributes")) return [];
+ return null;
+ }
+
+ const attrs = [];
+ const attributes = new Set();
+
+ do {
+ const node = this.startNode();
+ node.key = this.parseIdentifier(true);
+
+ if (node.key.name !== "type") {
+ this.raise(node.key.start, ErrorMessages.ModuleAttributeDifferentFromType, node.key.name);
+ }
+
+ if (attributes.has(node.key.name)) {
+ this.raise(node.key.start, ErrorMessages.ModuleAttributesWithDuplicateKeys, node.key.name);
+ }
+
+ attributes.add(node.key.name);
+ this.expect(22);
+
+ if (!this.match(4)) {
+ throw this.unexpected(this.state.start, ErrorMessages.ModuleAttributeInvalidValue);
+ }
+
+ node.value = this.parseStringLiteral(this.state.value);
+ this.finishNode(node, "ImportAttribute");
+ attrs.push(node);
+ } while (this.eat(20));
+
+ return attrs;
+ }
+
+ maybeParseImportAssertions() {
+ if (this.isContextual("assert") && !this.hasPrecedingLineBreak()) {
+ this.expectPlugin("importAssertions");
+ this.next();
+ } else {
+ if (this.hasPlugin("importAssertions")) return [];
+ return null;
+ }
+
+ this.eat(13);
+ const attrs = this.parseAssertEntries();
+ this.eat(16);
+ return attrs;
+ }
+
+ maybeParseDefaultImportSpecifier(node) {
+ if (this.shouldParseDefaultImport(node)) {
+ this.parseImportSpecifierLocal(node, this.startNode(), "ImportDefaultSpecifier", "default import specifier");
+ return true;
+ }
+
+ return false;
+ }
+
+ maybeParseStarImportSpecifier(node) {
+ if (this.match(54)) {
+ const specifier = this.startNode();
+ this.next();
+ this.expectContextual("as");
+ this.parseImportSpecifierLocal(node, specifier, "ImportNamespaceSpecifier", "import namespace specifier");
+ return true;
+ }
+
+ return false;
+ }
+
+ parseNamedImportSpecifiers(node) {
+ let first = true;
+ this.expect(13);
+
+ while (!this.eat(16)) {
+ if (first) {
+ first = false;
+ } else {
+ if (this.eat(22)) {
+ throw this.raise(this.state.start, ErrorMessages.DestructureNamedImport);
+ }
+
+ this.expect(20);
+ if (this.eat(16)) break;
+ }
+
+ this.parseImportSpecifier(node);
+ }
+ }
+
+ parseImportSpecifier(node) {
+ const specifier = this.startNode();
+ const importedIsString = this.match(4);
+ specifier.imported = this.parseModuleExportName();
+
+ if (this.eatContextual("as")) {
+ specifier.local = this.parseIdentifier();
+ } else {
+ const {
+ imported
+ } = specifier;
+
+ if (importedIsString) {
+ throw this.raise(specifier.start, ErrorMessages.ImportBindingIsString, imported.value);
+ }
+
+ this.checkReservedWord(imported.name, specifier.start, true, true);
+ specifier.local = cloneIdentifier(imported);
+ }
+
+ this.checkLVal(specifier.local, "import specifier", BIND_LEXICAL);
+ node.specifiers.push(this.finishNode(specifier, "ImportSpecifier"));
+ }
+
+ isThisParam(param) {
+ return param.type === "Identifier" && param.name === "this";
+ }
+
+}
+
+class Parser extends StatementParser {
+ constructor(options, input) {
+ options = getOptions(options);
+ super(options, input);
+ this.options = options;
+ this.initializeScopes();
+ this.plugins = pluginsMap(this.options.plugins);
+ this.filename = options.sourceFilename;
+ }
+
+ getScopeHandler() {
+ return ScopeHandler;
+ }
+
+ parse() {
+ this.enterInitialScopes();
+ const file = this.startNode();
+ const program = this.startNode();
+ this.nextToken();
+ file.errors = null;
+ this.parseTopLevel(file, program);
+ file.errors = this.state.errors;
+ return file;
+ }
+
+}
+
+function pluginsMap(plugins) {
+ const pluginMap = new Map();
+
+ for (const plugin of plugins) {
+ const [name, options] = Array.isArray(plugin) ? plugin : [plugin, {}];
+ if (!pluginMap.has(name)) pluginMap.set(name, options || {});
+ }
+
+ return pluginMap;
+}
+
+function parse(input, options) {
+ var _options;
+
+ if (((_options = options) == null ? void 0 : _options.sourceType) === "unambiguous") {
+ options = Object.assign({}, options);
+
+ try {
+ options.sourceType = "module";
+ const parser = getParser(options, input);
+ const ast = parser.parse();
+
+ if (parser.sawUnambiguousESM) {
+ return ast;
+ }
+
+ if (parser.ambiguousScriptDifferentAst) {
+ try {
+ options.sourceType = "script";
+ return getParser(options, input).parse();
+ } catch (_unused) {}
+ } else {
+ ast.program.sourceType = "script";
+ }
+
+ return ast;
+ } catch (moduleError) {
+ try {
+ options.sourceType = "script";
+ return getParser(options, input).parse();
+ } catch (_unused2) {}
+
+ throw moduleError;
+ }
+ } else {
+ return getParser(options, input).parse();
+ }
+}
+function parseExpression(input, options) {
+ const parser = getParser(options, input);
+
+ if (parser.options.strictMode) {
+ parser.state.strict = true;
+ }
+
+ return parser.getExpression();
+}
+
+function generateExportedTokenTypes(internalTokenTypes) {
+ const tokenTypes = {};
+
+ for (const typeName of Object.keys(internalTokenTypes)) {
+ tokenTypes[typeName] = getExportedToken(internalTokenTypes[typeName]);
+ }
+
+ return tokenTypes;
+}
+
+const tokTypes = generateExportedTokenTypes(tt);
+
+function getParser(options, input) {
+ let cls = Parser;
+
+ if (options != null && options.plugins) {
+ validatePlugins(options.plugins);
+ cls = getParserClass(options.plugins);
+ }
+
+ return new cls(options, input);
+}
+
+const parserClassCache = {};
+
+function getParserClass(pluginsFromOptions) {
+ const pluginList = mixinPluginNames.filter(name => hasPlugin(pluginsFromOptions, name));
+ const key = pluginList.join("/");
+ let cls = parserClassCache[key];
+
+ if (!cls) {
+ cls = Parser;
+
+ for (const plugin of pluginList) {
+ cls = mixinPlugins[plugin](cls);
+ }
+
+ parserClassCache[key] = cls;
+ }
+
+ return cls;
+}
+
+exports.parse = parse;
+exports.parseExpression = parseExpression;
+exports.tokTypes = tokTypes;
+//# sourceMappingURL=index.js.map
diff --git a/chromium/third_party/node/node_modules/@babel/parser/package.json b/chromium/third_party/node/node_modules/@babel/parser/package.json
new file mode 100644
index 00000000000..d2ef82f707b
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/parser/package.json
@@ -0,0 +1,42 @@
+{
+ "name": "@babel/parser",
+ "version": "7.15.7",
+ "description": "A JavaScript parser",
+ "author": "The Babel Team (https://babel.dev/team)",
+ "homepage": "https://babel.dev/docs/en/next/babel-parser",
+ "bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A+parser+%28babylon%29%22+is%3Aopen",
+ "license": "MIT",
+ "publishConfig": {
+ "access": "public"
+ },
+ "keywords": [
+ "babel",
+ "javascript",
+ "parser",
+ "tc39",
+ "ecmascript",
+ "@babel/parser"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/babel/babel.git",
+ "directory": "packages/babel-parser"
+ },
+ "main": "./lib/index.js",
+ "types": "./typings/babel-parser.d.ts",
+ "files": [
+ "bin",
+ "lib",
+ "typings"
+ ],
+ "engines": {
+ "node": ">=6.0.0"
+ },
+ "devDependencies": {
+ "@babel/code-frame": "7.14.5",
+ "@babel/helper-fixtures": "7.14.5",
+ "@babel/helper-validator-identifier": "7.15.7",
+ "charcodes": "^0.2.0"
+ },
+ "bin": "./bin/babel-parser.js"
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/template/LICENSE b/chromium/third_party/node/node_modules/@babel/template/LICENSE
new file mode 100644
index 00000000000..f31575ec773
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/template/LICENSE
@@ -0,0 +1,22 @@
+MIT License
+
+Copyright (c) 2014-present Sebastian McKenzie and other contributors
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/chromium/third_party/node/node_modules/@babel/template/lib/builder.js b/chromium/third_party/node/node_modules/@babel/template/lib/builder.js
new file mode 100644
index 00000000000..e65b27d77c7
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/template/lib/builder.js
@@ -0,0 +1,81 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = createTemplateBuilder;
+
+var _options = require("./options");
+
+var _string = require("./string");
+
+var _literal = require("./literal");
+
+const NO_PLACEHOLDER = (0, _options.validate)({
+ placeholderPattern: false
+});
+
+function createTemplateBuilder(formatter, defaultOpts) {
+ const templateFnCache = new WeakMap();
+ const templateAstCache = new WeakMap();
+ const cachedOpts = defaultOpts || (0, _options.validate)(null);
+ return Object.assign((tpl, ...args) => {
+ if (typeof tpl === "string") {
+ if (args.length > 1) throw new Error("Unexpected extra params.");
+ return extendedTrace((0, _string.default)(formatter, tpl, (0, _options.merge)(cachedOpts, (0, _options.validate)(args[0]))));
+ } else if (Array.isArray(tpl)) {
+ let builder = templateFnCache.get(tpl);
+
+ if (!builder) {
+ builder = (0, _literal.default)(formatter, tpl, cachedOpts);
+ templateFnCache.set(tpl, builder);
+ }
+
+ return extendedTrace(builder(args));
+ } else if (typeof tpl === "object" && tpl) {
+ if (args.length > 0) throw new Error("Unexpected extra params.");
+ return createTemplateBuilder(formatter, (0, _options.merge)(cachedOpts, (0, _options.validate)(tpl)));
+ }
+
+ throw new Error(`Unexpected template param ${typeof tpl}`);
+ }, {
+ ast: (tpl, ...args) => {
+ if (typeof tpl === "string") {
+ if (args.length > 1) throw new Error("Unexpected extra params.");
+ return (0, _string.default)(formatter, tpl, (0, _options.merge)((0, _options.merge)(cachedOpts, (0, _options.validate)(args[0])), NO_PLACEHOLDER))();
+ } else if (Array.isArray(tpl)) {
+ let builder = templateAstCache.get(tpl);
+
+ if (!builder) {
+ builder = (0, _literal.default)(formatter, tpl, (0, _options.merge)(cachedOpts, NO_PLACEHOLDER));
+ templateAstCache.set(tpl, builder);
+ }
+
+ return builder(args)();
+ }
+
+ throw new Error(`Unexpected template param ${typeof tpl}`);
+ }
+ });
+}
+
+function extendedTrace(fn) {
+ let rootStack = "";
+
+ try {
+ throw new Error();
+ } catch (error) {
+ if (error.stack) {
+ rootStack = error.stack.split("\n").slice(3).join("\n");
+ }
+ }
+
+ return arg => {
+ try {
+ return fn(arg);
+ } catch (err) {
+ err.stack += `\n =============\n${rootStack}`;
+ throw err;
+ }
+ };
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/template/lib/formatters.js b/chromium/third_party/node/node_modules/@babel/template/lib/formatters.js
new file mode 100644
index 00000000000..addc6fee6b6
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/template/lib/formatters.js
@@ -0,0 +1,71 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.program = exports.expression = exports.statement = exports.statements = exports.smart = void 0;
+
+var _t = require("@babel/types");
+
+const {
+ assertExpressionStatement
+} = _t;
+
+function makeStatementFormatter(fn) {
+ return {
+ code: str => `/* @babel/template */;\n${str}`,
+ validate: () => {},
+ unwrap: ast => {
+ return fn(ast.program.body.slice(1));
+ }
+ };
+}
+
+const smart = makeStatementFormatter(body => {
+ if (body.length > 1) {
+ return body;
+ } else {
+ return body[0];
+ }
+});
+exports.smart = smart;
+const statements = makeStatementFormatter(body => body);
+exports.statements = statements;
+const statement = makeStatementFormatter(body => {
+ if (body.length === 0) {
+ throw new Error("Found nothing to return.");
+ }
+
+ if (body.length > 1) {
+ throw new Error("Found multiple statements but wanted one");
+ }
+
+ return body[0];
+});
+exports.statement = statement;
+const expression = {
+ code: str => `(\n${str}\n)`,
+ validate: ast => {
+ if (ast.program.body.length > 1) {
+ throw new Error("Found multiple statements but wanted one");
+ }
+
+ if (expression.unwrap(ast).start === 0) {
+ throw new Error("Parse result included parens.");
+ }
+ },
+ unwrap: ({
+ program
+ }) => {
+ const [stmt] = program.body;
+ assertExpressionStatement(stmt);
+ return stmt.expression;
+ }
+};
+exports.expression = expression;
+const program = {
+ code: str => str,
+ validate: () => {},
+ unwrap: ast => ast.program
+};
+exports.program = program; \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/template/lib/index.js b/chromium/third_party/node/node_modules/@babel/template/lib/index.js
new file mode 100644
index 00000000000..1a673a19bd4
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/template/lib/index.js
@@ -0,0 +1,32 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = exports.program = exports.expression = exports.statements = exports.statement = exports.smart = void 0;
+
+var formatters = require("./formatters");
+
+var _builder = require("./builder");
+
+const smart = (0, _builder.default)(formatters.smart);
+exports.smart = smart;
+const statement = (0, _builder.default)(formatters.statement);
+exports.statement = statement;
+const statements = (0, _builder.default)(formatters.statements);
+exports.statements = statements;
+const expression = (0, _builder.default)(formatters.expression);
+exports.expression = expression;
+const program = (0, _builder.default)(formatters.program);
+exports.program = program;
+
+var _default = Object.assign(smart.bind(undefined), {
+ smart,
+ statement,
+ statements,
+ expression,
+ program,
+ ast: smart.ast
+});
+
+exports.default = _default; \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/template/lib/literal.js b/chromium/third_party/node/node_modules/@babel/template/lib/literal.js
new file mode 100644
index 00000000000..fd194c6abb0
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/template/lib/literal.js
@@ -0,0 +1,80 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = literalTemplate;
+
+var _options = require("./options");
+
+var _parse = require("./parse");
+
+var _populate = require("./populate");
+
+function literalTemplate(formatter, tpl, opts) {
+ const {
+ metadata,
+ names
+ } = buildLiteralData(formatter, tpl, opts);
+ return arg => {
+ const defaultReplacements = {};
+ arg.forEach((replacement, i) => {
+ defaultReplacements[names[i]] = replacement;
+ });
+ return arg => {
+ const replacements = (0, _options.normalizeReplacements)(arg);
+
+ if (replacements) {
+ Object.keys(replacements).forEach(key => {
+ if (Object.prototype.hasOwnProperty.call(defaultReplacements, key)) {
+ throw new Error("Unexpected replacement overlap.");
+ }
+ });
+ }
+
+ return formatter.unwrap((0, _populate.default)(metadata, replacements ? Object.assign(replacements, defaultReplacements) : defaultReplacements));
+ };
+ };
+}
+
+function buildLiteralData(formatter, tpl, opts) {
+ let names;
+ let nameSet;
+ let metadata;
+ let prefix = "";
+
+ do {
+ prefix += "$";
+ const result = buildTemplateCode(tpl, prefix);
+ names = result.names;
+ nameSet = new Set(names);
+ metadata = (0, _parse.default)(formatter, formatter.code(result.code), {
+ parser: opts.parser,
+ placeholderWhitelist: new Set(result.names.concat(opts.placeholderWhitelist ? Array.from(opts.placeholderWhitelist) : [])),
+ placeholderPattern: opts.placeholderPattern,
+ preserveComments: opts.preserveComments,
+ syntacticPlaceholders: opts.syntacticPlaceholders
+ });
+ } while (metadata.placeholders.some(placeholder => placeholder.isDuplicate && nameSet.has(placeholder.name)));
+
+ return {
+ metadata,
+ names
+ };
+}
+
+function buildTemplateCode(tpl, prefix) {
+ const names = [];
+ let code = tpl[0];
+
+ for (let i = 1; i < tpl.length; i++) {
+ const value = `${prefix}${i - 1}`;
+ names.push(value);
+ code += value + tpl[i];
+ }
+
+ return {
+ names,
+ code
+ };
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/template/lib/options.js b/chromium/third_party/node/node_modules/@babel/template/lib/options.js
new file mode 100644
index 00000000000..1bb4fcbeed0
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/template/lib/options.js
@@ -0,0 +1,83 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.merge = merge;
+exports.validate = validate;
+exports.normalizeReplacements = normalizeReplacements;
+const _excluded = ["placeholderWhitelist", "placeholderPattern", "preserveComments", "syntacticPlaceholders"];
+
+function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
+
+function merge(a, b) {
+ const {
+ placeholderWhitelist = a.placeholderWhitelist,
+ placeholderPattern = a.placeholderPattern,
+ preserveComments = a.preserveComments,
+ syntacticPlaceholders = a.syntacticPlaceholders
+ } = b;
+ return {
+ parser: Object.assign({}, a.parser, b.parser),
+ placeholderWhitelist,
+ placeholderPattern,
+ preserveComments,
+ syntacticPlaceholders
+ };
+}
+
+function validate(opts) {
+ if (opts != null && typeof opts !== "object") {
+ throw new Error("Unknown template options.");
+ }
+
+ const _ref = opts || {},
+ {
+ placeholderWhitelist,
+ placeholderPattern,
+ preserveComments,
+ syntacticPlaceholders
+ } = _ref,
+ parser = _objectWithoutPropertiesLoose(_ref, _excluded);
+
+ if (placeholderWhitelist != null && !(placeholderWhitelist instanceof Set)) {
+ throw new Error("'.placeholderWhitelist' must be a Set, null, or undefined");
+ }
+
+ if (placeholderPattern != null && !(placeholderPattern instanceof RegExp) && placeholderPattern !== false) {
+ throw new Error("'.placeholderPattern' must be a RegExp, false, null, or undefined");
+ }
+
+ if (preserveComments != null && typeof preserveComments !== "boolean") {
+ throw new Error("'.preserveComments' must be a boolean, null, or undefined");
+ }
+
+ if (syntacticPlaceholders != null && typeof syntacticPlaceholders !== "boolean") {
+ throw new Error("'.syntacticPlaceholders' must be a boolean, null, or undefined");
+ }
+
+ if (syntacticPlaceholders === true && (placeholderWhitelist != null || placeholderPattern != null)) {
+ throw new Error("'.placeholderWhitelist' and '.placeholderPattern' aren't compatible" + " with '.syntacticPlaceholders: true'");
+ }
+
+ return {
+ parser,
+ placeholderWhitelist: placeholderWhitelist || undefined,
+ placeholderPattern: placeholderPattern == null ? undefined : placeholderPattern,
+ preserveComments: preserveComments == null ? undefined : preserveComments,
+ syntacticPlaceholders: syntacticPlaceholders == null ? undefined : syntacticPlaceholders
+ };
+}
+
+function normalizeReplacements(replacements) {
+ if (Array.isArray(replacements)) {
+ return replacements.reduce((acc, replacement, i) => {
+ acc["$" + i] = replacement;
+ return acc;
+ }, {});
+ } else if (typeof replacements === "object" || replacements == null) {
+ return replacements || undefined;
+ }
+
+ throw new Error("Template replacements must be an array, object, null, or undefined");
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/template/lib/parse.js b/chromium/third_party/node/node_modules/@babel/template/lib/parse.js
new file mode 100644
index 00000000000..0d42ed435b3
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/template/lib/parse.js
@@ -0,0 +1,188 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = parseAndBuildMetadata;
+
+var _t = require("@babel/types");
+
+var _parser = require("@babel/parser");
+
+var _codeFrame = require("@babel/code-frame");
+
+const {
+ isCallExpression,
+ isExpressionStatement,
+ isFunction,
+ isIdentifier,
+ isJSXIdentifier,
+ isNewExpression,
+ isPlaceholder,
+ isStatement,
+ isStringLiteral,
+ removePropertiesDeep,
+ traverse
+} = _t;
+const PATTERN = /^[_$A-Z0-9]+$/;
+
+function parseAndBuildMetadata(formatter, code, opts) {
+ const {
+ placeholderWhitelist,
+ placeholderPattern,
+ preserveComments,
+ syntacticPlaceholders
+ } = opts;
+ const ast = parseWithCodeFrame(code, opts.parser, syntacticPlaceholders);
+ removePropertiesDeep(ast, {
+ preserveComments
+ });
+ formatter.validate(ast);
+ const syntactic = {
+ placeholders: [],
+ placeholderNames: new Set()
+ };
+ const legacy = {
+ placeholders: [],
+ placeholderNames: new Set()
+ };
+ const isLegacyRef = {
+ value: undefined
+ };
+ traverse(ast, placeholderVisitorHandler, {
+ syntactic,
+ legacy,
+ isLegacyRef,
+ placeholderWhitelist,
+ placeholderPattern,
+ syntacticPlaceholders
+ });
+ return Object.assign({
+ ast
+ }, isLegacyRef.value ? legacy : syntactic);
+}
+
+function placeholderVisitorHandler(node, ancestors, state) {
+ var _state$placeholderWhi;
+
+ let name;
+
+ if (isPlaceholder(node)) {
+ if (state.syntacticPlaceholders === false) {
+ throw new Error("%%foo%%-style placeholders can't be used when " + "'.syntacticPlaceholders' is false.");
+ } else {
+ name = node.name.name;
+ state.isLegacyRef.value = false;
+ }
+ } else if (state.isLegacyRef.value === false || state.syntacticPlaceholders) {
+ return;
+ } else if (isIdentifier(node) || isJSXIdentifier(node)) {
+ name = node.name;
+ state.isLegacyRef.value = true;
+ } else if (isStringLiteral(node)) {
+ name = node.value;
+ state.isLegacyRef.value = true;
+ } else {
+ return;
+ }
+
+ if (!state.isLegacyRef.value && (state.placeholderPattern != null || state.placeholderWhitelist != null)) {
+ throw new Error("'.placeholderWhitelist' and '.placeholderPattern' aren't compatible" + " with '.syntacticPlaceholders: true'");
+ }
+
+ if (state.isLegacyRef.value && (state.placeholderPattern === false || !(state.placeholderPattern || PATTERN).test(name)) && !((_state$placeholderWhi = state.placeholderWhitelist) != null && _state$placeholderWhi.has(name))) {
+ return;
+ }
+
+ ancestors = ancestors.slice();
+ const {
+ node: parent,
+ key
+ } = ancestors[ancestors.length - 1];
+ let type;
+
+ if (isStringLiteral(node) || isPlaceholder(node, {
+ expectedNode: "StringLiteral"
+ })) {
+ type = "string";
+ } else if (isNewExpression(parent) && key === "arguments" || isCallExpression(parent) && key === "arguments" || isFunction(parent) && key === "params") {
+ type = "param";
+ } else if (isExpressionStatement(parent) && !isPlaceholder(node)) {
+ type = "statement";
+ ancestors = ancestors.slice(0, -1);
+ } else if (isStatement(node) && isPlaceholder(node)) {
+ type = "statement";
+ } else {
+ type = "other";
+ }
+
+ const {
+ placeholders,
+ placeholderNames
+ } = state.isLegacyRef.value ? state.legacy : state.syntactic;
+ placeholders.push({
+ name,
+ type,
+ resolve: ast => resolveAncestors(ast, ancestors),
+ isDuplicate: placeholderNames.has(name)
+ });
+ placeholderNames.add(name);
+}
+
+function resolveAncestors(ast, ancestors) {
+ let parent = ast;
+
+ for (let i = 0; i < ancestors.length - 1; i++) {
+ const {
+ key,
+ index
+ } = ancestors[i];
+
+ if (index === undefined) {
+ parent = parent[key];
+ } else {
+ parent = parent[key][index];
+ }
+ }
+
+ const {
+ key,
+ index
+ } = ancestors[ancestors.length - 1];
+ return {
+ parent,
+ key,
+ index
+ };
+}
+
+function parseWithCodeFrame(code, parserOpts, syntacticPlaceholders) {
+ const plugins = (parserOpts.plugins || []).slice();
+
+ if (syntacticPlaceholders !== false) {
+ plugins.push("placeholders");
+ }
+
+ parserOpts = Object.assign({
+ allowReturnOutsideFunction: true,
+ allowSuperOutsideMethod: true,
+ sourceType: "module"
+ }, parserOpts, {
+ plugins
+ });
+
+ try {
+ return (0, _parser.parse)(code, parserOpts);
+ } catch (err) {
+ const loc = err.loc;
+
+ if (loc) {
+ err.message += "\n" + (0, _codeFrame.codeFrameColumns)(code, {
+ start: loc
+ });
+ err.code = "BABEL_TEMPLATE_PARSE_ERROR";
+ }
+
+ throw err;
+ }
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/template/lib/populate.js b/chromium/third_party/node/node_modules/@babel/template/lib/populate.js
new file mode 100644
index 00000000000..b9125564b71
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/template/lib/populate.js
@@ -0,0 +1,135 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = populatePlaceholders;
+
+var _t = require("@babel/types");
+
+const {
+ blockStatement,
+ cloneNode,
+ emptyStatement,
+ expressionStatement,
+ identifier,
+ isStatement,
+ isStringLiteral,
+ stringLiteral,
+ validate
+} = _t;
+
+function populatePlaceholders(metadata, replacements) {
+ const ast = cloneNode(metadata.ast);
+
+ if (replacements) {
+ metadata.placeholders.forEach(placeholder => {
+ if (!Object.prototype.hasOwnProperty.call(replacements, placeholder.name)) {
+ const placeholderName = placeholder.name;
+ throw new Error(`Error: No substitution given for "${placeholderName}". If this is not meant to be a
+ placeholder you may want to consider passing one of the following options to @babel/template:
+ - { placeholderPattern: false, placeholderWhitelist: new Set(['${placeholderName}'])}
+ - { placeholderPattern: /^${placeholderName}$/ }`);
+ }
+ });
+ Object.keys(replacements).forEach(key => {
+ if (!metadata.placeholderNames.has(key)) {
+ throw new Error(`Unknown substitution "${key}" given`);
+ }
+ });
+ }
+
+ metadata.placeholders.slice().reverse().forEach(placeholder => {
+ try {
+ applyReplacement(placeholder, ast, replacements && replacements[placeholder.name] || null);
+ } catch (e) {
+ e.message = `@babel/template placeholder "${placeholder.name}": ${e.message}`;
+ throw e;
+ }
+ });
+ return ast;
+}
+
+function applyReplacement(placeholder, ast, replacement) {
+ if (placeholder.isDuplicate) {
+ if (Array.isArray(replacement)) {
+ replacement = replacement.map(node => cloneNode(node));
+ } else if (typeof replacement === "object") {
+ replacement = cloneNode(replacement);
+ }
+ }
+
+ const {
+ parent,
+ key,
+ index
+ } = placeholder.resolve(ast);
+
+ if (placeholder.type === "string") {
+ if (typeof replacement === "string") {
+ replacement = stringLiteral(replacement);
+ }
+
+ if (!replacement || !isStringLiteral(replacement)) {
+ throw new Error("Expected string substitution");
+ }
+ } else if (placeholder.type === "statement") {
+ if (index === undefined) {
+ if (!replacement) {
+ replacement = emptyStatement();
+ } else if (Array.isArray(replacement)) {
+ replacement = blockStatement(replacement);
+ } else if (typeof replacement === "string") {
+ replacement = expressionStatement(identifier(replacement));
+ } else if (!isStatement(replacement)) {
+ replacement = expressionStatement(replacement);
+ }
+ } else {
+ if (replacement && !Array.isArray(replacement)) {
+ if (typeof replacement === "string") {
+ replacement = identifier(replacement);
+ }
+
+ if (!isStatement(replacement)) {
+ replacement = expressionStatement(replacement);
+ }
+ }
+ }
+ } else if (placeholder.type === "param") {
+ if (typeof replacement === "string") {
+ replacement = identifier(replacement);
+ }
+
+ if (index === undefined) throw new Error("Assertion failure.");
+ } else {
+ if (typeof replacement === "string") {
+ replacement = identifier(replacement);
+ }
+
+ if (Array.isArray(replacement)) {
+ throw new Error("Cannot replace single expression with an array.");
+ }
+ }
+
+ if (index === undefined) {
+ validate(parent, key, replacement);
+ parent[key] = replacement;
+ } else {
+ const items = parent[key].slice();
+
+ if (placeholder.type === "statement" || placeholder.type === "param") {
+ if (replacement == null) {
+ items.splice(index, 1);
+ } else if (Array.isArray(replacement)) {
+ items.splice(index, 1, ...replacement);
+ } else {
+ items[index] = replacement;
+ }
+ } else {
+ items[index] = replacement;
+ }
+
+ validate(parent, key, items);
+ parent[key] = items;
+ }
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/template/lib/string.js b/chromium/third_party/node/node_modules/@babel/template/lib/string.js
new file mode 100644
index 00000000000..fa8aade5313
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/template/lib/string.js
@@ -0,0 +1,22 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = stringTemplate;
+
+var _options = require("./options");
+
+var _parse = require("./parse");
+
+var _populate = require("./populate");
+
+function stringTemplate(formatter, code, opts) {
+ code = formatter.code(code);
+ let metadata;
+ return arg => {
+ const replacements = (0, _options.normalizeReplacements)(arg);
+ if (!metadata) metadata = (0, _parse.default)(formatter, code, opts);
+ return formatter.unwrap((0, _populate.default)(metadata, replacements));
+ };
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/template/package.json b/chromium/third_party/node/node_modules/@babel/template/package.json
new file mode 100644
index 00000000000..0a43a23a8c4
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/template/package.json
@@ -0,0 +1,26 @@
+{
+ "name": "@babel/template",
+ "version": "7.15.4",
+ "description": "Generate an AST from a string template.",
+ "author": "The Babel Team (https://babel.dev/team)",
+ "homepage": "https://babel.dev/docs/en/next/babel-template",
+ "bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20template%22+is%3Aopen",
+ "license": "MIT",
+ "publishConfig": {
+ "access": "public"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/babel/babel.git",
+ "directory": "packages/babel-template"
+ },
+ "main": "./lib/index.js",
+ "dependencies": {
+ "@babel/code-frame": "^7.14.5",
+ "@babel/parser": "^7.15.4",
+ "@babel/types": "^7.15.4"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/traverse/LICENSE b/chromium/third_party/node/node_modules/@babel/traverse/LICENSE
new file mode 100644
index 00000000000..f31575ec773
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/traverse/LICENSE
@@ -0,0 +1,22 @@
+MIT License
+
+Copyright (c) 2014-present Sebastian McKenzie and other contributors
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/chromium/third_party/node/node_modules/@babel/traverse/lib/cache.js b/chromium/third_party/node/node_modules/@babel/traverse/lib/cache.js
new file mode 100644
index 00000000000..89f200777be
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/traverse/lib/cache.js
@@ -0,0 +1,26 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.clear = clear;
+exports.clearPath = clearPath;
+exports.clearScope = clearScope;
+exports.scope = exports.path = void 0;
+let path = new WeakMap();
+exports.path = path;
+let scope = new WeakMap();
+exports.scope = scope;
+
+function clear() {
+ clearPath();
+ clearScope();
+}
+
+function clearPath() {
+ exports.path = path = new WeakMap();
+}
+
+function clearScope() {
+ exports.scope = scope = new WeakMap();
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/traverse/lib/context.js b/chromium/third_party/node/node_modules/@babel/traverse/lib/context.js
new file mode 100644
index 00000000000..25e2e0a7501
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/traverse/lib/context.js
@@ -0,0 +1,137 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = void 0;
+
+var _path = require("./path");
+
+var _t = require("@babel/types");
+
+const {
+ VISITOR_KEYS
+} = _t;
+
+class TraversalContext {
+ constructor(scope, opts, state, parentPath) {
+ this.queue = null;
+ this.priorityQueue = null;
+ this.parentPath = parentPath;
+ this.scope = scope;
+ this.state = state;
+ this.opts = opts;
+ }
+
+ shouldVisit(node) {
+ const opts = this.opts;
+ if (opts.enter || opts.exit) return true;
+ if (opts[node.type]) return true;
+ const keys = VISITOR_KEYS[node.type];
+ if (!(keys != null && keys.length)) return false;
+
+ for (const key of keys) {
+ if (node[key]) return true;
+ }
+
+ return false;
+ }
+
+ create(node, obj, key, listKey) {
+ return _path.default.get({
+ parentPath: this.parentPath,
+ parent: node,
+ container: obj,
+ key: key,
+ listKey
+ });
+ }
+
+ maybeQueue(path, notPriority) {
+ if (this.queue) {
+ if (notPriority) {
+ this.queue.push(path);
+ } else {
+ this.priorityQueue.push(path);
+ }
+ }
+ }
+
+ visitMultiple(container, parent, listKey) {
+ if (container.length === 0) return false;
+ const queue = [];
+
+ for (let key = 0; key < container.length; key++) {
+ const node = container[key];
+
+ if (node && this.shouldVisit(node)) {
+ queue.push(this.create(parent, container, key, listKey));
+ }
+ }
+
+ return this.visitQueue(queue);
+ }
+
+ visitSingle(node, key) {
+ if (this.shouldVisit(node[key])) {
+ return this.visitQueue([this.create(node, node, key)]);
+ } else {
+ return false;
+ }
+ }
+
+ visitQueue(queue) {
+ this.queue = queue;
+ this.priorityQueue = [];
+ const visited = new WeakSet();
+ let stop = false;
+
+ for (const path of queue) {
+ path.resync();
+
+ if (path.contexts.length === 0 || path.contexts[path.contexts.length - 1] !== this) {
+ path.pushContext(this);
+ }
+
+ if (path.key === null) continue;
+ const {
+ node
+ } = path;
+ if (visited.has(node)) continue;
+ if (node) visited.add(node);
+
+ if (path.visit()) {
+ stop = true;
+ break;
+ }
+
+ if (this.priorityQueue.length) {
+ stop = this.visitQueue(this.priorityQueue);
+ this.priorityQueue = [];
+ this.queue = queue;
+ if (stop) break;
+ }
+ }
+
+ for (const path of queue) {
+ path.popContext();
+ }
+
+ this.queue = null;
+ return stop;
+ }
+
+ visit(node, key) {
+ const nodes = node[key];
+ if (!nodes) return false;
+
+ if (Array.isArray(nodes)) {
+ return this.visitMultiple(nodes, node, key);
+ } else {
+ return this.visitSingle(node, key);
+ }
+ }
+
+}
+
+exports.default = TraversalContext; \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/traverse/lib/hub.js b/chromium/third_party/node/node_modules/@babel/traverse/lib/hub.js
new file mode 100644
index 00000000000..fe139d2a8f2
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/traverse/lib/hub.js
@@ -0,0 +1,23 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = void 0;
+
+class Hub {
+ getCode() {}
+
+ getScope() {}
+
+ addHelper() {
+ throw new Error("Helpers are not supported by the default hub.");
+ }
+
+ buildError(node, msg, Error = TypeError) {
+ return new Error(msg);
+ }
+
+}
+
+exports.default = Hub; \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/traverse/lib/index.js b/chromium/third_party/node/node_modules/@babel/traverse/lib/index.js
new file mode 100644
index 00000000000..aa4616c9f63
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/traverse/lib/index.js
@@ -0,0 +1,118 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+Object.defineProperty(exports, "NodePath", {
+ enumerable: true,
+ get: function () {
+ return _path.default;
+ }
+});
+Object.defineProperty(exports, "Scope", {
+ enumerable: true,
+ get: function () {
+ return _scope.default;
+ }
+});
+Object.defineProperty(exports, "Hub", {
+ enumerable: true,
+ get: function () {
+ return _hub.default;
+ }
+});
+exports.visitors = exports.default = void 0;
+
+var _context = require("./context");
+
+var visitors = require("./visitors");
+
+exports.visitors = visitors;
+
+var _t = require("@babel/types");
+
+var cache = require("./cache");
+
+var _path = require("./path");
+
+var _scope = require("./scope");
+
+var _hub = require("./hub");
+
+const {
+ VISITOR_KEYS,
+ removeProperties,
+ traverseFast
+} = _t;
+
+function traverse(parent, opts = {}, scope, state, parentPath) {
+ if (!parent) return;
+
+ if (!opts.noScope && !scope) {
+ if (parent.type !== "Program" && parent.type !== "File") {
+ throw new Error("You must pass a scope and parentPath unless traversing a Program/File. " + `Instead of that you tried to traverse a ${parent.type} node without ` + "passing scope and parentPath.");
+ }
+ }
+
+ if (!VISITOR_KEYS[parent.type]) {
+ return;
+ }
+
+ visitors.explode(opts);
+ traverse.node(parent, opts, scope, state, parentPath);
+}
+
+var _default = traverse;
+exports.default = _default;
+traverse.visitors = visitors;
+traverse.verify = visitors.verify;
+traverse.explode = visitors.explode;
+
+traverse.cheap = function (node, enter) {
+ return traverseFast(node, enter);
+};
+
+traverse.node = function (node, opts, scope, state, parentPath, skipKeys) {
+ const keys = VISITOR_KEYS[node.type];
+ if (!keys) return;
+ const context = new _context.default(scope, opts, state, parentPath);
+
+ for (const key of keys) {
+ if (skipKeys && skipKeys[key]) continue;
+ if (context.visit(node, key)) return;
+ }
+};
+
+traverse.clearNode = function (node, opts) {
+ removeProperties(node, opts);
+ cache.path.delete(node);
+};
+
+traverse.removeProperties = function (tree, opts) {
+ traverseFast(tree, traverse.clearNode, opts);
+ return tree;
+};
+
+function hasDenylistedType(path, state) {
+ if (path.node.type === state.type) {
+ state.has = true;
+ path.stop();
+ }
+}
+
+traverse.hasType = function (tree, type, denylistTypes) {
+ if (denylistTypes != null && denylistTypes.includes(tree.type)) return false;
+ if (tree.type === type) return true;
+ const state = {
+ has: false,
+ type: type
+ };
+ traverse(tree, {
+ noScope: true,
+ denylist: denylistTypes,
+ enter: hasDenylistedType
+ }, null, state);
+ return state.has;
+};
+
+traverse.cache = cache; \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/traverse/lib/path/ancestry.js b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/ancestry.js
new file mode 100644
index 00000000000..763936bd0f9
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/ancestry.js
@@ -0,0 +1,180 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.findParent = findParent;
+exports.find = find;
+exports.getFunctionParent = getFunctionParent;
+exports.getStatementParent = getStatementParent;
+exports.getEarliestCommonAncestorFrom = getEarliestCommonAncestorFrom;
+exports.getDeepestCommonAncestorFrom = getDeepestCommonAncestorFrom;
+exports.getAncestry = getAncestry;
+exports.isAncestor = isAncestor;
+exports.isDescendant = isDescendant;
+exports.inType = inType;
+
+var _t = require("@babel/types");
+
+var _index = require("./index");
+
+const {
+ VISITOR_KEYS
+} = _t;
+
+function findParent(callback) {
+ let path = this;
+
+ while (path = path.parentPath) {
+ if (callback(path)) return path;
+ }
+
+ return null;
+}
+
+function find(callback) {
+ let path = this;
+
+ do {
+ if (callback(path)) return path;
+ } while (path = path.parentPath);
+
+ return null;
+}
+
+function getFunctionParent() {
+ return this.findParent(p => p.isFunction());
+}
+
+function getStatementParent() {
+ let path = this;
+
+ do {
+ if (!path.parentPath || Array.isArray(path.container) && path.isStatement()) {
+ break;
+ } else {
+ path = path.parentPath;
+ }
+ } while (path);
+
+ if (path && (path.isProgram() || path.isFile())) {
+ throw new Error("File/Program node, we can't possibly find a statement parent to this");
+ }
+
+ return path;
+}
+
+function getEarliestCommonAncestorFrom(paths) {
+ return this.getDeepestCommonAncestorFrom(paths, function (deepest, i, ancestries) {
+ let earliest;
+ const keys = VISITOR_KEYS[deepest.type];
+
+ for (const ancestry of ancestries) {
+ const path = ancestry[i + 1];
+
+ if (!earliest) {
+ earliest = path;
+ continue;
+ }
+
+ if (path.listKey && earliest.listKey === path.listKey) {
+ if (path.key < earliest.key) {
+ earliest = path;
+ continue;
+ }
+ }
+
+ const earliestKeyIndex = keys.indexOf(earliest.parentKey);
+ const currentKeyIndex = keys.indexOf(path.parentKey);
+
+ if (earliestKeyIndex > currentKeyIndex) {
+ earliest = path;
+ }
+ }
+
+ return earliest;
+ });
+}
+
+function getDeepestCommonAncestorFrom(paths, filter) {
+ if (!paths.length) {
+ return this;
+ }
+
+ if (paths.length === 1) {
+ return paths[0];
+ }
+
+ let minDepth = Infinity;
+ let lastCommonIndex, lastCommon;
+ const ancestries = paths.map(path => {
+ const ancestry = [];
+
+ do {
+ ancestry.unshift(path);
+ } while ((path = path.parentPath) && path !== this);
+
+ if (ancestry.length < minDepth) {
+ minDepth = ancestry.length;
+ }
+
+ return ancestry;
+ });
+ const first = ancestries[0];
+
+ depthLoop: for (let i = 0; i < minDepth; i++) {
+ const shouldMatch = first[i];
+
+ for (const ancestry of ancestries) {
+ if (ancestry[i] !== shouldMatch) {
+ break depthLoop;
+ }
+ }
+
+ lastCommonIndex = i;
+ lastCommon = shouldMatch;
+ }
+
+ if (lastCommon) {
+ if (filter) {
+ return filter(lastCommon, lastCommonIndex, ancestries);
+ } else {
+ return lastCommon;
+ }
+ } else {
+ throw new Error("Couldn't find intersection");
+ }
+}
+
+function getAncestry() {
+ let path = this;
+ const paths = [];
+
+ do {
+ paths.push(path);
+ } while (path = path.parentPath);
+
+ return paths;
+}
+
+function isAncestor(maybeDescendant) {
+ return maybeDescendant.isDescendant(this);
+}
+
+function isDescendant(maybeAncestor) {
+ return !!this.findParent(parent => parent === maybeAncestor);
+}
+
+function inType(...candidateTypes) {
+ let path = this;
+
+ while (path) {
+ for (const type of candidateTypes) {
+ if (path.node.type === type) return true;
+ }
+
+ path = path.parentPath;
+ }
+
+ return false;
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/traverse/lib/path/comments.js b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/comments.js
new file mode 100644
index 00000000000..0aa6b05b699
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/comments.js
@@ -0,0 +1,42 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.shareCommentsWithSiblings = shareCommentsWithSiblings;
+exports.addComment = addComment;
+exports.addComments = addComments;
+
+var _t = require("@babel/types");
+
+const {
+ addComment: _addComment,
+ addComments: _addComments
+} = _t;
+
+function shareCommentsWithSiblings() {
+ if (typeof this.key === "string") return;
+ const node = this.node;
+ if (!node) return;
+ const trailing = node.trailingComments;
+ const leading = node.leadingComments;
+ if (!trailing && !leading) return;
+ const prev = this.getSibling(this.key - 1);
+ const next = this.getSibling(this.key + 1);
+ const hasPrev = Boolean(prev.node);
+ const hasNext = Boolean(next.node);
+
+ if (hasPrev && !hasNext) {
+ prev.addComments("trailing", trailing);
+ } else if (hasNext && !hasPrev) {
+ next.addComments("leading", leading);
+ }
+}
+
+function addComment(type, content, line) {
+ _addComment(this.node, type, content, line);
+}
+
+function addComments(type, comments) {
+ _addComments(this.node, type, comments);
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/traverse/lib/path/context.js b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/context.js
new file mode 100644
index 00000000000..a1b34f53e4b
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/context.js
@@ -0,0 +1,253 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.call = call;
+exports._call = _call;
+exports.isBlacklisted = exports.isDenylisted = isDenylisted;
+exports.visit = visit;
+exports.skip = skip;
+exports.skipKey = skipKey;
+exports.stop = stop;
+exports.setScope = setScope;
+exports.setContext = setContext;
+exports.resync = resync;
+exports._resyncParent = _resyncParent;
+exports._resyncKey = _resyncKey;
+exports._resyncList = _resyncList;
+exports._resyncRemoved = _resyncRemoved;
+exports.popContext = popContext;
+exports.pushContext = pushContext;
+exports.setup = setup;
+exports.setKey = setKey;
+exports.requeue = requeue;
+exports._getQueueContexts = _getQueueContexts;
+
+var _index = require("../index");
+
+var _index2 = require("./index");
+
+function call(key) {
+ const opts = this.opts;
+ this.debug(key);
+
+ if (this.node) {
+ if (this._call(opts[key])) return true;
+ }
+
+ if (this.node) {
+ return this._call(opts[this.node.type] && opts[this.node.type][key]);
+ }
+
+ return false;
+}
+
+function _call(fns) {
+ if (!fns) return false;
+
+ for (const fn of fns) {
+ if (!fn) continue;
+ const node = this.node;
+ if (!node) return true;
+ const ret = fn.call(this.state, this, this.state);
+
+ if (ret && typeof ret === "object" && typeof ret.then === "function") {
+ throw new Error(`You appear to be using a plugin with an async traversal visitor, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, you may need to upgrade ` + `your @babel/core version.`);
+ }
+
+ if (ret) {
+ throw new Error(`Unexpected return value from visitor method ${fn}`);
+ }
+
+ if (this.node !== node) return true;
+ if (this._traverseFlags > 0) return true;
+ }
+
+ return false;
+}
+
+function isDenylisted() {
+ var _this$opts$denylist;
+
+ const denylist = (_this$opts$denylist = this.opts.denylist) != null ? _this$opts$denylist : this.opts.blacklist;
+ return denylist && denylist.indexOf(this.node.type) > -1;
+}
+
+function visit() {
+ if (!this.node) {
+ return false;
+ }
+
+ if (this.isDenylisted()) {
+ return false;
+ }
+
+ if (this.opts.shouldSkip && this.opts.shouldSkip(this)) {
+ return false;
+ }
+
+ if (this.shouldSkip || this.call("enter") || this.shouldSkip) {
+ this.debug("Skip...");
+ return this.shouldStop;
+ }
+
+ this.debug("Recursing into...");
+
+ _index.default.node(this.node, this.opts, this.scope, this.state, this, this.skipKeys);
+
+ this.call("exit");
+ return this.shouldStop;
+}
+
+function skip() {
+ this.shouldSkip = true;
+}
+
+function skipKey(key) {
+ if (this.skipKeys == null) {
+ this.skipKeys = {};
+ }
+
+ this.skipKeys[key] = true;
+}
+
+function stop() {
+ this._traverseFlags |= _index2.SHOULD_SKIP | _index2.SHOULD_STOP;
+}
+
+function setScope() {
+ if (this.opts && this.opts.noScope) return;
+ let path = this.parentPath;
+ if (this.key === "key" && path.isMethod()) path = path.parentPath;
+ let target;
+
+ while (path && !target) {
+ if (path.opts && path.opts.noScope) return;
+ target = path.scope;
+ path = path.parentPath;
+ }
+
+ this.scope = this.getScope(target);
+ if (this.scope) this.scope.init();
+}
+
+function setContext(context) {
+ if (this.skipKeys != null) {
+ this.skipKeys = {};
+ }
+
+ this._traverseFlags = 0;
+
+ if (context) {
+ this.context = context;
+ this.state = context.state;
+ this.opts = context.opts;
+ }
+
+ this.setScope();
+ return this;
+}
+
+function resync() {
+ if (this.removed) return;
+
+ this._resyncParent();
+
+ this._resyncList();
+
+ this._resyncKey();
+}
+
+function _resyncParent() {
+ if (this.parentPath) {
+ this.parent = this.parentPath.node;
+ }
+}
+
+function _resyncKey() {
+ if (!this.container) return;
+ if (this.node === this.container[this.key]) return;
+
+ if (Array.isArray(this.container)) {
+ for (let i = 0; i < this.container.length; i++) {
+ if (this.container[i] === this.node) {
+ return this.setKey(i);
+ }
+ }
+ } else {
+ for (const key of Object.keys(this.container)) {
+ if (this.container[key] === this.node) {
+ return this.setKey(key);
+ }
+ }
+ }
+
+ this.key = null;
+}
+
+function _resyncList() {
+ if (!this.parent || !this.inList) return;
+ const newContainer = this.parent[this.listKey];
+ if (this.container === newContainer) return;
+ this.container = newContainer || null;
+}
+
+function _resyncRemoved() {
+ if (this.key == null || !this.container || this.container[this.key] !== this.node) {
+ this._markRemoved();
+ }
+}
+
+function popContext() {
+ this.contexts.pop();
+
+ if (this.contexts.length > 0) {
+ this.setContext(this.contexts[this.contexts.length - 1]);
+ } else {
+ this.setContext(undefined);
+ }
+}
+
+function pushContext(context) {
+ this.contexts.push(context);
+ this.setContext(context);
+}
+
+function setup(parentPath, container, listKey, key) {
+ this.listKey = listKey;
+ this.container = container;
+ this.parentPath = parentPath || this.parentPath;
+ this.setKey(key);
+}
+
+function setKey(key) {
+ var _this$node;
+
+ this.key = key;
+ this.node = this.container[this.key];
+ this.type = (_this$node = this.node) == null ? void 0 : _this$node.type;
+}
+
+function requeue(pathToQueue = this) {
+ if (pathToQueue.removed) return;
+ ;
+ const contexts = this.contexts;
+
+ for (const context of contexts) {
+ context.maybeQueue(pathToQueue);
+ }
+}
+
+function _getQueueContexts() {
+ let path = this;
+ let contexts = this.contexts;
+
+ while (!contexts.length) {
+ path = path.parentPath;
+ if (!path) break;
+ contexts = path.contexts;
+ }
+
+ return contexts;
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/traverse/lib/path/conversion.js b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/conversion.js
new file mode 100644
index 00000000000..2037748e024
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/conversion.js
@@ -0,0 +1,468 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.toComputedKey = toComputedKey;
+exports.ensureBlock = ensureBlock;
+exports.arrowFunctionToShadowed = arrowFunctionToShadowed;
+exports.unwrapFunctionEnvironment = unwrapFunctionEnvironment;
+exports.arrowFunctionToExpression = arrowFunctionToExpression;
+
+var _t = require("@babel/types");
+
+var _helperFunctionName = require("@babel/helper-function-name");
+
+const {
+ arrowFunctionExpression,
+ assignmentExpression,
+ binaryExpression,
+ blockStatement,
+ callExpression,
+ conditionalExpression,
+ expressionStatement,
+ identifier,
+ isIdentifier,
+ jsxIdentifier,
+ memberExpression,
+ metaProperty,
+ numericLiteral,
+ objectExpression,
+ restElement,
+ returnStatement,
+ sequenceExpression,
+ spreadElement,
+ stringLiteral,
+ super: _super,
+ thisExpression,
+ unaryExpression
+} = _t;
+
+function toComputedKey() {
+ let key;
+
+ if (this.isMemberExpression()) {
+ key = this.node.property;
+ } else if (this.isProperty() || this.isMethod()) {
+ key = this.node.key;
+ } else {
+ throw new ReferenceError("todo");
+ }
+
+ if (!this.node.computed) {
+ if (isIdentifier(key)) key = stringLiteral(key.name);
+ }
+
+ return key;
+}
+
+function ensureBlock() {
+ const body = this.get("body");
+ const bodyNode = body.node;
+
+ if (Array.isArray(body)) {
+ throw new Error("Can't convert array path to a block statement");
+ }
+
+ if (!bodyNode) {
+ throw new Error("Can't convert node without a body");
+ }
+
+ if (body.isBlockStatement()) {
+ return bodyNode;
+ }
+
+ const statements = [];
+ let stringPath = "body";
+ let key;
+ let listKey;
+
+ if (body.isStatement()) {
+ listKey = "body";
+ key = 0;
+ statements.push(body.node);
+ } else {
+ stringPath += ".body.0";
+
+ if (this.isFunction()) {
+ key = "argument";
+ statements.push(returnStatement(body.node));
+ } else {
+ key = "expression";
+ statements.push(expressionStatement(body.node));
+ }
+ }
+
+ this.node.body = blockStatement(statements);
+ const parentPath = this.get(stringPath);
+ body.setup(parentPath, listKey ? parentPath.node[listKey] : parentPath.node, listKey, key);
+ return this.node;
+}
+
+function arrowFunctionToShadowed() {
+ if (!this.isArrowFunctionExpression()) return;
+ this.arrowFunctionToExpression();
+}
+
+function unwrapFunctionEnvironment() {
+ if (!this.isArrowFunctionExpression() && !this.isFunctionExpression() && !this.isFunctionDeclaration()) {
+ throw this.buildCodeFrameError("Can only unwrap the environment of a function.");
+ }
+
+ hoistFunctionEnvironment(this);
+}
+
+function arrowFunctionToExpression({
+ allowInsertArrow = true,
+ specCompliant = false,
+ noNewArrows = !specCompliant
+} = {}) {
+ if (!this.isArrowFunctionExpression()) {
+ throw this.buildCodeFrameError("Cannot convert non-arrow function to a function expression.");
+ }
+
+ const thisBinding = hoistFunctionEnvironment(this, noNewArrows, allowInsertArrow);
+ this.ensureBlock();
+ this.node.type = "FunctionExpression";
+
+ if (!noNewArrows) {
+ const checkBinding = thisBinding ? null : this.parentPath.scope.generateUidIdentifier("arrowCheckId");
+
+ if (checkBinding) {
+ this.parentPath.scope.push({
+ id: checkBinding,
+ init: objectExpression([])
+ });
+ }
+
+ this.get("body").unshiftContainer("body", expressionStatement(callExpression(this.hub.addHelper("newArrowCheck"), [thisExpression(), checkBinding ? identifier(checkBinding.name) : identifier(thisBinding)])));
+ this.replaceWith(callExpression(memberExpression((0, _helperFunctionName.default)(this, true) || this.node, identifier("bind")), [checkBinding ? identifier(checkBinding.name) : thisExpression()]));
+ }
+}
+
+function hoistFunctionEnvironment(fnPath, noNewArrows = true, allowInsertArrow = true) {
+ const thisEnvFn = fnPath.findParent(p => {
+ return p.isFunction() && !p.isArrowFunctionExpression() || p.isProgram() || p.isClassProperty({
+ static: false
+ });
+ });
+ const inConstructor = (thisEnvFn == null ? void 0 : thisEnvFn.node.kind) === "constructor";
+
+ if (thisEnvFn.isClassProperty()) {
+ throw fnPath.buildCodeFrameError("Unable to transform arrow inside class property");
+ }
+
+ const {
+ thisPaths,
+ argumentsPaths,
+ newTargetPaths,
+ superProps,
+ superCalls
+ } = getScopeInformation(fnPath);
+
+ if (inConstructor && superCalls.length > 0) {
+ if (!allowInsertArrow) {
+ throw superCalls[0].buildCodeFrameError("Unable to handle nested super() usage in arrow");
+ }
+
+ const allSuperCalls = [];
+ thisEnvFn.traverse({
+ Function(child) {
+ if (child.isArrowFunctionExpression()) return;
+ child.skip();
+ },
+
+ ClassProperty(child) {
+ child.skip();
+ },
+
+ CallExpression(child) {
+ if (!child.get("callee").isSuper()) return;
+ allSuperCalls.push(child);
+ }
+
+ });
+ const superBinding = getSuperBinding(thisEnvFn);
+ allSuperCalls.forEach(superCall => {
+ const callee = identifier(superBinding);
+ callee.loc = superCall.node.callee.loc;
+ superCall.get("callee").replaceWith(callee);
+ });
+ }
+
+ if (argumentsPaths.length > 0) {
+ const argumentsBinding = getBinding(thisEnvFn, "arguments", () => {
+ const args = () => identifier("arguments");
+
+ if (thisEnvFn.scope.path.isProgram()) {
+ return conditionalExpression(binaryExpression("===", unaryExpression("typeof", args()), stringLiteral("undefined")), thisEnvFn.scope.buildUndefinedNode(), args());
+ } else {
+ return args();
+ }
+ });
+ argumentsPaths.forEach(argumentsChild => {
+ const argsRef = identifier(argumentsBinding);
+ argsRef.loc = argumentsChild.node.loc;
+ argumentsChild.replaceWith(argsRef);
+ });
+ }
+
+ if (newTargetPaths.length > 0) {
+ const newTargetBinding = getBinding(thisEnvFn, "newtarget", () => metaProperty(identifier("new"), identifier("target")));
+ newTargetPaths.forEach(targetChild => {
+ const targetRef = identifier(newTargetBinding);
+ targetRef.loc = targetChild.node.loc;
+ targetChild.replaceWith(targetRef);
+ });
+ }
+
+ if (superProps.length > 0) {
+ if (!allowInsertArrow) {
+ throw superProps[0].buildCodeFrameError("Unable to handle nested super.prop usage");
+ }
+
+ const flatSuperProps = superProps.reduce((acc, superProp) => acc.concat(standardizeSuperProperty(superProp)), []);
+ flatSuperProps.forEach(superProp => {
+ const key = superProp.node.computed ? "" : superProp.get("property").node.name;
+ const isAssignment = superProp.parentPath.isAssignmentExpression({
+ left: superProp.node
+ });
+ const isCall = superProp.parentPath.isCallExpression({
+ callee: superProp.node
+ });
+ const superBinding = getSuperPropBinding(thisEnvFn, isAssignment, key);
+ const args = [];
+
+ if (superProp.node.computed) {
+ args.push(superProp.get("property").node);
+ }
+
+ if (isAssignment) {
+ const value = superProp.parentPath.node.right;
+ args.push(value);
+ }
+
+ const call = callExpression(identifier(superBinding), args);
+
+ if (isCall) {
+ superProp.parentPath.unshiftContainer("arguments", thisExpression());
+ superProp.replaceWith(memberExpression(call, identifier("call")));
+ thisPaths.push(superProp.parentPath.get("arguments.0"));
+ } else if (isAssignment) {
+ superProp.parentPath.replaceWith(call);
+ } else {
+ superProp.replaceWith(call);
+ }
+ });
+ }
+
+ let thisBinding;
+
+ if (thisPaths.length > 0 || !noNewArrows) {
+ thisBinding = getThisBinding(thisEnvFn, inConstructor);
+
+ if (noNewArrows || inConstructor && hasSuperClass(thisEnvFn)) {
+ thisPaths.forEach(thisChild => {
+ const thisRef = thisChild.isJSX() ? jsxIdentifier(thisBinding) : identifier(thisBinding);
+ thisRef.loc = thisChild.node.loc;
+ thisChild.replaceWith(thisRef);
+ });
+ if (!noNewArrows) thisBinding = null;
+ }
+ }
+
+ return thisBinding;
+}
+
+function standardizeSuperProperty(superProp) {
+ if (superProp.parentPath.isAssignmentExpression() && superProp.parentPath.node.operator !== "=") {
+ const assignmentPath = superProp.parentPath;
+ const op = assignmentPath.node.operator.slice(0, -1);
+ const value = assignmentPath.node.right;
+ assignmentPath.node.operator = "=";
+
+ if (superProp.node.computed) {
+ const tmp = superProp.scope.generateDeclaredUidIdentifier("tmp");
+ assignmentPath.get("left").replaceWith(memberExpression(superProp.node.object, assignmentExpression("=", tmp, superProp.node.property), true));
+ assignmentPath.get("right").replaceWith(binaryExpression(op, memberExpression(superProp.node.object, identifier(tmp.name), true), value));
+ } else {
+ assignmentPath.get("left").replaceWith(memberExpression(superProp.node.object, superProp.node.property));
+ assignmentPath.get("right").replaceWith(binaryExpression(op, memberExpression(superProp.node.object, identifier(superProp.node.property.name)), value));
+ }
+
+ return [assignmentPath.get("left"), assignmentPath.get("right").get("left")];
+ } else if (superProp.parentPath.isUpdateExpression()) {
+ const updateExpr = superProp.parentPath;
+ const tmp = superProp.scope.generateDeclaredUidIdentifier("tmp");
+ const computedKey = superProp.node.computed ? superProp.scope.generateDeclaredUidIdentifier("prop") : null;
+ const parts = [assignmentExpression("=", tmp, memberExpression(superProp.node.object, computedKey ? assignmentExpression("=", computedKey, superProp.node.property) : superProp.node.property, superProp.node.computed)), assignmentExpression("=", memberExpression(superProp.node.object, computedKey ? identifier(computedKey.name) : superProp.node.property, superProp.node.computed), binaryExpression("+", identifier(tmp.name), numericLiteral(1)))];
+
+ if (!superProp.parentPath.node.prefix) {
+ parts.push(identifier(tmp.name));
+ }
+
+ updateExpr.replaceWith(sequenceExpression(parts));
+ const left = updateExpr.get("expressions.0.right");
+ const right = updateExpr.get("expressions.1.left");
+ return [left, right];
+ }
+
+ return [superProp];
+}
+
+function hasSuperClass(thisEnvFn) {
+ return thisEnvFn.isClassMethod() && !!thisEnvFn.parentPath.parentPath.node.superClass;
+}
+
+function getThisBinding(thisEnvFn, inConstructor) {
+ return getBinding(thisEnvFn, "this", thisBinding => {
+ if (!inConstructor || !hasSuperClass(thisEnvFn)) return thisExpression();
+ const supers = new WeakSet();
+ thisEnvFn.traverse({
+ Function(child) {
+ if (child.isArrowFunctionExpression()) return;
+ child.skip();
+ },
+
+ ClassProperty(child) {
+ child.skip();
+ },
+
+ CallExpression(child) {
+ if (!child.get("callee").isSuper()) return;
+ if (supers.has(child.node)) return;
+ supers.add(child.node);
+ child.replaceWithMultiple([child.node, assignmentExpression("=", identifier(thisBinding), identifier("this"))]);
+ }
+
+ });
+ });
+}
+
+function getSuperBinding(thisEnvFn) {
+ return getBinding(thisEnvFn, "supercall", () => {
+ const argsBinding = thisEnvFn.scope.generateUidIdentifier("args");
+ return arrowFunctionExpression([restElement(argsBinding)], callExpression(_super(), [spreadElement(identifier(argsBinding.name))]));
+ });
+}
+
+function getSuperPropBinding(thisEnvFn, isAssignment, propName) {
+ const op = isAssignment ? "set" : "get";
+ return getBinding(thisEnvFn, `superprop_${op}:${propName || ""}`, () => {
+ const argsList = [];
+ let fnBody;
+
+ if (propName) {
+ fnBody = memberExpression(_super(), identifier(propName));
+ } else {
+ const method = thisEnvFn.scope.generateUidIdentifier("prop");
+ argsList.unshift(method);
+ fnBody = memberExpression(_super(), identifier(method.name), true);
+ }
+
+ if (isAssignment) {
+ const valueIdent = thisEnvFn.scope.generateUidIdentifier("value");
+ argsList.push(valueIdent);
+ fnBody = assignmentExpression("=", fnBody, identifier(valueIdent.name));
+ }
+
+ return arrowFunctionExpression(argsList, fnBody);
+ });
+}
+
+function getBinding(thisEnvFn, key, init) {
+ const cacheKey = "binding:" + key;
+ let data = thisEnvFn.getData(cacheKey);
+
+ if (!data) {
+ const id = thisEnvFn.scope.generateUidIdentifier(key);
+ data = id.name;
+ thisEnvFn.setData(cacheKey, data);
+ thisEnvFn.scope.push({
+ id: id,
+ init: init(data)
+ });
+ }
+
+ return data;
+}
+
+function getScopeInformation(fnPath) {
+ const thisPaths = [];
+ const argumentsPaths = [];
+ const newTargetPaths = [];
+ const superProps = [];
+ const superCalls = [];
+ fnPath.traverse({
+ ClassProperty(child) {
+ child.skip();
+ },
+
+ Function(child) {
+ if (child.isArrowFunctionExpression()) return;
+ child.skip();
+ },
+
+ ThisExpression(child) {
+ thisPaths.push(child);
+ },
+
+ JSXIdentifier(child) {
+ if (child.node.name !== "this") return;
+
+ if (!child.parentPath.isJSXMemberExpression({
+ object: child.node
+ }) && !child.parentPath.isJSXOpeningElement({
+ name: child.node
+ })) {
+ return;
+ }
+
+ thisPaths.push(child);
+ },
+
+ CallExpression(child) {
+ if (child.get("callee").isSuper()) superCalls.push(child);
+ },
+
+ MemberExpression(child) {
+ if (child.get("object").isSuper()) superProps.push(child);
+ },
+
+ ReferencedIdentifier(child) {
+ if (child.node.name !== "arguments") return;
+ let curr = child.scope;
+
+ do {
+ if (curr.hasOwnBinding("arguments")) {
+ curr.rename("arguments");
+ return;
+ }
+
+ if (curr.path.isFunction() && !curr.path.isArrowFunctionExpression()) {
+ break;
+ }
+ } while (curr = curr.parent);
+
+ argumentsPaths.push(child);
+ },
+
+ MetaProperty(child) {
+ if (!child.get("meta").isIdentifier({
+ name: "new"
+ })) return;
+ if (!child.get("property").isIdentifier({
+ name: "target"
+ })) return;
+ newTargetPaths.push(child);
+ }
+
+ });
+ return {
+ thisPaths,
+ argumentsPaths,
+ newTargetPaths,
+ superProps,
+ superCalls
+ };
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/traverse/lib/path/evaluation.js b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/evaluation.js
new file mode 100644
index 00000000000..1bea6807cb8
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/evaluation.js
@@ -0,0 +1,401 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.evaluateTruthy = evaluateTruthy;
+exports.evaluate = evaluate;
+const VALID_CALLEES = ["String", "Number", "Math"];
+const INVALID_METHODS = ["random"];
+
+function evaluateTruthy() {
+ const res = this.evaluate();
+ if (res.confident) return !!res.value;
+}
+
+function deopt(path, state) {
+ if (!state.confident) return;
+ state.deoptPath = path;
+ state.confident = false;
+}
+
+function evaluateCached(path, state) {
+ const {
+ node
+ } = path;
+ const {
+ seen
+ } = state;
+
+ if (seen.has(node)) {
+ const existing = seen.get(node);
+
+ if (existing.resolved) {
+ return existing.value;
+ } else {
+ deopt(path, state);
+ return;
+ }
+ } else {
+ const item = {
+ resolved: false
+ };
+ seen.set(node, item);
+
+ const val = _evaluate(path, state);
+
+ if (state.confident) {
+ item.resolved = true;
+ item.value = val;
+ }
+
+ return val;
+ }
+}
+
+function _evaluate(path, state) {
+ if (!state.confident) return;
+
+ if (path.isSequenceExpression()) {
+ const exprs = path.get("expressions");
+ return evaluateCached(exprs[exprs.length - 1], state);
+ }
+
+ if (path.isStringLiteral() || path.isNumericLiteral() || path.isBooleanLiteral()) {
+ return path.node.value;
+ }
+
+ if (path.isNullLiteral()) {
+ return null;
+ }
+
+ if (path.isTemplateLiteral()) {
+ return evaluateQuasis(path, path.node.quasis, state);
+ }
+
+ if (path.isTaggedTemplateExpression() && path.get("tag").isMemberExpression()) {
+ const object = path.get("tag.object");
+ const {
+ node: {
+ name
+ }
+ } = object;
+ const property = path.get("tag.property");
+
+ if (object.isIdentifier() && name === "String" && !path.scope.getBinding(name) && property.isIdentifier() && property.node.name === "raw") {
+ return evaluateQuasis(path, path.node.quasi.quasis, state, true);
+ }
+ }
+
+ if (path.isConditionalExpression()) {
+ const testResult = evaluateCached(path.get("test"), state);
+ if (!state.confident) return;
+
+ if (testResult) {
+ return evaluateCached(path.get("consequent"), state);
+ } else {
+ return evaluateCached(path.get("alternate"), state);
+ }
+ }
+
+ if (path.isExpressionWrapper()) {
+ return evaluateCached(path.get("expression"), state);
+ }
+
+ if (path.isMemberExpression() && !path.parentPath.isCallExpression({
+ callee: path.node
+ })) {
+ const property = path.get("property");
+ const object = path.get("object");
+
+ if (object.isLiteral() && property.isIdentifier()) {
+ const value = object.node.value;
+ const type = typeof value;
+
+ if (type === "number" || type === "string") {
+ return value[property.node.name];
+ }
+ }
+ }
+
+ if (path.isReferencedIdentifier()) {
+ const binding = path.scope.getBinding(path.node.name);
+
+ if (binding && binding.constantViolations.length > 0) {
+ return deopt(binding.path, state);
+ }
+
+ if (binding && path.node.start < binding.path.node.end) {
+ return deopt(binding.path, state);
+ }
+
+ if (binding != null && binding.hasValue) {
+ return binding.value;
+ } else {
+ if (path.node.name === "undefined") {
+ return binding ? deopt(binding.path, state) : undefined;
+ } else if (path.node.name === "Infinity") {
+ return binding ? deopt(binding.path, state) : Infinity;
+ } else if (path.node.name === "NaN") {
+ return binding ? deopt(binding.path, state) : NaN;
+ }
+
+ const resolved = path.resolve();
+
+ if (resolved === path) {
+ return deopt(path, state);
+ } else {
+ return evaluateCached(resolved, state);
+ }
+ }
+ }
+
+ if (path.isUnaryExpression({
+ prefix: true
+ })) {
+ if (path.node.operator === "void") {
+ return undefined;
+ }
+
+ const argument = path.get("argument");
+
+ if (path.node.operator === "typeof" && (argument.isFunction() || argument.isClass())) {
+ return "function";
+ }
+
+ const arg = evaluateCached(argument, state);
+ if (!state.confident) return;
+
+ switch (path.node.operator) {
+ case "!":
+ return !arg;
+
+ case "+":
+ return +arg;
+
+ case "-":
+ return -arg;
+
+ case "~":
+ return ~arg;
+
+ case "typeof":
+ return typeof arg;
+ }
+ }
+
+ if (path.isArrayExpression()) {
+ const arr = [];
+ const elems = path.get("elements");
+
+ for (const elem of elems) {
+ const elemValue = elem.evaluate();
+
+ if (elemValue.confident) {
+ arr.push(elemValue.value);
+ } else {
+ return deopt(elemValue.deopt, state);
+ }
+ }
+
+ return arr;
+ }
+
+ if (path.isObjectExpression()) {
+ const obj = {};
+ const props = path.get("properties");
+
+ for (const prop of props) {
+ if (prop.isObjectMethod() || prop.isSpreadElement()) {
+ return deopt(prop, state);
+ }
+
+ const keyPath = prop.get("key");
+ let key = keyPath;
+
+ if (prop.node.computed) {
+ key = key.evaluate();
+
+ if (!key.confident) {
+ return deopt(key.deopt, state);
+ }
+
+ key = key.value;
+ } else if (key.isIdentifier()) {
+ key = key.node.name;
+ } else {
+ key = key.node.value;
+ }
+
+ const valuePath = prop.get("value");
+ let value = valuePath.evaluate();
+
+ if (!value.confident) {
+ return deopt(value.deopt, state);
+ }
+
+ value = value.value;
+ obj[key] = value;
+ }
+
+ return obj;
+ }
+
+ if (path.isLogicalExpression()) {
+ const wasConfident = state.confident;
+ const left = evaluateCached(path.get("left"), state);
+ const leftConfident = state.confident;
+ state.confident = wasConfident;
+ const right = evaluateCached(path.get("right"), state);
+ const rightConfident = state.confident;
+
+ switch (path.node.operator) {
+ case "||":
+ state.confident = leftConfident && (!!left || rightConfident);
+ if (!state.confident) return;
+ return left || right;
+
+ case "&&":
+ state.confident = leftConfident && (!left || rightConfident);
+ if (!state.confident) return;
+ return left && right;
+ }
+ }
+
+ if (path.isBinaryExpression()) {
+ const left = evaluateCached(path.get("left"), state);
+ if (!state.confident) return;
+ const right = evaluateCached(path.get("right"), state);
+ if (!state.confident) return;
+
+ switch (path.node.operator) {
+ case "-":
+ return left - right;
+
+ case "+":
+ return left + right;
+
+ case "/":
+ return left / right;
+
+ case "*":
+ return left * right;
+
+ case "%":
+ return left % right;
+
+ case "**":
+ return Math.pow(left, right);
+
+ case "<":
+ return left < right;
+
+ case ">":
+ return left > right;
+
+ case "<=":
+ return left <= right;
+
+ case ">=":
+ return left >= right;
+
+ case "==":
+ return left == right;
+
+ case "!=":
+ return left != right;
+
+ case "===":
+ return left === right;
+
+ case "!==":
+ return left !== right;
+
+ case "|":
+ return left | right;
+
+ case "&":
+ return left & right;
+
+ case "^":
+ return left ^ right;
+
+ case "<<":
+ return left << right;
+
+ case ">>":
+ return left >> right;
+
+ case ">>>":
+ return left >>> right;
+ }
+ }
+
+ if (path.isCallExpression()) {
+ const callee = path.get("callee");
+ let context;
+ let func;
+
+ if (callee.isIdentifier() && !path.scope.getBinding(callee.node.name) && VALID_CALLEES.indexOf(callee.node.name) >= 0) {
+ func = global[callee.node.name];
+ }
+
+ if (callee.isMemberExpression()) {
+ const object = callee.get("object");
+ const property = callee.get("property");
+
+ if (object.isIdentifier() && property.isIdentifier() && VALID_CALLEES.indexOf(object.node.name) >= 0 && INVALID_METHODS.indexOf(property.node.name) < 0) {
+ context = global[object.node.name];
+ func = context[property.node.name];
+ }
+
+ if (object.isLiteral() && property.isIdentifier()) {
+ const type = typeof object.node.value;
+
+ if (type === "string" || type === "number") {
+ context = object.node.value;
+ func = context[property.node.name];
+ }
+ }
+ }
+
+ if (func) {
+ const args = path.get("arguments").map(arg => evaluateCached(arg, state));
+ if (!state.confident) return;
+ return func.apply(context, args);
+ }
+ }
+
+ deopt(path, state);
+}
+
+function evaluateQuasis(path, quasis, state, raw = false) {
+ let str = "";
+ let i = 0;
+ const exprs = path.get("expressions");
+
+ for (const elem of quasis) {
+ if (!state.confident) break;
+ str += raw ? elem.value.raw : elem.value.cooked;
+ const expr = exprs[i++];
+ if (expr) str += String(evaluateCached(expr, state));
+ }
+
+ if (!state.confident) return;
+ return str;
+}
+
+function evaluate() {
+ const state = {
+ confident: true,
+ deoptPath: null,
+ seen: new Map()
+ };
+ let value = evaluateCached(this, state);
+ if (!state.confident) value = undefined;
+ return {
+ confident: state.confident,
+ deopt: state.deoptPath,
+ value: value
+ };
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/traverse/lib/path/family.js b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/family.js
new file mode 100644
index 00000000000..111a331e181
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/family.js
@@ -0,0 +1,407 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.getOpposite = getOpposite;
+exports.getCompletionRecords = getCompletionRecords;
+exports.getSibling = getSibling;
+exports.getPrevSibling = getPrevSibling;
+exports.getNextSibling = getNextSibling;
+exports.getAllNextSiblings = getAllNextSiblings;
+exports.getAllPrevSiblings = getAllPrevSiblings;
+exports.get = get;
+exports._getKey = _getKey;
+exports._getPattern = _getPattern;
+exports.getBindingIdentifiers = getBindingIdentifiers;
+exports.getOuterBindingIdentifiers = getOuterBindingIdentifiers;
+exports.getBindingIdentifierPaths = getBindingIdentifierPaths;
+exports.getOuterBindingIdentifierPaths = getOuterBindingIdentifierPaths;
+
+var _index = require("./index");
+
+var _t = require("@babel/types");
+
+const {
+ getBindingIdentifiers: _getBindingIdentifiers,
+ getOuterBindingIdentifiers: _getOuterBindingIdentifiers,
+ isDeclaration,
+ numericLiteral,
+ unaryExpression
+} = _t;
+const NORMAL_COMPLETION = 0;
+const BREAK_COMPLETION = 1;
+
+function NormalCompletion(path) {
+ return {
+ type: NORMAL_COMPLETION,
+ path
+ };
+}
+
+function BreakCompletion(path) {
+ return {
+ type: BREAK_COMPLETION,
+ path
+ };
+}
+
+function getOpposite() {
+ if (this.key === "left") {
+ return this.getSibling("right");
+ } else if (this.key === "right") {
+ return this.getSibling("left");
+ }
+
+ return null;
+}
+
+function addCompletionRecords(path, records, context) {
+ if (path) {
+ records.push(..._getCompletionRecords(path, context));
+ }
+
+ return records;
+}
+
+function completionRecordForSwitch(cases, records, context) {
+ let lastNormalCompletions = [];
+
+ for (let i = 0; i < cases.length; i++) {
+ const casePath = cases[i];
+
+ const caseCompletions = _getCompletionRecords(casePath, context);
+
+ const normalCompletions = [];
+ const breakCompletions = [];
+
+ for (const c of caseCompletions) {
+ if (c.type === NORMAL_COMPLETION) {
+ normalCompletions.push(c);
+ }
+
+ if (c.type === BREAK_COMPLETION) {
+ breakCompletions.push(c);
+ }
+ }
+
+ if (normalCompletions.length) {
+ lastNormalCompletions = normalCompletions;
+ }
+
+ records.push(...breakCompletions);
+ }
+
+ records.push(...lastNormalCompletions);
+ return records;
+}
+
+function normalCompletionToBreak(completions) {
+ completions.forEach(c => {
+ c.type = BREAK_COMPLETION;
+ });
+}
+
+function replaceBreakStatementInBreakCompletion(completions, reachable) {
+ completions.forEach(c => {
+ if (c.path.isBreakStatement({
+ label: null
+ })) {
+ if (reachable) {
+ c.path.replaceWith(unaryExpression("void", numericLiteral(0)));
+ } else {
+ c.path.remove();
+ }
+ }
+ });
+}
+
+function getStatementListCompletion(paths, context) {
+ const completions = [];
+
+ if (context.canHaveBreak) {
+ let lastNormalCompletions = [];
+
+ for (let i = 0; i < paths.length; i++) {
+ const path = paths[i];
+ const newContext = Object.assign({}, context, {
+ inCaseClause: false
+ });
+
+ if (path.isBlockStatement() && (context.inCaseClause || context.shouldPopulateBreak)) {
+ newContext.shouldPopulateBreak = true;
+ } else {
+ newContext.shouldPopulateBreak = false;
+ }
+
+ const statementCompletions = _getCompletionRecords(path, newContext);
+
+ if (statementCompletions.length > 0 && statementCompletions.every(c => c.type === BREAK_COMPLETION)) {
+ if (lastNormalCompletions.length > 0 && statementCompletions.every(c => c.path.isBreakStatement({
+ label: null
+ }))) {
+ normalCompletionToBreak(lastNormalCompletions);
+ completions.push(...lastNormalCompletions);
+
+ if (lastNormalCompletions.some(c => c.path.isDeclaration())) {
+ completions.push(...statementCompletions);
+ replaceBreakStatementInBreakCompletion(statementCompletions, true);
+ }
+
+ replaceBreakStatementInBreakCompletion(statementCompletions, false);
+ } else {
+ completions.push(...statementCompletions);
+
+ if (!context.shouldPopulateBreak) {
+ replaceBreakStatementInBreakCompletion(statementCompletions, true);
+ }
+ }
+
+ break;
+ }
+
+ if (i === paths.length - 1) {
+ completions.push(...statementCompletions);
+ } else {
+ lastNormalCompletions = [];
+
+ for (let i = 0; i < statementCompletions.length; i++) {
+ const c = statementCompletions[i];
+
+ if (c.type === BREAK_COMPLETION) {
+ completions.push(c);
+ }
+
+ if (c.type === NORMAL_COMPLETION) {
+ lastNormalCompletions.push(c);
+ }
+ }
+ }
+ }
+ } else if (paths.length) {
+ for (let i = paths.length - 1; i >= 0; i--) {
+ const pathCompletions = _getCompletionRecords(paths[i], context);
+
+ if (pathCompletions.length > 1 || pathCompletions.length === 1 && !pathCompletions[0].path.isVariableDeclaration()) {
+ completions.push(...pathCompletions);
+ break;
+ }
+ }
+ }
+
+ return completions;
+}
+
+function _getCompletionRecords(path, context) {
+ let records = [];
+
+ if (path.isIfStatement()) {
+ records = addCompletionRecords(path.get("consequent"), records, context);
+ records = addCompletionRecords(path.get("alternate"), records, context);
+ } else if (path.isDoExpression() || path.isFor() || path.isWhile() || path.isLabeledStatement()) {
+ return addCompletionRecords(path.get("body"), records, context);
+ } else if (path.isProgram() || path.isBlockStatement()) {
+ return getStatementListCompletion(path.get("body"), context);
+ } else if (path.isFunction()) {
+ return _getCompletionRecords(path.get("body"), context);
+ } else if (path.isTryStatement()) {
+ records = addCompletionRecords(path.get("block"), records, context);
+ records = addCompletionRecords(path.get("handler"), records, context);
+ } else if (path.isCatchClause()) {
+ return addCompletionRecords(path.get("body"), records, context);
+ } else if (path.isSwitchStatement()) {
+ return completionRecordForSwitch(path.get("cases"), records, context);
+ } else if (path.isSwitchCase()) {
+ return getStatementListCompletion(path.get("consequent"), {
+ canHaveBreak: true,
+ shouldPopulateBreak: false,
+ inCaseClause: true
+ });
+ } else if (path.isBreakStatement()) {
+ records.push(BreakCompletion(path));
+ } else {
+ records.push(NormalCompletion(path));
+ }
+
+ return records;
+}
+
+function getCompletionRecords() {
+ const records = _getCompletionRecords(this, {
+ canHaveBreak: false,
+ shouldPopulateBreak: false,
+ inCaseClause: false
+ });
+
+ return records.map(r => r.path);
+}
+
+function getSibling(key) {
+ return _index.default.get({
+ parentPath: this.parentPath,
+ parent: this.parent,
+ container: this.container,
+ listKey: this.listKey,
+ key: key
+ }).setContext(this.context);
+}
+
+function getPrevSibling() {
+ return this.getSibling(this.key - 1);
+}
+
+function getNextSibling() {
+ return this.getSibling(this.key + 1);
+}
+
+function getAllNextSiblings() {
+ let _key = this.key;
+ let sibling = this.getSibling(++_key);
+ const siblings = [];
+
+ while (sibling.node) {
+ siblings.push(sibling);
+ sibling = this.getSibling(++_key);
+ }
+
+ return siblings;
+}
+
+function getAllPrevSiblings() {
+ let _key = this.key;
+ let sibling = this.getSibling(--_key);
+ const siblings = [];
+
+ while (sibling.node) {
+ siblings.push(sibling);
+ sibling = this.getSibling(--_key);
+ }
+
+ return siblings;
+}
+
+function get(key, context = true) {
+ if (context === true) context = this.context;
+ const parts = key.split(".");
+
+ if (parts.length === 1) {
+ return this._getKey(key, context);
+ } else {
+ return this._getPattern(parts, context);
+ }
+}
+
+function _getKey(key, context) {
+ const node = this.node;
+ const container = node[key];
+
+ if (Array.isArray(container)) {
+ return container.map((_, i) => {
+ return _index.default.get({
+ listKey: key,
+ parentPath: this,
+ parent: node,
+ container: container,
+ key: i
+ }).setContext(context);
+ });
+ } else {
+ return _index.default.get({
+ parentPath: this,
+ parent: node,
+ container: node,
+ key: key
+ }).setContext(context);
+ }
+}
+
+function _getPattern(parts, context) {
+ let path = this;
+
+ for (const part of parts) {
+ if (part === ".") {
+ path = path.parentPath;
+ } else {
+ if (Array.isArray(path)) {
+ path = path[part];
+ } else {
+ path = path.get(part, context);
+ }
+ }
+ }
+
+ return path;
+}
+
+function getBindingIdentifiers(duplicates) {
+ return _getBindingIdentifiers(this.node, duplicates);
+}
+
+function getOuterBindingIdentifiers(duplicates) {
+ return _getOuterBindingIdentifiers(this.node, duplicates);
+}
+
+function getBindingIdentifierPaths(duplicates = false, outerOnly = false) {
+ const path = this;
+ const search = [path];
+ const ids = Object.create(null);
+
+ while (search.length) {
+ const id = search.shift();
+ if (!id) continue;
+ if (!id.node) continue;
+ const keys = _getBindingIdentifiers.keys[id.node.type];
+
+ if (id.isIdentifier()) {
+ if (duplicates) {
+ const _ids = ids[id.node.name] = ids[id.node.name] || [];
+
+ _ids.push(id);
+ } else {
+ ids[id.node.name] = id;
+ }
+
+ continue;
+ }
+
+ if (id.isExportDeclaration()) {
+ const declaration = id.get("declaration");
+
+ if (isDeclaration(declaration)) {
+ search.push(declaration);
+ }
+
+ continue;
+ }
+
+ if (outerOnly) {
+ if (id.isFunctionDeclaration()) {
+ search.push(id.get("id"));
+ continue;
+ }
+
+ if (id.isFunctionExpression()) {
+ continue;
+ }
+ }
+
+ if (keys) {
+ for (let i = 0; i < keys.length; i++) {
+ const key = keys[i];
+ const child = id.get(key);
+
+ if (Array.isArray(child)) {
+ search.push(...child);
+ } else if (child.node) {
+ search.push(child);
+ }
+ }
+ }
+ }
+
+ return ids;
+}
+
+function getOuterBindingIdentifierPaths(duplicates) {
+ return this.getBindingIdentifierPaths(duplicates, true);
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/traverse/lib/path/generated/asserts.js b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/generated/asserts.js
new file mode 100644
index 00000000000..bee8a438ea4
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/generated/asserts.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var t = require("@babel/types");
+
+var _index = require("../index"); \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/traverse/lib/path/generated/validators.js b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/generated/validators.js
new file mode 100644
index 00000000000..bee8a438ea4
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/generated/validators.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var t = require("@babel/types");
+
+var _index = require("../index"); \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/traverse/lib/path/generated/virtual-types.js b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/generated/virtual-types.js
new file mode 100644
index 00000000000..bf37ed9378a
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/generated/virtual-types.js
@@ -0,0 +1,3 @@
+"use strict";
+
+var t = require("@babel/types"); \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/traverse/lib/path/index.js b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/index.js
new file mode 100644
index 00000000000..0a1dd80bc0b
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/index.js
@@ -0,0 +1,253 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = exports.SHOULD_SKIP = exports.SHOULD_STOP = exports.REMOVED = void 0;
+
+var virtualTypes = require("./lib/virtual-types");
+
+var _debug = require("debug");
+
+var _index = require("../index");
+
+var _scope = require("../scope");
+
+var _t = require("@babel/types");
+
+var t = _t;
+
+var _cache = require("../cache");
+
+var _generator = require("@babel/generator");
+
+var NodePath_ancestry = require("./ancestry");
+
+var NodePath_inference = require("./inference");
+
+var NodePath_replacement = require("./replacement");
+
+var NodePath_evaluation = require("./evaluation");
+
+var NodePath_conversion = require("./conversion");
+
+var NodePath_introspection = require("./introspection");
+
+var NodePath_context = require("./context");
+
+var NodePath_removal = require("./removal");
+
+var NodePath_modification = require("./modification");
+
+var NodePath_family = require("./family");
+
+var NodePath_comments = require("./comments");
+
+const {
+ validate
+} = _t;
+
+const debug = _debug("babel");
+
+const REMOVED = 1 << 0;
+exports.REMOVED = REMOVED;
+const SHOULD_STOP = 1 << 1;
+exports.SHOULD_STOP = SHOULD_STOP;
+const SHOULD_SKIP = 1 << 2;
+exports.SHOULD_SKIP = SHOULD_SKIP;
+
+class NodePath {
+ constructor(hub, parent) {
+ this.contexts = [];
+ this.state = null;
+ this.opts = null;
+ this._traverseFlags = 0;
+ this.skipKeys = null;
+ this.parentPath = null;
+ this.container = null;
+ this.listKey = null;
+ this.key = null;
+ this.node = null;
+ this.type = null;
+ this.parent = parent;
+ this.hub = hub;
+ this.data = null;
+ this.context = null;
+ this.scope = null;
+ }
+
+ static get({
+ hub,
+ parentPath,
+ parent,
+ container,
+ listKey,
+ key
+ }) {
+ if (!hub && parentPath) {
+ hub = parentPath.hub;
+ }
+
+ if (!parent) {
+ throw new Error("To get a node path the parent needs to exist");
+ }
+
+ const targetNode = container[key];
+
+ let paths = _cache.path.get(parent);
+
+ if (!paths) {
+ paths = new Map();
+
+ _cache.path.set(parent, paths);
+ }
+
+ let path = paths.get(targetNode);
+
+ if (!path) {
+ path = new NodePath(hub, parent);
+ if (targetNode) paths.set(targetNode, path);
+ }
+
+ path.setup(parentPath, container, listKey, key);
+ return path;
+ }
+
+ getScope(scope) {
+ return this.isScope() ? new _scope.default(this) : scope;
+ }
+
+ setData(key, val) {
+ if (this.data == null) {
+ this.data = Object.create(null);
+ }
+
+ return this.data[key] = val;
+ }
+
+ getData(key, def) {
+ if (this.data == null) {
+ this.data = Object.create(null);
+ }
+
+ let val = this.data[key];
+ if (val === undefined && def !== undefined) val = this.data[key] = def;
+ return val;
+ }
+
+ buildCodeFrameError(msg, Error = SyntaxError) {
+ return this.hub.buildError(this.node, msg, Error);
+ }
+
+ traverse(visitor, state) {
+ (0, _index.default)(this.node, visitor, this.scope, state, this);
+ }
+
+ set(key, node) {
+ validate(this.node, key, node);
+ this.node[key] = node;
+ }
+
+ getPathLocation() {
+ const parts = [];
+ let path = this;
+
+ do {
+ let key = path.key;
+ if (path.inList) key = `${path.listKey}[${key}]`;
+ parts.unshift(key);
+ } while (path = path.parentPath);
+
+ return parts.join(".");
+ }
+
+ debug(message) {
+ if (!debug.enabled) return;
+ debug(`${this.getPathLocation()} ${this.type}: ${message}`);
+ }
+
+ toString() {
+ return (0, _generator.default)(this.node).code;
+ }
+
+ get inList() {
+ return !!this.listKey;
+ }
+
+ set inList(inList) {
+ if (!inList) {
+ this.listKey = null;
+ }
+ }
+
+ get parentKey() {
+ return this.listKey || this.key;
+ }
+
+ get shouldSkip() {
+ return !!(this._traverseFlags & SHOULD_SKIP);
+ }
+
+ set shouldSkip(v) {
+ if (v) {
+ this._traverseFlags |= SHOULD_SKIP;
+ } else {
+ this._traverseFlags &= ~SHOULD_SKIP;
+ }
+ }
+
+ get shouldStop() {
+ return !!(this._traverseFlags & SHOULD_STOP);
+ }
+
+ set shouldStop(v) {
+ if (v) {
+ this._traverseFlags |= SHOULD_STOP;
+ } else {
+ this._traverseFlags &= ~SHOULD_STOP;
+ }
+ }
+
+ get removed() {
+ return !!(this._traverseFlags & REMOVED);
+ }
+
+ set removed(v) {
+ if (v) {
+ this._traverseFlags |= REMOVED;
+ } else {
+ this._traverseFlags &= ~REMOVED;
+ }
+ }
+
+}
+
+Object.assign(NodePath.prototype, NodePath_ancestry, NodePath_inference, NodePath_replacement, NodePath_evaluation, NodePath_conversion, NodePath_introspection, NodePath_context, NodePath_removal, NodePath_modification, NodePath_family, NodePath_comments);
+
+for (const type of t.TYPES) {
+ const typeKey = `is${type}`;
+ const fn = t[typeKey];
+
+ NodePath.prototype[typeKey] = function (opts) {
+ return fn(this.node, opts);
+ };
+
+ NodePath.prototype[`assert${type}`] = function (opts) {
+ if (!fn(this.node, opts)) {
+ throw new TypeError(`Expected node path of type ${type}`);
+ }
+ };
+}
+
+for (const type of Object.keys(virtualTypes)) {
+ if (type[0] === "_") continue;
+ if (t.TYPES.indexOf(type) < 0) t.TYPES.push(type);
+ const virtualType = virtualTypes[type];
+
+ NodePath.prototype[`is${type}`] = function (opts) {
+ return virtualType.checkPath(this, opts);
+ };
+}
+
+var _default = NodePath;
+exports.default = _default; \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/traverse/lib/path/inference/index.js b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/inference/index.js
new file mode 100644
index 00000000000..9f2cec93c2f
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/inference/index.js
@@ -0,0 +1,156 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.getTypeAnnotation = getTypeAnnotation;
+exports._getTypeAnnotation = _getTypeAnnotation;
+exports.isBaseType = isBaseType;
+exports.couldBeBaseType = couldBeBaseType;
+exports.baseTypeStrictlyMatches = baseTypeStrictlyMatches;
+exports.isGenericType = isGenericType;
+
+var inferers = require("./inferers");
+
+var _t = require("@babel/types");
+
+const {
+ anyTypeAnnotation,
+ isAnyTypeAnnotation,
+ isBooleanTypeAnnotation,
+ isEmptyTypeAnnotation,
+ isFlowBaseAnnotation,
+ isGenericTypeAnnotation,
+ isIdentifier,
+ isMixedTypeAnnotation,
+ isNumberTypeAnnotation,
+ isStringTypeAnnotation,
+ isTypeAnnotation,
+ isUnionTypeAnnotation,
+ isVoidTypeAnnotation,
+ stringTypeAnnotation,
+ voidTypeAnnotation
+} = _t;
+
+function getTypeAnnotation() {
+ if (this.typeAnnotation) return this.typeAnnotation;
+ let type = this._getTypeAnnotation() || anyTypeAnnotation();
+ if (isTypeAnnotation(type)) type = type.typeAnnotation;
+ return this.typeAnnotation = type;
+}
+
+const typeAnnotationInferringNodes = new WeakSet();
+
+function _getTypeAnnotation() {
+ const node = this.node;
+
+ if (!node) {
+ if (this.key === "init" && this.parentPath.isVariableDeclarator()) {
+ const declar = this.parentPath.parentPath;
+ const declarParent = declar.parentPath;
+
+ if (declar.key === "left" && declarParent.isForInStatement()) {
+ return stringTypeAnnotation();
+ }
+
+ if (declar.key === "left" && declarParent.isForOfStatement()) {
+ return anyTypeAnnotation();
+ }
+
+ return voidTypeAnnotation();
+ } else {
+ return;
+ }
+ }
+
+ if (node.typeAnnotation) {
+ return node.typeAnnotation;
+ }
+
+ if (typeAnnotationInferringNodes.has(node)) {
+ return;
+ }
+
+ typeAnnotationInferringNodes.add(node);
+
+ try {
+ var _inferer;
+
+ let inferer = inferers[node.type];
+
+ if (inferer) {
+ return inferer.call(this, node);
+ }
+
+ inferer = inferers[this.parentPath.type];
+
+ if ((_inferer = inferer) != null && _inferer.validParent) {
+ return this.parentPath.getTypeAnnotation();
+ }
+ } finally {
+ typeAnnotationInferringNodes.delete(node);
+ }
+}
+
+function isBaseType(baseName, soft) {
+ return _isBaseType(baseName, this.getTypeAnnotation(), soft);
+}
+
+function _isBaseType(baseName, type, soft) {
+ if (baseName === "string") {
+ return isStringTypeAnnotation(type);
+ } else if (baseName === "number") {
+ return isNumberTypeAnnotation(type);
+ } else if (baseName === "boolean") {
+ return isBooleanTypeAnnotation(type);
+ } else if (baseName === "any") {
+ return isAnyTypeAnnotation(type);
+ } else if (baseName === "mixed") {
+ return isMixedTypeAnnotation(type);
+ } else if (baseName === "empty") {
+ return isEmptyTypeAnnotation(type);
+ } else if (baseName === "void") {
+ return isVoidTypeAnnotation(type);
+ } else {
+ if (soft) {
+ return false;
+ } else {
+ throw new Error(`Unknown base type ${baseName}`);
+ }
+ }
+}
+
+function couldBeBaseType(name) {
+ const type = this.getTypeAnnotation();
+ if (isAnyTypeAnnotation(type)) return true;
+
+ if (isUnionTypeAnnotation(type)) {
+ for (const type2 of type.types) {
+ if (isAnyTypeAnnotation(type2) || _isBaseType(name, type2, true)) {
+ return true;
+ }
+ }
+
+ return false;
+ } else {
+ return _isBaseType(name, type, true);
+ }
+}
+
+function baseTypeStrictlyMatches(rightArg) {
+ const left = this.getTypeAnnotation();
+ const right = rightArg.getTypeAnnotation();
+
+ if (!isAnyTypeAnnotation(left) && isFlowBaseAnnotation(left)) {
+ return right.type === left.type;
+ }
+
+ return false;
+}
+
+function isGenericType(genericName) {
+ const type = this.getTypeAnnotation();
+ return isGenericTypeAnnotation(type) && isIdentifier(type.id, {
+ name: genericName
+ });
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/traverse/lib/path/inference/inferer-reference.js b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/inference/inferer-reference.js
new file mode 100644
index 00000000000..c328dc150f4
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/inference/inferer-reference.js
@@ -0,0 +1,206 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = _default;
+
+var _t = require("@babel/types");
+
+const {
+ BOOLEAN_NUMBER_BINARY_OPERATORS,
+ createFlowUnionType,
+ createTSUnionType,
+ createTypeAnnotationBasedOnTypeof,
+ createUnionTypeAnnotation,
+ isTSTypeAnnotation,
+ numberTypeAnnotation,
+ voidTypeAnnotation
+} = _t;
+
+function _default(node) {
+ if (!this.isReferenced()) return;
+ const binding = this.scope.getBinding(node.name);
+
+ if (binding) {
+ if (binding.identifier.typeAnnotation) {
+ return binding.identifier.typeAnnotation;
+ } else {
+ return getTypeAnnotationBindingConstantViolations(binding, this, node.name);
+ }
+ }
+
+ if (node.name === "undefined") {
+ return voidTypeAnnotation();
+ } else if (node.name === "NaN" || node.name === "Infinity") {
+ return numberTypeAnnotation();
+ } else if (node.name === "arguments") {}
+}
+
+function getTypeAnnotationBindingConstantViolations(binding, path, name) {
+ const types = [];
+ const functionConstantViolations = [];
+ let constantViolations = getConstantViolationsBefore(binding, path, functionConstantViolations);
+ const testType = getConditionalAnnotation(binding, path, name);
+
+ if (testType) {
+ const testConstantViolations = getConstantViolationsBefore(binding, testType.ifStatement);
+ constantViolations = constantViolations.filter(path => testConstantViolations.indexOf(path) < 0);
+ types.push(testType.typeAnnotation);
+ }
+
+ if (constantViolations.length) {
+ constantViolations.push(...functionConstantViolations);
+
+ for (const violation of constantViolations) {
+ types.push(violation.getTypeAnnotation());
+ }
+ }
+
+ if (!types.length) {
+ return;
+ }
+
+ if (isTSTypeAnnotation(types[0]) && createTSUnionType) {
+ return createTSUnionType(types);
+ }
+
+ if (createFlowUnionType) {
+ return createFlowUnionType(types);
+ }
+
+ return createUnionTypeAnnotation(types);
+}
+
+function getConstantViolationsBefore(binding, path, functions) {
+ const violations = binding.constantViolations.slice();
+ violations.unshift(binding.path);
+ return violations.filter(violation => {
+ violation = violation.resolve();
+
+ const status = violation._guessExecutionStatusRelativeTo(path);
+
+ if (functions && status === "unknown") functions.push(violation);
+ return status === "before";
+ });
+}
+
+function inferAnnotationFromBinaryExpression(name, path) {
+ const operator = path.node.operator;
+ const right = path.get("right").resolve();
+ const left = path.get("left").resolve();
+ let target;
+
+ if (left.isIdentifier({
+ name
+ })) {
+ target = right;
+ } else if (right.isIdentifier({
+ name
+ })) {
+ target = left;
+ }
+
+ if (target) {
+ if (operator === "===") {
+ return target.getTypeAnnotation();
+ }
+
+ if (BOOLEAN_NUMBER_BINARY_OPERATORS.indexOf(operator) >= 0) {
+ return numberTypeAnnotation();
+ }
+
+ return;
+ }
+
+ if (operator !== "===" && operator !== "==") return;
+ let typeofPath;
+ let typePath;
+
+ if (left.isUnaryExpression({
+ operator: "typeof"
+ })) {
+ typeofPath = left;
+ typePath = right;
+ } else if (right.isUnaryExpression({
+ operator: "typeof"
+ })) {
+ typeofPath = right;
+ typePath = left;
+ }
+
+ if (!typeofPath) return;
+ if (!typeofPath.get("argument").isIdentifier({
+ name
+ })) return;
+ typePath = typePath.resolve();
+ if (!typePath.isLiteral()) return;
+ const typeValue = typePath.node.value;
+ if (typeof typeValue !== "string") return;
+ return createTypeAnnotationBasedOnTypeof(typeValue);
+}
+
+function getParentConditionalPath(binding, path, name) {
+ let parentPath;
+
+ while (parentPath = path.parentPath) {
+ if (parentPath.isIfStatement() || parentPath.isConditionalExpression()) {
+ if (path.key === "test") {
+ return;
+ }
+
+ return parentPath;
+ }
+
+ if (parentPath.isFunction()) {
+ if (parentPath.parentPath.scope.getBinding(name) !== binding) return;
+ }
+
+ path = parentPath;
+ }
+}
+
+function getConditionalAnnotation(binding, path, name) {
+ const ifStatement = getParentConditionalPath(binding, path, name);
+ if (!ifStatement) return;
+ const test = ifStatement.get("test");
+ const paths = [test];
+ const types = [];
+
+ for (let i = 0; i < paths.length; i++) {
+ const path = paths[i];
+
+ if (path.isLogicalExpression()) {
+ if (path.node.operator === "&&") {
+ paths.push(path.get("left"));
+ paths.push(path.get("right"));
+ }
+ } else if (path.isBinaryExpression()) {
+ const type = inferAnnotationFromBinaryExpression(name, path);
+ if (type) types.push(type);
+ }
+ }
+
+ if (types.length) {
+ if (isTSTypeAnnotation(types[0]) && createTSUnionType) {
+ return {
+ typeAnnotation: createTSUnionType(types),
+ ifStatement
+ };
+ }
+
+ if (createFlowUnionType) {
+ return {
+ typeAnnotation: createFlowUnionType(types),
+ ifStatement
+ };
+ }
+
+ return {
+ typeAnnotation: createUnionTypeAnnotation(types),
+ ifStatement
+ };
+ }
+
+ return getConditionalAnnotation(ifStatement, name);
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/traverse/lib/path/inference/inferers.js b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/inference/inferers.js
new file mode 100644
index 00000000000..043522458a2
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/inference/inferers.js
@@ -0,0 +1,261 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.VariableDeclarator = VariableDeclarator;
+exports.TypeCastExpression = TypeCastExpression;
+exports.NewExpression = NewExpression;
+exports.TemplateLiteral = TemplateLiteral;
+exports.UnaryExpression = UnaryExpression;
+exports.BinaryExpression = BinaryExpression;
+exports.LogicalExpression = LogicalExpression;
+exports.ConditionalExpression = ConditionalExpression;
+exports.SequenceExpression = SequenceExpression;
+exports.ParenthesizedExpression = ParenthesizedExpression;
+exports.AssignmentExpression = AssignmentExpression;
+exports.UpdateExpression = UpdateExpression;
+exports.StringLiteral = StringLiteral;
+exports.NumericLiteral = NumericLiteral;
+exports.BooleanLiteral = BooleanLiteral;
+exports.NullLiteral = NullLiteral;
+exports.RegExpLiteral = RegExpLiteral;
+exports.ObjectExpression = ObjectExpression;
+exports.ArrayExpression = ArrayExpression;
+exports.RestElement = RestElement;
+exports.ClassDeclaration = exports.ClassExpression = exports.FunctionDeclaration = exports.ArrowFunctionExpression = exports.FunctionExpression = Func;
+exports.CallExpression = CallExpression;
+exports.TaggedTemplateExpression = TaggedTemplateExpression;
+Object.defineProperty(exports, "Identifier", {
+ enumerable: true,
+ get: function () {
+ return _infererReference.default;
+ }
+});
+
+var _t = require("@babel/types");
+
+var _infererReference = require("./inferer-reference");
+
+const {
+ BOOLEAN_BINARY_OPERATORS,
+ BOOLEAN_UNARY_OPERATORS,
+ NUMBER_BINARY_OPERATORS,
+ NUMBER_UNARY_OPERATORS,
+ STRING_UNARY_OPERATORS,
+ anyTypeAnnotation,
+ arrayTypeAnnotation,
+ booleanTypeAnnotation,
+ buildMatchMemberExpression,
+ createFlowUnionType,
+ createTSUnionType,
+ createUnionTypeAnnotation,
+ genericTypeAnnotation,
+ identifier,
+ isTSTypeAnnotation,
+ nullLiteralTypeAnnotation,
+ numberTypeAnnotation,
+ stringTypeAnnotation,
+ tupleTypeAnnotation,
+ unionTypeAnnotation,
+ voidTypeAnnotation
+} = _t;
+
+function VariableDeclarator() {
+ var _type;
+
+ const id = this.get("id");
+ if (!id.isIdentifier()) return;
+ const init = this.get("init");
+ let type = init.getTypeAnnotation();
+
+ if (((_type = type) == null ? void 0 : _type.type) === "AnyTypeAnnotation") {
+ if (init.isCallExpression() && init.get("callee").isIdentifier({
+ name: "Array"
+ }) && !init.scope.hasBinding("Array", true)) {
+ type = ArrayExpression();
+ }
+ }
+
+ return type;
+}
+
+function TypeCastExpression(node) {
+ return node.typeAnnotation;
+}
+
+TypeCastExpression.validParent = true;
+
+function NewExpression(node) {
+ if (this.get("callee").isIdentifier()) {
+ return genericTypeAnnotation(node.callee);
+ }
+}
+
+function TemplateLiteral() {
+ return stringTypeAnnotation();
+}
+
+function UnaryExpression(node) {
+ const operator = node.operator;
+
+ if (operator === "void") {
+ return voidTypeAnnotation();
+ } else if (NUMBER_UNARY_OPERATORS.indexOf(operator) >= 0) {
+ return numberTypeAnnotation();
+ } else if (STRING_UNARY_OPERATORS.indexOf(operator) >= 0) {
+ return stringTypeAnnotation();
+ } else if (BOOLEAN_UNARY_OPERATORS.indexOf(operator) >= 0) {
+ return booleanTypeAnnotation();
+ }
+}
+
+function BinaryExpression(node) {
+ const operator = node.operator;
+
+ if (NUMBER_BINARY_OPERATORS.indexOf(operator) >= 0) {
+ return numberTypeAnnotation();
+ } else if (BOOLEAN_BINARY_OPERATORS.indexOf(operator) >= 0) {
+ return booleanTypeAnnotation();
+ } else if (operator === "+") {
+ const right = this.get("right");
+ const left = this.get("left");
+
+ if (left.isBaseType("number") && right.isBaseType("number")) {
+ return numberTypeAnnotation();
+ } else if (left.isBaseType("string") || right.isBaseType("string")) {
+ return stringTypeAnnotation();
+ }
+
+ return unionTypeAnnotation([stringTypeAnnotation(), numberTypeAnnotation()]);
+ }
+}
+
+function LogicalExpression() {
+ const argumentTypes = [this.get("left").getTypeAnnotation(), this.get("right").getTypeAnnotation()];
+
+ if (isTSTypeAnnotation(argumentTypes[0]) && createTSUnionType) {
+ return createTSUnionType(argumentTypes);
+ }
+
+ if (createFlowUnionType) {
+ return createFlowUnionType(argumentTypes);
+ }
+
+ return createUnionTypeAnnotation(argumentTypes);
+}
+
+function ConditionalExpression() {
+ const argumentTypes = [this.get("consequent").getTypeAnnotation(), this.get("alternate").getTypeAnnotation()];
+
+ if (isTSTypeAnnotation(argumentTypes[0]) && createTSUnionType) {
+ return createTSUnionType(argumentTypes);
+ }
+
+ if (createFlowUnionType) {
+ return createFlowUnionType(argumentTypes);
+ }
+
+ return createUnionTypeAnnotation(argumentTypes);
+}
+
+function SequenceExpression() {
+ return this.get("expressions").pop().getTypeAnnotation();
+}
+
+function ParenthesizedExpression() {
+ return this.get("expression").getTypeAnnotation();
+}
+
+function AssignmentExpression() {
+ return this.get("right").getTypeAnnotation();
+}
+
+function UpdateExpression(node) {
+ const operator = node.operator;
+
+ if (operator === "++" || operator === "--") {
+ return numberTypeAnnotation();
+ }
+}
+
+function StringLiteral() {
+ return stringTypeAnnotation();
+}
+
+function NumericLiteral() {
+ return numberTypeAnnotation();
+}
+
+function BooleanLiteral() {
+ return booleanTypeAnnotation();
+}
+
+function NullLiteral() {
+ return nullLiteralTypeAnnotation();
+}
+
+function RegExpLiteral() {
+ return genericTypeAnnotation(identifier("RegExp"));
+}
+
+function ObjectExpression() {
+ return genericTypeAnnotation(identifier("Object"));
+}
+
+function ArrayExpression() {
+ return genericTypeAnnotation(identifier("Array"));
+}
+
+function RestElement() {
+ return ArrayExpression();
+}
+
+RestElement.validParent = true;
+
+function Func() {
+ return genericTypeAnnotation(identifier("Function"));
+}
+
+const isArrayFrom = buildMatchMemberExpression("Array.from");
+const isObjectKeys = buildMatchMemberExpression("Object.keys");
+const isObjectValues = buildMatchMemberExpression("Object.values");
+const isObjectEntries = buildMatchMemberExpression("Object.entries");
+
+function CallExpression() {
+ const {
+ callee
+ } = this.node;
+
+ if (isObjectKeys(callee)) {
+ return arrayTypeAnnotation(stringTypeAnnotation());
+ } else if (isArrayFrom(callee) || isObjectValues(callee)) {
+ return arrayTypeAnnotation(anyTypeAnnotation());
+ } else if (isObjectEntries(callee)) {
+ return arrayTypeAnnotation(tupleTypeAnnotation([stringTypeAnnotation(), anyTypeAnnotation()]));
+ }
+
+ return resolveCall(this.get("callee"));
+}
+
+function TaggedTemplateExpression() {
+ return resolveCall(this.get("tag"));
+}
+
+function resolveCall(callee) {
+ callee = callee.resolve();
+
+ if (callee.isFunction()) {
+ if (callee.is("async")) {
+ if (callee.is("generator")) {
+ return genericTypeAnnotation(identifier("AsyncIterator"));
+ } else {
+ return genericTypeAnnotation(identifier("Promise"));
+ }
+ } else {
+ if (callee.node.returnType) {
+ return callee.node.returnType;
+ } else {}
+ }
+ }
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/traverse/lib/path/introspection.js b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/introspection.js
new file mode 100644
index 00000000000..65f98110bcf
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/introspection.js
@@ -0,0 +1,436 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.matchesPattern = matchesPattern;
+exports.has = has;
+exports.isStatic = isStatic;
+exports.isnt = isnt;
+exports.equals = equals;
+exports.isNodeType = isNodeType;
+exports.canHaveVariableDeclarationOrExpression = canHaveVariableDeclarationOrExpression;
+exports.canSwapBetweenExpressionAndStatement = canSwapBetweenExpressionAndStatement;
+exports.isCompletionRecord = isCompletionRecord;
+exports.isStatementOrBlock = isStatementOrBlock;
+exports.referencesImport = referencesImport;
+exports.getSource = getSource;
+exports.willIMaybeExecuteBefore = willIMaybeExecuteBefore;
+exports._guessExecutionStatusRelativeTo = _guessExecutionStatusRelativeTo;
+exports._guessExecutionStatusRelativeToDifferentFunctions = _guessExecutionStatusRelativeToDifferentFunctions;
+exports.resolve = resolve;
+exports._resolve = _resolve;
+exports.isConstantExpression = isConstantExpression;
+exports.isInStrictMode = isInStrictMode;
+exports.is = void 0;
+
+var _t = require("@babel/types");
+
+const {
+ STATEMENT_OR_BLOCK_KEYS,
+ VISITOR_KEYS,
+ isBlockStatement,
+ isExpression,
+ isIdentifier,
+ isLiteral,
+ isStringLiteral,
+ isType,
+ matchesPattern: _matchesPattern
+} = _t;
+
+function matchesPattern(pattern, allowPartial) {
+ return _matchesPattern(this.node, pattern, allowPartial);
+}
+
+function has(key) {
+ const val = this.node && this.node[key];
+
+ if (val && Array.isArray(val)) {
+ return !!val.length;
+ } else {
+ return !!val;
+ }
+}
+
+function isStatic() {
+ return this.scope.isStatic(this.node);
+}
+
+const is = has;
+exports.is = is;
+
+function isnt(key) {
+ return !this.has(key);
+}
+
+function equals(key, value) {
+ return this.node[key] === value;
+}
+
+function isNodeType(type) {
+ return isType(this.type, type);
+}
+
+function canHaveVariableDeclarationOrExpression() {
+ return (this.key === "init" || this.key === "left") && this.parentPath.isFor();
+}
+
+function canSwapBetweenExpressionAndStatement(replacement) {
+ if (this.key !== "body" || !this.parentPath.isArrowFunctionExpression()) {
+ return false;
+ }
+
+ if (this.isExpression()) {
+ return isBlockStatement(replacement);
+ } else if (this.isBlockStatement()) {
+ return isExpression(replacement);
+ }
+
+ return false;
+}
+
+function isCompletionRecord(allowInsideFunction) {
+ let path = this;
+ let first = true;
+
+ do {
+ const container = path.container;
+
+ if (path.isFunction() && !first) {
+ return !!allowInsideFunction;
+ }
+
+ first = false;
+
+ if (Array.isArray(container) && path.key !== container.length - 1) {
+ return false;
+ }
+ } while ((path = path.parentPath) && !path.isProgram());
+
+ return true;
+}
+
+function isStatementOrBlock() {
+ if (this.parentPath.isLabeledStatement() || isBlockStatement(this.container)) {
+ return false;
+ } else {
+ return STATEMENT_OR_BLOCK_KEYS.includes(this.key);
+ }
+}
+
+function referencesImport(moduleSource, importName) {
+ if (!this.isReferencedIdentifier()) {
+ if ((this.isMemberExpression() || this.isOptionalMemberExpression()) && (this.node.computed ? isStringLiteral(this.node.property, {
+ value: importName
+ }) : this.node.property.name === importName)) {
+ const object = this.get("object");
+ return object.isReferencedIdentifier() && object.referencesImport(moduleSource, "*");
+ }
+
+ return false;
+ }
+
+ const binding = this.scope.getBinding(this.node.name);
+ if (!binding || binding.kind !== "module") return false;
+ const path = binding.path;
+ const parent = path.parentPath;
+ if (!parent.isImportDeclaration()) return false;
+
+ if (parent.node.source.value === moduleSource) {
+ if (!importName) return true;
+ } else {
+ return false;
+ }
+
+ if (path.isImportDefaultSpecifier() && importName === "default") {
+ return true;
+ }
+
+ if (path.isImportNamespaceSpecifier() && importName === "*") {
+ return true;
+ }
+
+ if (path.isImportSpecifier() && isIdentifier(path.node.imported, {
+ name: importName
+ })) {
+ return true;
+ }
+
+ return false;
+}
+
+function getSource() {
+ const node = this.node;
+
+ if (node.end) {
+ const code = this.hub.getCode();
+ if (code) return code.slice(node.start, node.end);
+ }
+
+ return "";
+}
+
+function willIMaybeExecuteBefore(target) {
+ return this._guessExecutionStatusRelativeTo(target) !== "after";
+}
+
+function getOuterFunction(path) {
+ return (path.scope.getFunctionParent() || path.scope.getProgramParent()).path;
+}
+
+function isExecutionUncertain(type, key) {
+ switch (type) {
+ case "LogicalExpression":
+ return key === "right";
+
+ case "ConditionalExpression":
+ case "IfStatement":
+ return key === "consequent" || key === "alternate";
+
+ case "WhileStatement":
+ case "DoWhileStatement":
+ case "ForInStatement":
+ case "ForOfStatement":
+ return key === "body";
+
+ case "ForStatement":
+ return key === "body" || key === "update";
+
+ case "SwitchStatement":
+ return key === "cases";
+
+ case "TryStatement":
+ return key === "handler";
+
+ case "AssignmentPattern":
+ return key === "right";
+
+ case "OptionalMemberExpression":
+ return key === "property";
+
+ case "OptionalCallExpression":
+ return key === "arguments";
+
+ default:
+ return false;
+ }
+}
+
+function isExecutionUncertainInList(paths, maxIndex) {
+ for (let i = 0; i < maxIndex; i++) {
+ const path = paths[i];
+
+ if (isExecutionUncertain(path.parent.type, path.parentKey)) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+function _guessExecutionStatusRelativeTo(target) {
+ const funcParent = {
+ this: getOuterFunction(this),
+ target: getOuterFunction(target)
+ };
+
+ if (funcParent.target.node !== funcParent.this.node) {
+ return this._guessExecutionStatusRelativeToDifferentFunctions(funcParent.target);
+ }
+
+ const paths = {
+ target: target.getAncestry(),
+ this: this.getAncestry()
+ };
+ if (paths.target.indexOf(this) >= 0) return "after";
+ if (paths.this.indexOf(target) >= 0) return "before";
+ let commonPath;
+ const commonIndex = {
+ target: 0,
+ this: 0
+ };
+
+ while (!commonPath && commonIndex.this < paths.this.length) {
+ const path = paths.this[commonIndex.this];
+ commonIndex.target = paths.target.indexOf(path);
+
+ if (commonIndex.target >= 0) {
+ commonPath = path;
+ } else {
+ commonIndex.this++;
+ }
+ }
+
+ if (!commonPath) {
+ throw new Error("Internal Babel error - The two compared nodes" + " don't appear to belong to the same program.");
+ }
+
+ if (isExecutionUncertainInList(paths.this, commonIndex.this - 1) || isExecutionUncertainInList(paths.target, commonIndex.target - 1)) {
+ return "unknown";
+ }
+
+ const divergence = {
+ this: paths.this[commonIndex.this - 1],
+ target: paths.target[commonIndex.target - 1]
+ };
+
+ if (divergence.target.listKey && divergence.this.listKey && divergence.target.container === divergence.this.container) {
+ return divergence.target.key > divergence.this.key ? "before" : "after";
+ }
+
+ const keys = VISITOR_KEYS[commonPath.type];
+ const keyPosition = {
+ this: keys.indexOf(divergence.this.parentKey),
+ target: keys.indexOf(divergence.target.parentKey)
+ };
+ return keyPosition.target > keyPosition.this ? "before" : "after";
+}
+
+const executionOrderCheckedNodes = new WeakSet();
+
+function _guessExecutionStatusRelativeToDifferentFunctions(target) {
+ if (!target.isFunctionDeclaration() || target.parentPath.isExportDeclaration()) {
+ return "unknown";
+ }
+
+ const binding = target.scope.getBinding(target.node.id.name);
+ if (!binding.references) return "before";
+ const referencePaths = binding.referencePaths;
+ let allStatus;
+
+ for (const path of referencePaths) {
+ const childOfFunction = !!path.find(path => path.node === target.node);
+ if (childOfFunction) continue;
+
+ if (path.key !== "callee" || !path.parentPath.isCallExpression()) {
+ return "unknown";
+ }
+
+ if (executionOrderCheckedNodes.has(path.node)) continue;
+ executionOrderCheckedNodes.add(path.node);
+
+ const status = this._guessExecutionStatusRelativeTo(path);
+
+ executionOrderCheckedNodes.delete(path.node);
+
+ if (allStatus && allStatus !== status) {
+ return "unknown";
+ } else {
+ allStatus = status;
+ }
+ }
+
+ return allStatus;
+}
+
+function resolve(dangerous, resolved) {
+ return this._resolve(dangerous, resolved) || this;
+}
+
+function _resolve(dangerous, resolved) {
+ if (resolved && resolved.indexOf(this) >= 0) return;
+ resolved = resolved || [];
+ resolved.push(this);
+
+ if (this.isVariableDeclarator()) {
+ if (this.get("id").isIdentifier()) {
+ return this.get("init").resolve(dangerous, resolved);
+ } else {}
+ } else if (this.isReferencedIdentifier()) {
+ const binding = this.scope.getBinding(this.node.name);
+ if (!binding) return;
+ if (!binding.constant) return;
+ if (binding.kind === "module") return;
+
+ if (binding.path !== this) {
+ const ret = binding.path.resolve(dangerous, resolved);
+ if (this.find(parent => parent.node === ret.node)) return;
+ return ret;
+ }
+ } else if (this.isTypeCastExpression()) {
+ return this.get("expression").resolve(dangerous, resolved);
+ } else if (dangerous && this.isMemberExpression()) {
+ const targetKey = this.toComputedKey();
+ if (!isLiteral(targetKey)) return;
+ const targetName = targetKey.value;
+ const target = this.get("object").resolve(dangerous, resolved);
+
+ if (target.isObjectExpression()) {
+ const props = target.get("properties");
+
+ for (const prop of props) {
+ if (!prop.isProperty()) continue;
+ const key = prop.get("key");
+ let match = prop.isnt("computed") && key.isIdentifier({
+ name: targetName
+ });
+ match = match || key.isLiteral({
+ value: targetName
+ });
+ if (match) return prop.get("value").resolve(dangerous, resolved);
+ }
+ } else if (target.isArrayExpression() && !isNaN(+targetName)) {
+ const elems = target.get("elements");
+ const elem = elems[targetName];
+ if (elem) return elem.resolve(dangerous, resolved);
+ }
+ }
+}
+
+function isConstantExpression() {
+ if (this.isIdentifier()) {
+ const binding = this.scope.getBinding(this.node.name);
+ if (!binding) return false;
+ return binding.constant;
+ }
+
+ if (this.isLiteral()) {
+ if (this.isRegExpLiteral()) {
+ return false;
+ }
+
+ if (this.isTemplateLiteral()) {
+ return this.get("expressions").every(expression => expression.isConstantExpression());
+ }
+
+ return true;
+ }
+
+ if (this.isUnaryExpression()) {
+ if (this.node.operator !== "void") {
+ return false;
+ }
+
+ return this.get("argument").isConstantExpression();
+ }
+
+ if (this.isBinaryExpression()) {
+ return this.get("left").isConstantExpression() && this.get("right").isConstantExpression();
+ }
+
+ return false;
+}
+
+function isInStrictMode() {
+ const start = this.isProgram() ? this : this.parentPath;
+ const strictParent = start.find(path => {
+ if (path.isProgram({
+ sourceType: "module"
+ })) return true;
+ if (path.isClass()) return true;
+ if (!path.isProgram() && !path.isFunction()) return false;
+
+ if (path.isArrowFunctionExpression() && !path.get("body").isBlockStatement()) {
+ return false;
+ }
+
+ const body = path.isFunction() ? path.node.body : path.node;
+
+ for (const directive of body.directives) {
+ if (directive.value.value === "use strict") {
+ return true;
+ }
+ }
+ });
+ return !!strictParent;
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/traverse/lib/path/lib/hoister.js b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/lib/hoister.js
new file mode 100644
index 00000000000..536a3409741
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/lib/hoister.js
@@ -0,0 +1,206 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = void 0;
+
+var _t = require("@babel/types");
+
+var _t2 = _t;
+const {
+ react
+} = _t;
+const {
+ cloneNode,
+ jsxExpressionContainer,
+ variableDeclaration,
+ variableDeclarator
+} = _t2;
+const referenceVisitor = {
+ ReferencedIdentifier(path, state) {
+ if (path.isJSXIdentifier() && react.isCompatTag(path.node.name) && !path.parentPath.isJSXMemberExpression()) {
+ return;
+ }
+
+ if (path.node.name === "this") {
+ let scope = path.scope;
+
+ do {
+ if (scope.path.isFunction() && !scope.path.isArrowFunctionExpression()) {
+ break;
+ }
+ } while (scope = scope.parent);
+
+ if (scope) state.breakOnScopePaths.push(scope.path);
+ }
+
+ const binding = path.scope.getBinding(path.node.name);
+ if (!binding) return;
+
+ for (const violation of binding.constantViolations) {
+ if (violation.scope !== binding.path.scope) {
+ state.mutableBinding = true;
+ path.stop();
+ return;
+ }
+ }
+
+ if (binding !== state.scope.getBinding(path.node.name)) return;
+ state.bindings[path.node.name] = binding;
+ }
+
+};
+
+class PathHoister {
+ constructor(path, scope) {
+ this.breakOnScopePaths = void 0;
+ this.bindings = void 0;
+ this.mutableBinding = void 0;
+ this.scopes = void 0;
+ this.scope = void 0;
+ this.path = void 0;
+ this.attachAfter = void 0;
+ this.breakOnScopePaths = [];
+ this.bindings = {};
+ this.mutableBinding = false;
+ this.scopes = [];
+ this.scope = scope;
+ this.path = path;
+ this.attachAfter = false;
+ }
+
+ isCompatibleScope(scope) {
+ for (const key of Object.keys(this.bindings)) {
+ const binding = this.bindings[key];
+
+ if (!scope.bindingIdentifierEquals(key, binding.identifier)) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ getCompatibleScopes() {
+ let scope = this.path.scope;
+
+ do {
+ if (this.isCompatibleScope(scope)) {
+ this.scopes.push(scope);
+ } else {
+ break;
+ }
+
+ if (this.breakOnScopePaths.indexOf(scope.path) >= 0) {
+ break;
+ }
+ } while (scope = scope.parent);
+ }
+
+ getAttachmentPath() {
+ let path = this._getAttachmentPath();
+
+ if (!path) return;
+ let targetScope = path.scope;
+
+ if (targetScope.path === path) {
+ targetScope = path.scope.parent;
+ }
+
+ if (targetScope.path.isProgram() || targetScope.path.isFunction()) {
+ for (const name of Object.keys(this.bindings)) {
+ if (!targetScope.hasOwnBinding(name)) continue;
+ const binding = this.bindings[name];
+
+ if (binding.kind === "param" || binding.path.parentKey === "params") {
+ continue;
+ }
+
+ const bindingParentPath = this.getAttachmentParentForPath(binding.path);
+
+ if (bindingParentPath.key >= path.key) {
+ this.attachAfter = true;
+ path = binding.path;
+
+ for (const violationPath of binding.constantViolations) {
+ if (this.getAttachmentParentForPath(violationPath).key > path.key) {
+ path = violationPath;
+ }
+ }
+ }
+ }
+ }
+
+ return path;
+ }
+
+ _getAttachmentPath() {
+ const scopes = this.scopes;
+ const scope = scopes.pop();
+ if (!scope) return;
+
+ if (scope.path.isFunction()) {
+ if (this.hasOwnParamBindings(scope)) {
+ if (this.scope === scope) return;
+ const bodies = scope.path.get("body").get("body");
+
+ for (let i = 0; i < bodies.length; i++) {
+ if (bodies[i].node._blockHoist) continue;
+ return bodies[i];
+ }
+ } else {
+ return this.getNextScopeAttachmentParent();
+ }
+ } else if (scope.path.isProgram()) {
+ return this.getNextScopeAttachmentParent();
+ }
+ }
+
+ getNextScopeAttachmentParent() {
+ const scope = this.scopes.pop();
+ if (scope) return this.getAttachmentParentForPath(scope.path);
+ }
+
+ getAttachmentParentForPath(path) {
+ do {
+ if (!path.parentPath || Array.isArray(path.container) && path.isStatement()) {
+ return path;
+ }
+ } while (path = path.parentPath);
+ }
+
+ hasOwnParamBindings(scope) {
+ for (const name of Object.keys(this.bindings)) {
+ if (!scope.hasOwnBinding(name)) continue;
+ const binding = this.bindings[name];
+ if (binding.kind === "param" && binding.constant) return true;
+ }
+
+ return false;
+ }
+
+ run() {
+ this.path.traverse(referenceVisitor, this);
+ if (this.mutableBinding) return;
+ this.getCompatibleScopes();
+ const attachTo = this.getAttachmentPath();
+ if (!attachTo) return;
+ if (attachTo.getFunctionParent() === this.path.getFunctionParent()) return;
+ let uid = attachTo.scope.generateUidIdentifier("ref");
+ const declarator = variableDeclarator(uid, this.path.node);
+ const insertFn = this.attachAfter ? "insertAfter" : "insertBefore";
+ const [attached] = attachTo[insertFn]([attachTo.isVariableDeclarator() ? declarator : variableDeclaration("var", [declarator])]);
+ const parent = this.path.parentPath;
+
+ if (parent.isJSXElement() && this.path.container === parent.node.children) {
+ uid = jsxExpressionContainer(uid);
+ }
+
+ this.path.replaceWith(cloneNode(uid));
+ return attachTo.isVariableDeclarator() ? attached.get("init") : attached.get("declarations.0.init");
+ }
+
+}
+
+exports.default = PathHoister; \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/traverse/lib/path/lib/removal-hooks.js b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/lib/removal-hooks.js
new file mode 100644
index 00000000000..23ec8fe6d7e
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/lib/removal-hooks.js
@@ -0,0 +1,38 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.hooks = void 0;
+const hooks = [function (self, parent) {
+ const removeParent = self.key === "test" && (parent.isWhile() || parent.isSwitchCase()) || self.key === "declaration" && parent.isExportDeclaration() || self.key === "body" && parent.isLabeledStatement() || self.listKey === "declarations" && parent.isVariableDeclaration() && parent.node.declarations.length === 1 || self.key === "expression" && parent.isExpressionStatement();
+
+ if (removeParent) {
+ parent.remove();
+ return true;
+ }
+}, function (self, parent) {
+ if (parent.isSequenceExpression() && parent.node.expressions.length === 1) {
+ parent.replaceWith(parent.node.expressions[0]);
+ return true;
+ }
+}, function (self, parent) {
+ if (parent.isBinary()) {
+ if (self.key === "left") {
+ parent.replaceWith(parent.node.right);
+ } else {
+ parent.replaceWith(parent.node.left);
+ }
+
+ return true;
+ }
+}, function (self, parent) {
+ if (parent.isIfStatement() && (self.key === "consequent" || self.key === "alternate") || self.key === "body" && (parent.isLoop() || parent.isArrowFunctionExpression())) {
+ self.replaceWith({
+ type: "BlockStatement",
+ body: []
+ });
+ return true;
+ }
+}];
+exports.hooks = hooks; \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/traverse/lib/path/lib/virtual-types.js b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/lib/virtual-types.js
new file mode 100644
index 00000000000..7dbda0b7ad8
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/lib/virtual-types.js
@@ -0,0 +1,230 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.ForAwaitStatement = exports.NumericLiteralTypeAnnotation = exports.ExistentialTypeParam = exports.SpreadProperty = exports.RestProperty = exports.Flow = exports.Pure = exports.Generated = exports.User = exports.Var = exports.BlockScoped = exports.Referenced = exports.Scope = exports.Expression = exports.Statement = exports.BindingIdentifier = exports.ReferencedMemberExpression = exports.ReferencedIdentifier = void 0;
+
+var _t = require("@babel/types");
+
+const {
+ isBinding,
+ isBlockScoped,
+ isExportDeclaration,
+ isExpression,
+ isFlow,
+ isForStatement,
+ isForXStatement,
+ isIdentifier,
+ isImportDeclaration,
+ isImportSpecifier,
+ isJSXIdentifier,
+ isJSXMemberExpression,
+ isMemberExpression,
+ isReferenced,
+ isScope,
+ isStatement,
+ isVar,
+ isVariableDeclaration,
+ react
+} = _t;
+const {
+ isCompatTag
+} = react;
+const ReferencedIdentifier = {
+ types: ["Identifier", "JSXIdentifier"],
+
+ checkPath(path, opts) {
+ const {
+ node,
+ parent
+ } = path;
+
+ if (!isIdentifier(node, opts) && !isJSXMemberExpression(parent, opts)) {
+ if (isJSXIdentifier(node, opts)) {
+ if (isCompatTag(node.name)) return false;
+ } else {
+ return false;
+ }
+ }
+
+ return isReferenced(node, parent, path.parentPath.parent);
+ }
+
+};
+exports.ReferencedIdentifier = ReferencedIdentifier;
+const ReferencedMemberExpression = {
+ types: ["MemberExpression"],
+
+ checkPath({
+ node,
+ parent
+ }) {
+ return isMemberExpression(node) && isReferenced(node, parent);
+ }
+
+};
+exports.ReferencedMemberExpression = ReferencedMemberExpression;
+const BindingIdentifier = {
+ types: ["Identifier"],
+
+ checkPath(path) {
+ const {
+ node,
+ parent
+ } = path;
+ const grandparent = path.parentPath.parent;
+ return isIdentifier(node) && isBinding(node, parent, grandparent);
+ }
+
+};
+exports.BindingIdentifier = BindingIdentifier;
+const Statement = {
+ types: ["Statement"],
+
+ checkPath({
+ node,
+ parent
+ }) {
+ if (isStatement(node)) {
+ if (isVariableDeclaration(node)) {
+ if (isForXStatement(parent, {
+ left: node
+ })) return false;
+ if (isForStatement(parent, {
+ init: node
+ })) return false;
+ }
+
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+};
+exports.Statement = Statement;
+const Expression = {
+ types: ["Expression"],
+
+ checkPath(path) {
+ if (path.isIdentifier()) {
+ return path.isReferencedIdentifier();
+ } else {
+ return isExpression(path.node);
+ }
+ }
+
+};
+exports.Expression = Expression;
+const Scope = {
+ types: ["Scopable", "Pattern"],
+
+ checkPath(path) {
+ return isScope(path.node, path.parent);
+ }
+
+};
+exports.Scope = Scope;
+const Referenced = {
+ checkPath(path) {
+ return isReferenced(path.node, path.parent);
+ }
+
+};
+exports.Referenced = Referenced;
+const BlockScoped = {
+ checkPath(path) {
+ return isBlockScoped(path.node);
+ }
+
+};
+exports.BlockScoped = BlockScoped;
+const Var = {
+ types: ["VariableDeclaration"],
+
+ checkPath(path) {
+ return isVar(path.node);
+ }
+
+};
+exports.Var = Var;
+const User = {
+ checkPath(path) {
+ return path.node && !!path.node.loc;
+ }
+
+};
+exports.User = User;
+const Generated = {
+ checkPath(path) {
+ return !path.isUser();
+ }
+
+};
+exports.Generated = Generated;
+const Pure = {
+ checkPath(path, opts) {
+ return path.scope.isPure(path.node, opts);
+ }
+
+};
+exports.Pure = Pure;
+const Flow = {
+ types: ["Flow", "ImportDeclaration", "ExportDeclaration", "ImportSpecifier"],
+
+ checkPath({
+ node
+ }) {
+ if (isFlow(node)) {
+ return true;
+ } else if (isImportDeclaration(node)) {
+ return node.importKind === "type" || node.importKind === "typeof";
+ } else if (isExportDeclaration(node)) {
+ return node.exportKind === "type";
+ } else if (isImportSpecifier(node)) {
+ return node.importKind === "type" || node.importKind === "typeof";
+ } else {
+ return false;
+ }
+ }
+
+};
+exports.Flow = Flow;
+const RestProperty = {
+ types: ["RestElement"],
+
+ checkPath(path) {
+ return path.parentPath && path.parentPath.isObjectPattern();
+ }
+
+};
+exports.RestProperty = RestProperty;
+const SpreadProperty = {
+ types: ["RestElement"],
+
+ checkPath(path) {
+ return path.parentPath && path.parentPath.isObjectExpression();
+ }
+
+};
+exports.SpreadProperty = SpreadProperty;
+const ExistentialTypeParam = {
+ types: ["ExistsTypeAnnotation"]
+};
+exports.ExistentialTypeParam = ExistentialTypeParam;
+const NumericLiteralTypeAnnotation = {
+ types: ["NumberLiteralTypeAnnotation"]
+};
+exports.NumericLiteralTypeAnnotation = NumericLiteralTypeAnnotation;
+const ForAwaitStatement = {
+ types: ["ForOfStatement"],
+
+ checkPath({
+ node
+ }) {
+ return node.await === true;
+ }
+
+};
+exports.ForAwaitStatement = ForAwaitStatement; \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/traverse/lib/path/modification.js b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/modification.js
new file mode 100644
index 00000000000..8b8c08925f8
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/modification.js
@@ -0,0 +1,232 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.insertBefore = insertBefore;
+exports._containerInsert = _containerInsert;
+exports._containerInsertBefore = _containerInsertBefore;
+exports._containerInsertAfter = _containerInsertAfter;
+exports.insertAfter = insertAfter;
+exports.updateSiblingKeys = updateSiblingKeys;
+exports._verifyNodeList = _verifyNodeList;
+exports.unshiftContainer = unshiftContainer;
+exports.pushContainer = pushContainer;
+exports.hoist = hoist;
+
+var _cache = require("../cache");
+
+var _hoister = require("./lib/hoister");
+
+var _index = require("./index");
+
+var _t = require("@babel/types");
+
+const {
+ arrowFunctionExpression,
+ assertExpression,
+ assignmentExpression,
+ blockStatement,
+ callExpression,
+ cloneNode,
+ expressionStatement,
+ isExpression
+} = _t;
+
+function insertBefore(nodes_) {
+ this._assertUnremoved();
+
+ const nodes = this._verifyNodeList(nodes_);
+
+ const {
+ parentPath
+ } = this;
+
+ if (parentPath.isExpressionStatement() || parentPath.isLabeledStatement() || parentPath.isExportNamedDeclaration() || parentPath.isExportDefaultDeclaration() && this.isDeclaration()) {
+ return parentPath.insertBefore(nodes);
+ } else if (this.isNodeType("Expression") && !this.isJSXElement() || parentPath.isForStatement() && this.key === "init") {
+ if (this.node) nodes.push(this.node);
+ return this.replaceExpressionWithStatements(nodes);
+ } else if (Array.isArray(this.container)) {
+ return this._containerInsertBefore(nodes);
+ } else if (this.isStatementOrBlock()) {
+ const node = this.node;
+ const shouldInsertCurrentNode = node && (!this.isExpressionStatement() || node.expression != null);
+ this.replaceWith(blockStatement(shouldInsertCurrentNode ? [node] : []));
+ return this.unshiftContainer("body", nodes);
+ } else {
+ throw new Error("We don't know what to do with this node type. " + "We were previously a Statement but we can't fit in here?");
+ }
+}
+
+function _containerInsert(from, nodes) {
+ this.updateSiblingKeys(from, nodes.length);
+ const paths = [];
+ this.container.splice(from, 0, ...nodes);
+
+ for (let i = 0; i < nodes.length; i++) {
+ const to = from + i;
+ const path = this.getSibling(to);
+ paths.push(path);
+
+ if (this.context && this.context.queue) {
+ path.pushContext(this.context);
+ }
+ }
+
+ const contexts = this._getQueueContexts();
+
+ for (const path of paths) {
+ path.setScope();
+ path.debug("Inserted.");
+
+ for (const context of contexts) {
+ context.maybeQueue(path, true);
+ }
+ }
+
+ return paths;
+}
+
+function _containerInsertBefore(nodes) {
+ return this._containerInsert(this.key, nodes);
+}
+
+function _containerInsertAfter(nodes) {
+ return this._containerInsert(this.key + 1, nodes);
+}
+
+function insertAfter(nodes_) {
+ this._assertUnremoved();
+
+ const nodes = this._verifyNodeList(nodes_);
+
+ const {
+ parentPath
+ } = this;
+
+ if (parentPath.isExpressionStatement() || parentPath.isLabeledStatement() || parentPath.isExportNamedDeclaration() || parentPath.isExportDefaultDeclaration() && this.isDeclaration()) {
+ return parentPath.insertAfter(nodes.map(node => {
+ return isExpression(node) ? expressionStatement(node) : node;
+ }));
+ } else if (this.isNodeType("Expression") && !this.isJSXElement() && !parentPath.isJSXElement() || parentPath.isForStatement() && this.key === "init") {
+ if (this.node) {
+ const node = this.node;
+ let {
+ scope
+ } = this;
+
+ if (scope.path.isPattern()) {
+ assertExpression(node);
+ this.replaceWith(callExpression(arrowFunctionExpression([], node), []));
+ this.get("callee.body").insertAfter(nodes);
+ return [this];
+ }
+
+ if (parentPath.isMethod({
+ computed: true,
+ key: node
+ })) {
+ scope = scope.parent;
+ }
+
+ const temp = scope.generateDeclaredUidIdentifier();
+ nodes.unshift(expressionStatement(assignmentExpression("=", cloneNode(temp), node)));
+ nodes.push(expressionStatement(cloneNode(temp)));
+ }
+
+ return this.replaceExpressionWithStatements(nodes);
+ } else if (Array.isArray(this.container)) {
+ return this._containerInsertAfter(nodes);
+ } else if (this.isStatementOrBlock()) {
+ const node = this.node;
+ const shouldInsertCurrentNode = node && (!this.isExpressionStatement() || node.expression != null);
+ this.replaceWith(blockStatement(shouldInsertCurrentNode ? [node] : []));
+ return this.pushContainer("body", nodes);
+ } else {
+ throw new Error("We don't know what to do with this node type. " + "We were previously a Statement but we can't fit in here?");
+ }
+}
+
+function updateSiblingKeys(fromIndex, incrementBy) {
+ if (!this.parent) return;
+
+ const paths = _cache.path.get(this.parent);
+
+ for (const [, path] of paths) {
+ if (path.key >= fromIndex) {
+ path.key += incrementBy;
+ }
+ }
+}
+
+function _verifyNodeList(nodes) {
+ if (!nodes) {
+ return [];
+ }
+
+ if (!Array.isArray(nodes)) {
+ nodes = [nodes];
+ }
+
+ for (let i = 0; i < nodes.length; i++) {
+ const node = nodes[i];
+ let msg;
+
+ if (!node) {
+ msg = "has falsy node";
+ } else if (typeof node !== "object") {
+ msg = "contains a non-object node";
+ } else if (!node.type) {
+ msg = "without a type";
+ } else if (node instanceof _index.default) {
+ msg = "has a NodePath when it expected a raw object";
+ }
+
+ if (msg) {
+ const type = Array.isArray(node) ? "array" : typeof node;
+ throw new Error(`Node list ${msg} with the index of ${i} and type of ${type}`);
+ }
+ }
+
+ return nodes;
+}
+
+function unshiftContainer(listKey, nodes) {
+ this._assertUnremoved();
+
+ nodes = this._verifyNodeList(nodes);
+
+ const path = _index.default.get({
+ parentPath: this,
+ parent: this.node,
+ container: this.node[listKey],
+ listKey,
+ key: 0
+ }).setContext(this.context);
+
+ return path._containerInsertBefore(nodes);
+}
+
+function pushContainer(listKey, nodes) {
+ this._assertUnremoved();
+
+ const verifiedNodes = this._verifyNodeList(nodes);
+
+ const container = this.node[listKey];
+
+ const path = _index.default.get({
+ parentPath: this,
+ parent: this.node,
+ container: container,
+ listKey,
+ key: container.length
+ }).setContext(this.context);
+
+ return path.replaceWithMultiple(verifiedNodes);
+}
+
+function hoist(scope = this.scope) {
+ const hoister = new _hoister.default(this, scope);
+ return hoister.run();
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/traverse/lib/path/removal.js b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/removal.js
new file mode 100644
index 00000000000..7f787c22c77
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/removal.js
@@ -0,0 +1,73 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.remove = remove;
+exports._removeFromScope = _removeFromScope;
+exports._callRemovalHooks = _callRemovalHooks;
+exports._remove = _remove;
+exports._markRemoved = _markRemoved;
+exports._assertUnremoved = _assertUnremoved;
+
+var _removalHooks = require("./lib/removal-hooks");
+
+var _cache = require("../cache");
+
+var _index = require("./index");
+
+function remove() {
+ var _this$opts;
+
+ this._assertUnremoved();
+
+ this.resync();
+
+ if (!((_this$opts = this.opts) != null && _this$opts.noScope)) {
+ this._removeFromScope();
+ }
+
+ if (this._callRemovalHooks()) {
+ this._markRemoved();
+
+ return;
+ }
+
+ this.shareCommentsWithSiblings();
+
+ this._remove();
+
+ this._markRemoved();
+}
+
+function _removeFromScope() {
+ const bindings = this.getBindingIdentifiers();
+ Object.keys(bindings).forEach(name => this.scope.removeBinding(name));
+}
+
+function _callRemovalHooks() {
+ for (const fn of _removalHooks.hooks) {
+ if (fn(this, this.parentPath)) return true;
+ }
+}
+
+function _remove() {
+ if (Array.isArray(this.container)) {
+ this.container.splice(this.key, 1);
+ this.updateSiblingKeys(this.key, -1);
+ } else {
+ this._replaceWith(null);
+ }
+}
+
+function _markRemoved() {
+ this._traverseFlags |= _index.SHOULD_SKIP | _index.REMOVED;
+ if (this.parent) _cache.path.get(this.parent).delete(this.node);
+ this.node = null;
+}
+
+function _assertUnremoved() {
+ if (this.removed) {
+ throw this.buildCodeFrameError("NodePath has been removed so is read-only.");
+ }
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/traverse/lib/path/replacement.js b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/replacement.js
new file mode 100644
index 00000000000..ddd88baf979
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/traverse/lib/path/replacement.js
@@ -0,0 +1,260 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.replaceWithMultiple = replaceWithMultiple;
+exports.replaceWithSourceString = replaceWithSourceString;
+exports.replaceWith = replaceWith;
+exports._replaceWith = _replaceWith;
+exports.replaceExpressionWithStatements = replaceExpressionWithStatements;
+exports.replaceInline = replaceInline;
+
+var _codeFrame = require("@babel/code-frame");
+
+var _index = require("../index");
+
+var _index2 = require("./index");
+
+var _cache = require("../cache");
+
+var _parser = require("@babel/parser");
+
+var _t = require("@babel/types");
+
+var _helperHoistVariables = require("@babel/helper-hoist-variables");
+
+const {
+ FUNCTION_TYPES,
+ arrowFunctionExpression,
+ assignmentExpression,
+ awaitExpression,
+ blockStatement,
+ callExpression,
+ cloneNode,
+ expressionStatement,
+ identifier,
+ inheritLeadingComments,
+ inheritTrailingComments,
+ inheritsComments,
+ isExpression,
+ isProgram,
+ isStatement,
+ removeComments,
+ returnStatement,
+ toSequenceExpression,
+ validate,
+ yieldExpression
+} = _t;
+
+function replaceWithMultiple(nodes) {
+ var _pathCache$get;
+
+ this.resync();
+ nodes = this._verifyNodeList(nodes);
+ inheritLeadingComments(nodes[0], this.node);
+ inheritTrailingComments(nodes[nodes.length - 1], this.node);
+ (_pathCache$get = _cache.path.get(this.parent)) == null ? void 0 : _pathCache$get.delete(this.node);
+ this.node = this.container[this.key] = null;
+ const paths = this.insertAfter(nodes);
+
+ if (this.node) {
+ this.requeue();
+ } else {
+ this.remove();
+ }
+
+ return paths;
+}
+
+function replaceWithSourceString(replacement) {
+ this.resync();
+
+ try {
+ replacement = `(${replacement})`;
+ replacement = (0, _parser.parse)(replacement);
+ } catch (err) {
+ const loc = err.loc;
+
+ if (loc) {
+ err.message += " - make sure this is an expression.\n" + (0, _codeFrame.codeFrameColumns)(replacement, {
+ start: {
+ line: loc.line,
+ column: loc.column + 1
+ }
+ });
+ err.code = "BABEL_REPLACE_SOURCE_ERROR";
+ }
+
+ throw err;
+ }
+
+ replacement = replacement.program.body[0].expression;
+
+ _index.default.removeProperties(replacement);
+
+ return this.replaceWith(replacement);
+}
+
+function replaceWith(replacement) {
+ this.resync();
+
+ if (this.removed) {
+ throw new Error("You can't replace this node, we've already removed it");
+ }
+
+ if (replacement instanceof _index2.default) {
+ replacement = replacement.node;
+ }
+
+ if (!replacement) {
+ throw new Error("You passed `path.replaceWith()` a falsy node, use `path.remove()` instead");
+ }
+
+ if (this.node === replacement) {
+ return [this];
+ }
+
+ if (this.isProgram() && !isProgram(replacement)) {
+ throw new Error("You can only replace a Program root node with another Program node");
+ }
+
+ if (Array.isArray(replacement)) {
+ throw new Error("Don't use `path.replaceWith()` with an array of nodes, use `path.replaceWithMultiple()`");
+ }
+
+ if (typeof replacement === "string") {
+ throw new Error("Don't use `path.replaceWith()` with a source string, use `path.replaceWithSourceString()`");
+ }
+
+ let nodePath = "";
+
+ if (this.isNodeType("Statement") && isExpression(replacement)) {
+ if (!this.canHaveVariableDeclarationOrExpression() && !this.canSwapBetweenExpressionAndStatement(replacement) && !this.parentPath.isExportDefaultDeclaration()) {
+ replacement = expressionStatement(replacement);
+ nodePath = "expression";
+ }
+ }
+
+ if (this.isNodeType("Expression") && isStatement(replacement)) {
+ if (!this.canHaveVariableDeclarationOrExpression() && !this.canSwapBetweenExpressionAndStatement(replacement)) {
+ return this.replaceExpressionWithStatements([replacement]);
+ }
+ }
+
+ const oldNode = this.node;
+
+ if (oldNode) {
+ inheritsComments(replacement, oldNode);
+ removeComments(oldNode);
+ }
+
+ this._replaceWith(replacement);
+
+ this.type = replacement.type;
+ this.setScope();
+ this.requeue();
+ return [nodePath ? this.get(nodePath) : this];
+}
+
+function _replaceWith(node) {
+ var _pathCache$get2;
+
+ if (!this.container) {
+ throw new ReferenceError("Container is falsy");
+ }
+
+ if (this.inList) {
+ validate(this.parent, this.key, [node]);
+ } else {
+ validate(this.parent, this.key, node);
+ }
+
+ this.debug(`Replace with ${node == null ? void 0 : node.type}`);
+ (_pathCache$get2 = _cache.path.get(this.parent)) == null ? void 0 : _pathCache$get2.set(node, this).delete(this.node);
+ this.node = this.container[this.key] = node;
+}
+
+function replaceExpressionWithStatements(nodes) {
+ this.resync();
+ const nodesAsSequenceExpression = toSequenceExpression(nodes, this.scope);
+
+ if (nodesAsSequenceExpression) {
+ return this.replaceWith(nodesAsSequenceExpression)[0].get("expressions");
+ }
+
+ const functionParent = this.getFunctionParent();
+ const isParentAsync = functionParent == null ? void 0 : functionParent.is("async");
+ const isParentGenerator = functionParent == null ? void 0 : functionParent.is("generator");
+ const container = arrowFunctionExpression([], blockStatement(nodes));
+ this.replaceWith(callExpression(container, []));
+ const callee = this.get("callee");
+ (0, _helperHoistVariables.default)(callee.get("body"), id => {
+ this.scope.push({
+ id
+ });
+ }, "var");
+ const completionRecords = this.get("callee").getCompletionRecords();
+
+ for (const path of completionRecords) {
+ if (!path.isExpressionStatement()) continue;
+ const loop = path.findParent(path => path.isLoop());
+
+ if (loop) {
+ let uid = loop.getData("expressionReplacementReturnUid");
+
+ if (!uid) {
+ uid = callee.scope.generateDeclaredUidIdentifier("ret");
+ callee.get("body").pushContainer("body", returnStatement(cloneNode(uid)));
+ loop.setData("expressionReplacementReturnUid", uid);
+ } else {
+ uid = identifier(uid.name);
+ }
+
+ path.get("expression").replaceWith(assignmentExpression("=", cloneNode(uid), path.node.expression));
+ } else {
+ path.replaceWith(returnStatement(path.node.expression));
+ }
+ }
+
+ callee.arrowFunctionToExpression();
+ const newCallee = callee;
+
+ const needToAwaitFunction = isParentAsync && _index.default.hasType(this.get("callee.body").node, "AwaitExpression", FUNCTION_TYPES);
+
+ const needToYieldFunction = isParentGenerator && _index.default.hasType(this.get("callee.body").node, "YieldExpression", FUNCTION_TYPES);
+
+ if (needToAwaitFunction) {
+ newCallee.set("async", true);
+
+ if (!needToYieldFunction) {
+ this.replaceWith(awaitExpression(this.node));
+ }
+ }
+
+ if (needToYieldFunction) {
+ newCallee.set("generator", true);
+ this.replaceWith(yieldExpression(this.node, true));
+ }
+
+ return newCallee.get("body.body");
+}
+
+function replaceInline(nodes) {
+ this.resync();
+
+ if (Array.isArray(nodes)) {
+ if (Array.isArray(this.container)) {
+ nodes = this._verifyNodeList(nodes);
+
+ const paths = this._containerInsertAfter(nodes);
+
+ this.remove();
+ return paths;
+ } else {
+ return this.replaceWithMultiple(nodes);
+ }
+ } else {
+ return this.replaceWith(nodes);
+ }
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/traverse/lib/scope/binding.js b/chromium/third_party/node/node_modules/@babel/traverse/lib/scope/binding.js
new file mode 100644
index 00000000000..16911ef21c0
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/traverse/lib/scope/binding.js
@@ -0,0 +1,75 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = void 0;
+
+class Binding {
+ constructor({
+ identifier,
+ scope,
+ path,
+ kind
+ }) {
+ this.identifier = void 0;
+ this.scope = void 0;
+ this.path = void 0;
+ this.kind = void 0;
+ this.constantViolations = [];
+ this.constant = true;
+ this.referencePaths = [];
+ this.referenced = false;
+ this.references = 0;
+ this.identifier = identifier;
+ this.scope = scope;
+ this.path = path;
+ this.kind = kind;
+ this.clearValue();
+ }
+
+ deoptValue() {
+ this.clearValue();
+ this.hasDeoptedValue = true;
+ }
+
+ setValue(value) {
+ if (this.hasDeoptedValue) return;
+ this.hasValue = true;
+ this.value = value;
+ }
+
+ clearValue() {
+ this.hasDeoptedValue = false;
+ this.hasValue = false;
+ this.value = null;
+ }
+
+ reassign(path) {
+ this.constant = false;
+
+ if (this.constantViolations.indexOf(path) !== -1) {
+ return;
+ }
+
+ this.constantViolations.push(path);
+ }
+
+ reference(path) {
+ if (this.referencePaths.indexOf(path) !== -1) {
+ return;
+ }
+
+ this.referenced = true;
+ this.references++;
+ this.referencePaths.push(path);
+ }
+
+ dereference() {
+ this.references--;
+ this.referenced = !!this.references;
+ }
+
+}
+
+exports.default = Binding; \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/traverse/lib/scope/index.js b/chromium/third_party/node/node_modules/@babel/traverse/lib/scope/index.js
new file mode 100644
index 00000000000..8ab588a31d3
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/traverse/lib/scope/index.js
@@ -0,0 +1,1015 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = void 0;
+
+var _renamer = require("./lib/renamer");
+
+var _index = require("../index");
+
+var _binding = require("./binding");
+
+var _globals = require("globals");
+
+var _t = require("@babel/types");
+
+var _cache = require("../cache");
+
+const {
+ NOT_LOCAL_BINDING,
+ callExpression,
+ cloneNode,
+ getBindingIdentifiers,
+ identifier,
+ isArrayExpression,
+ isBinary,
+ isClass,
+ isClassBody,
+ isClassDeclaration,
+ isExportAllDeclaration,
+ isExportDefaultDeclaration,
+ isExportNamedDeclaration,
+ isFunctionDeclaration,
+ isIdentifier,
+ isImportDeclaration,
+ isLiteral,
+ isMethod,
+ isModuleDeclaration,
+ isModuleSpecifier,
+ isObjectExpression,
+ isProperty,
+ isPureish,
+ isSuper,
+ isTaggedTemplateExpression,
+ isTemplateLiteral,
+ isThisExpression,
+ isUnaryExpression,
+ isVariableDeclaration,
+ matchesPattern,
+ memberExpression,
+ numericLiteral,
+ toIdentifier,
+ unaryExpression,
+ variableDeclaration,
+ variableDeclarator
+} = _t;
+
+function gatherNodeParts(node, parts) {
+ switch (node == null ? void 0 : node.type) {
+ default:
+ if (isModuleDeclaration(node)) {
+ if ((isExportAllDeclaration(node) || isExportNamedDeclaration(node) || isImportDeclaration(node)) && node.source) {
+ gatherNodeParts(node.source, parts);
+ } else if ((isExportNamedDeclaration(node) || isImportDeclaration(node)) && node.specifiers && node.specifiers.length) {
+ for (const e of node.specifiers) gatherNodeParts(e, parts);
+ } else if ((isExportDefaultDeclaration(node) || isExportNamedDeclaration(node)) && node.declaration) {
+ gatherNodeParts(node.declaration, parts);
+ }
+ } else if (isModuleSpecifier(node)) {
+ gatherNodeParts(node.local, parts);
+ } else if (isLiteral(node)) {
+ parts.push(node.value);
+ }
+
+ break;
+
+ case "MemberExpression":
+ case "OptionalMemberExpression":
+ case "JSXMemberExpression":
+ gatherNodeParts(node.object, parts);
+ gatherNodeParts(node.property, parts);
+ break;
+
+ case "Identifier":
+ case "JSXIdentifier":
+ parts.push(node.name);
+ break;
+
+ case "CallExpression":
+ case "OptionalCallExpression":
+ case "NewExpression":
+ gatherNodeParts(node.callee, parts);
+ break;
+
+ case "ObjectExpression":
+ case "ObjectPattern":
+ for (const e of node.properties) {
+ gatherNodeParts(e, parts);
+ }
+
+ break;
+
+ case "SpreadElement":
+ case "RestElement":
+ gatherNodeParts(node.argument, parts);
+ break;
+
+ case "ObjectProperty":
+ case "ObjectMethod":
+ case "ClassProperty":
+ case "ClassMethod":
+ case "ClassPrivateProperty":
+ case "ClassPrivateMethod":
+ gatherNodeParts(node.key, parts);
+ break;
+
+ case "ThisExpression":
+ parts.push("this");
+ break;
+
+ case "Super":
+ parts.push("super");
+ break;
+
+ case "Import":
+ parts.push("import");
+ break;
+
+ case "DoExpression":
+ parts.push("do");
+ break;
+
+ case "YieldExpression":
+ parts.push("yield");
+ gatherNodeParts(node.argument, parts);
+ break;
+
+ case "AwaitExpression":
+ parts.push("await");
+ gatherNodeParts(node.argument, parts);
+ break;
+
+ case "AssignmentExpression":
+ gatherNodeParts(node.left, parts);
+ break;
+
+ case "VariableDeclarator":
+ gatherNodeParts(node.id, parts);
+ break;
+
+ case "FunctionExpression":
+ case "FunctionDeclaration":
+ case "ClassExpression":
+ case "ClassDeclaration":
+ gatherNodeParts(node.id, parts);
+ break;
+
+ case "PrivateName":
+ gatherNodeParts(node.id, parts);
+ break;
+
+ case "ParenthesizedExpression":
+ gatherNodeParts(node.expression, parts);
+ break;
+
+ case "UnaryExpression":
+ case "UpdateExpression":
+ gatherNodeParts(node.argument, parts);
+ break;
+
+ case "MetaProperty":
+ gatherNodeParts(node.meta, parts);
+ gatherNodeParts(node.property, parts);
+ break;
+
+ case "JSXElement":
+ gatherNodeParts(node.openingElement, parts);
+ break;
+
+ case "JSXOpeningElement":
+ parts.push(node.name);
+ break;
+
+ case "JSXFragment":
+ gatherNodeParts(node.openingFragment, parts);
+ break;
+
+ case "JSXOpeningFragment":
+ parts.push("Fragment");
+ break;
+
+ case "JSXNamespacedName":
+ gatherNodeParts(node.namespace, parts);
+ gatherNodeParts(node.name, parts);
+ break;
+ }
+}
+
+const collectorVisitor = {
+ ForStatement(path) {
+ const declar = path.get("init");
+
+ if (declar.isVar()) {
+ const {
+ scope
+ } = path;
+ const parentScope = scope.getFunctionParent() || scope.getProgramParent();
+ parentScope.registerBinding("var", declar);
+ }
+ },
+
+ Declaration(path) {
+ if (path.isBlockScoped()) return;
+ if (path.isImportDeclaration()) return;
+ if (path.isExportDeclaration()) return;
+ const parent = path.scope.getFunctionParent() || path.scope.getProgramParent();
+ parent.registerDeclaration(path);
+ },
+
+ ImportDeclaration(path) {
+ const parent = path.scope.getBlockParent();
+ parent.registerDeclaration(path);
+ },
+
+ ReferencedIdentifier(path, state) {
+ state.references.push(path);
+ },
+
+ ForXStatement(path, state) {
+ const left = path.get("left");
+
+ if (left.isPattern() || left.isIdentifier()) {
+ state.constantViolations.push(path);
+ } else if (left.isVar()) {
+ const {
+ scope
+ } = path;
+ const parentScope = scope.getFunctionParent() || scope.getProgramParent();
+ parentScope.registerBinding("var", left);
+ }
+ },
+
+ ExportDeclaration: {
+ exit(path) {
+ const {
+ node,
+ scope
+ } = path;
+ if (isExportAllDeclaration(node)) return;
+ const declar = node.declaration;
+
+ if (isClassDeclaration(declar) || isFunctionDeclaration(declar)) {
+ const id = declar.id;
+ if (!id) return;
+ const binding = scope.getBinding(id.name);
+ binding == null ? void 0 : binding.reference(path);
+ } else if (isVariableDeclaration(declar)) {
+ for (const decl of declar.declarations) {
+ for (const name of Object.keys(getBindingIdentifiers(decl))) {
+ const binding = scope.getBinding(name);
+ binding == null ? void 0 : binding.reference(path);
+ }
+ }
+ }
+ }
+
+ },
+
+ LabeledStatement(path) {
+ path.scope.getBlockParent().registerDeclaration(path);
+ },
+
+ AssignmentExpression(path, state) {
+ state.assignments.push(path);
+ },
+
+ UpdateExpression(path, state) {
+ state.constantViolations.push(path);
+ },
+
+ UnaryExpression(path, state) {
+ if (path.node.operator === "delete") {
+ state.constantViolations.push(path);
+ }
+ },
+
+ BlockScoped(path) {
+ let scope = path.scope;
+ if (scope.path === path) scope = scope.parent;
+ const parent = scope.getBlockParent();
+ parent.registerDeclaration(path);
+
+ if (path.isClassDeclaration() && path.node.id) {
+ const id = path.node.id;
+ const name = id.name;
+ path.scope.bindings[name] = path.scope.parent.getBinding(name);
+ }
+ },
+
+ CatchClause(path) {
+ path.scope.registerBinding("let", path);
+ },
+
+ Function(path) {
+ if (path.isFunctionExpression() && path.has("id") && !path.get("id").node[NOT_LOCAL_BINDING]) {
+ path.scope.registerBinding("local", path.get("id"), path);
+ }
+
+ const params = path.get("params");
+
+ for (const param of params) {
+ path.scope.registerBinding("param", param);
+ }
+ },
+
+ ClassExpression(path) {
+ if (path.has("id") && !path.get("id").node[NOT_LOCAL_BINDING]) {
+ path.scope.registerBinding("local", path);
+ }
+ }
+
+};
+let uid = 0;
+
+class Scope {
+ constructor(path) {
+ this.uid = void 0;
+ this.path = void 0;
+ this.block = void 0;
+ this.labels = void 0;
+ this.inited = void 0;
+ this.bindings = void 0;
+ this.references = void 0;
+ this.globals = void 0;
+ this.uids = void 0;
+ this.data = void 0;
+ this.crawling = void 0;
+ const {
+ node
+ } = path;
+
+ const cached = _cache.scope.get(node);
+
+ if ((cached == null ? void 0 : cached.path) === path) {
+ return cached;
+ }
+
+ _cache.scope.set(node, this);
+
+ this.uid = uid++;
+ this.block = node;
+ this.path = path;
+ this.labels = new Map();
+ this.inited = false;
+ }
+
+ get parent() {
+ var _parent;
+
+ let parent,
+ path = this.path;
+
+ do {
+ const isKey = path.key === "key";
+ path = path.parentPath;
+ if (isKey && path.isMethod()) path = path.parentPath;
+ if (path && path.isScope()) parent = path;
+ } while (path && !parent);
+
+ return (_parent = parent) == null ? void 0 : _parent.scope;
+ }
+
+ get parentBlock() {
+ return this.path.parent;
+ }
+
+ get hub() {
+ return this.path.hub;
+ }
+
+ traverse(node, opts, state) {
+ (0, _index.default)(node, opts, this, state, this.path);
+ }
+
+ generateDeclaredUidIdentifier(name) {
+ const id = this.generateUidIdentifier(name);
+ this.push({
+ id
+ });
+ return cloneNode(id);
+ }
+
+ generateUidIdentifier(name) {
+ return identifier(this.generateUid(name));
+ }
+
+ generateUid(name = "temp") {
+ name = toIdentifier(name).replace(/^_+/, "").replace(/[0-9]+$/g, "");
+ let uid;
+ let i = 1;
+
+ do {
+ uid = this._generateUid(name, i);
+ i++;
+ } while (this.hasLabel(uid) || this.hasBinding(uid) || this.hasGlobal(uid) || this.hasReference(uid));
+
+ const program = this.getProgramParent();
+ program.references[uid] = true;
+ program.uids[uid] = true;
+ return uid;
+ }
+
+ _generateUid(name, i) {
+ let id = name;
+ if (i > 1) id += i;
+ return `_${id}`;
+ }
+
+ generateUidBasedOnNode(node, defaultName) {
+ const parts = [];
+ gatherNodeParts(node, parts);
+ let id = parts.join("$");
+ id = id.replace(/^_/, "") || defaultName || "ref";
+ return this.generateUid(id.slice(0, 20));
+ }
+
+ generateUidIdentifierBasedOnNode(node, defaultName) {
+ return identifier(this.generateUidBasedOnNode(node, defaultName));
+ }
+
+ isStatic(node) {
+ if (isThisExpression(node) || isSuper(node)) {
+ return true;
+ }
+
+ if (isIdentifier(node)) {
+ const binding = this.getBinding(node.name);
+
+ if (binding) {
+ return binding.constant;
+ } else {
+ return this.hasBinding(node.name);
+ }
+ }
+
+ return false;
+ }
+
+ maybeGenerateMemoised(node, dontPush) {
+ if (this.isStatic(node)) {
+ return null;
+ } else {
+ const id = this.generateUidIdentifierBasedOnNode(node);
+
+ if (!dontPush) {
+ this.push({
+ id
+ });
+ return cloneNode(id);
+ }
+
+ return id;
+ }
+ }
+
+ checkBlockScopedCollisions(local, kind, name, id) {
+ if (kind === "param") return;
+ if (local.kind === "local") return;
+ const duplicate = kind === "let" || local.kind === "let" || local.kind === "const" || local.kind === "module" || local.kind === "param" && (kind === "let" || kind === "const");
+
+ if (duplicate) {
+ throw this.hub.buildError(id, `Duplicate declaration "${name}"`, TypeError);
+ }
+ }
+
+ rename(oldName, newName, block) {
+ const binding = this.getBinding(oldName);
+
+ if (binding) {
+ newName = newName || this.generateUidIdentifier(oldName).name;
+ return new _renamer.default(binding, oldName, newName).rename(block);
+ }
+ }
+
+ _renameFromMap(map, oldName, newName, value) {
+ if (map[oldName]) {
+ map[newName] = value;
+ map[oldName] = null;
+ }
+ }
+
+ dump() {
+ const sep = "-".repeat(60);
+ console.log(sep);
+ let scope = this;
+
+ do {
+ console.log("#", scope.block.type);
+
+ for (const name of Object.keys(scope.bindings)) {
+ const binding = scope.bindings[name];
+ console.log(" -", name, {
+ constant: binding.constant,
+ references: binding.references,
+ violations: binding.constantViolations.length,
+ kind: binding.kind
+ });
+ }
+ } while (scope = scope.parent);
+
+ console.log(sep);
+ }
+
+ toArray(node, i, arrayLikeIsIterable) {
+ if (isIdentifier(node)) {
+ const binding = this.getBinding(node.name);
+
+ if (binding != null && binding.constant && binding.path.isGenericType("Array")) {
+ return node;
+ }
+ }
+
+ if (isArrayExpression(node)) {
+ return node;
+ }
+
+ if (isIdentifier(node, {
+ name: "arguments"
+ })) {
+ return callExpression(memberExpression(memberExpression(memberExpression(identifier("Array"), identifier("prototype")), identifier("slice")), identifier("call")), [node]);
+ }
+
+ let helperName;
+ const args = [node];
+
+ if (i === true) {
+ helperName = "toConsumableArray";
+ } else if (i) {
+ args.push(numericLiteral(i));
+ helperName = "slicedToArray";
+ } else {
+ helperName = "toArray";
+ }
+
+ if (arrayLikeIsIterable) {
+ args.unshift(this.hub.addHelper(helperName));
+ helperName = "maybeArrayLike";
+ }
+
+ return callExpression(this.hub.addHelper(helperName), args);
+ }
+
+ hasLabel(name) {
+ return !!this.getLabel(name);
+ }
+
+ getLabel(name) {
+ return this.labels.get(name);
+ }
+
+ registerLabel(path) {
+ this.labels.set(path.node.label.name, path);
+ }
+
+ registerDeclaration(path) {
+ if (path.isLabeledStatement()) {
+ this.registerLabel(path);
+ } else if (path.isFunctionDeclaration()) {
+ this.registerBinding("hoisted", path.get("id"), path);
+ } else if (path.isVariableDeclaration()) {
+ const declarations = path.get("declarations");
+
+ for (const declar of declarations) {
+ this.registerBinding(path.node.kind, declar);
+ }
+ } else if (path.isClassDeclaration()) {
+ this.registerBinding("let", path);
+ } else if (path.isImportDeclaration()) {
+ const specifiers = path.get("specifiers");
+
+ for (const specifier of specifiers) {
+ this.registerBinding("module", specifier);
+ }
+ } else if (path.isExportDeclaration()) {
+ const declar = path.get("declaration");
+
+ if (declar.isClassDeclaration() || declar.isFunctionDeclaration() || declar.isVariableDeclaration()) {
+ this.registerDeclaration(declar);
+ }
+ } else {
+ this.registerBinding("unknown", path);
+ }
+ }
+
+ buildUndefinedNode() {
+ return unaryExpression("void", numericLiteral(0), true);
+ }
+
+ registerConstantViolation(path) {
+ const ids = path.getBindingIdentifiers();
+
+ for (const name of Object.keys(ids)) {
+ const binding = this.getBinding(name);
+ if (binding) binding.reassign(path);
+ }
+ }
+
+ registerBinding(kind, path, bindingPath = path) {
+ if (!kind) throw new ReferenceError("no `kind`");
+
+ if (path.isVariableDeclaration()) {
+ const declarators = path.get("declarations");
+
+ for (const declar of declarators) {
+ this.registerBinding(kind, declar);
+ }
+
+ return;
+ }
+
+ const parent = this.getProgramParent();
+ const ids = path.getOuterBindingIdentifiers(true);
+
+ for (const name of Object.keys(ids)) {
+ parent.references[name] = true;
+
+ for (const id of ids[name]) {
+ const local = this.getOwnBinding(name);
+
+ if (local) {
+ if (local.identifier === id) continue;
+ this.checkBlockScopedCollisions(local, kind, name, id);
+ }
+
+ if (local) {
+ this.registerConstantViolation(bindingPath);
+ } else {
+ this.bindings[name] = new _binding.default({
+ identifier: id,
+ scope: this,
+ path: bindingPath,
+ kind: kind
+ });
+ }
+ }
+ }
+ }
+
+ addGlobal(node) {
+ this.globals[node.name] = node;
+ }
+
+ hasUid(name) {
+ let scope = this;
+
+ do {
+ if (scope.uids[name]) return true;
+ } while (scope = scope.parent);
+
+ return false;
+ }
+
+ hasGlobal(name) {
+ let scope = this;
+
+ do {
+ if (scope.globals[name]) return true;
+ } while (scope = scope.parent);
+
+ return false;
+ }
+
+ hasReference(name) {
+ return !!this.getProgramParent().references[name];
+ }
+
+ isPure(node, constantsOnly) {
+ if (isIdentifier(node)) {
+ const binding = this.getBinding(node.name);
+ if (!binding) return false;
+ if (constantsOnly) return binding.constant;
+ return true;
+ } else if (isClass(node)) {
+ if (node.superClass && !this.isPure(node.superClass, constantsOnly)) {
+ return false;
+ }
+
+ return this.isPure(node.body, constantsOnly);
+ } else if (isClassBody(node)) {
+ for (const method of node.body) {
+ if (!this.isPure(method, constantsOnly)) return false;
+ }
+
+ return true;
+ } else if (isBinary(node)) {
+ return this.isPure(node.left, constantsOnly) && this.isPure(node.right, constantsOnly);
+ } else if (isArrayExpression(node)) {
+ for (const elem of node.elements) {
+ if (!this.isPure(elem, constantsOnly)) return false;
+ }
+
+ return true;
+ } else if (isObjectExpression(node)) {
+ for (const prop of node.properties) {
+ if (!this.isPure(prop, constantsOnly)) return false;
+ }
+
+ return true;
+ } else if (isMethod(node)) {
+ if (node.computed && !this.isPure(node.key, constantsOnly)) return false;
+ if (node.kind === "get" || node.kind === "set") return false;
+ return true;
+ } else if (isProperty(node)) {
+ if (node.computed && !this.isPure(node.key, constantsOnly)) return false;
+ return this.isPure(node.value, constantsOnly);
+ } else if (isUnaryExpression(node)) {
+ return this.isPure(node.argument, constantsOnly);
+ } else if (isTaggedTemplateExpression(node)) {
+ return matchesPattern(node.tag, "String.raw") && !this.hasBinding("String", true) && this.isPure(node.quasi, constantsOnly);
+ } else if (isTemplateLiteral(node)) {
+ for (const expression of node.expressions) {
+ if (!this.isPure(expression, constantsOnly)) return false;
+ }
+
+ return true;
+ } else {
+ return isPureish(node);
+ }
+ }
+
+ setData(key, val) {
+ return this.data[key] = val;
+ }
+
+ getData(key) {
+ let scope = this;
+
+ do {
+ const data = scope.data[key];
+ if (data != null) return data;
+ } while (scope = scope.parent);
+ }
+
+ removeData(key) {
+ let scope = this;
+
+ do {
+ const data = scope.data[key];
+ if (data != null) scope.data[key] = null;
+ } while (scope = scope.parent);
+ }
+
+ init() {
+ if (!this.inited) {
+ this.inited = true;
+ this.crawl();
+ }
+ }
+
+ crawl() {
+ const path = this.path;
+ this.references = Object.create(null);
+ this.bindings = Object.create(null);
+ this.globals = Object.create(null);
+ this.uids = Object.create(null);
+ this.data = Object.create(null);
+ const programParent = this.getProgramParent();
+ if (programParent.crawling) return;
+ const state = {
+ references: [],
+ constantViolations: [],
+ assignments: []
+ };
+ this.crawling = true;
+
+ if (path.type !== "Program" && collectorVisitor._exploded) {
+ for (const visit of collectorVisitor.enter) {
+ visit(path, state);
+ }
+
+ const typeVisitors = collectorVisitor[path.type];
+
+ if (typeVisitors) {
+ for (const visit of typeVisitors.enter) {
+ visit(path, state);
+ }
+ }
+ }
+
+ path.traverse(collectorVisitor, state);
+ this.crawling = false;
+
+ for (const path of state.assignments) {
+ const ids = path.getBindingIdentifiers();
+
+ for (const name of Object.keys(ids)) {
+ if (path.scope.getBinding(name)) continue;
+ programParent.addGlobal(ids[name]);
+ }
+
+ path.scope.registerConstantViolation(path);
+ }
+
+ for (const ref of state.references) {
+ const binding = ref.scope.getBinding(ref.node.name);
+
+ if (binding) {
+ binding.reference(ref);
+ } else {
+ programParent.addGlobal(ref.node);
+ }
+ }
+
+ for (const path of state.constantViolations) {
+ path.scope.registerConstantViolation(path);
+ }
+ }
+
+ push(opts) {
+ let path = this.path;
+
+ if (!path.isBlockStatement() && !path.isProgram()) {
+ path = this.getBlockParent().path;
+ }
+
+ if (path.isSwitchStatement()) {
+ path = (this.getFunctionParent() || this.getProgramParent()).path;
+ }
+
+ if (path.isLoop() || path.isCatchClause() || path.isFunction()) {
+ path.ensureBlock();
+ path = path.get("body");
+ }
+
+ const unique = opts.unique;
+ const kind = opts.kind || "var";
+ const blockHoist = opts._blockHoist == null ? 2 : opts._blockHoist;
+ const dataKey = `declaration:${kind}:${blockHoist}`;
+ let declarPath = !unique && path.getData(dataKey);
+
+ if (!declarPath) {
+ const declar = variableDeclaration(kind, []);
+ declar._blockHoist = blockHoist;
+ [declarPath] = path.unshiftContainer("body", [declar]);
+ if (!unique) path.setData(dataKey, declarPath);
+ }
+
+ const declarator = variableDeclarator(opts.id, opts.init);
+ declarPath.node.declarations.push(declarator);
+ this.registerBinding(kind, declarPath.get("declarations").pop());
+ }
+
+ getProgramParent() {
+ let scope = this;
+
+ do {
+ if (scope.path.isProgram()) {
+ return scope;
+ }
+ } while (scope = scope.parent);
+
+ throw new Error("Couldn't find a Program");
+ }
+
+ getFunctionParent() {
+ let scope = this;
+
+ do {
+ if (scope.path.isFunctionParent()) {
+ return scope;
+ }
+ } while (scope = scope.parent);
+
+ return null;
+ }
+
+ getBlockParent() {
+ let scope = this;
+
+ do {
+ if (scope.path.isBlockParent()) {
+ return scope;
+ }
+ } while (scope = scope.parent);
+
+ throw new Error("We couldn't find a BlockStatement, For, Switch, Function, Loop or Program...");
+ }
+
+ getAllBindings() {
+ const ids = Object.create(null);
+ let scope = this;
+
+ do {
+ for (const key of Object.keys(scope.bindings)) {
+ if (key in ids === false) {
+ ids[key] = scope.bindings[key];
+ }
+ }
+
+ scope = scope.parent;
+ } while (scope);
+
+ return ids;
+ }
+
+ getAllBindingsOfKind(...kinds) {
+ const ids = Object.create(null);
+
+ for (const kind of kinds) {
+ let scope = this;
+
+ do {
+ for (const name of Object.keys(scope.bindings)) {
+ const binding = scope.bindings[name];
+ if (binding.kind === kind) ids[name] = binding;
+ }
+
+ scope = scope.parent;
+ } while (scope);
+ }
+
+ return ids;
+ }
+
+ bindingIdentifierEquals(name, node) {
+ return this.getBindingIdentifier(name) === node;
+ }
+
+ getBinding(name) {
+ let scope = this;
+ let previousPath;
+
+ do {
+ const binding = scope.getOwnBinding(name);
+
+ if (binding) {
+ var _previousPath;
+
+ if ((_previousPath = previousPath) != null && _previousPath.isPattern() && binding.kind !== "param") {} else {
+ return binding;
+ }
+ }
+
+ previousPath = scope.path;
+ } while (scope = scope.parent);
+ }
+
+ getOwnBinding(name) {
+ return this.bindings[name];
+ }
+
+ getBindingIdentifier(name) {
+ var _this$getBinding;
+
+ return (_this$getBinding = this.getBinding(name)) == null ? void 0 : _this$getBinding.identifier;
+ }
+
+ getOwnBindingIdentifier(name) {
+ const binding = this.bindings[name];
+ return binding == null ? void 0 : binding.identifier;
+ }
+
+ hasOwnBinding(name) {
+ return !!this.getOwnBinding(name);
+ }
+
+ hasBinding(name, noGlobals) {
+ if (!name) return false;
+ if (this.hasOwnBinding(name)) return true;
+ if (this.parentHasBinding(name, noGlobals)) return true;
+ if (this.hasUid(name)) return true;
+ if (!noGlobals && Scope.globals.includes(name)) return true;
+ if (!noGlobals && Scope.contextVariables.includes(name)) return true;
+ return false;
+ }
+
+ parentHasBinding(name, noGlobals) {
+ var _this$parent;
+
+ return (_this$parent = this.parent) == null ? void 0 : _this$parent.hasBinding(name, noGlobals);
+ }
+
+ moveBindingTo(name, scope) {
+ const info = this.getBinding(name);
+
+ if (info) {
+ info.scope.removeOwnBinding(name);
+ info.scope = scope;
+ scope.bindings[name] = info;
+ }
+ }
+
+ removeOwnBinding(name) {
+ delete this.bindings[name];
+ }
+
+ removeBinding(name) {
+ var _this$getBinding2;
+
+ (_this$getBinding2 = this.getBinding(name)) == null ? void 0 : _this$getBinding2.scope.removeOwnBinding(name);
+ let scope = this;
+
+ do {
+ if (scope.uids[name]) {
+ scope.uids[name] = false;
+ }
+ } while (scope = scope.parent);
+ }
+
+}
+
+exports.default = Scope;
+Scope.globals = Object.keys(_globals.builtin);
+Scope.contextVariables = ["arguments", "undefined", "Infinity", "NaN"]; \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/traverse/lib/scope/lib/renamer.js b/chromium/third_party/node/node_modules/@babel/traverse/lib/scope/lib/renamer.js
new file mode 100644
index 00000000000..f11bbb70066
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/traverse/lib/scope/lib/renamer.js
@@ -0,0 +1,146 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = void 0;
+
+var _binding = require("../binding");
+
+var _helperSplitExportDeclaration = require("@babel/helper-split-export-declaration");
+
+var _t = require("@babel/types");
+
+const {
+ VISITOR_KEYS,
+ assignmentExpression,
+ identifier,
+ toExpression,
+ variableDeclaration,
+ variableDeclarator
+} = _t;
+const renameVisitor = {
+ ReferencedIdentifier({
+ node
+ }, state) {
+ if (node.name === state.oldName) {
+ node.name = state.newName;
+ }
+ },
+
+ Scope(path, state) {
+ if (!path.scope.bindingIdentifierEquals(state.oldName, state.binding.identifier)) {
+ skipAllButComputedMethodKey(path);
+ }
+ },
+
+ "AssignmentExpression|Declaration|VariableDeclarator"(path, state) {
+ if (path.isVariableDeclaration()) return;
+ const ids = path.getOuterBindingIdentifiers();
+
+ for (const name in ids) {
+ if (name === state.oldName) ids[name].name = state.newName;
+ }
+ }
+
+};
+
+class Renamer {
+ constructor(binding, oldName, newName) {
+ this.newName = newName;
+ this.oldName = oldName;
+ this.binding = binding;
+ }
+
+ maybeConvertFromExportDeclaration(parentDeclar) {
+ const maybeExportDeclar = parentDeclar.parentPath;
+
+ if (!maybeExportDeclar.isExportDeclaration()) {
+ return;
+ }
+
+ if (maybeExportDeclar.isExportDefaultDeclaration() && !maybeExportDeclar.get("declaration").node.id) {
+ return;
+ }
+
+ (0, _helperSplitExportDeclaration.default)(maybeExportDeclar);
+ }
+
+ maybeConvertFromClassFunctionDeclaration(path) {
+ return;
+ if (!path.isFunctionDeclaration() && !path.isClassDeclaration()) return;
+ if (this.binding.kind !== "hoisted") return;
+ path.node.id = identifier(this.oldName);
+ path.node._blockHoist = 3;
+ path.replaceWith(variableDeclaration("let", [variableDeclarator(identifier(this.newName), toExpression(path.node))]));
+ }
+
+ maybeConvertFromClassFunctionExpression(path) {
+ return;
+ if (!path.isFunctionExpression() && !path.isClassExpression()) return;
+ if (this.binding.kind !== "local") return;
+ path.node.id = identifier(this.oldName);
+ this.binding.scope.parent.push({
+ id: identifier(this.newName)
+ });
+ path.replaceWith(assignmentExpression("=", identifier(this.newName), path.node));
+ }
+
+ rename(block) {
+ const {
+ binding,
+ oldName,
+ newName
+ } = this;
+ const {
+ scope,
+ path
+ } = binding;
+ const parentDeclar = path.find(path => path.isDeclaration() || path.isFunctionExpression() || path.isClassExpression());
+
+ if (parentDeclar) {
+ const bindingIds = parentDeclar.getOuterBindingIdentifiers();
+
+ if (bindingIds[oldName] === binding.identifier) {
+ this.maybeConvertFromExportDeclaration(parentDeclar);
+ }
+ }
+
+ const blockToTraverse = block || scope.block;
+
+ if ((blockToTraverse == null ? void 0 : blockToTraverse.type) === "SwitchStatement") {
+ blockToTraverse.cases.forEach(c => {
+ scope.traverse(c, renameVisitor, this);
+ });
+ } else {
+ scope.traverse(blockToTraverse, renameVisitor, this);
+ }
+
+ if (!block) {
+ scope.removeOwnBinding(oldName);
+ scope.bindings[newName] = binding;
+ this.binding.identifier.name = newName;
+ }
+
+ if (parentDeclar) {
+ this.maybeConvertFromClassFunctionDeclaration(parentDeclar);
+ this.maybeConvertFromClassFunctionExpression(parentDeclar);
+ }
+ }
+
+}
+
+exports.default = Renamer;
+
+function skipAllButComputedMethodKey(path) {
+ if (!path.isMethod() || !path.node.computed) {
+ path.skip();
+ return;
+ }
+
+ const keys = VISITOR_KEYS[path.type];
+
+ for (const key of keys) {
+ if (key !== "key") path.skipKey(key);
+ }
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/traverse/lib/types.js b/chromium/third_party/node/node_modules/@babel/traverse/lib/types.js
new file mode 100644
index 00000000000..ec17ee62fc5
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/traverse/lib/types.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var _index = require("./index");
+
+var _virtualTypes = require("./path/generated/virtual-types"); \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/traverse/lib/visitors.js b/chromium/third_party/node/node_modules/@babel/traverse/lib/visitors.js
new file mode 100644
index 00000000000..33fab0c9acb
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/traverse/lib/visitors.js
@@ -0,0 +1,242 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.explode = explode;
+exports.verify = verify;
+exports.merge = merge;
+
+var virtualTypes = require("./path/lib/virtual-types");
+
+var _t = require("@babel/types");
+
+const {
+ DEPRECATED_KEYS,
+ FLIPPED_ALIAS_KEYS,
+ TYPES
+} = _t;
+
+function explode(visitor) {
+ if (visitor._exploded) return visitor;
+ visitor._exploded = true;
+
+ for (const nodeType of Object.keys(visitor)) {
+ if (shouldIgnoreKey(nodeType)) continue;
+ const parts = nodeType.split("|");
+ if (parts.length === 1) continue;
+ const fns = visitor[nodeType];
+ delete visitor[nodeType];
+
+ for (const part of parts) {
+ visitor[part] = fns;
+ }
+ }
+
+ verify(visitor);
+ delete visitor.__esModule;
+ ensureEntranceObjects(visitor);
+ ensureCallbackArrays(visitor);
+
+ for (const nodeType of Object.keys(visitor)) {
+ if (shouldIgnoreKey(nodeType)) continue;
+ const wrapper = virtualTypes[nodeType];
+ if (!wrapper) continue;
+ const fns = visitor[nodeType];
+
+ for (const type of Object.keys(fns)) {
+ fns[type] = wrapCheck(wrapper, fns[type]);
+ }
+
+ delete visitor[nodeType];
+
+ if (wrapper.types) {
+ for (const type of wrapper.types) {
+ if (visitor[type]) {
+ mergePair(visitor[type], fns);
+ } else {
+ visitor[type] = fns;
+ }
+ }
+ } else {
+ mergePair(visitor, fns);
+ }
+ }
+
+ for (const nodeType of Object.keys(visitor)) {
+ if (shouldIgnoreKey(nodeType)) continue;
+ const fns = visitor[nodeType];
+ let aliases = FLIPPED_ALIAS_KEYS[nodeType];
+ const deprecatedKey = DEPRECATED_KEYS[nodeType];
+
+ if (deprecatedKey) {
+ console.trace(`Visitor defined for ${nodeType} but it has been renamed to ${deprecatedKey}`);
+ aliases = [deprecatedKey];
+ }
+
+ if (!aliases) continue;
+ delete visitor[nodeType];
+
+ for (const alias of aliases) {
+ const existing = visitor[alias];
+
+ if (existing) {
+ mergePair(existing, fns);
+ } else {
+ visitor[alias] = Object.assign({}, fns);
+ }
+ }
+ }
+
+ for (const nodeType of Object.keys(visitor)) {
+ if (shouldIgnoreKey(nodeType)) continue;
+ ensureCallbackArrays(visitor[nodeType]);
+ }
+
+ return visitor;
+}
+
+function verify(visitor) {
+ if (visitor._verified) return;
+
+ if (typeof visitor === "function") {
+ throw new Error("You passed `traverse()` a function when it expected a visitor object, " + "are you sure you didn't mean `{ enter: Function }`?");
+ }
+
+ for (const nodeType of Object.keys(visitor)) {
+ if (nodeType === "enter" || nodeType === "exit") {
+ validateVisitorMethods(nodeType, visitor[nodeType]);
+ }
+
+ if (shouldIgnoreKey(nodeType)) continue;
+
+ if (TYPES.indexOf(nodeType) < 0) {
+ throw new Error(`You gave us a visitor for the node type ${nodeType} but it's not a valid type`);
+ }
+
+ const visitors = visitor[nodeType];
+
+ if (typeof visitors === "object") {
+ for (const visitorKey of Object.keys(visitors)) {
+ if (visitorKey === "enter" || visitorKey === "exit") {
+ validateVisitorMethods(`${nodeType}.${visitorKey}`, visitors[visitorKey]);
+ } else {
+ throw new Error("You passed `traverse()` a visitor object with the property " + `${nodeType} that has the invalid property ${visitorKey}`);
+ }
+ }
+ }
+ }
+
+ visitor._verified = true;
+}
+
+function validateVisitorMethods(path, val) {
+ const fns = [].concat(val);
+
+ for (const fn of fns) {
+ if (typeof fn !== "function") {
+ throw new TypeError(`Non-function found defined in ${path} with type ${typeof fn}`);
+ }
+ }
+}
+
+function merge(visitors, states = [], wrapper) {
+ const rootVisitor = {};
+
+ for (let i = 0; i < visitors.length; i++) {
+ const visitor = visitors[i];
+ const state = states[i];
+ explode(visitor);
+
+ for (const type of Object.keys(visitor)) {
+ let visitorType = visitor[type];
+
+ if (state || wrapper) {
+ visitorType = wrapWithStateOrWrapper(visitorType, state, wrapper);
+ }
+
+ const nodeVisitor = rootVisitor[type] = rootVisitor[type] || {};
+ mergePair(nodeVisitor, visitorType);
+ }
+ }
+
+ return rootVisitor;
+}
+
+function wrapWithStateOrWrapper(oldVisitor, state, wrapper) {
+ const newVisitor = {};
+
+ for (const key of Object.keys(oldVisitor)) {
+ let fns = oldVisitor[key];
+ if (!Array.isArray(fns)) continue;
+ fns = fns.map(function (fn) {
+ let newFn = fn;
+
+ if (state) {
+ newFn = function (path) {
+ return fn.call(state, path, state);
+ };
+ }
+
+ if (wrapper) {
+ newFn = wrapper(state.key, key, newFn);
+ }
+
+ if (newFn !== fn) {
+ newFn.toString = () => fn.toString();
+ }
+
+ return newFn;
+ });
+ newVisitor[key] = fns;
+ }
+
+ return newVisitor;
+}
+
+function ensureEntranceObjects(obj) {
+ for (const key of Object.keys(obj)) {
+ if (shouldIgnoreKey(key)) continue;
+ const fns = obj[key];
+
+ if (typeof fns === "function") {
+ obj[key] = {
+ enter: fns
+ };
+ }
+ }
+}
+
+function ensureCallbackArrays(obj) {
+ if (obj.enter && !Array.isArray(obj.enter)) obj.enter = [obj.enter];
+ if (obj.exit && !Array.isArray(obj.exit)) obj.exit = [obj.exit];
+}
+
+function wrapCheck(wrapper, fn) {
+ const newFn = function (path) {
+ if (wrapper.checkPath(path)) {
+ return fn.apply(this, arguments);
+ }
+ };
+
+ newFn.toString = () => fn.toString();
+
+ return newFn;
+}
+
+function shouldIgnoreKey(key) {
+ if (key[0] === "_") return true;
+ if (key === "enter" || key === "exit" || key === "shouldSkip") return true;
+
+ if (key === "denylist" || key === "noScope" || key === "skipKeys" || key === "blacklist") {
+ return true;
+ }
+
+ return false;
+}
+
+function mergePair(dest, src) {
+ for (const key of Object.keys(src)) {
+ dest[key] = [].concat(dest[key] || [], src[key]);
+ }
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/traverse/package.json b/chromium/third_party/node/node_modules/@babel/traverse/package.json
new file mode 100644
index 00000000000..4b43e12698d
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/traverse/package.json
@@ -0,0 +1,35 @@
+{
+ "name": "@babel/traverse",
+ "version": "7.15.4",
+ "description": "The Babel Traverse module maintains the overall tree state, and is responsible for replacing, removing, and adding nodes",
+ "author": "The Babel Team (https://babel.dev/team)",
+ "homepage": "https://babel.dev/docs/en/next/babel-traverse",
+ "bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20traverse%22+is%3Aopen",
+ "license": "MIT",
+ "publishConfig": {
+ "access": "public"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/babel/babel.git",
+ "directory": "packages/babel-traverse"
+ },
+ "main": "./lib/index.js",
+ "dependencies": {
+ "@babel/code-frame": "^7.14.5",
+ "@babel/generator": "^7.15.4",
+ "@babel/helper-function-name": "^7.15.4",
+ "@babel/helper-hoist-variables": "^7.15.4",
+ "@babel/helper-split-export-declaration": "^7.15.4",
+ "@babel/parser": "^7.15.4",
+ "@babel/types": "^7.15.4",
+ "debug": "^4.1.0",
+ "globals": "^11.1.0"
+ },
+ "devDependencies": {
+ "@babel/helper-plugin-test-runner": "7.14.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/traverse/scripts/generators/asserts.js b/chromium/third_party/node/node_modules/@babel/traverse/scripts/generators/asserts.js
new file mode 100644
index 00000000000..f10b33eede2
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/traverse/scripts/generators/asserts.js
@@ -0,0 +1,25 @@
+import t from "@babel/types";
+
+export default function generateAsserts() {
+ let output = `/*
+ * This file is auto-generated! Do not modify it directly.
+ * To re-generate run 'make build'
+ */
+import * as t from "@babel/types";
+import NodePath from "../index";
+
+
+export interface NodePathAssetions {`;
+
+ for (const type of [...t.TYPES].sort()) {
+ output += `
+ assert${type}(
+ opts?: object,
+ ): asserts this is NodePath<t.${type}>;`;
+ }
+
+ output += `
+}`;
+
+ return output;
+}
diff --git a/chromium/third_party/node/node_modules/@babel/traverse/scripts/generators/validators.js b/chromium/third_party/node/node_modules/@babel/traverse/scripts/generators/validators.js
new file mode 100644
index 00000000000..a3ec31a3ebb
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/traverse/scripts/generators/validators.js
@@ -0,0 +1,43 @@
+import t from "@babel/types";
+import virtualTypes from "../../lib/path/lib/virtual-types.js";
+import definitions from "@babel/types/lib/definitions/index.js";
+
+export default function generateValidators() {
+ let output = `/*
+ * This file is auto-generated! Do not modify it directly.
+ * To re-generate run 'make build'
+ */
+import * as t from "@babel/types";
+import NodePath from "../index";
+import type { VirtualTypeAliases } from "./virtual-types";
+
+export interface NodePathValidators {
+`;
+
+ for (const type of [...t.TYPES].sort()) {
+ output += `is${type}(opts?: object): this is NodePath<t.${type}>;`;
+ }
+
+ for (const type of Object.keys(virtualTypes)) {
+ const { types } = virtualTypes[type];
+ if (type[0] === "_") continue;
+ if (definitions.NODE_FIELDS[type] || definitions.FLIPPED_ALIAS_KEYS[type]) {
+ output += `is${type}(opts?: object): this is NodePath<t.${type}>;`;
+ } else if (types /* in VirtualTypeAliases */) {
+ output += `is${type}(opts?: object): this is NodePath<VirtualTypeAliases["${type}"]>;`;
+ } else {
+ // if it don't have types, then VirtualTypeAliases[type] is t.Node
+ // which TS marked as always true
+ // eg. if (path.isBlockScope()) return;
+ // path resolved to `never` here
+ // so we have to return boolean instead of this is NodePath<t.Node> here
+ output += `is${type}(opts?: object): boolean;`;
+ }
+ }
+
+ output += `
+}
+`;
+
+ return output;
+}
diff --git a/chromium/third_party/node/node_modules/@babel/traverse/scripts/generators/virtual-types.js b/chromium/third_party/node/node_modules/@babel/traverse/scripts/generators/virtual-types.js
new file mode 100644
index 00000000000..6d55f54caaf
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/traverse/scripts/generators/virtual-types.js
@@ -0,0 +1,24 @@
+import virtualTypes from "../../lib/path/lib/virtual-types.js";
+
+export default function generateValidators() {
+ let output = `/*
+ * This file is auto-generated! Do not modify it directly.
+ * To re-generate run 'make build'
+ */
+import * as t from "@babel/types";
+
+export interface VirtualTypeAliases {
+`;
+
+ for (const type of Object.keys(virtualTypes)) {
+ output += ` ${type}: ${(virtualTypes[type].types || ["Node"])
+ .map(t => `t.${t}`)
+ .join(" | ")};`;
+ }
+
+ output += `
+}
+`;
+
+ return output;
+}
diff --git a/chromium/third_party/node/node_modules/@babel/traverse/scripts/package.json b/chromium/third_party/node/node_modules/@babel/traverse/scripts/package.json
new file mode 100644
index 00000000000..5ffd9800b97
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/traverse/scripts/package.json
@@ -0,0 +1 @@
+{ "type": "module" }
diff --git a/chromium/third_party/node/node_modules/@babel/types/LICENSE b/chromium/third_party/node/node_modules/@babel/types/LICENSE
new file mode 100644
index 00000000000..f31575ec773
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/LICENSE
@@ -0,0 +1,22 @@
+MIT License
+
+Copyright (c) 2014-present Sebastian McKenzie and other contributors
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/asserts/assertNode.js b/chromium/third_party/node/node_modules/@babel/types/lib/asserts/assertNode.js
new file mode 100644
index 00000000000..e584e3eec60
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/asserts/assertNode.js
@@ -0,0 +1,17 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = assertNode;
+
+var _isNode = require("../validators/isNode");
+
+function assertNode(node) {
+ if (!(0, _isNode.default)(node)) {
+ var _node$type;
+
+ const type = (_node$type = node == null ? void 0 : node.type) != null ? _node$type : JSON.stringify(node);
+ throw new TypeError(`Not a valid node of type "${type}"`);
+ }
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/asserts/generated/index.js b/chromium/third_party/node/node_modules/@babel/types/lib/asserts/generated/index.js
new file mode 100644
index 00000000000..b7309f7a241
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/asserts/generated/index.js
@@ -0,0 +1,1492 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.assertArrayExpression = assertArrayExpression;
+exports.assertAssignmentExpression = assertAssignmentExpression;
+exports.assertBinaryExpression = assertBinaryExpression;
+exports.assertInterpreterDirective = assertInterpreterDirective;
+exports.assertDirective = assertDirective;
+exports.assertDirectiveLiteral = assertDirectiveLiteral;
+exports.assertBlockStatement = assertBlockStatement;
+exports.assertBreakStatement = assertBreakStatement;
+exports.assertCallExpression = assertCallExpression;
+exports.assertCatchClause = assertCatchClause;
+exports.assertConditionalExpression = assertConditionalExpression;
+exports.assertContinueStatement = assertContinueStatement;
+exports.assertDebuggerStatement = assertDebuggerStatement;
+exports.assertDoWhileStatement = assertDoWhileStatement;
+exports.assertEmptyStatement = assertEmptyStatement;
+exports.assertExpressionStatement = assertExpressionStatement;
+exports.assertFile = assertFile;
+exports.assertForInStatement = assertForInStatement;
+exports.assertForStatement = assertForStatement;
+exports.assertFunctionDeclaration = assertFunctionDeclaration;
+exports.assertFunctionExpression = assertFunctionExpression;
+exports.assertIdentifier = assertIdentifier;
+exports.assertIfStatement = assertIfStatement;
+exports.assertLabeledStatement = assertLabeledStatement;
+exports.assertStringLiteral = assertStringLiteral;
+exports.assertNumericLiteral = assertNumericLiteral;
+exports.assertNullLiteral = assertNullLiteral;
+exports.assertBooleanLiteral = assertBooleanLiteral;
+exports.assertRegExpLiteral = assertRegExpLiteral;
+exports.assertLogicalExpression = assertLogicalExpression;
+exports.assertMemberExpression = assertMemberExpression;
+exports.assertNewExpression = assertNewExpression;
+exports.assertProgram = assertProgram;
+exports.assertObjectExpression = assertObjectExpression;
+exports.assertObjectMethod = assertObjectMethod;
+exports.assertObjectProperty = assertObjectProperty;
+exports.assertRestElement = assertRestElement;
+exports.assertReturnStatement = assertReturnStatement;
+exports.assertSequenceExpression = assertSequenceExpression;
+exports.assertParenthesizedExpression = assertParenthesizedExpression;
+exports.assertSwitchCase = assertSwitchCase;
+exports.assertSwitchStatement = assertSwitchStatement;
+exports.assertThisExpression = assertThisExpression;
+exports.assertThrowStatement = assertThrowStatement;
+exports.assertTryStatement = assertTryStatement;
+exports.assertUnaryExpression = assertUnaryExpression;
+exports.assertUpdateExpression = assertUpdateExpression;
+exports.assertVariableDeclaration = assertVariableDeclaration;
+exports.assertVariableDeclarator = assertVariableDeclarator;
+exports.assertWhileStatement = assertWhileStatement;
+exports.assertWithStatement = assertWithStatement;
+exports.assertAssignmentPattern = assertAssignmentPattern;
+exports.assertArrayPattern = assertArrayPattern;
+exports.assertArrowFunctionExpression = assertArrowFunctionExpression;
+exports.assertClassBody = assertClassBody;
+exports.assertClassExpression = assertClassExpression;
+exports.assertClassDeclaration = assertClassDeclaration;
+exports.assertExportAllDeclaration = assertExportAllDeclaration;
+exports.assertExportDefaultDeclaration = assertExportDefaultDeclaration;
+exports.assertExportNamedDeclaration = assertExportNamedDeclaration;
+exports.assertExportSpecifier = assertExportSpecifier;
+exports.assertForOfStatement = assertForOfStatement;
+exports.assertImportDeclaration = assertImportDeclaration;
+exports.assertImportDefaultSpecifier = assertImportDefaultSpecifier;
+exports.assertImportNamespaceSpecifier = assertImportNamespaceSpecifier;
+exports.assertImportSpecifier = assertImportSpecifier;
+exports.assertMetaProperty = assertMetaProperty;
+exports.assertClassMethod = assertClassMethod;
+exports.assertObjectPattern = assertObjectPattern;
+exports.assertSpreadElement = assertSpreadElement;
+exports.assertSuper = assertSuper;
+exports.assertTaggedTemplateExpression = assertTaggedTemplateExpression;
+exports.assertTemplateElement = assertTemplateElement;
+exports.assertTemplateLiteral = assertTemplateLiteral;
+exports.assertYieldExpression = assertYieldExpression;
+exports.assertAwaitExpression = assertAwaitExpression;
+exports.assertImport = assertImport;
+exports.assertBigIntLiteral = assertBigIntLiteral;
+exports.assertExportNamespaceSpecifier = assertExportNamespaceSpecifier;
+exports.assertOptionalMemberExpression = assertOptionalMemberExpression;
+exports.assertOptionalCallExpression = assertOptionalCallExpression;
+exports.assertClassProperty = assertClassProperty;
+exports.assertClassPrivateProperty = assertClassPrivateProperty;
+exports.assertClassPrivateMethod = assertClassPrivateMethod;
+exports.assertPrivateName = assertPrivateName;
+exports.assertAnyTypeAnnotation = assertAnyTypeAnnotation;
+exports.assertArrayTypeAnnotation = assertArrayTypeAnnotation;
+exports.assertBooleanTypeAnnotation = assertBooleanTypeAnnotation;
+exports.assertBooleanLiteralTypeAnnotation = assertBooleanLiteralTypeAnnotation;
+exports.assertNullLiteralTypeAnnotation = assertNullLiteralTypeAnnotation;
+exports.assertClassImplements = assertClassImplements;
+exports.assertDeclareClass = assertDeclareClass;
+exports.assertDeclareFunction = assertDeclareFunction;
+exports.assertDeclareInterface = assertDeclareInterface;
+exports.assertDeclareModule = assertDeclareModule;
+exports.assertDeclareModuleExports = assertDeclareModuleExports;
+exports.assertDeclareTypeAlias = assertDeclareTypeAlias;
+exports.assertDeclareOpaqueType = assertDeclareOpaqueType;
+exports.assertDeclareVariable = assertDeclareVariable;
+exports.assertDeclareExportDeclaration = assertDeclareExportDeclaration;
+exports.assertDeclareExportAllDeclaration = assertDeclareExportAllDeclaration;
+exports.assertDeclaredPredicate = assertDeclaredPredicate;
+exports.assertExistsTypeAnnotation = assertExistsTypeAnnotation;
+exports.assertFunctionTypeAnnotation = assertFunctionTypeAnnotation;
+exports.assertFunctionTypeParam = assertFunctionTypeParam;
+exports.assertGenericTypeAnnotation = assertGenericTypeAnnotation;
+exports.assertInferredPredicate = assertInferredPredicate;
+exports.assertInterfaceExtends = assertInterfaceExtends;
+exports.assertInterfaceDeclaration = assertInterfaceDeclaration;
+exports.assertInterfaceTypeAnnotation = assertInterfaceTypeAnnotation;
+exports.assertIntersectionTypeAnnotation = assertIntersectionTypeAnnotation;
+exports.assertMixedTypeAnnotation = assertMixedTypeAnnotation;
+exports.assertEmptyTypeAnnotation = assertEmptyTypeAnnotation;
+exports.assertNullableTypeAnnotation = assertNullableTypeAnnotation;
+exports.assertNumberLiteralTypeAnnotation = assertNumberLiteralTypeAnnotation;
+exports.assertNumberTypeAnnotation = assertNumberTypeAnnotation;
+exports.assertObjectTypeAnnotation = assertObjectTypeAnnotation;
+exports.assertObjectTypeInternalSlot = assertObjectTypeInternalSlot;
+exports.assertObjectTypeCallProperty = assertObjectTypeCallProperty;
+exports.assertObjectTypeIndexer = assertObjectTypeIndexer;
+exports.assertObjectTypeProperty = assertObjectTypeProperty;
+exports.assertObjectTypeSpreadProperty = assertObjectTypeSpreadProperty;
+exports.assertOpaqueType = assertOpaqueType;
+exports.assertQualifiedTypeIdentifier = assertQualifiedTypeIdentifier;
+exports.assertStringLiteralTypeAnnotation = assertStringLiteralTypeAnnotation;
+exports.assertStringTypeAnnotation = assertStringTypeAnnotation;
+exports.assertSymbolTypeAnnotation = assertSymbolTypeAnnotation;
+exports.assertThisTypeAnnotation = assertThisTypeAnnotation;
+exports.assertTupleTypeAnnotation = assertTupleTypeAnnotation;
+exports.assertTypeofTypeAnnotation = assertTypeofTypeAnnotation;
+exports.assertTypeAlias = assertTypeAlias;
+exports.assertTypeAnnotation = assertTypeAnnotation;
+exports.assertTypeCastExpression = assertTypeCastExpression;
+exports.assertTypeParameter = assertTypeParameter;
+exports.assertTypeParameterDeclaration = assertTypeParameterDeclaration;
+exports.assertTypeParameterInstantiation = assertTypeParameterInstantiation;
+exports.assertUnionTypeAnnotation = assertUnionTypeAnnotation;
+exports.assertVariance = assertVariance;
+exports.assertVoidTypeAnnotation = assertVoidTypeAnnotation;
+exports.assertEnumDeclaration = assertEnumDeclaration;
+exports.assertEnumBooleanBody = assertEnumBooleanBody;
+exports.assertEnumNumberBody = assertEnumNumberBody;
+exports.assertEnumStringBody = assertEnumStringBody;
+exports.assertEnumSymbolBody = assertEnumSymbolBody;
+exports.assertEnumBooleanMember = assertEnumBooleanMember;
+exports.assertEnumNumberMember = assertEnumNumberMember;
+exports.assertEnumStringMember = assertEnumStringMember;
+exports.assertEnumDefaultedMember = assertEnumDefaultedMember;
+exports.assertIndexedAccessType = assertIndexedAccessType;
+exports.assertOptionalIndexedAccessType = assertOptionalIndexedAccessType;
+exports.assertJSXAttribute = assertJSXAttribute;
+exports.assertJSXClosingElement = assertJSXClosingElement;
+exports.assertJSXElement = assertJSXElement;
+exports.assertJSXEmptyExpression = assertJSXEmptyExpression;
+exports.assertJSXExpressionContainer = assertJSXExpressionContainer;
+exports.assertJSXSpreadChild = assertJSXSpreadChild;
+exports.assertJSXIdentifier = assertJSXIdentifier;
+exports.assertJSXMemberExpression = assertJSXMemberExpression;
+exports.assertJSXNamespacedName = assertJSXNamespacedName;
+exports.assertJSXOpeningElement = assertJSXOpeningElement;
+exports.assertJSXSpreadAttribute = assertJSXSpreadAttribute;
+exports.assertJSXText = assertJSXText;
+exports.assertJSXFragment = assertJSXFragment;
+exports.assertJSXOpeningFragment = assertJSXOpeningFragment;
+exports.assertJSXClosingFragment = assertJSXClosingFragment;
+exports.assertNoop = assertNoop;
+exports.assertPlaceholder = assertPlaceholder;
+exports.assertV8IntrinsicIdentifier = assertV8IntrinsicIdentifier;
+exports.assertArgumentPlaceholder = assertArgumentPlaceholder;
+exports.assertBindExpression = assertBindExpression;
+exports.assertImportAttribute = assertImportAttribute;
+exports.assertDecorator = assertDecorator;
+exports.assertDoExpression = assertDoExpression;
+exports.assertExportDefaultSpecifier = assertExportDefaultSpecifier;
+exports.assertRecordExpression = assertRecordExpression;
+exports.assertTupleExpression = assertTupleExpression;
+exports.assertDecimalLiteral = assertDecimalLiteral;
+exports.assertStaticBlock = assertStaticBlock;
+exports.assertModuleExpression = assertModuleExpression;
+exports.assertTopicReference = assertTopicReference;
+exports.assertPipelineTopicExpression = assertPipelineTopicExpression;
+exports.assertPipelineBareFunction = assertPipelineBareFunction;
+exports.assertPipelinePrimaryTopicReference = assertPipelinePrimaryTopicReference;
+exports.assertTSParameterProperty = assertTSParameterProperty;
+exports.assertTSDeclareFunction = assertTSDeclareFunction;
+exports.assertTSDeclareMethod = assertTSDeclareMethod;
+exports.assertTSQualifiedName = assertTSQualifiedName;
+exports.assertTSCallSignatureDeclaration = assertTSCallSignatureDeclaration;
+exports.assertTSConstructSignatureDeclaration = assertTSConstructSignatureDeclaration;
+exports.assertTSPropertySignature = assertTSPropertySignature;
+exports.assertTSMethodSignature = assertTSMethodSignature;
+exports.assertTSIndexSignature = assertTSIndexSignature;
+exports.assertTSAnyKeyword = assertTSAnyKeyword;
+exports.assertTSBooleanKeyword = assertTSBooleanKeyword;
+exports.assertTSBigIntKeyword = assertTSBigIntKeyword;
+exports.assertTSIntrinsicKeyword = assertTSIntrinsicKeyword;
+exports.assertTSNeverKeyword = assertTSNeverKeyword;
+exports.assertTSNullKeyword = assertTSNullKeyword;
+exports.assertTSNumberKeyword = assertTSNumberKeyword;
+exports.assertTSObjectKeyword = assertTSObjectKeyword;
+exports.assertTSStringKeyword = assertTSStringKeyword;
+exports.assertTSSymbolKeyword = assertTSSymbolKeyword;
+exports.assertTSUndefinedKeyword = assertTSUndefinedKeyword;
+exports.assertTSUnknownKeyword = assertTSUnknownKeyword;
+exports.assertTSVoidKeyword = assertTSVoidKeyword;
+exports.assertTSThisType = assertTSThisType;
+exports.assertTSFunctionType = assertTSFunctionType;
+exports.assertTSConstructorType = assertTSConstructorType;
+exports.assertTSTypeReference = assertTSTypeReference;
+exports.assertTSTypePredicate = assertTSTypePredicate;
+exports.assertTSTypeQuery = assertTSTypeQuery;
+exports.assertTSTypeLiteral = assertTSTypeLiteral;
+exports.assertTSArrayType = assertTSArrayType;
+exports.assertTSTupleType = assertTSTupleType;
+exports.assertTSOptionalType = assertTSOptionalType;
+exports.assertTSRestType = assertTSRestType;
+exports.assertTSNamedTupleMember = assertTSNamedTupleMember;
+exports.assertTSUnionType = assertTSUnionType;
+exports.assertTSIntersectionType = assertTSIntersectionType;
+exports.assertTSConditionalType = assertTSConditionalType;
+exports.assertTSInferType = assertTSInferType;
+exports.assertTSParenthesizedType = assertTSParenthesizedType;
+exports.assertTSTypeOperator = assertTSTypeOperator;
+exports.assertTSIndexedAccessType = assertTSIndexedAccessType;
+exports.assertTSMappedType = assertTSMappedType;
+exports.assertTSLiteralType = assertTSLiteralType;
+exports.assertTSExpressionWithTypeArguments = assertTSExpressionWithTypeArguments;
+exports.assertTSInterfaceDeclaration = assertTSInterfaceDeclaration;
+exports.assertTSInterfaceBody = assertTSInterfaceBody;
+exports.assertTSTypeAliasDeclaration = assertTSTypeAliasDeclaration;
+exports.assertTSAsExpression = assertTSAsExpression;
+exports.assertTSTypeAssertion = assertTSTypeAssertion;
+exports.assertTSEnumDeclaration = assertTSEnumDeclaration;
+exports.assertTSEnumMember = assertTSEnumMember;
+exports.assertTSModuleDeclaration = assertTSModuleDeclaration;
+exports.assertTSModuleBlock = assertTSModuleBlock;
+exports.assertTSImportType = assertTSImportType;
+exports.assertTSImportEqualsDeclaration = assertTSImportEqualsDeclaration;
+exports.assertTSExternalModuleReference = assertTSExternalModuleReference;
+exports.assertTSNonNullExpression = assertTSNonNullExpression;
+exports.assertTSExportAssignment = assertTSExportAssignment;
+exports.assertTSNamespaceExportDeclaration = assertTSNamespaceExportDeclaration;
+exports.assertTSTypeAnnotation = assertTSTypeAnnotation;
+exports.assertTSTypeParameterInstantiation = assertTSTypeParameterInstantiation;
+exports.assertTSTypeParameterDeclaration = assertTSTypeParameterDeclaration;
+exports.assertTSTypeParameter = assertTSTypeParameter;
+exports.assertExpression = assertExpression;
+exports.assertBinary = assertBinary;
+exports.assertScopable = assertScopable;
+exports.assertBlockParent = assertBlockParent;
+exports.assertBlock = assertBlock;
+exports.assertStatement = assertStatement;
+exports.assertTerminatorless = assertTerminatorless;
+exports.assertCompletionStatement = assertCompletionStatement;
+exports.assertConditional = assertConditional;
+exports.assertLoop = assertLoop;
+exports.assertWhile = assertWhile;
+exports.assertExpressionWrapper = assertExpressionWrapper;
+exports.assertFor = assertFor;
+exports.assertForXStatement = assertForXStatement;
+exports.assertFunction = assertFunction;
+exports.assertFunctionParent = assertFunctionParent;
+exports.assertPureish = assertPureish;
+exports.assertDeclaration = assertDeclaration;
+exports.assertPatternLike = assertPatternLike;
+exports.assertLVal = assertLVal;
+exports.assertTSEntityName = assertTSEntityName;
+exports.assertLiteral = assertLiteral;
+exports.assertImmutable = assertImmutable;
+exports.assertUserWhitespacable = assertUserWhitespacable;
+exports.assertMethod = assertMethod;
+exports.assertObjectMember = assertObjectMember;
+exports.assertProperty = assertProperty;
+exports.assertUnaryLike = assertUnaryLike;
+exports.assertPattern = assertPattern;
+exports.assertClass = assertClass;
+exports.assertModuleDeclaration = assertModuleDeclaration;
+exports.assertExportDeclaration = assertExportDeclaration;
+exports.assertModuleSpecifier = assertModuleSpecifier;
+exports.assertPrivate = assertPrivate;
+exports.assertFlow = assertFlow;
+exports.assertFlowType = assertFlowType;
+exports.assertFlowBaseAnnotation = assertFlowBaseAnnotation;
+exports.assertFlowDeclaration = assertFlowDeclaration;
+exports.assertFlowPredicate = assertFlowPredicate;
+exports.assertEnumBody = assertEnumBody;
+exports.assertEnumMember = assertEnumMember;
+exports.assertJSX = assertJSX;
+exports.assertTSTypeElement = assertTSTypeElement;
+exports.assertTSType = assertTSType;
+exports.assertTSBaseType = assertTSBaseType;
+exports.assertNumberLiteral = assertNumberLiteral;
+exports.assertRegexLiteral = assertRegexLiteral;
+exports.assertRestProperty = assertRestProperty;
+exports.assertSpreadProperty = assertSpreadProperty;
+
+var _is = require("../../validators/is");
+
+function assert(type, node, opts) {
+ if (!(0, _is.default)(type, node, opts)) {
+ throw new Error(`Expected type "${type}" with option ${JSON.stringify(opts)}, ` + `but instead got "${node.type}".`);
+ }
+}
+
+function assertArrayExpression(node, opts) {
+ assert("ArrayExpression", node, opts);
+}
+
+function assertAssignmentExpression(node, opts) {
+ assert("AssignmentExpression", node, opts);
+}
+
+function assertBinaryExpression(node, opts) {
+ assert("BinaryExpression", node, opts);
+}
+
+function assertInterpreterDirective(node, opts) {
+ assert("InterpreterDirective", node, opts);
+}
+
+function assertDirective(node, opts) {
+ assert("Directive", node, opts);
+}
+
+function assertDirectiveLiteral(node, opts) {
+ assert("DirectiveLiteral", node, opts);
+}
+
+function assertBlockStatement(node, opts) {
+ assert("BlockStatement", node, opts);
+}
+
+function assertBreakStatement(node, opts) {
+ assert("BreakStatement", node, opts);
+}
+
+function assertCallExpression(node, opts) {
+ assert("CallExpression", node, opts);
+}
+
+function assertCatchClause(node, opts) {
+ assert("CatchClause", node, opts);
+}
+
+function assertConditionalExpression(node, opts) {
+ assert("ConditionalExpression", node, opts);
+}
+
+function assertContinueStatement(node, opts) {
+ assert("ContinueStatement", node, opts);
+}
+
+function assertDebuggerStatement(node, opts) {
+ assert("DebuggerStatement", node, opts);
+}
+
+function assertDoWhileStatement(node, opts) {
+ assert("DoWhileStatement", node, opts);
+}
+
+function assertEmptyStatement(node, opts) {
+ assert("EmptyStatement", node, opts);
+}
+
+function assertExpressionStatement(node, opts) {
+ assert("ExpressionStatement", node, opts);
+}
+
+function assertFile(node, opts) {
+ assert("File", node, opts);
+}
+
+function assertForInStatement(node, opts) {
+ assert("ForInStatement", node, opts);
+}
+
+function assertForStatement(node, opts) {
+ assert("ForStatement", node, opts);
+}
+
+function assertFunctionDeclaration(node, opts) {
+ assert("FunctionDeclaration", node, opts);
+}
+
+function assertFunctionExpression(node, opts) {
+ assert("FunctionExpression", node, opts);
+}
+
+function assertIdentifier(node, opts) {
+ assert("Identifier", node, opts);
+}
+
+function assertIfStatement(node, opts) {
+ assert("IfStatement", node, opts);
+}
+
+function assertLabeledStatement(node, opts) {
+ assert("LabeledStatement", node, opts);
+}
+
+function assertStringLiteral(node, opts) {
+ assert("StringLiteral", node, opts);
+}
+
+function assertNumericLiteral(node, opts) {
+ assert("NumericLiteral", node, opts);
+}
+
+function assertNullLiteral(node, opts) {
+ assert("NullLiteral", node, opts);
+}
+
+function assertBooleanLiteral(node, opts) {
+ assert("BooleanLiteral", node, opts);
+}
+
+function assertRegExpLiteral(node, opts) {
+ assert("RegExpLiteral", node, opts);
+}
+
+function assertLogicalExpression(node, opts) {
+ assert("LogicalExpression", node, opts);
+}
+
+function assertMemberExpression(node, opts) {
+ assert("MemberExpression", node, opts);
+}
+
+function assertNewExpression(node, opts) {
+ assert("NewExpression", node, opts);
+}
+
+function assertProgram(node, opts) {
+ assert("Program", node, opts);
+}
+
+function assertObjectExpression(node, opts) {
+ assert("ObjectExpression", node, opts);
+}
+
+function assertObjectMethod(node, opts) {
+ assert("ObjectMethod", node, opts);
+}
+
+function assertObjectProperty(node, opts) {
+ assert("ObjectProperty", node, opts);
+}
+
+function assertRestElement(node, opts) {
+ assert("RestElement", node, opts);
+}
+
+function assertReturnStatement(node, opts) {
+ assert("ReturnStatement", node, opts);
+}
+
+function assertSequenceExpression(node, opts) {
+ assert("SequenceExpression", node, opts);
+}
+
+function assertParenthesizedExpression(node, opts) {
+ assert("ParenthesizedExpression", node, opts);
+}
+
+function assertSwitchCase(node, opts) {
+ assert("SwitchCase", node, opts);
+}
+
+function assertSwitchStatement(node, opts) {
+ assert("SwitchStatement", node, opts);
+}
+
+function assertThisExpression(node, opts) {
+ assert("ThisExpression", node, opts);
+}
+
+function assertThrowStatement(node, opts) {
+ assert("ThrowStatement", node, opts);
+}
+
+function assertTryStatement(node, opts) {
+ assert("TryStatement", node, opts);
+}
+
+function assertUnaryExpression(node, opts) {
+ assert("UnaryExpression", node, opts);
+}
+
+function assertUpdateExpression(node, opts) {
+ assert("UpdateExpression", node, opts);
+}
+
+function assertVariableDeclaration(node, opts) {
+ assert("VariableDeclaration", node, opts);
+}
+
+function assertVariableDeclarator(node, opts) {
+ assert("VariableDeclarator", node, opts);
+}
+
+function assertWhileStatement(node, opts) {
+ assert("WhileStatement", node, opts);
+}
+
+function assertWithStatement(node, opts) {
+ assert("WithStatement", node, opts);
+}
+
+function assertAssignmentPattern(node, opts) {
+ assert("AssignmentPattern", node, opts);
+}
+
+function assertArrayPattern(node, opts) {
+ assert("ArrayPattern", node, opts);
+}
+
+function assertArrowFunctionExpression(node, opts) {
+ assert("ArrowFunctionExpression", node, opts);
+}
+
+function assertClassBody(node, opts) {
+ assert("ClassBody", node, opts);
+}
+
+function assertClassExpression(node, opts) {
+ assert("ClassExpression", node, opts);
+}
+
+function assertClassDeclaration(node, opts) {
+ assert("ClassDeclaration", node, opts);
+}
+
+function assertExportAllDeclaration(node, opts) {
+ assert("ExportAllDeclaration", node, opts);
+}
+
+function assertExportDefaultDeclaration(node, opts) {
+ assert("ExportDefaultDeclaration", node, opts);
+}
+
+function assertExportNamedDeclaration(node, opts) {
+ assert("ExportNamedDeclaration", node, opts);
+}
+
+function assertExportSpecifier(node, opts) {
+ assert("ExportSpecifier", node, opts);
+}
+
+function assertForOfStatement(node, opts) {
+ assert("ForOfStatement", node, opts);
+}
+
+function assertImportDeclaration(node, opts) {
+ assert("ImportDeclaration", node, opts);
+}
+
+function assertImportDefaultSpecifier(node, opts) {
+ assert("ImportDefaultSpecifier", node, opts);
+}
+
+function assertImportNamespaceSpecifier(node, opts) {
+ assert("ImportNamespaceSpecifier", node, opts);
+}
+
+function assertImportSpecifier(node, opts) {
+ assert("ImportSpecifier", node, opts);
+}
+
+function assertMetaProperty(node, opts) {
+ assert("MetaProperty", node, opts);
+}
+
+function assertClassMethod(node, opts) {
+ assert("ClassMethod", node, opts);
+}
+
+function assertObjectPattern(node, opts) {
+ assert("ObjectPattern", node, opts);
+}
+
+function assertSpreadElement(node, opts) {
+ assert("SpreadElement", node, opts);
+}
+
+function assertSuper(node, opts) {
+ assert("Super", node, opts);
+}
+
+function assertTaggedTemplateExpression(node, opts) {
+ assert("TaggedTemplateExpression", node, opts);
+}
+
+function assertTemplateElement(node, opts) {
+ assert("TemplateElement", node, opts);
+}
+
+function assertTemplateLiteral(node, opts) {
+ assert("TemplateLiteral", node, opts);
+}
+
+function assertYieldExpression(node, opts) {
+ assert("YieldExpression", node, opts);
+}
+
+function assertAwaitExpression(node, opts) {
+ assert("AwaitExpression", node, opts);
+}
+
+function assertImport(node, opts) {
+ assert("Import", node, opts);
+}
+
+function assertBigIntLiteral(node, opts) {
+ assert("BigIntLiteral", node, opts);
+}
+
+function assertExportNamespaceSpecifier(node, opts) {
+ assert("ExportNamespaceSpecifier", node, opts);
+}
+
+function assertOptionalMemberExpression(node, opts) {
+ assert("OptionalMemberExpression", node, opts);
+}
+
+function assertOptionalCallExpression(node, opts) {
+ assert("OptionalCallExpression", node, opts);
+}
+
+function assertClassProperty(node, opts) {
+ assert("ClassProperty", node, opts);
+}
+
+function assertClassPrivateProperty(node, opts) {
+ assert("ClassPrivateProperty", node, opts);
+}
+
+function assertClassPrivateMethod(node, opts) {
+ assert("ClassPrivateMethod", node, opts);
+}
+
+function assertPrivateName(node, opts) {
+ assert("PrivateName", node, opts);
+}
+
+function assertAnyTypeAnnotation(node, opts) {
+ assert("AnyTypeAnnotation", node, opts);
+}
+
+function assertArrayTypeAnnotation(node, opts) {
+ assert("ArrayTypeAnnotation", node, opts);
+}
+
+function assertBooleanTypeAnnotation(node, opts) {
+ assert("BooleanTypeAnnotation", node, opts);
+}
+
+function assertBooleanLiteralTypeAnnotation(node, opts) {
+ assert("BooleanLiteralTypeAnnotation", node, opts);
+}
+
+function assertNullLiteralTypeAnnotation(node, opts) {
+ assert("NullLiteralTypeAnnotation", node, opts);
+}
+
+function assertClassImplements(node, opts) {
+ assert("ClassImplements", node, opts);
+}
+
+function assertDeclareClass(node, opts) {
+ assert("DeclareClass", node, opts);
+}
+
+function assertDeclareFunction(node, opts) {
+ assert("DeclareFunction", node, opts);
+}
+
+function assertDeclareInterface(node, opts) {
+ assert("DeclareInterface", node, opts);
+}
+
+function assertDeclareModule(node, opts) {
+ assert("DeclareModule", node, opts);
+}
+
+function assertDeclareModuleExports(node, opts) {
+ assert("DeclareModuleExports", node, opts);
+}
+
+function assertDeclareTypeAlias(node, opts) {
+ assert("DeclareTypeAlias", node, opts);
+}
+
+function assertDeclareOpaqueType(node, opts) {
+ assert("DeclareOpaqueType", node, opts);
+}
+
+function assertDeclareVariable(node, opts) {
+ assert("DeclareVariable", node, opts);
+}
+
+function assertDeclareExportDeclaration(node, opts) {
+ assert("DeclareExportDeclaration", node, opts);
+}
+
+function assertDeclareExportAllDeclaration(node, opts) {
+ assert("DeclareExportAllDeclaration", node, opts);
+}
+
+function assertDeclaredPredicate(node, opts) {
+ assert("DeclaredPredicate", node, opts);
+}
+
+function assertExistsTypeAnnotation(node, opts) {
+ assert("ExistsTypeAnnotation", node, opts);
+}
+
+function assertFunctionTypeAnnotation(node, opts) {
+ assert("FunctionTypeAnnotation", node, opts);
+}
+
+function assertFunctionTypeParam(node, opts) {
+ assert("FunctionTypeParam", node, opts);
+}
+
+function assertGenericTypeAnnotation(node, opts) {
+ assert("GenericTypeAnnotation", node, opts);
+}
+
+function assertInferredPredicate(node, opts) {
+ assert("InferredPredicate", node, opts);
+}
+
+function assertInterfaceExtends(node, opts) {
+ assert("InterfaceExtends", node, opts);
+}
+
+function assertInterfaceDeclaration(node, opts) {
+ assert("InterfaceDeclaration", node, opts);
+}
+
+function assertInterfaceTypeAnnotation(node, opts) {
+ assert("InterfaceTypeAnnotation", node, opts);
+}
+
+function assertIntersectionTypeAnnotation(node, opts) {
+ assert("IntersectionTypeAnnotation", node, opts);
+}
+
+function assertMixedTypeAnnotation(node, opts) {
+ assert("MixedTypeAnnotation", node, opts);
+}
+
+function assertEmptyTypeAnnotation(node, opts) {
+ assert("EmptyTypeAnnotation", node, opts);
+}
+
+function assertNullableTypeAnnotation(node, opts) {
+ assert("NullableTypeAnnotation", node, opts);
+}
+
+function assertNumberLiteralTypeAnnotation(node, opts) {
+ assert("NumberLiteralTypeAnnotation", node, opts);
+}
+
+function assertNumberTypeAnnotation(node, opts) {
+ assert("NumberTypeAnnotation", node, opts);
+}
+
+function assertObjectTypeAnnotation(node, opts) {
+ assert("ObjectTypeAnnotation", node, opts);
+}
+
+function assertObjectTypeInternalSlot(node, opts) {
+ assert("ObjectTypeInternalSlot", node, opts);
+}
+
+function assertObjectTypeCallProperty(node, opts) {
+ assert("ObjectTypeCallProperty", node, opts);
+}
+
+function assertObjectTypeIndexer(node, opts) {
+ assert("ObjectTypeIndexer", node, opts);
+}
+
+function assertObjectTypeProperty(node, opts) {
+ assert("ObjectTypeProperty", node, opts);
+}
+
+function assertObjectTypeSpreadProperty(node, opts) {
+ assert("ObjectTypeSpreadProperty", node, opts);
+}
+
+function assertOpaqueType(node, opts) {
+ assert("OpaqueType", node, opts);
+}
+
+function assertQualifiedTypeIdentifier(node, opts) {
+ assert("QualifiedTypeIdentifier", node, opts);
+}
+
+function assertStringLiteralTypeAnnotation(node, opts) {
+ assert("StringLiteralTypeAnnotation", node, opts);
+}
+
+function assertStringTypeAnnotation(node, opts) {
+ assert("StringTypeAnnotation", node, opts);
+}
+
+function assertSymbolTypeAnnotation(node, opts) {
+ assert("SymbolTypeAnnotation", node, opts);
+}
+
+function assertThisTypeAnnotation(node, opts) {
+ assert("ThisTypeAnnotation", node, opts);
+}
+
+function assertTupleTypeAnnotation(node, opts) {
+ assert("TupleTypeAnnotation", node, opts);
+}
+
+function assertTypeofTypeAnnotation(node, opts) {
+ assert("TypeofTypeAnnotation", node, opts);
+}
+
+function assertTypeAlias(node, opts) {
+ assert("TypeAlias", node, opts);
+}
+
+function assertTypeAnnotation(node, opts) {
+ assert("TypeAnnotation", node, opts);
+}
+
+function assertTypeCastExpression(node, opts) {
+ assert("TypeCastExpression", node, opts);
+}
+
+function assertTypeParameter(node, opts) {
+ assert("TypeParameter", node, opts);
+}
+
+function assertTypeParameterDeclaration(node, opts) {
+ assert("TypeParameterDeclaration", node, opts);
+}
+
+function assertTypeParameterInstantiation(node, opts) {
+ assert("TypeParameterInstantiation", node, opts);
+}
+
+function assertUnionTypeAnnotation(node, opts) {
+ assert("UnionTypeAnnotation", node, opts);
+}
+
+function assertVariance(node, opts) {
+ assert("Variance", node, opts);
+}
+
+function assertVoidTypeAnnotation(node, opts) {
+ assert("VoidTypeAnnotation", node, opts);
+}
+
+function assertEnumDeclaration(node, opts) {
+ assert("EnumDeclaration", node, opts);
+}
+
+function assertEnumBooleanBody(node, opts) {
+ assert("EnumBooleanBody", node, opts);
+}
+
+function assertEnumNumberBody(node, opts) {
+ assert("EnumNumberBody", node, opts);
+}
+
+function assertEnumStringBody(node, opts) {
+ assert("EnumStringBody", node, opts);
+}
+
+function assertEnumSymbolBody(node, opts) {
+ assert("EnumSymbolBody", node, opts);
+}
+
+function assertEnumBooleanMember(node, opts) {
+ assert("EnumBooleanMember", node, opts);
+}
+
+function assertEnumNumberMember(node, opts) {
+ assert("EnumNumberMember", node, opts);
+}
+
+function assertEnumStringMember(node, opts) {
+ assert("EnumStringMember", node, opts);
+}
+
+function assertEnumDefaultedMember(node, opts) {
+ assert("EnumDefaultedMember", node, opts);
+}
+
+function assertIndexedAccessType(node, opts) {
+ assert("IndexedAccessType", node, opts);
+}
+
+function assertOptionalIndexedAccessType(node, opts) {
+ assert("OptionalIndexedAccessType", node, opts);
+}
+
+function assertJSXAttribute(node, opts) {
+ assert("JSXAttribute", node, opts);
+}
+
+function assertJSXClosingElement(node, opts) {
+ assert("JSXClosingElement", node, opts);
+}
+
+function assertJSXElement(node, opts) {
+ assert("JSXElement", node, opts);
+}
+
+function assertJSXEmptyExpression(node, opts) {
+ assert("JSXEmptyExpression", node, opts);
+}
+
+function assertJSXExpressionContainer(node, opts) {
+ assert("JSXExpressionContainer", node, opts);
+}
+
+function assertJSXSpreadChild(node, opts) {
+ assert("JSXSpreadChild", node, opts);
+}
+
+function assertJSXIdentifier(node, opts) {
+ assert("JSXIdentifier", node, opts);
+}
+
+function assertJSXMemberExpression(node, opts) {
+ assert("JSXMemberExpression", node, opts);
+}
+
+function assertJSXNamespacedName(node, opts) {
+ assert("JSXNamespacedName", node, opts);
+}
+
+function assertJSXOpeningElement(node, opts) {
+ assert("JSXOpeningElement", node, opts);
+}
+
+function assertJSXSpreadAttribute(node, opts) {
+ assert("JSXSpreadAttribute", node, opts);
+}
+
+function assertJSXText(node, opts) {
+ assert("JSXText", node, opts);
+}
+
+function assertJSXFragment(node, opts) {
+ assert("JSXFragment", node, opts);
+}
+
+function assertJSXOpeningFragment(node, opts) {
+ assert("JSXOpeningFragment", node, opts);
+}
+
+function assertJSXClosingFragment(node, opts) {
+ assert("JSXClosingFragment", node, opts);
+}
+
+function assertNoop(node, opts) {
+ assert("Noop", node, opts);
+}
+
+function assertPlaceholder(node, opts) {
+ assert("Placeholder", node, opts);
+}
+
+function assertV8IntrinsicIdentifier(node, opts) {
+ assert("V8IntrinsicIdentifier", node, opts);
+}
+
+function assertArgumentPlaceholder(node, opts) {
+ assert("ArgumentPlaceholder", node, opts);
+}
+
+function assertBindExpression(node, opts) {
+ assert("BindExpression", node, opts);
+}
+
+function assertImportAttribute(node, opts) {
+ assert("ImportAttribute", node, opts);
+}
+
+function assertDecorator(node, opts) {
+ assert("Decorator", node, opts);
+}
+
+function assertDoExpression(node, opts) {
+ assert("DoExpression", node, opts);
+}
+
+function assertExportDefaultSpecifier(node, opts) {
+ assert("ExportDefaultSpecifier", node, opts);
+}
+
+function assertRecordExpression(node, opts) {
+ assert("RecordExpression", node, opts);
+}
+
+function assertTupleExpression(node, opts) {
+ assert("TupleExpression", node, opts);
+}
+
+function assertDecimalLiteral(node, opts) {
+ assert("DecimalLiteral", node, opts);
+}
+
+function assertStaticBlock(node, opts) {
+ assert("StaticBlock", node, opts);
+}
+
+function assertModuleExpression(node, opts) {
+ assert("ModuleExpression", node, opts);
+}
+
+function assertTopicReference(node, opts) {
+ assert("TopicReference", node, opts);
+}
+
+function assertPipelineTopicExpression(node, opts) {
+ assert("PipelineTopicExpression", node, opts);
+}
+
+function assertPipelineBareFunction(node, opts) {
+ assert("PipelineBareFunction", node, opts);
+}
+
+function assertPipelinePrimaryTopicReference(node, opts) {
+ assert("PipelinePrimaryTopicReference", node, opts);
+}
+
+function assertTSParameterProperty(node, opts) {
+ assert("TSParameterProperty", node, opts);
+}
+
+function assertTSDeclareFunction(node, opts) {
+ assert("TSDeclareFunction", node, opts);
+}
+
+function assertTSDeclareMethod(node, opts) {
+ assert("TSDeclareMethod", node, opts);
+}
+
+function assertTSQualifiedName(node, opts) {
+ assert("TSQualifiedName", node, opts);
+}
+
+function assertTSCallSignatureDeclaration(node, opts) {
+ assert("TSCallSignatureDeclaration", node, opts);
+}
+
+function assertTSConstructSignatureDeclaration(node, opts) {
+ assert("TSConstructSignatureDeclaration", node, opts);
+}
+
+function assertTSPropertySignature(node, opts) {
+ assert("TSPropertySignature", node, opts);
+}
+
+function assertTSMethodSignature(node, opts) {
+ assert("TSMethodSignature", node, opts);
+}
+
+function assertTSIndexSignature(node, opts) {
+ assert("TSIndexSignature", node, opts);
+}
+
+function assertTSAnyKeyword(node, opts) {
+ assert("TSAnyKeyword", node, opts);
+}
+
+function assertTSBooleanKeyword(node, opts) {
+ assert("TSBooleanKeyword", node, opts);
+}
+
+function assertTSBigIntKeyword(node, opts) {
+ assert("TSBigIntKeyword", node, opts);
+}
+
+function assertTSIntrinsicKeyword(node, opts) {
+ assert("TSIntrinsicKeyword", node, opts);
+}
+
+function assertTSNeverKeyword(node, opts) {
+ assert("TSNeverKeyword", node, opts);
+}
+
+function assertTSNullKeyword(node, opts) {
+ assert("TSNullKeyword", node, opts);
+}
+
+function assertTSNumberKeyword(node, opts) {
+ assert("TSNumberKeyword", node, opts);
+}
+
+function assertTSObjectKeyword(node, opts) {
+ assert("TSObjectKeyword", node, opts);
+}
+
+function assertTSStringKeyword(node, opts) {
+ assert("TSStringKeyword", node, opts);
+}
+
+function assertTSSymbolKeyword(node, opts) {
+ assert("TSSymbolKeyword", node, opts);
+}
+
+function assertTSUndefinedKeyword(node, opts) {
+ assert("TSUndefinedKeyword", node, opts);
+}
+
+function assertTSUnknownKeyword(node, opts) {
+ assert("TSUnknownKeyword", node, opts);
+}
+
+function assertTSVoidKeyword(node, opts) {
+ assert("TSVoidKeyword", node, opts);
+}
+
+function assertTSThisType(node, opts) {
+ assert("TSThisType", node, opts);
+}
+
+function assertTSFunctionType(node, opts) {
+ assert("TSFunctionType", node, opts);
+}
+
+function assertTSConstructorType(node, opts) {
+ assert("TSConstructorType", node, opts);
+}
+
+function assertTSTypeReference(node, opts) {
+ assert("TSTypeReference", node, opts);
+}
+
+function assertTSTypePredicate(node, opts) {
+ assert("TSTypePredicate", node, opts);
+}
+
+function assertTSTypeQuery(node, opts) {
+ assert("TSTypeQuery", node, opts);
+}
+
+function assertTSTypeLiteral(node, opts) {
+ assert("TSTypeLiteral", node, opts);
+}
+
+function assertTSArrayType(node, opts) {
+ assert("TSArrayType", node, opts);
+}
+
+function assertTSTupleType(node, opts) {
+ assert("TSTupleType", node, opts);
+}
+
+function assertTSOptionalType(node, opts) {
+ assert("TSOptionalType", node, opts);
+}
+
+function assertTSRestType(node, opts) {
+ assert("TSRestType", node, opts);
+}
+
+function assertTSNamedTupleMember(node, opts) {
+ assert("TSNamedTupleMember", node, opts);
+}
+
+function assertTSUnionType(node, opts) {
+ assert("TSUnionType", node, opts);
+}
+
+function assertTSIntersectionType(node, opts) {
+ assert("TSIntersectionType", node, opts);
+}
+
+function assertTSConditionalType(node, opts) {
+ assert("TSConditionalType", node, opts);
+}
+
+function assertTSInferType(node, opts) {
+ assert("TSInferType", node, opts);
+}
+
+function assertTSParenthesizedType(node, opts) {
+ assert("TSParenthesizedType", node, opts);
+}
+
+function assertTSTypeOperator(node, opts) {
+ assert("TSTypeOperator", node, opts);
+}
+
+function assertTSIndexedAccessType(node, opts) {
+ assert("TSIndexedAccessType", node, opts);
+}
+
+function assertTSMappedType(node, opts) {
+ assert("TSMappedType", node, opts);
+}
+
+function assertTSLiteralType(node, opts) {
+ assert("TSLiteralType", node, opts);
+}
+
+function assertTSExpressionWithTypeArguments(node, opts) {
+ assert("TSExpressionWithTypeArguments", node, opts);
+}
+
+function assertTSInterfaceDeclaration(node, opts) {
+ assert("TSInterfaceDeclaration", node, opts);
+}
+
+function assertTSInterfaceBody(node, opts) {
+ assert("TSInterfaceBody", node, opts);
+}
+
+function assertTSTypeAliasDeclaration(node, opts) {
+ assert("TSTypeAliasDeclaration", node, opts);
+}
+
+function assertTSAsExpression(node, opts) {
+ assert("TSAsExpression", node, opts);
+}
+
+function assertTSTypeAssertion(node, opts) {
+ assert("TSTypeAssertion", node, opts);
+}
+
+function assertTSEnumDeclaration(node, opts) {
+ assert("TSEnumDeclaration", node, opts);
+}
+
+function assertTSEnumMember(node, opts) {
+ assert("TSEnumMember", node, opts);
+}
+
+function assertTSModuleDeclaration(node, opts) {
+ assert("TSModuleDeclaration", node, opts);
+}
+
+function assertTSModuleBlock(node, opts) {
+ assert("TSModuleBlock", node, opts);
+}
+
+function assertTSImportType(node, opts) {
+ assert("TSImportType", node, opts);
+}
+
+function assertTSImportEqualsDeclaration(node, opts) {
+ assert("TSImportEqualsDeclaration", node, opts);
+}
+
+function assertTSExternalModuleReference(node, opts) {
+ assert("TSExternalModuleReference", node, opts);
+}
+
+function assertTSNonNullExpression(node, opts) {
+ assert("TSNonNullExpression", node, opts);
+}
+
+function assertTSExportAssignment(node, opts) {
+ assert("TSExportAssignment", node, opts);
+}
+
+function assertTSNamespaceExportDeclaration(node, opts) {
+ assert("TSNamespaceExportDeclaration", node, opts);
+}
+
+function assertTSTypeAnnotation(node, opts) {
+ assert("TSTypeAnnotation", node, opts);
+}
+
+function assertTSTypeParameterInstantiation(node, opts) {
+ assert("TSTypeParameterInstantiation", node, opts);
+}
+
+function assertTSTypeParameterDeclaration(node, opts) {
+ assert("TSTypeParameterDeclaration", node, opts);
+}
+
+function assertTSTypeParameter(node, opts) {
+ assert("TSTypeParameter", node, opts);
+}
+
+function assertExpression(node, opts) {
+ assert("Expression", node, opts);
+}
+
+function assertBinary(node, opts) {
+ assert("Binary", node, opts);
+}
+
+function assertScopable(node, opts) {
+ assert("Scopable", node, opts);
+}
+
+function assertBlockParent(node, opts) {
+ assert("BlockParent", node, opts);
+}
+
+function assertBlock(node, opts) {
+ assert("Block", node, opts);
+}
+
+function assertStatement(node, opts) {
+ assert("Statement", node, opts);
+}
+
+function assertTerminatorless(node, opts) {
+ assert("Terminatorless", node, opts);
+}
+
+function assertCompletionStatement(node, opts) {
+ assert("CompletionStatement", node, opts);
+}
+
+function assertConditional(node, opts) {
+ assert("Conditional", node, opts);
+}
+
+function assertLoop(node, opts) {
+ assert("Loop", node, opts);
+}
+
+function assertWhile(node, opts) {
+ assert("While", node, opts);
+}
+
+function assertExpressionWrapper(node, opts) {
+ assert("ExpressionWrapper", node, opts);
+}
+
+function assertFor(node, opts) {
+ assert("For", node, opts);
+}
+
+function assertForXStatement(node, opts) {
+ assert("ForXStatement", node, opts);
+}
+
+function assertFunction(node, opts) {
+ assert("Function", node, opts);
+}
+
+function assertFunctionParent(node, opts) {
+ assert("FunctionParent", node, opts);
+}
+
+function assertPureish(node, opts) {
+ assert("Pureish", node, opts);
+}
+
+function assertDeclaration(node, opts) {
+ assert("Declaration", node, opts);
+}
+
+function assertPatternLike(node, opts) {
+ assert("PatternLike", node, opts);
+}
+
+function assertLVal(node, opts) {
+ assert("LVal", node, opts);
+}
+
+function assertTSEntityName(node, opts) {
+ assert("TSEntityName", node, opts);
+}
+
+function assertLiteral(node, opts) {
+ assert("Literal", node, opts);
+}
+
+function assertImmutable(node, opts) {
+ assert("Immutable", node, opts);
+}
+
+function assertUserWhitespacable(node, opts) {
+ assert("UserWhitespacable", node, opts);
+}
+
+function assertMethod(node, opts) {
+ assert("Method", node, opts);
+}
+
+function assertObjectMember(node, opts) {
+ assert("ObjectMember", node, opts);
+}
+
+function assertProperty(node, opts) {
+ assert("Property", node, opts);
+}
+
+function assertUnaryLike(node, opts) {
+ assert("UnaryLike", node, opts);
+}
+
+function assertPattern(node, opts) {
+ assert("Pattern", node, opts);
+}
+
+function assertClass(node, opts) {
+ assert("Class", node, opts);
+}
+
+function assertModuleDeclaration(node, opts) {
+ assert("ModuleDeclaration", node, opts);
+}
+
+function assertExportDeclaration(node, opts) {
+ assert("ExportDeclaration", node, opts);
+}
+
+function assertModuleSpecifier(node, opts) {
+ assert("ModuleSpecifier", node, opts);
+}
+
+function assertPrivate(node, opts) {
+ assert("Private", node, opts);
+}
+
+function assertFlow(node, opts) {
+ assert("Flow", node, opts);
+}
+
+function assertFlowType(node, opts) {
+ assert("FlowType", node, opts);
+}
+
+function assertFlowBaseAnnotation(node, opts) {
+ assert("FlowBaseAnnotation", node, opts);
+}
+
+function assertFlowDeclaration(node, opts) {
+ assert("FlowDeclaration", node, opts);
+}
+
+function assertFlowPredicate(node, opts) {
+ assert("FlowPredicate", node, opts);
+}
+
+function assertEnumBody(node, opts) {
+ assert("EnumBody", node, opts);
+}
+
+function assertEnumMember(node, opts) {
+ assert("EnumMember", node, opts);
+}
+
+function assertJSX(node, opts) {
+ assert("JSX", node, opts);
+}
+
+function assertTSTypeElement(node, opts) {
+ assert("TSTypeElement", node, opts);
+}
+
+function assertTSType(node, opts) {
+ assert("TSType", node, opts);
+}
+
+function assertTSBaseType(node, opts) {
+ assert("TSBaseType", node, opts);
+}
+
+function assertNumberLiteral(node, opts) {
+ console.trace("The node type NumberLiteral has been renamed to NumericLiteral");
+ assert("NumberLiteral", node, opts);
+}
+
+function assertRegexLiteral(node, opts) {
+ console.trace("The node type RegexLiteral has been renamed to RegExpLiteral");
+ assert("RegexLiteral", node, opts);
+}
+
+function assertRestProperty(node, opts) {
+ console.trace("The node type RestProperty has been renamed to RestElement");
+ assert("RestProperty", node, opts);
+}
+
+function assertSpreadProperty(node, opts) {
+ console.trace("The node type SpreadProperty has been renamed to SpreadElement");
+ assert("SpreadProperty", node, opts);
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/ast-types/generated/index.js b/chromium/third_party/node/node_modules/@babel/types/lib/ast-types/generated/index.js
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/ast-types/generated/index.js
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/builders/builder.js b/chromium/third_party/node/node_modules/@babel/types/lib/builders/builder.js
new file mode 100644
index 00000000000..b8a017138a0
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/builders/builder.js
@@ -0,0 +1,42 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = builder;
+
+var _definitions = require("../definitions");
+
+var _validate = require("../validators/validate");
+
+function builder(type, ...args) {
+ const keys = _definitions.BUILDER_KEYS[type];
+ const countArgs = args.length;
+
+ if (countArgs > keys.length) {
+ throw new Error(`${type}: Too many arguments passed. Received ${countArgs} but can receive no more than ${keys.length}`);
+ }
+
+ const node = {
+ type
+ };
+ let i = 0;
+ keys.forEach(key => {
+ const field = _definitions.NODE_FIELDS[type][key];
+ let arg;
+ if (i < countArgs) arg = args[i];
+
+ if (arg === undefined) {
+ arg = Array.isArray(field.default) ? [] : field.default;
+ }
+
+ node[key] = arg;
+ i++;
+ });
+
+ for (const key of Object.keys(node)) {
+ (0, _validate.default)(node, key, node[key]);
+ }
+
+ return node;
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js b/chromium/third_party/node/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js
new file mode 100644
index 00000000000..ddf20fdd3ae
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js
@@ -0,0 +1,20 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = createFlowUnionType;
+
+var _generated = require("../generated");
+
+var _removeTypeDuplicates = require("../../modifications/flow/removeTypeDuplicates");
+
+function createFlowUnionType(types) {
+ const flattened = (0, _removeTypeDuplicates.default)(types);
+
+ if (flattened.length === 1) {
+ return flattened[0];
+ } else {
+ return (0, _generated.unionTypeAnnotation)(flattened);
+ }
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js b/chromium/third_party/node/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js
new file mode 100644
index 00000000000..7711322ed37
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js
@@ -0,0 +1,30 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = createTypeAnnotationBasedOnTypeof;
+
+var _generated = require("../generated");
+
+function createTypeAnnotationBasedOnTypeof(type) {
+ if (type === "string") {
+ return (0, _generated.stringTypeAnnotation)();
+ } else if (type === "number") {
+ return (0, _generated.numberTypeAnnotation)();
+ } else if (type === "undefined") {
+ return (0, _generated.voidTypeAnnotation)();
+ } else if (type === "boolean") {
+ return (0, _generated.booleanTypeAnnotation)();
+ } else if (type === "function") {
+ return (0, _generated.genericTypeAnnotation)((0, _generated.identifier)("Function"));
+ } else if (type === "object") {
+ return (0, _generated.genericTypeAnnotation)((0, _generated.identifier)("Object"));
+ } else if (type === "symbol") {
+ return (0, _generated.genericTypeAnnotation)((0, _generated.identifier)("Symbol"));
+ } else if (type === "bigint") {
+ return (0, _generated.anyTypeAnnotation)();
+ } else {
+ throw new Error("Invalid typeof value: " + type);
+ }
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/builders/generated/index.js b/chromium/third_party/node/node_modules/@babel/types/lib/builders/generated/index.js
new file mode 100644
index 00000000000..cb40ee6e646
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/builders/generated/index.js
@@ -0,0 +1,1261 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.arrayExpression = arrayExpression;
+exports.assignmentExpression = assignmentExpression;
+exports.binaryExpression = binaryExpression;
+exports.interpreterDirective = interpreterDirective;
+exports.directive = directive;
+exports.directiveLiteral = directiveLiteral;
+exports.blockStatement = blockStatement;
+exports.breakStatement = breakStatement;
+exports.callExpression = callExpression;
+exports.catchClause = catchClause;
+exports.conditionalExpression = conditionalExpression;
+exports.continueStatement = continueStatement;
+exports.debuggerStatement = debuggerStatement;
+exports.doWhileStatement = doWhileStatement;
+exports.emptyStatement = emptyStatement;
+exports.expressionStatement = expressionStatement;
+exports.file = file;
+exports.forInStatement = forInStatement;
+exports.forStatement = forStatement;
+exports.functionDeclaration = functionDeclaration;
+exports.functionExpression = functionExpression;
+exports.identifier = identifier;
+exports.ifStatement = ifStatement;
+exports.labeledStatement = labeledStatement;
+exports.stringLiteral = stringLiteral;
+exports.numericLiteral = numericLiteral;
+exports.nullLiteral = nullLiteral;
+exports.booleanLiteral = booleanLiteral;
+exports.regExpLiteral = regExpLiteral;
+exports.logicalExpression = logicalExpression;
+exports.memberExpression = memberExpression;
+exports.newExpression = newExpression;
+exports.program = program;
+exports.objectExpression = objectExpression;
+exports.objectMethod = objectMethod;
+exports.objectProperty = objectProperty;
+exports.restElement = restElement;
+exports.returnStatement = returnStatement;
+exports.sequenceExpression = sequenceExpression;
+exports.parenthesizedExpression = parenthesizedExpression;
+exports.switchCase = switchCase;
+exports.switchStatement = switchStatement;
+exports.thisExpression = thisExpression;
+exports.throwStatement = throwStatement;
+exports.tryStatement = tryStatement;
+exports.unaryExpression = unaryExpression;
+exports.updateExpression = updateExpression;
+exports.variableDeclaration = variableDeclaration;
+exports.variableDeclarator = variableDeclarator;
+exports.whileStatement = whileStatement;
+exports.withStatement = withStatement;
+exports.assignmentPattern = assignmentPattern;
+exports.arrayPattern = arrayPattern;
+exports.arrowFunctionExpression = arrowFunctionExpression;
+exports.classBody = classBody;
+exports.classExpression = classExpression;
+exports.classDeclaration = classDeclaration;
+exports.exportAllDeclaration = exportAllDeclaration;
+exports.exportDefaultDeclaration = exportDefaultDeclaration;
+exports.exportNamedDeclaration = exportNamedDeclaration;
+exports.exportSpecifier = exportSpecifier;
+exports.forOfStatement = forOfStatement;
+exports.importDeclaration = importDeclaration;
+exports.importDefaultSpecifier = importDefaultSpecifier;
+exports.importNamespaceSpecifier = importNamespaceSpecifier;
+exports.importSpecifier = importSpecifier;
+exports.metaProperty = metaProperty;
+exports.classMethod = classMethod;
+exports.objectPattern = objectPattern;
+exports.spreadElement = spreadElement;
+exports.super = _super;
+exports.taggedTemplateExpression = taggedTemplateExpression;
+exports.templateElement = templateElement;
+exports.templateLiteral = templateLiteral;
+exports.yieldExpression = yieldExpression;
+exports.awaitExpression = awaitExpression;
+exports.import = _import;
+exports.bigIntLiteral = bigIntLiteral;
+exports.exportNamespaceSpecifier = exportNamespaceSpecifier;
+exports.optionalMemberExpression = optionalMemberExpression;
+exports.optionalCallExpression = optionalCallExpression;
+exports.classProperty = classProperty;
+exports.classPrivateProperty = classPrivateProperty;
+exports.classPrivateMethod = classPrivateMethod;
+exports.privateName = privateName;
+exports.anyTypeAnnotation = anyTypeAnnotation;
+exports.arrayTypeAnnotation = arrayTypeAnnotation;
+exports.booleanTypeAnnotation = booleanTypeAnnotation;
+exports.booleanLiteralTypeAnnotation = booleanLiteralTypeAnnotation;
+exports.nullLiteralTypeAnnotation = nullLiteralTypeAnnotation;
+exports.classImplements = classImplements;
+exports.declareClass = declareClass;
+exports.declareFunction = declareFunction;
+exports.declareInterface = declareInterface;
+exports.declareModule = declareModule;
+exports.declareModuleExports = declareModuleExports;
+exports.declareTypeAlias = declareTypeAlias;
+exports.declareOpaqueType = declareOpaqueType;
+exports.declareVariable = declareVariable;
+exports.declareExportDeclaration = declareExportDeclaration;
+exports.declareExportAllDeclaration = declareExportAllDeclaration;
+exports.declaredPredicate = declaredPredicate;
+exports.existsTypeAnnotation = existsTypeAnnotation;
+exports.functionTypeAnnotation = functionTypeAnnotation;
+exports.functionTypeParam = functionTypeParam;
+exports.genericTypeAnnotation = genericTypeAnnotation;
+exports.inferredPredicate = inferredPredicate;
+exports.interfaceExtends = interfaceExtends;
+exports.interfaceDeclaration = interfaceDeclaration;
+exports.interfaceTypeAnnotation = interfaceTypeAnnotation;
+exports.intersectionTypeAnnotation = intersectionTypeAnnotation;
+exports.mixedTypeAnnotation = mixedTypeAnnotation;
+exports.emptyTypeAnnotation = emptyTypeAnnotation;
+exports.nullableTypeAnnotation = nullableTypeAnnotation;
+exports.numberLiteralTypeAnnotation = numberLiteralTypeAnnotation;
+exports.numberTypeAnnotation = numberTypeAnnotation;
+exports.objectTypeAnnotation = objectTypeAnnotation;
+exports.objectTypeInternalSlot = objectTypeInternalSlot;
+exports.objectTypeCallProperty = objectTypeCallProperty;
+exports.objectTypeIndexer = objectTypeIndexer;
+exports.objectTypeProperty = objectTypeProperty;
+exports.objectTypeSpreadProperty = objectTypeSpreadProperty;
+exports.opaqueType = opaqueType;
+exports.qualifiedTypeIdentifier = qualifiedTypeIdentifier;
+exports.stringLiteralTypeAnnotation = stringLiteralTypeAnnotation;
+exports.stringTypeAnnotation = stringTypeAnnotation;
+exports.symbolTypeAnnotation = symbolTypeAnnotation;
+exports.thisTypeAnnotation = thisTypeAnnotation;
+exports.tupleTypeAnnotation = tupleTypeAnnotation;
+exports.typeofTypeAnnotation = typeofTypeAnnotation;
+exports.typeAlias = typeAlias;
+exports.typeAnnotation = typeAnnotation;
+exports.typeCastExpression = typeCastExpression;
+exports.typeParameter = typeParameter;
+exports.typeParameterDeclaration = typeParameterDeclaration;
+exports.typeParameterInstantiation = typeParameterInstantiation;
+exports.unionTypeAnnotation = unionTypeAnnotation;
+exports.variance = variance;
+exports.voidTypeAnnotation = voidTypeAnnotation;
+exports.enumDeclaration = enumDeclaration;
+exports.enumBooleanBody = enumBooleanBody;
+exports.enumNumberBody = enumNumberBody;
+exports.enumStringBody = enumStringBody;
+exports.enumSymbolBody = enumSymbolBody;
+exports.enumBooleanMember = enumBooleanMember;
+exports.enumNumberMember = enumNumberMember;
+exports.enumStringMember = enumStringMember;
+exports.enumDefaultedMember = enumDefaultedMember;
+exports.indexedAccessType = indexedAccessType;
+exports.optionalIndexedAccessType = optionalIndexedAccessType;
+exports.jSXAttribute = exports.jsxAttribute = jsxAttribute;
+exports.jSXClosingElement = exports.jsxClosingElement = jsxClosingElement;
+exports.jSXElement = exports.jsxElement = jsxElement;
+exports.jSXEmptyExpression = exports.jsxEmptyExpression = jsxEmptyExpression;
+exports.jSXExpressionContainer = exports.jsxExpressionContainer = jsxExpressionContainer;
+exports.jSXSpreadChild = exports.jsxSpreadChild = jsxSpreadChild;
+exports.jSXIdentifier = exports.jsxIdentifier = jsxIdentifier;
+exports.jSXMemberExpression = exports.jsxMemberExpression = jsxMemberExpression;
+exports.jSXNamespacedName = exports.jsxNamespacedName = jsxNamespacedName;
+exports.jSXOpeningElement = exports.jsxOpeningElement = jsxOpeningElement;
+exports.jSXSpreadAttribute = exports.jsxSpreadAttribute = jsxSpreadAttribute;
+exports.jSXText = exports.jsxText = jsxText;
+exports.jSXFragment = exports.jsxFragment = jsxFragment;
+exports.jSXOpeningFragment = exports.jsxOpeningFragment = jsxOpeningFragment;
+exports.jSXClosingFragment = exports.jsxClosingFragment = jsxClosingFragment;
+exports.noop = noop;
+exports.placeholder = placeholder;
+exports.v8IntrinsicIdentifier = v8IntrinsicIdentifier;
+exports.argumentPlaceholder = argumentPlaceholder;
+exports.bindExpression = bindExpression;
+exports.importAttribute = importAttribute;
+exports.decorator = decorator;
+exports.doExpression = doExpression;
+exports.exportDefaultSpecifier = exportDefaultSpecifier;
+exports.recordExpression = recordExpression;
+exports.tupleExpression = tupleExpression;
+exports.decimalLiteral = decimalLiteral;
+exports.staticBlock = staticBlock;
+exports.moduleExpression = moduleExpression;
+exports.topicReference = topicReference;
+exports.pipelineTopicExpression = pipelineTopicExpression;
+exports.pipelineBareFunction = pipelineBareFunction;
+exports.pipelinePrimaryTopicReference = pipelinePrimaryTopicReference;
+exports.tSParameterProperty = exports.tsParameterProperty = tsParameterProperty;
+exports.tSDeclareFunction = exports.tsDeclareFunction = tsDeclareFunction;
+exports.tSDeclareMethod = exports.tsDeclareMethod = tsDeclareMethod;
+exports.tSQualifiedName = exports.tsQualifiedName = tsQualifiedName;
+exports.tSCallSignatureDeclaration = exports.tsCallSignatureDeclaration = tsCallSignatureDeclaration;
+exports.tSConstructSignatureDeclaration = exports.tsConstructSignatureDeclaration = tsConstructSignatureDeclaration;
+exports.tSPropertySignature = exports.tsPropertySignature = tsPropertySignature;
+exports.tSMethodSignature = exports.tsMethodSignature = tsMethodSignature;
+exports.tSIndexSignature = exports.tsIndexSignature = tsIndexSignature;
+exports.tSAnyKeyword = exports.tsAnyKeyword = tsAnyKeyword;
+exports.tSBooleanKeyword = exports.tsBooleanKeyword = tsBooleanKeyword;
+exports.tSBigIntKeyword = exports.tsBigIntKeyword = tsBigIntKeyword;
+exports.tSIntrinsicKeyword = exports.tsIntrinsicKeyword = tsIntrinsicKeyword;
+exports.tSNeverKeyword = exports.tsNeverKeyword = tsNeverKeyword;
+exports.tSNullKeyword = exports.tsNullKeyword = tsNullKeyword;
+exports.tSNumberKeyword = exports.tsNumberKeyword = tsNumberKeyword;
+exports.tSObjectKeyword = exports.tsObjectKeyword = tsObjectKeyword;
+exports.tSStringKeyword = exports.tsStringKeyword = tsStringKeyword;
+exports.tSSymbolKeyword = exports.tsSymbolKeyword = tsSymbolKeyword;
+exports.tSUndefinedKeyword = exports.tsUndefinedKeyword = tsUndefinedKeyword;
+exports.tSUnknownKeyword = exports.tsUnknownKeyword = tsUnknownKeyword;
+exports.tSVoidKeyword = exports.tsVoidKeyword = tsVoidKeyword;
+exports.tSThisType = exports.tsThisType = tsThisType;
+exports.tSFunctionType = exports.tsFunctionType = tsFunctionType;
+exports.tSConstructorType = exports.tsConstructorType = tsConstructorType;
+exports.tSTypeReference = exports.tsTypeReference = tsTypeReference;
+exports.tSTypePredicate = exports.tsTypePredicate = tsTypePredicate;
+exports.tSTypeQuery = exports.tsTypeQuery = tsTypeQuery;
+exports.tSTypeLiteral = exports.tsTypeLiteral = tsTypeLiteral;
+exports.tSArrayType = exports.tsArrayType = tsArrayType;
+exports.tSTupleType = exports.tsTupleType = tsTupleType;
+exports.tSOptionalType = exports.tsOptionalType = tsOptionalType;
+exports.tSRestType = exports.tsRestType = tsRestType;
+exports.tSNamedTupleMember = exports.tsNamedTupleMember = tsNamedTupleMember;
+exports.tSUnionType = exports.tsUnionType = tsUnionType;
+exports.tSIntersectionType = exports.tsIntersectionType = tsIntersectionType;
+exports.tSConditionalType = exports.tsConditionalType = tsConditionalType;
+exports.tSInferType = exports.tsInferType = tsInferType;
+exports.tSParenthesizedType = exports.tsParenthesizedType = tsParenthesizedType;
+exports.tSTypeOperator = exports.tsTypeOperator = tsTypeOperator;
+exports.tSIndexedAccessType = exports.tsIndexedAccessType = tsIndexedAccessType;
+exports.tSMappedType = exports.tsMappedType = tsMappedType;
+exports.tSLiteralType = exports.tsLiteralType = tsLiteralType;
+exports.tSExpressionWithTypeArguments = exports.tsExpressionWithTypeArguments = tsExpressionWithTypeArguments;
+exports.tSInterfaceDeclaration = exports.tsInterfaceDeclaration = tsInterfaceDeclaration;
+exports.tSInterfaceBody = exports.tsInterfaceBody = tsInterfaceBody;
+exports.tSTypeAliasDeclaration = exports.tsTypeAliasDeclaration = tsTypeAliasDeclaration;
+exports.tSAsExpression = exports.tsAsExpression = tsAsExpression;
+exports.tSTypeAssertion = exports.tsTypeAssertion = tsTypeAssertion;
+exports.tSEnumDeclaration = exports.tsEnumDeclaration = tsEnumDeclaration;
+exports.tSEnumMember = exports.tsEnumMember = tsEnumMember;
+exports.tSModuleDeclaration = exports.tsModuleDeclaration = tsModuleDeclaration;
+exports.tSModuleBlock = exports.tsModuleBlock = tsModuleBlock;
+exports.tSImportType = exports.tsImportType = tsImportType;
+exports.tSImportEqualsDeclaration = exports.tsImportEqualsDeclaration = tsImportEqualsDeclaration;
+exports.tSExternalModuleReference = exports.tsExternalModuleReference = tsExternalModuleReference;
+exports.tSNonNullExpression = exports.tsNonNullExpression = tsNonNullExpression;
+exports.tSExportAssignment = exports.tsExportAssignment = tsExportAssignment;
+exports.tSNamespaceExportDeclaration = exports.tsNamespaceExportDeclaration = tsNamespaceExportDeclaration;
+exports.tSTypeAnnotation = exports.tsTypeAnnotation = tsTypeAnnotation;
+exports.tSTypeParameterInstantiation = exports.tsTypeParameterInstantiation = tsTypeParameterInstantiation;
+exports.tSTypeParameterDeclaration = exports.tsTypeParameterDeclaration = tsTypeParameterDeclaration;
+exports.tSTypeParameter = exports.tsTypeParameter = tsTypeParameter;
+exports.numberLiteral = NumberLiteral;
+exports.regexLiteral = RegexLiteral;
+exports.restProperty = RestProperty;
+exports.spreadProperty = SpreadProperty;
+
+var _builder = require("../builder");
+
+function arrayExpression(elements) {
+ return (0, _builder.default)("ArrayExpression", ...arguments);
+}
+
+function assignmentExpression(operator, left, right) {
+ return (0, _builder.default)("AssignmentExpression", ...arguments);
+}
+
+function binaryExpression(operator, left, right) {
+ return (0, _builder.default)("BinaryExpression", ...arguments);
+}
+
+function interpreterDirective(value) {
+ return (0, _builder.default)("InterpreterDirective", ...arguments);
+}
+
+function directive(value) {
+ return (0, _builder.default)("Directive", ...arguments);
+}
+
+function directiveLiteral(value) {
+ return (0, _builder.default)("DirectiveLiteral", ...arguments);
+}
+
+function blockStatement(body, directives) {
+ return (0, _builder.default)("BlockStatement", ...arguments);
+}
+
+function breakStatement(label) {
+ return (0, _builder.default)("BreakStatement", ...arguments);
+}
+
+function callExpression(callee, _arguments) {
+ return (0, _builder.default)("CallExpression", ...arguments);
+}
+
+function catchClause(param, body) {
+ return (0, _builder.default)("CatchClause", ...arguments);
+}
+
+function conditionalExpression(test, consequent, alternate) {
+ return (0, _builder.default)("ConditionalExpression", ...arguments);
+}
+
+function continueStatement(label) {
+ return (0, _builder.default)("ContinueStatement", ...arguments);
+}
+
+function debuggerStatement() {
+ return (0, _builder.default)("DebuggerStatement", ...arguments);
+}
+
+function doWhileStatement(test, body) {
+ return (0, _builder.default)("DoWhileStatement", ...arguments);
+}
+
+function emptyStatement() {
+ return (0, _builder.default)("EmptyStatement", ...arguments);
+}
+
+function expressionStatement(expression) {
+ return (0, _builder.default)("ExpressionStatement", ...arguments);
+}
+
+function file(program, comments, tokens) {
+ return (0, _builder.default)("File", ...arguments);
+}
+
+function forInStatement(left, right, body) {
+ return (0, _builder.default)("ForInStatement", ...arguments);
+}
+
+function forStatement(init, test, update, body) {
+ return (0, _builder.default)("ForStatement", ...arguments);
+}
+
+function functionDeclaration(id, params, body, generator, async) {
+ return (0, _builder.default)("FunctionDeclaration", ...arguments);
+}
+
+function functionExpression(id, params, body, generator, async) {
+ return (0, _builder.default)("FunctionExpression", ...arguments);
+}
+
+function identifier(name) {
+ return (0, _builder.default)("Identifier", ...arguments);
+}
+
+function ifStatement(test, consequent, alternate) {
+ return (0, _builder.default)("IfStatement", ...arguments);
+}
+
+function labeledStatement(label, body) {
+ return (0, _builder.default)("LabeledStatement", ...arguments);
+}
+
+function stringLiteral(value) {
+ return (0, _builder.default)("StringLiteral", ...arguments);
+}
+
+function numericLiteral(value) {
+ return (0, _builder.default)("NumericLiteral", ...arguments);
+}
+
+function nullLiteral() {
+ return (0, _builder.default)("NullLiteral", ...arguments);
+}
+
+function booleanLiteral(value) {
+ return (0, _builder.default)("BooleanLiteral", ...arguments);
+}
+
+function regExpLiteral(pattern, flags) {
+ return (0, _builder.default)("RegExpLiteral", ...arguments);
+}
+
+function logicalExpression(operator, left, right) {
+ return (0, _builder.default)("LogicalExpression", ...arguments);
+}
+
+function memberExpression(object, property, computed, optional) {
+ return (0, _builder.default)("MemberExpression", ...arguments);
+}
+
+function newExpression(callee, _arguments) {
+ return (0, _builder.default)("NewExpression", ...arguments);
+}
+
+function program(body, directives, sourceType, interpreter) {
+ return (0, _builder.default)("Program", ...arguments);
+}
+
+function objectExpression(properties) {
+ return (0, _builder.default)("ObjectExpression", ...arguments);
+}
+
+function objectMethod(kind, key, params, body, computed, generator, async) {
+ return (0, _builder.default)("ObjectMethod", ...arguments);
+}
+
+function objectProperty(key, value, computed, shorthand, decorators) {
+ return (0, _builder.default)("ObjectProperty", ...arguments);
+}
+
+function restElement(argument) {
+ return (0, _builder.default)("RestElement", ...arguments);
+}
+
+function returnStatement(argument) {
+ return (0, _builder.default)("ReturnStatement", ...arguments);
+}
+
+function sequenceExpression(expressions) {
+ return (0, _builder.default)("SequenceExpression", ...arguments);
+}
+
+function parenthesizedExpression(expression) {
+ return (0, _builder.default)("ParenthesizedExpression", ...arguments);
+}
+
+function switchCase(test, consequent) {
+ return (0, _builder.default)("SwitchCase", ...arguments);
+}
+
+function switchStatement(discriminant, cases) {
+ return (0, _builder.default)("SwitchStatement", ...arguments);
+}
+
+function thisExpression() {
+ return (0, _builder.default)("ThisExpression", ...arguments);
+}
+
+function throwStatement(argument) {
+ return (0, _builder.default)("ThrowStatement", ...arguments);
+}
+
+function tryStatement(block, handler, finalizer) {
+ return (0, _builder.default)("TryStatement", ...arguments);
+}
+
+function unaryExpression(operator, argument, prefix) {
+ return (0, _builder.default)("UnaryExpression", ...arguments);
+}
+
+function updateExpression(operator, argument, prefix) {
+ return (0, _builder.default)("UpdateExpression", ...arguments);
+}
+
+function variableDeclaration(kind, declarations) {
+ return (0, _builder.default)("VariableDeclaration", ...arguments);
+}
+
+function variableDeclarator(id, init) {
+ return (0, _builder.default)("VariableDeclarator", ...arguments);
+}
+
+function whileStatement(test, body) {
+ return (0, _builder.default)("WhileStatement", ...arguments);
+}
+
+function withStatement(object, body) {
+ return (0, _builder.default)("WithStatement", ...arguments);
+}
+
+function assignmentPattern(left, right) {
+ return (0, _builder.default)("AssignmentPattern", ...arguments);
+}
+
+function arrayPattern(elements) {
+ return (0, _builder.default)("ArrayPattern", ...arguments);
+}
+
+function arrowFunctionExpression(params, body, async) {
+ return (0, _builder.default)("ArrowFunctionExpression", ...arguments);
+}
+
+function classBody(body) {
+ return (0, _builder.default)("ClassBody", ...arguments);
+}
+
+function classExpression(id, superClass, body, decorators) {
+ return (0, _builder.default)("ClassExpression", ...arguments);
+}
+
+function classDeclaration(id, superClass, body, decorators) {
+ return (0, _builder.default)("ClassDeclaration", ...arguments);
+}
+
+function exportAllDeclaration(source) {
+ return (0, _builder.default)("ExportAllDeclaration", ...arguments);
+}
+
+function exportDefaultDeclaration(declaration) {
+ return (0, _builder.default)("ExportDefaultDeclaration", ...arguments);
+}
+
+function exportNamedDeclaration(declaration, specifiers, source) {
+ return (0, _builder.default)("ExportNamedDeclaration", ...arguments);
+}
+
+function exportSpecifier(local, exported) {
+ return (0, _builder.default)("ExportSpecifier", ...arguments);
+}
+
+function forOfStatement(left, right, body, _await) {
+ return (0, _builder.default)("ForOfStatement", ...arguments);
+}
+
+function importDeclaration(specifiers, source) {
+ return (0, _builder.default)("ImportDeclaration", ...arguments);
+}
+
+function importDefaultSpecifier(local) {
+ return (0, _builder.default)("ImportDefaultSpecifier", ...arguments);
+}
+
+function importNamespaceSpecifier(local) {
+ return (0, _builder.default)("ImportNamespaceSpecifier", ...arguments);
+}
+
+function importSpecifier(local, imported) {
+ return (0, _builder.default)("ImportSpecifier", ...arguments);
+}
+
+function metaProperty(meta, property) {
+ return (0, _builder.default)("MetaProperty", ...arguments);
+}
+
+function classMethod(kind, key, params, body, computed, _static, generator, async) {
+ return (0, _builder.default)("ClassMethod", ...arguments);
+}
+
+function objectPattern(properties) {
+ return (0, _builder.default)("ObjectPattern", ...arguments);
+}
+
+function spreadElement(argument) {
+ return (0, _builder.default)("SpreadElement", ...arguments);
+}
+
+function _super() {
+ return (0, _builder.default)("Super", ...arguments);
+}
+
+function taggedTemplateExpression(tag, quasi) {
+ return (0, _builder.default)("TaggedTemplateExpression", ...arguments);
+}
+
+function templateElement(value, tail) {
+ return (0, _builder.default)("TemplateElement", ...arguments);
+}
+
+function templateLiteral(quasis, expressions) {
+ return (0, _builder.default)("TemplateLiteral", ...arguments);
+}
+
+function yieldExpression(argument, delegate) {
+ return (0, _builder.default)("YieldExpression", ...arguments);
+}
+
+function awaitExpression(argument) {
+ return (0, _builder.default)("AwaitExpression", ...arguments);
+}
+
+function _import() {
+ return (0, _builder.default)("Import", ...arguments);
+}
+
+function bigIntLiteral(value) {
+ return (0, _builder.default)("BigIntLiteral", ...arguments);
+}
+
+function exportNamespaceSpecifier(exported) {
+ return (0, _builder.default)("ExportNamespaceSpecifier", ...arguments);
+}
+
+function optionalMemberExpression(object, property, computed, optional) {
+ return (0, _builder.default)("OptionalMemberExpression", ...arguments);
+}
+
+function optionalCallExpression(callee, _arguments, optional) {
+ return (0, _builder.default)("OptionalCallExpression", ...arguments);
+}
+
+function classProperty(key, value, typeAnnotation, decorators, computed, _static) {
+ return (0, _builder.default)("ClassProperty", ...arguments);
+}
+
+function classPrivateProperty(key, value, decorators, _static) {
+ return (0, _builder.default)("ClassPrivateProperty", ...arguments);
+}
+
+function classPrivateMethod(kind, key, params, body, _static) {
+ return (0, _builder.default)("ClassPrivateMethod", ...arguments);
+}
+
+function privateName(id) {
+ return (0, _builder.default)("PrivateName", ...arguments);
+}
+
+function anyTypeAnnotation() {
+ return (0, _builder.default)("AnyTypeAnnotation", ...arguments);
+}
+
+function arrayTypeAnnotation(elementType) {
+ return (0, _builder.default)("ArrayTypeAnnotation", ...arguments);
+}
+
+function booleanTypeAnnotation() {
+ return (0, _builder.default)("BooleanTypeAnnotation", ...arguments);
+}
+
+function booleanLiteralTypeAnnotation(value) {
+ return (0, _builder.default)("BooleanLiteralTypeAnnotation", ...arguments);
+}
+
+function nullLiteralTypeAnnotation() {
+ return (0, _builder.default)("NullLiteralTypeAnnotation", ...arguments);
+}
+
+function classImplements(id, typeParameters) {
+ return (0, _builder.default)("ClassImplements", ...arguments);
+}
+
+function declareClass(id, typeParameters, _extends, body) {
+ return (0, _builder.default)("DeclareClass", ...arguments);
+}
+
+function declareFunction(id) {
+ return (0, _builder.default)("DeclareFunction", ...arguments);
+}
+
+function declareInterface(id, typeParameters, _extends, body) {
+ return (0, _builder.default)("DeclareInterface", ...arguments);
+}
+
+function declareModule(id, body, kind) {
+ return (0, _builder.default)("DeclareModule", ...arguments);
+}
+
+function declareModuleExports(typeAnnotation) {
+ return (0, _builder.default)("DeclareModuleExports", ...arguments);
+}
+
+function declareTypeAlias(id, typeParameters, right) {
+ return (0, _builder.default)("DeclareTypeAlias", ...arguments);
+}
+
+function declareOpaqueType(id, typeParameters, supertype) {
+ return (0, _builder.default)("DeclareOpaqueType", ...arguments);
+}
+
+function declareVariable(id) {
+ return (0, _builder.default)("DeclareVariable", ...arguments);
+}
+
+function declareExportDeclaration(declaration, specifiers, source) {
+ return (0, _builder.default)("DeclareExportDeclaration", ...arguments);
+}
+
+function declareExportAllDeclaration(source) {
+ return (0, _builder.default)("DeclareExportAllDeclaration", ...arguments);
+}
+
+function declaredPredicate(value) {
+ return (0, _builder.default)("DeclaredPredicate", ...arguments);
+}
+
+function existsTypeAnnotation() {
+ return (0, _builder.default)("ExistsTypeAnnotation", ...arguments);
+}
+
+function functionTypeAnnotation(typeParameters, params, rest, returnType) {
+ return (0, _builder.default)("FunctionTypeAnnotation", ...arguments);
+}
+
+function functionTypeParam(name, typeAnnotation) {
+ return (0, _builder.default)("FunctionTypeParam", ...arguments);
+}
+
+function genericTypeAnnotation(id, typeParameters) {
+ return (0, _builder.default)("GenericTypeAnnotation", ...arguments);
+}
+
+function inferredPredicate() {
+ return (0, _builder.default)("InferredPredicate", ...arguments);
+}
+
+function interfaceExtends(id, typeParameters) {
+ return (0, _builder.default)("InterfaceExtends", ...arguments);
+}
+
+function interfaceDeclaration(id, typeParameters, _extends, body) {
+ return (0, _builder.default)("InterfaceDeclaration", ...arguments);
+}
+
+function interfaceTypeAnnotation(_extends, body) {
+ return (0, _builder.default)("InterfaceTypeAnnotation", ...arguments);
+}
+
+function intersectionTypeAnnotation(types) {
+ return (0, _builder.default)("IntersectionTypeAnnotation", ...arguments);
+}
+
+function mixedTypeAnnotation() {
+ return (0, _builder.default)("MixedTypeAnnotation", ...arguments);
+}
+
+function emptyTypeAnnotation() {
+ return (0, _builder.default)("EmptyTypeAnnotation", ...arguments);
+}
+
+function nullableTypeAnnotation(typeAnnotation) {
+ return (0, _builder.default)("NullableTypeAnnotation", ...arguments);
+}
+
+function numberLiteralTypeAnnotation(value) {
+ return (0, _builder.default)("NumberLiteralTypeAnnotation", ...arguments);
+}
+
+function numberTypeAnnotation() {
+ return (0, _builder.default)("NumberTypeAnnotation", ...arguments);
+}
+
+function objectTypeAnnotation(properties, indexers, callProperties, internalSlots, exact) {
+ return (0, _builder.default)("ObjectTypeAnnotation", ...arguments);
+}
+
+function objectTypeInternalSlot(id, value, optional, _static, method) {
+ return (0, _builder.default)("ObjectTypeInternalSlot", ...arguments);
+}
+
+function objectTypeCallProperty(value) {
+ return (0, _builder.default)("ObjectTypeCallProperty", ...arguments);
+}
+
+function objectTypeIndexer(id, key, value, variance) {
+ return (0, _builder.default)("ObjectTypeIndexer", ...arguments);
+}
+
+function objectTypeProperty(key, value, variance) {
+ return (0, _builder.default)("ObjectTypeProperty", ...arguments);
+}
+
+function objectTypeSpreadProperty(argument) {
+ return (0, _builder.default)("ObjectTypeSpreadProperty", ...arguments);
+}
+
+function opaqueType(id, typeParameters, supertype, impltype) {
+ return (0, _builder.default)("OpaqueType", ...arguments);
+}
+
+function qualifiedTypeIdentifier(id, qualification) {
+ return (0, _builder.default)("QualifiedTypeIdentifier", ...arguments);
+}
+
+function stringLiteralTypeAnnotation(value) {
+ return (0, _builder.default)("StringLiteralTypeAnnotation", ...arguments);
+}
+
+function stringTypeAnnotation() {
+ return (0, _builder.default)("StringTypeAnnotation", ...arguments);
+}
+
+function symbolTypeAnnotation() {
+ return (0, _builder.default)("SymbolTypeAnnotation", ...arguments);
+}
+
+function thisTypeAnnotation() {
+ return (0, _builder.default)("ThisTypeAnnotation", ...arguments);
+}
+
+function tupleTypeAnnotation(types) {
+ return (0, _builder.default)("TupleTypeAnnotation", ...arguments);
+}
+
+function typeofTypeAnnotation(argument) {
+ return (0, _builder.default)("TypeofTypeAnnotation", ...arguments);
+}
+
+function typeAlias(id, typeParameters, right) {
+ return (0, _builder.default)("TypeAlias", ...arguments);
+}
+
+function typeAnnotation(typeAnnotation) {
+ return (0, _builder.default)("TypeAnnotation", ...arguments);
+}
+
+function typeCastExpression(expression, typeAnnotation) {
+ return (0, _builder.default)("TypeCastExpression", ...arguments);
+}
+
+function typeParameter(bound, _default, variance) {
+ return (0, _builder.default)("TypeParameter", ...arguments);
+}
+
+function typeParameterDeclaration(params) {
+ return (0, _builder.default)("TypeParameterDeclaration", ...arguments);
+}
+
+function typeParameterInstantiation(params) {
+ return (0, _builder.default)("TypeParameterInstantiation", ...arguments);
+}
+
+function unionTypeAnnotation(types) {
+ return (0, _builder.default)("UnionTypeAnnotation", ...arguments);
+}
+
+function variance(kind) {
+ return (0, _builder.default)("Variance", ...arguments);
+}
+
+function voidTypeAnnotation() {
+ return (0, _builder.default)("VoidTypeAnnotation", ...arguments);
+}
+
+function enumDeclaration(id, body) {
+ return (0, _builder.default)("EnumDeclaration", ...arguments);
+}
+
+function enumBooleanBody(members) {
+ return (0, _builder.default)("EnumBooleanBody", ...arguments);
+}
+
+function enumNumberBody(members) {
+ return (0, _builder.default)("EnumNumberBody", ...arguments);
+}
+
+function enumStringBody(members) {
+ return (0, _builder.default)("EnumStringBody", ...arguments);
+}
+
+function enumSymbolBody(members) {
+ return (0, _builder.default)("EnumSymbolBody", ...arguments);
+}
+
+function enumBooleanMember(id) {
+ return (0, _builder.default)("EnumBooleanMember", ...arguments);
+}
+
+function enumNumberMember(id, init) {
+ return (0, _builder.default)("EnumNumberMember", ...arguments);
+}
+
+function enumStringMember(id, init) {
+ return (0, _builder.default)("EnumStringMember", ...arguments);
+}
+
+function enumDefaultedMember(id) {
+ return (0, _builder.default)("EnumDefaultedMember", ...arguments);
+}
+
+function indexedAccessType(objectType, indexType) {
+ return (0, _builder.default)("IndexedAccessType", ...arguments);
+}
+
+function optionalIndexedAccessType(objectType, indexType) {
+ return (0, _builder.default)("OptionalIndexedAccessType", ...arguments);
+}
+
+function jsxAttribute(name, value) {
+ return (0, _builder.default)("JSXAttribute", ...arguments);
+}
+
+function jsxClosingElement(name) {
+ return (0, _builder.default)("JSXClosingElement", ...arguments);
+}
+
+function jsxElement(openingElement, closingElement, children, selfClosing) {
+ return (0, _builder.default)("JSXElement", ...arguments);
+}
+
+function jsxEmptyExpression() {
+ return (0, _builder.default)("JSXEmptyExpression", ...arguments);
+}
+
+function jsxExpressionContainer(expression) {
+ return (0, _builder.default)("JSXExpressionContainer", ...arguments);
+}
+
+function jsxSpreadChild(expression) {
+ return (0, _builder.default)("JSXSpreadChild", ...arguments);
+}
+
+function jsxIdentifier(name) {
+ return (0, _builder.default)("JSXIdentifier", ...arguments);
+}
+
+function jsxMemberExpression(object, property) {
+ return (0, _builder.default)("JSXMemberExpression", ...arguments);
+}
+
+function jsxNamespacedName(namespace, name) {
+ return (0, _builder.default)("JSXNamespacedName", ...arguments);
+}
+
+function jsxOpeningElement(name, attributes, selfClosing) {
+ return (0, _builder.default)("JSXOpeningElement", ...arguments);
+}
+
+function jsxSpreadAttribute(argument) {
+ return (0, _builder.default)("JSXSpreadAttribute", ...arguments);
+}
+
+function jsxText(value) {
+ return (0, _builder.default)("JSXText", ...arguments);
+}
+
+function jsxFragment(openingFragment, closingFragment, children) {
+ return (0, _builder.default)("JSXFragment", ...arguments);
+}
+
+function jsxOpeningFragment() {
+ return (0, _builder.default)("JSXOpeningFragment", ...arguments);
+}
+
+function jsxClosingFragment() {
+ return (0, _builder.default)("JSXClosingFragment", ...arguments);
+}
+
+function noop() {
+ return (0, _builder.default)("Noop", ...arguments);
+}
+
+function placeholder(expectedNode, name) {
+ return (0, _builder.default)("Placeholder", ...arguments);
+}
+
+function v8IntrinsicIdentifier(name) {
+ return (0, _builder.default)("V8IntrinsicIdentifier", ...arguments);
+}
+
+function argumentPlaceholder() {
+ return (0, _builder.default)("ArgumentPlaceholder", ...arguments);
+}
+
+function bindExpression(object, callee) {
+ return (0, _builder.default)("BindExpression", ...arguments);
+}
+
+function importAttribute(key, value) {
+ return (0, _builder.default)("ImportAttribute", ...arguments);
+}
+
+function decorator(expression) {
+ return (0, _builder.default)("Decorator", ...arguments);
+}
+
+function doExpression(body, async) {
+ return (0, _builder.default)("DoExpression", ...arguments);
+}
+
+function exportDefaultSpecifier(exported) {
+ return (0, _builder.default)("ExportDefaultSpecifier", ...arguments);
+}
+
+function recordExpression(properties) {
+ return (0, _builder.default)("RecordExpression", ...arguments);
+}
+
+function tupleExpression(elements) {
+ return (0, _builder.default)("TupleExpression", ...arguments);
+}
+
+function decimalLiteral(value) {
+ return (0, _builder.default)("DecimalLiteral", ...arguments);
+}
+
+function staticBlock(body) {
+ return (0, _builder.default)("StaticBlock", ...arguments);
+}
+
+function moduleExpression(body) {
+ return (0, _builder.default)("ModuleExpression", ...arguments);
+}
+
+function topicReference() {
+ return (0, _builder.default)("TopicReference", ...arguments);
+}
+
+function pipelineTopicExpression(expression) {
+ return (0, _builder.default)("PipelineTopicExpression", ...arguments);
+}
+
+function pipelineBareFunction(callee) {
+ return (0, _builder.default)("PipelineBareFunction", ...arguments);
+}
+
+function pipelinePrimaryTopicReference() {
+ return (0, _builder.default)("PipelinePrimaryTopicReference", ...arguments);
+}
+
+function tsParameterProperty(parameter) {
+ return (0, _builder.default)("TSParameterProperty", ...arguments);
+}
+
+function tsDeclareFunction(id, typeParameters, params, returnType) {
+ return (0, _builder.default)("TSDeclareFunction", ...arguments);
+}
+
+function tsDeclareMethod(decorators, key, typeParameters, params, returnType) {
+ return (0, _builder.default)("TSDeclareMethod", ...arguments);
+}
+
+function tsQualifiedName(left, right) {
+ return (0, _builder.default)("TSQualifiedName", ...arguments);
+}
+
+function tsCallSignatureDeclaration(typeParameters, parameters, typeAnnotation) {
+ return (0, _builder.default)("TSCallSignatureDeclaration", ...arguments);
+}
+
+function tsConstructSignatureDeclaration(typeParameters, parameters, typeAnnotation) {
+ return (0, _builder.default)("TSConstructSignatureDeclaration", ...arguments);
+}
+
+function tsPropertySignature(key, typeAnnotation, initializer) {
+ return (0, _builder.default)("TSPropertySignature", ...arguments);
+}
+
+function tsMethodSignature(key, typeParameters, parameters, typeAnnotation) {
+ return (0, _builder.default)("TSMethodSignature", ...arguments);
+}
+
+function tsIndexSignature(parameters, typeAnnotation) {
+ return (0, _builder.default)("TSIndexSignature", ...arguments);
+}
+
+function tsAnyKeyword() {
+ return (0, _builder.default)("TSAnyKeyword", ...arguments);
+}
+
+function tsBooleanKeyword() {
+ return (0, _builder.default)("TSBooleanKeyword", ...arguments);
+}
+
+function tsBigIntKeyword() {
+ return (0, _builder.default)("TSBigIntKeyword", ...arguments);
+}
+
+function tsIntrinsicKeyword() {
+ return (0, _builder.default)("TSIntrinsicKeyword", ...arguments);
+}
+
+function tsNeverKeyword() {
+ return (0, _builder.default)("TSNeverKeyword", ...arguments);
+}
+
+function tsNullKeyword() {
+ return (0, _builder.default)("TSNullKeyword", ...arguments);
+}
+
+function tsNumberKeyword() {
+ return (0, _builder.default)("TSNumberKeyword", ...arguments);
+}
+
+function tsObjectKeyword() {
+ return (0, _builder.default)("TSObjectKeyword", ...arguments);
+}
+
+function tsStringKeyword() {
+ return (0, _builder.default)("TSStringKeyword", ...arguments);
+}
+
+function tsSymbolKeyword() {
+ return (0, _builder.default)("TSSymbolKeyword", ...arguments);
+}
+
+function tsUndefinedKeyword() {
+ return (0, _builder.default)("TSUndefinedKeyword", ...arguments);
+}
+
+function tsUnknownKeyword() {
+ return (0, _builder.default)("TSUnknownKeyword", ...arguments);
+}
+
+function tsVoidKeyword() {
+ return (0, _builder.default)("TSVoidKeyword", ...arguments);
+}
+
+function tsThisType() {
+ return (0, _builder.default)("TSThisType", ...arguments);
+}
+
+function tsFunctionType(typeParameters, parameters, typeAnnotation) {
+ return (0, _builder.default)("TSFunctionType", ...arguments);
+}
+
+function tsConstructorType(typeParameters, parameters, typeAnnotation) {
+ return (0, _builder.default)("TSConstructorType", ...arguments);
+}
+
+function tsTypeReference(typeName, typeParameters) {
+ return (0, _builder.default)("TSTypeReference", ...arguments);
+}
+
+function tsTypePredicate(parameterName, typeAnnotation, asserts) {
+ return (0, _builder.default)("TSTypePredicate", ...arguments);
+}
+
+function tsTypeQuery(exprName) {
+ return (0, _builder.default)("TSTypeQuery", ...arguments);
+}
+
+function tsTypeLiteral(members) {
+ return (0, _builder.default)("TSTypeLiteral", ...arguments);
+}
+
+function tsArrayType(elementType) {
+ return (0, _builder.default)("TSArrayType", ...arguments);
+}
+
+function tsTupleType(elementTypes) {
+ return (0, _builder.default)("TSTupleType", ...arguments);
+}
+
+function tsOptionalType(typeAnnotation) {
+ return (0, _builder.default)("TSOptionalType", ...arguments);
+}
+
+function tsRestType(typeAnnotation) {
+ return (0, _builder.default)("TSRestType", ...arguments);
+}
+
+function tsNamedTupleMember(label, elementType, optional) {
+ return (0, _builder.default)("TSNamedTupleMember", ...arguments);
+}
+
+function tsUnionType(types) {
+ return (0, _builder.default)("TSUnionType", ...arguments);
+}
+
+function tsIntersectionType(types) {
+ return (0, _builder.default)("TSIntersectionType", ...arguments);
+}
+
+function tsConditionalType(checkType, extendsType, trueType, falseType) {
+ return (0, _builder.default)("TSConditionalType", ...arguments);
+}
+
+function tsInferType(typeParameter) {
+ return (0, _builder.default)("TSInferType", ...arguments);
+}
+
+function tsParenthesizedType(typeAnnotation) {
+ return (0, _builder.default)("TSParenthesizedType", ...arguments);
+}
+
+function tsTypeOperator(typeAnnotation) {
+ return (0, _builder.default)("TSTypeOperator", ...arguments);
+}
+
+function tsIndexedAccessType(objectType, indexType) {
+ return (0, _builder.default)("TSIndexedAccessType", ...arguments);
+}
+
+function tsMappedType(typeParameter, typeAnnotation, nameType) {
+ return (0, _builder.default)("TSMappedType", ...arguments);
+}
+
+function tsLiteralType(literal) {
+ return (0, _builder.default)("TSLiteralType", ...arguments);
+}
+
+function tsExpressionWithTypeArguments(expression, typeParameters) {
+ return (0, _builder.default)("TSExpressionWithTypeArguments", ...arguments);
+}
+
+function tsInterfaceDeclaration(id, typeParameters, _extends, body) {
+ return (0, _builder.default)("TSInterfaceDeclaration", ...arguments);
+}
+
+function tsInterfaceBody(body) {
+ return (0, _builder.default)("TSInterfaceBody", ...arguments);
+}
+
+function tsTypeAliasDeclaration(id, typeParameters, typeAnnotation) {
+ return (0, _builder.default)("TSTypeAliasDeclaration", ...arguments);
+}
+
+function tsAsExpression(expression, typeAnnotation) {
+ return (0, _builder.default)("TSAsExpression", ...arguments);
+}
+
+function tsTypeAssertion(typeAnnotation, expression) {
+ return (0, _builder.default)("TSTypeAssertion", ...arguments);
+}
+
+function tsEnumDeclaration(id, members) {
+ return (0, _builder.default)("TSEnumDeclaration", ...arguments);
+}
+
+function tsEnumMember(id, initializer) {
+ return (0, _builder.default)("TSEnumMember", ...arguments);
+}
+
+function tsModuleDeclaration(id, body) {
+ return (0, _builder.default)("TSModuleDeclaration", ...arguments);
+}
+
+function tsModuleBlock(body) {
+ return (0, _builder.default)("TSModuleBlock", ...arguments);
+}
+
+function tsImportType(argument, qualifier, typeParameters) {
+ return (0, _builder.default)("TSImportType", ...arguments);
+}
+
+function tsImportEqualsDeclaration(id, moduleReference) {
+ return (0, _builder.default)("TSImportEqualsDeclaration", ...arguments);
+}
+
+function tsExternalModuleReference(expression) {
+ return (0, _builder.default)("TSExternalModuleReference", ...arguments);
+}
+
+function tsNonNullExpression(expression) {
+ return (0, _builder.default)("TSNonNullExpression", ...arguments);
+}
+
+function tsExportAssignment(expression) {
+ return (0, _builder.default)("TSExportAssignment", ...arguments);
+}
+
+function tsNamespaceExportDeclaration(id) {
+ return (0, _builder.default)("TSNamespaceExportDeclaration", ...arguments);
+}
+
+function tsTypeAnnotation(typeAnnotation) {
+ return (0, _builder.default)("TSTypeAnnotation", ...arguments);
+}
+
+function tsTypeParameterInstantiation(params) {
+ return (0, _builder.default)("TSTypeParameterInstantiation", ...arguments);
+}
+
+function tsTypeParameterDeclaration(params) {
+ return (0, _builder.default)("TSTypeParameterDeclaration", ...arguments);
+}
+
+function tsTypeParameter(constraint, _default, name) {
+ return (0, _builder.default)("TSTypeParameter", ...arguments);
+}
+
+function NumberLiteral(...args) {
+ console.trace("The node type NumberLiteral has been renamed to NumericLiteral");
+ return (0, _builder.default)("NumberLiteral", ...args);
+}
+
+function RegexLiteral(...args) {
+ console.trace("The node type RegexLiteral has been renamed to RegExpLiteral");
+ return (0, _builder.default)("RegexLiteral", ...args);
+}
+
+function RestProperty(...args) {
+ console.trace("The node type RestProperty has been renamed to RestElement");
+ return (0, _builder.default)("RestProperty", ...args);
+}
+
+function SpreadProperty(...args) {
+ console.trace("The node type SpreadProperty has been renamed to SpreadElement");
+ return (0, _builder.default)("SpreadProperty", ...args);
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/builders/generated/uppercase.js b/chromium/third_party/node/node_modules/@babel/types/lib/builders/generated/uppercase.js
new file mode 100644
index 00000000000..e2ad08d82aa
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/builders/generated/uppercase.js
@@ -0,0 +1,1507 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+Object.defineProperty(exports, "ArrayExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.arrayExpression;
+ }
+});
+Object.defineProperty(exports, "AssignmentExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.assignmentExpression;
+ }
+});
+Object.defineProperty(exports, "BinaryExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.binaryExpression;
+ }
+});
+Object.defineProperty(exports, "InterpreterDirective", {
+ enumerable: true,
+ get: function () {
+ return _index.interpreterDirective;
+ }
+});
+Object.defineProperty(exports, "Directive", {
+ enumerable: true,
+ get: function () {
+ return _index.directive;
+ }
+});
+Object.defineProperty(exports, "DirectiveLiteral", {
+ enumerable: true,
+ get: function () {
+ return _index.directiveLiteral;
+ }
+});
+Object.defineProperty(exports, "BlockStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.blockStatement;
+ }
+});
+Object.defineProperty(exports, "BreakStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.breakStatement;
+ }
+});
+Object.defineProperty(exports, "CallExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.callExpression;
+ }
+});
+Object.defineProperty(exports, "CatchClause", {
+ enumerable: true,
+ get: function () {
+ return _index.catchClause;
+ }
+});
+Object.defineProperty(exports, "ConditionalExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.conditionalExpression;
+ }
+});
+Object.defineProperty(exports, "ContinueStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.continueStatement;
+ }
+});
+Object.defineProperty(exports, "DebuggerStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.debuggerStatement;
+ }
+});
+Object.defineProperty(exports, "DoWhileStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.doWhileStatement;
+ }
+});
+Object.defineProperty(exports, "EmptyStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.emptyStatement;
+ }
+});
+Object.defineProperty(exports, "ExpressionStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.expressionStatement;
+ }
+});
+Object.defineProperty(exports, "File", {
+ enumerable: true,
+ get: function () {
+ return _index.file;
+ }
+});
+Object.defineProperty(exports, "ForInStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.forInStatement;
+ }
+});
+Object.defineProperty(exports, "ForStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.forStatement;
+ }
+});
+Object.defineProperty(exports, "FunctionDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.functionDeclaration;
+ }
+});
+Object.defineProperty(exports, "FunctionExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.functionExpression;
+ }
+});
+Object.defineProperty(exports, "Identifier", {
+ enumerable: true,
+ get: function () {
+ return _index.identifier;
+ }
+});
+Object.defineProperty(exports, "IfStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.ifStatement;
+ }
+});
+Object.defineProperty(exports, "LabeledStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.labeledStatement;
+ }
+});
+Object.defineProperty(exports, "StringLiteral", {
+ enumerable: true,
+ get: function () {
+ return _index.stringLiteral;
+ }
+});
+Object.defineProperty(exports, "NumericLiteral", {
+ enumerable: true,
+ get: function () {
+ return _index.numericLiteral;
+ }
+});
+Object.defineProperty(exports, "NullLiteral", {
+ enumerable: true,
+ get: function () {
+ return _index.nullLiteral;
+ }
+});
+Object.defineProperty(exports, "BooleanLiteral", {
+ enumerable: true,
+ get: function () {
+ return _index.booleanLiteral;
+ }
+});
+Object.defineProperty(exports, "RegExpLiteral", {
+ enumerable: true,
+ get: function () {
+ return _index.regExpLiteral;
+ }
+});
+Object.defineProperty(exports, "LogicalExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.logicalExpression;
+ }
+});
+Object.defineProperty(exports, "MemberExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.memberExpression;
+ }
+});
+Object.defineProperty(exports, "NewExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.newExpression;
+ }
+});
+Object.defineProperty(exports, "Program", {
+ enumerable: true,
+ get: function () {
+ return _index.program;
+ }
+});
+Object.defineProperty(exports, "ObjectExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.objectExpression;
+ }
+});
+Object.defineProperty(exports, "ObjectMethod", {
+ enumerable: true,
+ get: function () {
+ return _index.objectMethod;
+ }
+});
+Object.defineProperty(exports, "ObjectProperty", {
+ enumerable: true,
+ get: function () {
+ return _index.objectProperty;
+ }
+});
+Object.defineProperty(exports, "RestElement", {
+ enumerable: true,
+ get: function () {
+ return _index.restElement;
+ }
+});
+Object.defineProperty(exports, "ReturnStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.returnStatement;
+ }
+});
+Object.defineProperty(exports, "SequenceExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.sequenceExpression;
+ }
+});
+Object.defineProperty(exports, "ParenthesizedExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.parenthesizedExpression;
+ }
+});
+Object.defineProperty(exports, "SwitchCase", {
+ enumerable: true,
+ get: function () {
+ return _index.switchCase;
+ }
+});
+Object.defineProperty(exports, "SwitchStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.switchStatement;
+ }
+});
+Object.defineProperty(exports, "ThisExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.thisExpression;
+ }
+});
+Object.defineProperty(exports, "ThrowStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.throwStatement;
+ }
+});
+Object.defineProperty(exports, "TryStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.tryStatement;
+ }
+});
+Object.defineProperty(exports, "UnaryExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.unaryExpression;
+ }
+});
+Object.defineProperty(exports, "UpdateExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.updateExpression;
+ }
+});
+Object.defineProperty(exports, "VariableDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.variableDeclaration;
+ }
+});
+Object.defineProperty(exports, "VariableDeclarator", {
+ enumerable: true,
+ get: function () {
+ return _index.variableDeclarator;
+ }
+});
+Object.defineProperty(exports, "WhileStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.whileStatement;
+ }
+});
+Object.defineProperty(exports, "WithStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.withStatement;
+ }
+});
+Object.defineProperty(exports, "AssignmentPattern", {
+ enumerable: true,
+ get: function () {
+ return _index.assignmentPattern;
+ }
+});
+Object.defineProperty(exports, "ArrayPattern", {
+ enumerable: true,
+ get: function () {
+ return _index.arrayPattern;
+ }
+});
+Object.defineProperty(exports, "ArrowFunctionExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.arrowFunctionExpression;
+ }
+});
+Object.defineProperty(exports, "ClassBody", {
+ enumerable: true,
+ get: function () {
+ return _index.classBody;
+ }
+});
+Object.defineProperty(exports, "ClassExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.classExpression;
+ }
+});
+Object.defineProperty(exports, "ClassDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.classDeclaration;
+ }
+});
+Object.defineProperty(exports, "ExportAllDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.exportAllDeclaration;
+ }
+});
+Object.defineProperty(exports, "ExportDefaultDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.exportDefaultDeclaration;
+ }
+});
+Object.defineProperty(exports, "ExportNamedDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.exportNamedDeclaration;
+ }
+});
+Object.defineProperty(exports, "ExportSpecifier", {
+ enumerable: true,
+ get: function () {
+ return _index.exportSpecifier;
+ }
+});
+Object.defineProperty(exports, "ForOfStatement", {
+ enumerable: true,
+ get: function () {
+ return _index.forOfStatement;
+ }
+});
+Object.defineProperty(exports, "ImportDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.importDeclaration;
+ }
+});
+Object.defineProperty(exports, "ImportDefaultSpecifier", {
+ enumerable: true,
+ get: function () {
+ return _index.importDefaultSpecifier;
+ }
+});
+Object.defineProperty(exports, "ImportNamespaceSpecifier", {
+ enumerable: true,
+ get: function () {
+ return _index.importNamespaceSpecifier;
+ }
+});
+Object.defineProperty(exports, "ImportSpecifier", {
+ enumerable: true,
+ get: function () {
+ return _index.importSpecifier;
+ }
+});
+Object.defineProperty(exports, "MetaProperty", {
+ enumerable: true,
+ get: function () {
+ return _index.metaProperty;
+ }
+});
+Object.defineProperty(exports, "ClassMethod", {
+ enumerable: true,
+ get: function () {
+ return _index.classMethod;
+ }
+});
+Object.defineProperty(exports, "ObjectPattern", {
+ enumerable: true,
+ get: function () {
+ return _index.objectPattern;
+ }
+});
+Object.defineProperty(exports, "SpreadElement", {
+ enumerable: true,
+ get: function () {
+ return _index.spreadElement;
+ }
+});
+Object.defineProperty(exports, "Super", {
+ enumerable: true,
+ get: function () {
+ return _index.super;
+ }
+});
+Object.defineProperty(exports, "TaggedTemplateExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.taggedTemplateExpression;
+ }
+});
+Object.defineProperty(exports, "TemplateElement", {
+ enumerable: true,
+ get: function () {
+ return _index.templateElement;
+ }
+});
+Object.defineProperty(exports, "TemplateLiteral", {
+ enumerable: true,
+ get: function () {
+ return _index.templateLiteral;
+ }
+});
+Object.defineProperty(exports, "YieldExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.yieldExpression;
+ }
+});
+Object.defineProperty(exports, "AwaitExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.awaitExpression;
+ }
+});
+Object.defineProperty(exports, "Import", {
+ enumerable: true,
+ get: function () {
+ return _index.import;
+ }
+});
+Object.defineProperty(exports, "BigIntLiteral", {
+ enumerable: true,
+ get: function () {
+ return _index.bigIntLiteral;
+ }
+});
+Object.defineProperty(exports, "ExportNamespaceSpecifier", {
+ enumerable: true,
+ get: function () {
+ return _index.exportNamespaceSpecifier;
+ }
+});
+Object.defineProperty(exports, "OptionalMemberExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.optionalMemberExpression;
+ }
+});
+Object.defineProperty(exports, "OptionalCallExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.optionalCallExpression;
+ }
+});
+Object.defineProperty(exports, "ClassProperty", {
+ enumerable: true,
+ get: function () {
+ return _index.classProperty;
+ }
+});
+Object.defineProperty(exports, "ClassPrivateProperty", {
+ enumerable: true,
+ get: function () {
+ return _index.classPrivateProperty;
+ }
+});
+Object.defineProperty(exports, "ClassPrivateMethod", {
+ enumerable: true,
+ get: function () {
+ return _index.classPrivateMethod;
+ }
+});
+Object.defineProperty(exports, "PrivateName", {
+ enumerable: true,
+ get: function () {
+ return _index.privateName;
+ }
+});
+Object.defineProperty(exports, "AnyTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.anyTypeAnnotation;
+ }
+});
+Object.defineProperty(exports, "ArrayTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.arrayTypeAnnotation;
+ }
+});
+Object.defineProperty(exports, "BooleanTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.booleanTypeAnnotation;
+ }
+});
+Object.defineProperty(exports, "BooleanLiteralTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.booleanLiteralTypeAnnotation;
+ }
+});
+Object.defineProperty(exports, "NullLiteralTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.nullLiteralTypeAnnotation;
+ }
+});
+Object.defineProperty(exports, "ClassImplements", {
+ enumerable: true,
+ get: function () {
+ return _index.classImplements;
+ }
+});
+Object.defineProperty(exports, "DeclareClass", {
+ enumerable: true,
+ get: function () {
+ return _index.declareClass;
+ }
+});
+Object.defineProperty(exports, "DeclareFunction", {
+ enumerable: true,
+ get: function () {
+ return _index.declareFunction;
+ }
+});
+Object.defineProperty(exports, "DeclareInterface", {
+ enumerable: true,
+ get: function () {
+ return _index.declareInterface;
+ }
+});
+Object.defineProperty(exports, "DeclareModule", {
+ enumerable: true,
+ get: function () {
+ return _index.declareModule;
+ }
+});
+Object.defineProperty(exports, "DeclareModuleExports", {
+ enumerable: true,
+ get: function () {
+ return _index.declareModuleExports;
+ }
+});
+Object.defineProperty(exports, "DeclareTypeAlias", {
+ enumerable: true,
+ get: function () {
+ return _index.declareTypeAlias;
+ }
+});
+Object.defineProperty(exports, "DeclareOpaqueType", {
+ enumerable: true,
+ get: function () {
+ return _index.declareOpaqueType;
+ }
+});
+Object.defineProperty(exports, "DeclareVariable", {
+ enumerable: true,
+ get: function () {
+ return _index.declareVariable;
+ }
+});
+Object.defineProperty(exports, "DeclareExportDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.declareExportDeclaration;
+ }
+});
+Object.defineProperty(exports, "DeclareExportAllDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.declareExportAllDeclaration;
+ }
+});
+Object.defineProperty(exports, "DeclaredPredicate", {
+ enumerable: true,
+ get: function () {
+ return _index.declaredPredicate;
+ }
+});
+Object.defineProperty(exports, "ExistsTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.existsTypeAnnotation;
+ }
+});
+Object.defineProperty(exports, "FunctionTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.functionTypeAnnotation;
+ }
+});
+Object.defineProperty(exports, "FunctionTypeParam", {
+ enumerable: true,
+ get: function () {
+ return _index.functionTypeParam;
+ }
+});
+Object.defineProperty(exports, "GenericTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.genericTypeAnnotation;
+ }
+});
+Object.defineProperty(exports, "InferredPredicate", {
+ enumerable: true,
+ get: function () {
+ return _index.inferredPredicate;
+ }
+});
+Object.defineProperty(exports, "InterfaceExtends", {
+ enumerable: true,
+ get: function () {
+ return _index.interfaceExtends;
+ }
+});
+Object.defineProperty(exports, "InterfaceDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.interfaceDeclaration;
+ }
+});
+Object.defineProperty(exports, "InterfaceTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.interfaceTypeAnnotation;
+ }
+});
+Object.defineProperty(exports, "IntersectionTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.intersectionTypeAnnotation;
+ }
+});
+Object.defineProperty(exports, "MixedTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.mixedTypeAnnotation;
+ }
+});
+Object.defineProperty(exports, "EmptyTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.emptyTypeAnnotation;
+ }
+});
+Object.defineProperty(exports, "NullableTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.nullableTypeAnnotation;
+ }
+});
+Object.defineProperty(exports, "NumberLiteralTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.numberLiteralTypeAnnotation;
+ }
+});
+Object.defineProperty(exports, "NumberTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.numberTypeAnnotation;
+ }
+});
+Object.defineProperty(exports, "ObjectTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.objectTypeAnnotation;
+ }
+});
+Object.defineProperty(exports, "ObjectTypeInternalSlot", {
+ enumerable: true,
+ get: function () {
+ return _index.objectTypeInternalSlot;
+ }
+});
+Object.defineProperty(exports, "ObjectTypeCallProperty", {
+ enumerable: true,
+ get: function () {
+ return _index.objectTypeCallProperty;
+ }
+});
+Object.defineProperty(exports, "ObjectTypeIndexer", {
+ enumerable: true,
+ get: function () {
+ return _index.objectTypeIndexer;
+ }
+});
+Object.defineProperty(exports, "ObjectTypeProperty", {
+ enumerable: true,
+ get: function () {
+ return _index.objectTypeProperty;
+ }
+});
+Object.defineProperty(exports, "ObjectTypeSpreadProperty", {
+ enumerable: true,
+ get: function () {
+ return _index.objectTypeSpreadProperty;
+ }
+});
+Object.defineProperty(exports, "OpaqueType", {
+ enumerable: true,
+ get: function () {
+ return _index.opaqueType;
+ }
+});
+Object.defineProperty(exports, "QualifiedTypeIdentifier", {
+ enumerable: true,
+ get: function () {
+ return _index.qualifiedTypeIdentifier;
+ }
+});
+Object.defineProperty(exports, "StringLiteralTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.stringLiteralTypeAnnotation;
+ }
+});
+Object.defineProperty(exports, "StringTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.stringTypeAnnotation;
+ }
+});
+Object.defineProperty(exports, "SymbolTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.symbolTypeAnnotation;
+ }
+});
+Object.defineProperty(exports, "ThisTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.thisTypeAnnotation;
+ }
+});
+Object.defineProperty(exports, "TupleTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.tupleTypeAnnotation;
+ }
+});
+Object.defineProperty(exports, "TypeofTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.typeofTypeAnnotation;
+ }
+});
+Object.defineProperty(exports, "TypeAlias", {
+ enumerable: true,
+ get: function () {
+ return _index.typeAlias;
+ }
+});
+Object.defineProperty(exports, "TypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.typeAnnotation;
+ }
+});
+Object.defineProperty(exports, "TypeCastExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.typeCastExpression;
+ }
+});
+Object.defineProperty(exports, "TypeParameter", {
+ enumerable: true,
+ get: function () {
+ return _index.typeParameter;
+ }
+});
+Object.defineProperty(exports, "TypeParameterDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.typeParameterDeclaration;
+ }
+});
+Object.defineProperty(exports, "TypeParameterInstantiation", {
+ enumerable: true,
+ get: function () {
+ return _index.typeParameterInstantiation;
+ }
+});
+Object.defineProperty(exports, "UnionTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.unionTypeAnnotation;
+ }
+});
+Object.defineProperty(exports, "Variance", {
+ enumerable: true,
+ get: function () {
+ return _index.variance;
+ }
+});
+Object.defineProperty(exports, "VoidTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.voidTypeAnnotation;
+ }
+});
+Object.defineProperty(exports, "EnumDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.enumDeclaration;
+ }
+});
+Object.defineProperty(exports, "EnumBooleanBody", {
+ enumerable: true,
+ get: function () {
+ return _index.enumBooleanBody;
+ }
+});
+Object.defineProperty(exports, "EnumNumberBody", {
+ enumerable: true,
+ get: function () {
+ return _index.enumNumberBody;
+ }
+});
+Object.defineProperty(exports, "EnumStringBody", {
+ enumerable: true,
+ get: function () {
+ return _index.enumStringBody;
+ }
+});
+Object.defineProperty(exports, "EnumSymbolBody", {
+ enumerable: true,
+ get: function () {
+ return _index.enumSymbolBody;
+ }
+});
+Object.defineProperty(exports, "EnumBooleanMember", {
+ enumerable: true,
+ get: function () {
+ return _index.enumBooleanMember;
+ }
+});
+Object.defineProperty(exports, "EnumNumberMember", {
+ enumerable: true,
+ get: function () {
+ return _index.enumNumberMember;
+ }
+});
+Object.defineProperty(exports, "EnumStringMember", {
+ enumerable: true,
+ get: function () {
+ return _index.enumStringMember;
+ }
+});
+Object.defineProperty(exports, "EnumDefaultedMember", {
+ enumerable: true,
+ get: function () {
+ return _index.enumDefaultedMember;
+ }
+});
+Object.defineProperty(exports, "IndexedAccessType", {
+ enumerable: true,
+ get: function () {
+ return _index.indexedAccessType;
+ }
+});
+Object.defineProperty(exports, "OptionalIndexedAccessType", {
+ enumerable: true,
+ get: function () {
+ return _index.optionalIndexedAccessType;
+ }
+});
+Object.defineProperty(exports, "JSXAttribute", {
+ enumerable: true,
+ get: function () {
+ return _index.jsxAttribute;
+ }
+});
+Object.defineProperty(exports, "JSXClosingElement", {
+ enumerable: true,
+ get: function () {
+ return _index.jsxClosingElement;
+ }
+});
+Object.defineProperty(exports, "JSXElement", {
+ enumerable: true,
+ get: function () {
+ return _index.jsxElement;
+ }
+});
+Object.defineProperty(exports, "JSXEmptyExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.jsxEmptyExpression;
+ }
+});
+Object.defineProperty(exports, "JSXExpressionContainer", {
+ enumerable: true,
+ get: function () {
+ return _index.jsxExpressionContainer;
+ }
+});
+Object.defineProperty(exports, "JSXSpreadChild", {
+ enumerable: true,
+ get: function () {
+ return _index.jsxSpreadChild;
+ }
+});
+Object.defineProperty(exports, "JSXIdentifier", {
+ enumerable: true,
+ get: function () {
+ return _index.jsxIdentifier;
+ }
+});
+Object.defineProperty(exports, "JSXMemberExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.jsxMemberExpression;
+ }
+});
+Object.defineProperty(exports, "JSXNamespacedName", {
+ enumerable: true,
+ get: function () {
+ return _index.jsxNamespacedName;
+ }
+});
+Object.defineProperty(exports, "JSXOpeningElement", {
+ enumerable: true,
+ get: function () {
+ return _index.jsxOpeningElement;
+ }
+});
+Object.defineProperty(exports, "JSXSpreadAttribute", {
+ enumerable: true,
+ get: function () {
+ return _index.jsxSpreadAttribute;
+ }
+});
+Object.defineProperty(exports, "JSXText", {
+ enumerable: true,
+ get: function () {
+ return _index.jsxText;
+ }
+});
+Object.defineProperty(exports, "JSXFragment", {
+ enumerable: true,
+ get: function () {
+ return _index.jsxFragment;
+ }
+});
+Object.defineProperty(exports, "JSXOpeningFragment", {
+ enumerable: true,
+ get: function () {
+ return _index.jsxOpeningFragment;
+ }
+});
+Object.defineProperty(exports, "JSXClosingFragment", {
+ enumerable: true,
+ get: function () {
+ return _index.jsxClosingFragment;
+ }
+});
+Object.defineProperty(exports, "Noop", {
+ enumerable: true,
+ get: function () {
+ return _index.noop;
+ }
+});
+Object.defineProperty(exports, "Placeholder", {
+ enumerable: true,
+ get: function () {
+ return _index.placeholder;
+ }
+});
+Object.defineProperty(exports, "V8IntrinsicIdentifier", {
+ enumerable: true,
+ get: function () {
+ return _index.v8IntrinsicIdentifier;
+ }
+});
+Object.defineProperty(exports, "ArgumentPlaceholder", {
+ enumerable: true,
+ get: function () {
+ return _index.argumentPlaceholder;
+ }
+});
+Object.defineProperty(exports, "BindExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.bindExpression;
+ }
+});
+Object.defineProperty(exports, "ImportAttribute", {
+ enumerable: true,
+ get: function () {
+ return _index.importAttribute;
+ }
+});
+Object.defineProperty(exports, "Decorator", {
+ enumerable: true,
+ get: function () {
+ return _index.decorator;
+ }
+});
+Object.defineProperty(exports, "DoExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.doExpression;
+ }
+});
+Object.defineProperty(exports, "ExportDefaultSpecifier", {
+ enumerable: true,
+ get: function () {
+ return _index.exportDefaultSpecifier;
+ }
+});
+Object.defineProperty(exports, "RecordExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.recordExpression;
+ }
+});
+Object.defineProperty(exports, "TupleExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.tupleExpression;
+ }
+});
+Object.defineProperty(exports, "DecimalLiteral", {
+ enumerable: true,
+ get: function () {
+ return _index.decimalLiteral;
+ }
+});
+Object.defineProperty(exports, "StaticBlock", {
+ enumerable: true,
+ get: function () {
+ return _index.staticBlock;
+ }
+});
+Object.defineProperty(exports, "ModuleExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.moduleExpression;
+ }
+});
+Object.defineProperty(exports, "TopicReference", {
+ enumerable: true,
+ get: function () {
+ return _index.topicReference;
+ }
+});
+Object.defineProperty(exports, "PipelineTopicExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.pipelineTopicExpression;
+ }
+});
+Object.defineProperty(exports, "PipelineBareFunction", {
+ enumerable: true,
+ get: function () {
+ return _index.pipelineBareFunction;
+ }
+});
+Object.defineProperty(exports, "PipelinePrimaryTopicReference", {
+ enumerable: true,
+ get: function () {
+ return _index.pipelinePrimaryTopicReference;
+ }
+});
+Object.defineProperty(exports, "TSParameterProperty", {
+ enumerable: true,
+ get: function () {
+ return _index.tsParameterProperty;
+ }
+});
+Object.defineProperty(exports, "TSDeclareFunction", {
+ enumerable: true,
+ get: function () {
+ return _index.tsDeclareFunction;
+ }
+});
+Object.defineProperty(exports, "TSDeclareMethod", {
+ enumerable: true,
+ get: function () {
+ return _index.tsDeclareMethod;
+ }
+});
+Object.defineProperty(exports, "TSQualifiedName", {
+ enumerable: true,
+ get: function () {
+ return _index.tsQualifiedName;
+ }
+});
+Object.defineProperty(exports, "TSCallSignatureDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.tsCallSignatureDeclaration;
+ }
+});
+Object.defineProperty(exports, "TSConstructSignatureDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.tsConstructSignatureDeclaration;
+ }
+});
+Object.defineProperty(exports, "TSPropertySignature", {
+ enumerable: true,
+ get: function () {
+ return _index.tsPropertySignature;
+ }
+});
+Object.defineProperty(exports, "TSMethodSignature", {
+ enumerable: true,
+ get: function () {
+ return _index.tsMethodSignature;
+ }
+});
+Object.defineProperty(exports, "TSIndexSignature", {
+ enumerable: true,
+ get: function () {
+ return _index.tsIndexSignature;
+ }
+});
+Object.defineProperty(exports, "TSAnyKeyword", {
+ enumerable: true,
+ get: function () {
+ return _index.tsAnyKeyword;
+ }
+});
+Object.defineProperty(exports, "TSBooleanKeyword", {
+ enumerable: true,
+ get: function () {
+ return _index.tsBooleanKeyword;
+ }
+});
+Object.defineProperty(exports, "TSBigIntKeyword", {
+ enumerable: true,
+ get: function () {
+ return _index.tsBigIntKeyword;
+ }
+});
+Object.defineProperty(exports, "TSIntrinsicKeyword", {
+ enumerable: true,
+ get: function () {
+ return _index.tsIntrinsicKeyword;
+ }
+});
+Object.defineProperty(exports, "TSNeverKeyword", {
+ enumerable: true,
+ get: function () {
+ return _index.tsNeverKeyword;
+ }
+});
+Object.defineProperty(exports, "TSNullKeyword", {
+ enumerable: true,
+ get: function () {
+ return _index.tsNullKeyword;
+ }
+});
+Object.defineProperty(exports, "TSNumberKeyword", {
+ enumerable: true,
+ get: function () {
+ return _index.tsNumberKeyword;
+ }
+});
+Object.defineProperty(exports, "TSObjectKeyword", {
+ enumerable: true,
+ get: function () {
+ return _index.tsObjectKeyword;
+ }
+});
+Object.defineProperty(exports, "TSStringKeyword", {
+ enumerable: true,
+ get: function () {
+ return _index.tsStringKeyword;
+ }
+});
+Object.defineProperty(exports, "TSSymbolKeyword", {
+ enumerable: true,
+ get: function () {
+ return _index.tsSymbolKeyword;
+ }
+});
+Object.defineProperty(exports, "TSUndefinedKeyword", {
+ enumerable: true,
+ get: function () {
+ return _index.tsUndefinedKeyword;
+ }
+});
+Object.defineProperty(exports, "TSUnknownKeyword", {
+ enumerable: true,
+ get: function () {
+ return _index.tsUnknownKeyword;
+ }
+});
+Object.defineProperty(exports, "TSVoidKeyword", {
+ enumerable: true,
+ get: function () {
+ return _index.tsVoidKeyword;
+ }
+});
+Object.defineProperty(exports, "TSThisType", {
+ enumerable: true,
+ get: function () {
+ return _index.tsThisType;
+ }
+});
+Object.defineProperty(exports, "TSFunctionType", {
+ enumerable: true,
+ get: function () {
+ return _index.tsFunctionType;
+ }
+});
+Object.defineProperty(exports, "TSConstructorType", {
+ enumerable: true,
+ get: function () {
+ return _index.tsConstructorType;
+ }
+});
+Object.defineProperty(exports, "TSTypeReference", {
+ enumerable: true,
+ get: function () {
+ return _index.tsTypeReference;
+ }
+});
+Object.defineProperty(exports, "TSTypePredicate", {
+ enumerable: true,
+ get: function () {
+ return _index.tsTypePredicate;
+ }
+});
+Object.defineProperty(exports, "TSTypeQuery", {
+ enumerable: true,
+ get: function () {
+ return _index.tsTypeQuery;
+ }
+});
+Object.defineProperty(exports, "TSTypeLiteral", {
+ enumerable: true,
+ get: function () {
+ return _index.tsTypeLiteral;
+ }
+});
+Object.defineProperty(exports, "TSArrayType", {
+ enumerable: true,
+ get: function () {
+ return _index.tsArrayType;
+ }
+});
+Object.defineProperty(exports, "TSTupleType", {
+ enumerable: true,
+ get: function () {
+ return _index.tsTupleType;
+ }
+});
+Object.defineProperty(exports, "TSOptionalType", {
+ enumerable: true,
+ get: function () {
+ return _index.tsOptionalType;
+ }
+});
+Object.defineProperty(exports, "TSRestType", {
+ enumerable: true,
+ get: function () {
+ return _index.tsRestType;
+ }
+});
+Object.defineProperty(exports, "TSNamedTupleMember", {
+ enumerable: true,
+ get: function () {
+ return _index.tsNamedTupleMember;
+ }
+});
+Object.defineProperty(exports, "TSUnionType", {
+ enumerable: true,
+ get: function () {
+ return _index.tsUnionType;
+ }
+});
+Object.defineProperty(exports, "TSIntersectionType", {
+ enumerable: true,
+ get: function () {
+ return _index.tsIntersectionType;
+ }
+});
+Object.defineProperty(exports, "TSConditionalType", {
+ enumerable: true,
+ get: function () {
+ return _index.tsConditionalType;
+ }
+});
+Object.defineProperty(exports, "TSInferType", {
+ enumerable: true,
+ get: function () {
+ return _index.tsInferType;
+ }
+});
+Object.defineProperty(exports, "TSParenthesizedType", {
+ enumerable: true,
+ get: function () {
+ return _index.tsParenthesizedType;
+ }
+});
+Object.defineProperty(exports, "TSTypeOperator", {
+ enumerable: true,
+ get: function () {
+ return _index.tsTypeOperator;
+ }
+});
+Object.defineProperty(exports, "TSIndexedAccessType", {
+ enumerable: true,
+ get: function () {
+ return _index.tsIndexedAccessType;
+ }
+});
+Object.defineProperty(exports, "TSMappedType", {
+ enumerable: true,
+ get: function () {
+ return _index.tsMappedType;
+ }
+});
+Object.defineProperty(exports, "TSLiteralType", {
+ enumerable: true,
+ get: function () {
+ return _index.tsLiteralType;
+ }
+});
+Object.defineProperty(exports, "TSExpressionWithTypeArguments", {
+ enumerable: true,
+ get: function () {
+ return _index.tsExpressionWithTypeArguments;
+ }
+});
+Object.defineProperty(exports, "TSInterfaceDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.tsInterfaceDeclaration;
+ }
+});
+Object.defineProperty(exports, "TSInterfaceBody", {
+ enumerable: true,
+ get: function () {
+ return _index.tsInterfaceBody;
+ }
+});
+Object.defineProperty(exports, "TSTypeAliasDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.tsTypeAliasDeclaration;
+ }
+});
+Object.defineProperty(exports, "TSAsExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.tsAsExpression;
+ }
+});
+Object.defineProperty(exports, "TSTypeAssertion", {
+ enumerable: true,
+ get: function () {
+ return _index.tsTypeAssertion;
+ }
+});
+Object.defineProperty(exports, "TSEnumDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.tsEnumDeclaration;
+ }
+});
+Object.defineProperty(exports, "TSEnumMember", {
+ enumerable: true,
+ get: function () {
+ return _index.tsEnumMember;
+ }
+});
+Object.defineProperty(exports, "TSModuleDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.tsModuleDeclaration;
+ }
+});
+Object.defineProperty(exports, "TSModuleBlock", {
+ enumerable: true,
+ get: function () {
+ return _index.tsModuleBlock;
+ }
+});
+Object.defineProperty(exports, "TSImportType", {
+ enumerable: true,
+ get: function () {
+ return _index.tsImportType;
+ }
+});
+Object.defineProperty(exports, "TSImportEqualsDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.tsImportEqualsDeclaration;
+ }
+});
+Object.defineProperty(exports, "TSExternalModuleReference", {
+ enumerable: true,
+ get: function () {
+ return _index.tsExternalModuleReference;
+ }
+});
+Object.defineProperty(exports, "TSNonNullExpression", {
+ enumerable: true,
+ get: function () {
+ return _index.tsNonNullExpression;
+ }
+});
+Object.defineProperty(exports, "TSExportAssignment", {
+ enumerable: true,
+ get: function () {
+ return _index.tsExportAssignment;
+ }
+});
+Object.defineProperty(exports, "TSNamespaceExportDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.tsNamespaceExportDeclaration;
+ }
+});
+Object.defineProperty(exports, "TSTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _index.tsTypeAnnotation;
+ }
+});
+Object.defineProperty(exports, "TSTypeParameterInstantiation", {
+ enumerable: true,
+ get: function () {
+ return _index.tsTypeParameterInstantiation;
+ }
+});
+Object.defineProperty(exports, "TSTypeParameterDeclaration", {
+ enumerable: true,
+ get: function () {
+ return _index.tsTypeParameterDeclaration;
+ }
+});
+Object.defineProperty(exports, "TSTypeParameter", {
+ enumerable: true,
+ get: function () {
+ return _index.tsTypeParameter;
+ }
+});
+Object.defineProperty(exports, "NumberLiteral", {
+ enumerable: true,
+ get: function () {
+ return _index.numberLiteral;
+ }
+});
+Object.defineProperty(exports, "RegexLiteral", {
+ enumerable: true,
+ get: function () {
+ return _index.regexLiteral;
+ }
+});
+Object.defineProperty(exports, "RestProperty", {
+ enumerable: true,
+ get: function () {
+ return _index.restProperty;
+ }
+});
+Object.defineProperty(exports, "SpreadProperty", {
+ enumerable: true,
+ get: function () {
+ return _index.spreadProperty;
+ }
+});
+
+var _index = require("./index"); \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/builders/react/buildChildren.js b/chromium/third_party/node/node_modules/@babel/types/lib/builders/react/buildChildren.js
new file mode 100644
index 00000000000..20a194b6b9e
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/builders/react/buildChildren.js
@@ -0,0 +1,29 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = buildChildren;
+
+var _generated = require("../../validators/generated");
+
+var _cleanJSXElementLiteralChild = require("../../utils/react/cleanJSXElementLiteralChild");
+
+function buildChildren(node) {
+ const elements = [];
+
+ for (let i = 0; i < node.children.length; i++) {
+ let child = node.children[i];
+
+ if ((0, _generated.isJSXText)(child)) {
+ (0, _cleanJSXElementLiteralChild.default)(child, elements);
+ continue;
+ }
+
+ if ((0, _generated.isJSXExpressionContainer)(child)) child = child.expression;
+ if ((0, _generated.isJSXEmptyExpression)(child)) continue;
+ elements.push(child);
+ }
+
+ return elements;
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js b/chromium/third_party/node/node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js
new file mode 100644
index 00000000000..9b53be29d32
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js
@@ -0,0 +1,21 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = createTSUnionType;
+
+var _generated = require("../generated");
+
+var _removeTypeDuplicates = require("../../modifications/typescript/removeTypeDuplicates");
+
+function createTSUnionType(typeAnnotations) {
+ const types = typeAnnotations.map(type => type.typeAnnotation);
+ const flattened = (0, _removeTypeDuplicates.default)(types);
+
+ if (flattened.length === 1) {
+ return flattened[0];
+ } else {
+ return (0, _generated.tsUnionType)(flattened);
+ }
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/clone/clone.js b/chromium/third_party/node/node_modules/@babel/types/lib/clone/clone.js
new file mode 100644
index 00000000000..e262c632d8d
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/clone/clone.js
@@ -0,0 +1,12 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = clone;
+
+var _cloneNode = require("./cloneNode");
+
+function clone(node) {
+ return (0, _cloneNode.default)(node, false);
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/clone/cloneDeep.js b/chromium/third_party/node/node_modules/@babel/types/lib/clone/cloneDeep.js
new file mode 100644
index 00000000000..9067e7b73d9
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/clone/cloneDeep.js
@@ -0,0 +1,12 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = cloneDeep;
+
+var _cloneNode = require("./cloneNode");
+
+function cloneDeep(node) {
+ return (0, _cloneNode.default)(node);
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js b/chromium/third_party/node/node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js
new file mode 100644
index 00000000000..a8c53dd4b1f
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js
@@ -0,0 +1,12 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = cloneDeepWithoutLoc;
+
+var _cloneNode = require("./cloneNode");
+
+function cloneDeepWithoutLoc(node) {
+ return (0, _cloneNode.default)(node, true, true);
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/clone/cloneNode.js b/chromium/third_party/node/node_modules/@babel/types/lib/clone/cloneNode.js
new file mode 100644
index 00000000000..5980f2d1ba9
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/clone/cloneNode.js
@@ -0,0 +1,114 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = cloneNode;
+
+var _definitions = require("../definitions");
+
+var _generated = require("../validators/generated");
+
+const has = Function.call.bind(Object.prototype.hasOwnProperty);
+
+function cloneIfNode(obj, deep, withoutLoc) {
+ if (obj && typeof obj.type === "string") {
+ return cloneNode(obj, deep, withoutLoc);
+ }
+
+ return obj;
+}
+
+function cloneIfNodeOrArray(obj, deep, withoutLoc) {
+ if (Array.isArray(obj)) {
+ return obj.map(node => cloneIfNode(node, deep, withoutLoc));
+ }
+
+ return cloneIfNode(obj, deep, withoutLoc);
+}
+
+function cloneNode(node, deep = true, withoutLoc = false) {
+ if (!node) return node;
+ const {
+ type
+ } = node;
+ const newNode = {
+ type: node.type
+ };
+
+ if ((0, _generated.isIdentifier)(node)) {
+ newNode.name = node.name;
+
+ if (has(node, "optional") && typeof node.optional === "boolean") {
+ newNode.optional = node.optional;
+ }
+
+ if (has(node, "typeAnnotation")) {
+ newNode.typeAnnotation = deep ? cloneIfNodeOrArray(node.typeAnnotation, true, withoutLoc) : node.typeAnnotation;
+ }
+ } else if (!has(_definitions.NODE_FIELDS, type)) {
+ throw new Error(`Unknown node type: "${type}"`);
+ } else {
+ for (const field of Object.keys(_definitions.NODE_FIELDS[type])) {
+ if (has(node, field)) {
+ if (deep) {
+ newNode[field] = (0, _generated.isFile)(node) && field === "comments" ? maybeCloneComments(node.comments, deep, withoutLoc) : cloneIfNodeOrArray(node[field], true, withoutLoc);
+ } else {
+ newNode[field] = node[field];
+ }
+ }
+ }
+ }
+
+ if (has(node, "loc")) {
+ if (withoutLoc) {
+ newNode.loc = null;
+ } else {
+ newNode.loc = node.loc;
+ }
+ }
+
+ if (has(node, "leadingComments")) {
+ newNode.leadingComments = maybeCloneComments(node.leadingComments, deep, withoutLoc);
+ }
+
+ if (has(node, "innerComments")) {
+ newNode.innerComments = maybeCloneComments(node.innerComments, deep, withoutLoc);
+ }
+
+ if (has(node, "trailingComments")) {
+ newNode.trailingComments = maybeCloneComments(node.trailingComments, deep, withoutLoc);
+ }
+
+ if (has(node, "extra")) {
+ newNode.extra = Object.assign({}, node.extra);
+ }
+
+ return newNode;
+}
+
+function maybeCloneComments(comments, deep, withoutLoc) {
+ if (!comments || !deep) {
+ return comments;
+ }
+
+ return comments.map(({
+ type,
+ value,
+ loc
+ }) => {
+ if (withoutLoc) {
+ return {
+ type,
+ value,
+ loc: null
+ };
+ }
+
+ return {
+ type,
+ value,
+ loc
+ };
+ });
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/clone/cloneWithoutLoc.js b/chromium/third_party/node/node_modules/@babel/types/lib/clone/cloneWithoutLoc.js
new file mode 100644
index 00000000000..d0420b1c0de
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/clone/cloneWithoutLoc.js
@@ -0,0 +1,12 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = cloneWithoutLoc;
+
+var _cloneNode = require("./cloneNode");
+
+function cloneWithoutLoc(node) {
+ return (0, _cloneNode.default)(node, false, true);
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/comments/addComment.js b/chromium/third_party/node/node_modules/@babel/types/lib/comments/addComment.js
new file mode 100644
index 00000000000..de19ab74e84
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/comments/addComment.js
@@ -0,0 +1,15 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = addComment;
+
+var _addComments = require("./addComments");
+
+function addComment(node, type, content, line) {
+ return (0, _addComments.default)(node, type, [{
+ type: line ? "CommentLine" : "CommentBlock",
+ value: content
+ }]);
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/comments/addComments.js b/chromium/third_party/node/node_modules/@babel/types/lib/comments/addComments.js
new file mode 100644
index 00000000000..26c456fc301
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/comments/addComments.js
@@ -0,0 +1,23 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = addComments;
+
+function addComments(node, type, comments) {
+ if (!comments || !node) return node;
+ const key = `${type}Comments`;
+
+ if (node[key]) {
+ if (type === "leading") {
+ node[key] = comments.concat(node[key]);
+ } else {
+ node[key].push(...comments);
+ }
+ } else {
+ node[key] = comments;
+ }
+
+ return node;
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/comments/inheritInnerComments.js b/chromium/third_party/node/node_modules/@babel/types/lib/comments/inheritInnerComments.js
new file mode 100644
index 00000000000..4b5dc9cac2b
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/comments/inheritInnerComments.js
@@ -0,0 +1,12 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = inheritInnerComments;
+
+var _inherit = require("../utils/inherit");
+
+function inheritInnerComments(child, parent) {
+ (0, _inherit.default)("innerComments", child, parent);
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/comments/inheritLeadingComments.js b/chromium/third_party/node/node_modules/@babel/types/lib/comments/inheritLeadingComments.js
new file mode 100644
index 00000000000..6aa2b250290
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/comments/inheritLeadingComments.js
@@ -0,0 +1,12 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = inheritLeadingComments;
+
+var _inherit = require("../utils/inherit");
+
+function inheritLeadingComments(child, parent) {
+ (0, _inherit.default)("leadingComments", child, parent);
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/comments/inheritTrailingComments.js b/chromium/third_party/node/node_modules/@babel/types/lib/comments/inheritTrailingComments.js
new file mode 100644
index 00000000000..934ef0b9cad
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/comments/inheritTrailingComments.js
@@ -0,0 +1,12 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = inheritTrailingComments;
+
+var _inherit = require("../utils/inherit");
+
+function inheritTrailingComments(child, parent) {
+ (0, _inherit.default)("trailingComments", child, parent);
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/comments/inheritsComments.js b/chromium/third_party/node/node_modules/@babel/types/lib/comments/inheritsComments.js
new file mode 100644
index 00000000000..49476cffd95
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/comments/inheritsComments.js
@@ -0,0 +1,19 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = inheritsComments;
+
+var _inheritTrailingComments = require("./inheritTrailingComments");
+
+var _inheritLeadingComments = require("./inheritLeadingComments");
+
+var _inheritInnerComments = require("./inheritInnerComments");
+
+function inheritsComments(child, parent) {
+ (0, _inheritTrailingComments.default)(child, parent);
+ (0, _inheritLeadingComments.default)(child, parent);
+ (0, _inheritInnerComments.default)(child, parent);
+ return child;
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/comments/removeComments.js b/chromium/third_party/node/node_modules/@babel/types/lib/comments/removeComments.js
new file mode 100644
index 00000000000..fe34f1a8905
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/comments/removeComments.js
@@ -0,0 +1,16 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = removeComments;
+
+var _constants = require("../constants");
+
+function removeComments(node) {
+ _constants.COMMENT_KEYS.forEach(key => {
+ node[key] = null;
+ });
+
+ return node;
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/constants/generated/index.js b/chromium/third_party/node/node_modules/@babel/types/lib/constants/generated/index.js
new file mode 100644
index 00000000000..5c5900009f6
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/constants/generated/index.js
@@ -0,0 +1,99 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.TSBASETYPE_TYPES = exports.TSTYPE_TYPES = exports.TSTYPEELEMENT_TYPES = exports.JSX_TYPES = exports.ENUMMEMBER_TYPES = exports.ENUMBODY_TYPES = exports.FLOWPREDICATE_TYPES = exports.FLOWDECLARATION_TYPES = exports.FLOWBASEANNOTATION_TYPES = exports.FLOWTYPE_TYPES = exports.FLOW_TYPES = exports.PRIVATE_TYPES = exports.MODULESPECIFIER_TYPES = exports.EXPORTDECLARATION_TYPES = exports.MODULEDECLARATION_TYPES = exports.CLASS_TYPES = exports.PATTERN_TYPES = exports.UNARYLIKE_TYPES = exports.PROPERTY_TYPES = exports.OBJECTMEMBER_TYPES = exports.METHOD_TYPES = exports.USERWHITESPACABLE_TYPES = exports.IMMUTABLE_TYPES = exports.LITERAL_TYPES = exports.TSENTITYNAME_TYPES = exports.LVAL_TYPES = exports.PATTERNLIKE_TYPES = exports.DECLARATION_TYPES = exports.PUREISH_TYPES = exports.FUNCTIONPARENT_TYPES = exports.FUNCTION_TYPES = exports.FORXSTATEMENT_TYPES = exports.FOR_TYPES = exports.EXPRESSIONWRAPPER_TYPES = exports.WHILE_TYPES = exports.LOOP_TYPES = exports.CONDITIONAL_TYPES = exports.COMPLETIONSTATEMENT_TYPES = exports.TERMINATORLESS_TYPES = exports.STATEMENT_TYPES = exports.BLOCK_TYPES = exports.BLOCKPARENT_TYPES = exports.SCOPABLE_TYPES = exports.BINARY_TYPES = exports.EXPRESSION_TYPES = void 0;
+
+var _definitions = require("../../definitions");
+
+const EXPRESSION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Expression"];
+exports.EXPRESSION_TYPES = EXPRESSION_TYPES;
+const BINARY_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Binary"];
+exports.BINARY_TYPES = BINARY_TYPES;
+const SCOPABLE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Scopable"];
+exports.SCOPABLE_TYPES = SCOPABLE_TYPES;
+const BLOCKPARENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["BlockParent"];
+exports.BLOCKPARENT_TYPES = BLOCKPARENT_TYPES;
+const BLOCK_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Block"];
+exports.BLOCK_TYPES = BLOCK_TYPES;
+const STATEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Statement"];
+exports.STATEMENT_TYPES = STATEMENT_TYPES;
+const TERMINATORLESS_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Terminatorless"];
+exports.TERMINATORLESS_TYPES = TERMINATORLESS_TYPES;
+const COMPLETIONSTATEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["CompletionStatement"];
+exports.COMPLETIONSTATEMENT_TYPES = COMPLETIONSTATEMENT_TYPES;
+const CONDITIONAL_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Conditional"];
+exports.CONDITIONAL_TYPES = CONDITIONAL_TYPES;
+const LOOP_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Loop"];
+exports.LOOP_TYPES = LOOP_TYPES;
+const WHILE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["While"];
+exports.WHILE_TYPES = WHILE_TYPES;
+const EXPRESSIONWRAPPER_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ExpressionWrapper"];
+exports.EXPRESSIONWRAPPER_TYPES = EXPRESSIONWRAPPER_TYPES;
+const FOR_TYPES = _definitions.FLIPPED_ALIAS_KEYS["For"];
+exports.FOR_TYPES = FOR_TYPES;
+const FORXSTATEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ForXStatement"];
+exports.FORXSTATEMENT_TYPES = FORXSTATEMENT_TYPES;
+const FUNCTION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Function"];
+exports.FUNCTION_TYPES = FUNCTION_TYPES;
+const FUNCTIONPARENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FunctionParent"];
+exports.FUNCTIONPARENT_TYPES = FUNCTIONPARENT_TYPES;
+const PUREISH_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Pureish"];
+exports.PUREISH_TYPES = PUREISH_TYPES;
+const DECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Declaration"];
+exports.DECLARATION_TYPES = DECLARATION_TYPES;
+const PATTERNLIKE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["PatternLike"];
+exports.PATTERNLIKE_TYPES = PATTERNLIKE_TYPES;
+const LVAL_TYPES = _definitions.FLIPPED_ALIAS_KEYS["LVal"];
+exports.LVAL_TYPES = LVAL_TYPES;
+const TSENTITYNAME_TYPES = _definitions.FLIPPED_ALIAS_KEYS["TSEntityName"];
+exports.TSENTITYNAME_TYPES = TSENTITYNAME_TYPES;
+const LITERAL_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Literal"];
+exports.LITERAL_TYPES = LITERAL_TYPES;
+const IMMUTABLE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Immutable"];
+exports.IMMUTABLE_TYPES = IMMUTABLE_TYPES;
+const USERWHITESPACABLE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["UserWhitespacable"];
+exports.USERWHITESPACABLE_TYPES = USERWHITESPACABLE_TYPES;
+const METHOD_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Method"];
+exports.METHOD_TYPES = METHOD_TYPES;
+const OBJECTMEMBER_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ObjectMember"];
+exports.OBJECTMEMBER_TYPES = OBJECTMEMBER_TYPES;
+const PROPERTY_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Property"];
+exports.PROPERTY_TYPES = PROPERTY_TYPES;
+const UNARYLIKE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["UnaryLike"];
+exports.UNARYLIKE_TYPES = UNARYLIKE_TYPES;
+const PATTERN_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Pattern"];
+exports.PATTERN_TYPES = PATTERN_TYPES;
+const CLASS_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Class"];
+exports.CLASS_TYPES = CLASS_TYPES;
+const MODULEDECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ModuleDeclaration"];
+exports.MODULEDECLARATION_TYPES = MODULEDECLARATION_TYPES;
+const EXPORTDECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ExportDeclaration"];
+exports.EXPORTDECLARATION_TYPES = EXPORTDECLARATION_TYPES;
+const MODULESPECIFIER_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ModuleSpecifier"];
+exports.MODULESPECIFIER_TYPES = MODULESPECIFIER_TYPES;
+const PRIVATE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Private"];
+exports.PRIVATE_TYPES = PRIVATE_TYPES;
+const FLOW_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Flow"];
+exports.FLOW_TYPES = FLOW_TYPES;
+const FLOWTYPE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FlowType"];
+exports.FLOWTYPE_TYPES = FLOWTYPE_TYPES;
+const FLOWBASEANNOTATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FlowBaseAnnotation"];
+exports.FLOWBASEANNOTATION_TYPES = FLOWBASEANNOTATION_TYPES;
+const FLOWDECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FlowDeclaration"];
+exports.FLOWDECLARATION_TYPES = FLOWDECLARATION_TYPES;
+const FLOWPREDICATE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FlowPredicate"];
+exports.FLOWPREDICATE_TYPES = FLOWPREDICATE_TYPES;
+const ENUMBODY_TYPES = _definitions.FLIPPED_ALIAS_KEYS["EnumBody"];
+exports.ENUMBODY_TYPES = ENUMBODY_TYPES;
+const ENUMMEMBER_TYPES = _definitions.FLIPPED_ALIAS_KEYS["EnumMember"];
+exports.ENUMMEMBER_TYPES = ENUMMEMBER_TYPES;
+const JSX_TYPES = _definitions.FLIPPED_ALIAS_KEYS["JSX"];
+exports.JSX_TYPES = JSX_TYPES;
+const TSTYPEELEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["TSTypeElement"];
+exports.TSTYPEELEMENT_TYPES = TSTYPEELEMENT_TYPES;
+const TSTYPE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["TSType"];
+exports.TSTYPE_TYPES = TSTYPE_TYPES;
+const TSBASETYPE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["TSBaseType"];
+exports.TSBASETYPE_TYPES = TSBASETYPE_TYPES; \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/constants/index.js b/chromium/third_party/node/node_modules/@babel/types/lib/constants/index.js
new file mode 100644
index 00000000000..7553162c664
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/constants/index.js
@@ -0,0 +1,49 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.NOT_LOCAL_BINDING = exports.BLOCK_SCOPED_SYMBOL = exports.INHERIT_KEYS = exports.UNARY_OPERATORS = exports.STRING_UNARY_OPERATORS = exports.NUMBER_UNARY_OPERATORS = exports.BOOLEAN_UNARY_OPERATORS = exports.ASSIGNMENT_OPERATORS = exports.BINARY_OPERATORS = exports.NUMBER_BINARY_OPERATORS = exports.BOOLEAN_BINARY_OPERATORS = exports.COMPARISON_BINARY_OPERATORS = exports.EQUALITY_BINARY_OPERATORS = exports.BOOLEAN_NUMBER_BINARY_OPERATORS = exports.UPDATE_OPERATORS = exports.LOGICAL_OPERATORS = exports.COMMENT_KEYS = exports.FOR_INIT_KEYS = exports.FLATTENABLE_KEYS = exports.STATEMENT_OR_BLOCK_KEYS = void 0;
+const STATEMENT_OR_BLOCK_KEYS = ["consequent", "body", "alternate"];
+exports.STATEMENT_OR_BLOCK_KEYS = STATEMENT_OR_BLOCK_KEYS;
+const FLATTENABLE_KEYS = ["body", "expressions"];
+exports.FLATTENABLE_KEYS = FLATTENABLE_KEYS;
+const FOR_INIT_KEYS = ["left", "init"];
+exports.FOR_INIT_KEYS = FOR_INIT_KEYS;
+const COMMENT_KEYS = ["leadingComments", "trailingComments", "innerComments"];
+exports.COMMENT_KEYS = COMMENT_KEYS;
+const LOGICAL_OPERATORS = ["||", "&&", "??"];
+exports.LOGICAL_OPERATORS = LOGICAL_OPERATORS;
+const UPDATE_OPERATORS = ["++", "--"];
+exports.UPDATE_OPERATORS = UPDATE_OPERATORS;
+const BOOLEAN_NUMBER_BINARY_OPERATORS = [">", "<", ">=", "<="];
+exports.BOOLEAN_NUMBER_BINARY_OPERATORS = BOOLEAN_NUMBER_BINARY_OPERATORS;
+const EQUALITY_BINARY_OPERATORS = ["==", "===", "!=", "!=="];
+exports.EQUALITY_BINARY_OPERATORS = EQUALITY_BINARY_OPERATORS;
+const COMPARISON_BINARY_OPERATORS = [...EQUALITY_BINARY_OPERATORS, "in", "instanceof"];
+exports.COMPARISON_BINARY_OPERATORS = COMPARISON_BINARY_OPERATORS;
+const BOOLEAN_BINARY_OPERATORS = [...COMPARISON_BINARY_OPERATORS, ...BOOLEAN_NUMBER_BINARY_OPERATORS];
+exports.BOOLEAN_BINARY_OPERATORS = BOOLEAN_BINARY_OPERATORS;
+const NUMBER_BINARY_OPERATORS = ["-", "/", "%", "*", "**", "&", "|", ">>", ">>>", "<<", "^"];
+exports.NUMBER_BINARY_OPERATORS = NUMBER_BINARY_OPERATORS;
+const BINARY_OPERATORS = ["+", ...NUMBER_BINARY_OPERATORS, ...BOOLEAN_BINARY_OPERATORS];
+exports.BINARY_OPERATORS = BINARY_OPERATORS;
+const ASSIGNMENT_OPERATORS = ["=", "+=", ...NUMBER_BINARY_OPERATORS.map(op => op + "="), ...LOGICAL_OPERATORS.map(op => op + "=")];
+exports.ASSIGNMENT_OPERATORS = ASSIGNMENT_OPERATORS;
+const BOOLEAN_UNARY_OPERATORS = ["delete", "!"];
+exports.BOOLEAN_UNARY_OPERATORS = BOOLEAN_UNARY_OPERATORS;
+const NUMBER_UNARY_OPERATORS = ["+", "-", "~"];
+exports.NUMBER_UNARY_OPERATORS = NUMBER_UNARY_OPERATORS;
+const STRING_UNARY_OPERATORS = ["typeof"];
+exports.STRING_UNARY_OPERATORS = STRING_UNARY_OPERATORS;
+const UNARY_OPERATORS = ["void", "throw", ...BOOLEAN_UNARY_OPERATORS, ...NUMBER_UNARY_OPERATORS, ...STRING_UNARY_OPERATORS];
+exports.UNARY_OPERATORS = UNARY_OPERATORS;
+const INHERIT_KEYS = {
+ optional: ["typeAnnotation", "typeParameters", "returnType"],
+ force: ["start", "loc", "end"]
+};
+exports.INHERIT_KEYS = INHERIT_KEYS;
+const BLOCK_SCOPED_SYMBOL = Symbol.for("var used to be block scoped");
+exports.BLOCK_SCOPED_SYMBOL = BLOCK_SCOPED_SYMBOL;
+const NOT_LOCAL_BINDING = Symbol.for("should not be considered a local binding");
+exports.NOT_LOCAL_BINDING = NOT_LOCAL_BINDING; \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/converters/Scope.js b/chromium/third_party/node/node_modules/@babel/types/lib/converters/Scope.js
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/converters/Scope.js
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/converters/ensureBlock.js b/chromium/third_party/node/node_modules/@babel/types/lib/converters/ensureBlock.js
new file mode 100644
index 00000000000..56fdf1fdb43
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/converters/ensureBlock.js
@@ -0,0 +1,12 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = ensureBlock;
+
+var _toBlock = require("./toBlock");
+
+function ensureBlock(node, key = "body") {
+ return node[key] = (0, _toBlock.default)(node[key], node);
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js b/chromium/third_party/node/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js
new file mode 100644
index 00000000000..379e5ffe099
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js
@@ -0,0 +1,75 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = gatherSequenceExpressions;
+
+var _getBindingIdentifiers = require("../retrievers/getBindingIdentifiers");
+
+var _generated = require("../validators/generated");
+
+var _generated2 = require("../builders/generated");
+
+var _cloneNode = require("../clone/cloneNode");
+
+function gatherSequenceExpressions(nodes, scope, declars) {
+ const exprs = [];
+ let ensureLastUndefined = true;
+
+ for (const node of nodes) {
+ if (!(0, _generated.isEmptyStatement)(node)) {
+ ensureLastUndefined = false;
+ }
+
+ if ((0, _generated.isExpression)(node)) {
+ exprs.push(node);
+ } else if ((0, _generated.isExpressionStatement)(node)) {
+ exprs.push(node.expression);
+ } else if ((0, _generated.isVariableDeclaration)(node)) {
+ if (node.kind !== "var") return;
+
+ for (const declar of node.declarations) {
+ const bindings = (0, _getBindingIdentifiers.default)(declar);
+
+ for (const key of Object.keys(bindings)) {
+ declars.push({
+ kind: node.kind,
+ id: (0, _cloneNode.default)(bindings[key])
+ });
+ }
+
+ if (declar.init) {
+ exprs.push((0, _generated2.assignmentExpression)("=", declar.id, declar.init));
+ }
+ }
+
+ ensureLastUndefined = true;
+ } else if ((0, _generated.isIfStatement)(node)) {
+ const consequent = node.consequent ? gatherSequenceExpressions([node.consequent], scope, declars) : scope.buildUndefinedNode();
+ const alternate = node.alternate ? gatherSequenceExpressions([node.alternate], scope, declars) : scope.buildUndefinedNode();
+ if (!consequent || !alternate) return;
+ exprs.push((0, _generated2.conditionalExpression)(node.test, consequent, alternate));
+ } else if ((0, _generated.isBlockStatement)(node)) {
+ const body = gatherSequenceExpressions(node.body, scope, declars);
+ if (!body) return;
+ exprs.push(body);
+ } else if ((0, _generated.isEmptyStatement)(node)) {
+ if (nodes.indexOf(node) === 0) {
+ ensureLastUndefined = true;
+ }
+ } else {
+ return;
+ }
+ }
+
+ if (ensureLastUndefined) {
+ exprs.push(scope.buildUndefinedNode());
+ }
+
+ if (exprs.length === 1) {
+ return exprs[0];
+ } else {
+ return (0, _generated2.sequenceExpression)(exprs);
+ }
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/converters/toBindingIdentifierName.js b/chromium/third_party/node/node_modules/@babel/types/lib/converters/toBindingIdentifierName.js
new file mode 100644
index 00000000000..6bbce6e5578
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/converters/toBindingIdentifierName.js
@@ -0,0 +1,14 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = toBindingIdentifierName;
+
+var _toIdentifier = require("./toIdentifier");
+
+function toBindingIdentifierName(name) {
+ name = (0, _toIdentifier.default)(name);
+ if (name === "eval" || name === "arguments") name = "_" + name;
+ return name;
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/converters/toBlock.js b/chromium/third_party/node/node_modules/@babel/types/lib/converters/toBlock.js
new file mode 100644
index 00000000000..19886833fa3
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/converters/toBlock.js
@@ -0,0 +1,34 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = toBlock;
+
+var _generated = require("../validators/generated");
+
+var _generated2 = require("../builders/generated");
+
+function toBlock(node, parent) {
+ if ((0, _generated.isBlockStatement)(node)) {
+ return node;
+ }
+
+ let blockNodes = [];
+
+ if ((0, _generated.isEmptyStatement)(node)) {
+ blockNodes = [];
+ } else {
+ if (!(0, _generated.isStatement)(node)) {
+ if ((0, _generated.isFunction)(parent)) {
+ node = (0, _generated2.returnStatement)(node);
+ } else {
+ node = (0, _generated2.expressionStatement)(node);
+ }
+ }
+
+ blockNodes = [node];
+ }
+
+ return (0, _generated2.blockStatement)(blockNodes);
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/converters/toComputedKey.js b/chromium/third_party/node/node_modules/@babel/types/lib/converters/toComputedKey.js
new file mode 100644
index 00000000000..31e6770f6f7
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/converters/toComputedKey.js
@@ -0,0 +1,15 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = toComputedKey;
+
+var _generated = require("../validators/generated");
+
+var _generated2 = require("../builders/generated");
+
+function toComputedKey(node, key = node.key || node.property) {
+ if (!node.computed && (0, _generated.isIdentifier)(key)) key = (0, _generated2.stringLiteral)(key.name);
+ return key;
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/converters/toExpression.js b/chromium/third_party/node/node_modules/@babel/types/lib/converters/toExpression.js
new file mode 100644
index 00000000000..2d944f0e98d
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/converters/toExpression.js
@@ -0,0 +1,33 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = void 0;
+
+var _generated = require("../validators/generated");
+
+var _default = toExpression;
+exports.default = _default;
+
+function toExpression(node) {
+ if ((0, _generated.isExpressionStatement)(node)) {
+ node = node.expression;
+ }
+
+ if ((0, _generated.isExpression)(node)) {
+ return node;
+ }
+
+ if ((0, _generated.isClass)(node)) {
+ node.type = "ClassExpression";
+ } else if ((0, _generated.isFunction)(node)) {
+ node.type = "FunctionExpression";
+ }
+
+ if (!(0, _generated.isExpression)(node)) {
+ throw new Error(`cannot turn ${node.type} to an expression`);
+ }
+
+ return node;
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/converters/toIdentifier.js b/chromium/third_party/node/node_modules/@babel/types/lib/converters/toIdentifier.js
new file mode 100644
index 00000000000..2fd4028d2db
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/converters/toIdentifier.js
@@ -0,0 +1,30 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = toIdentifier;
+
+var _isValidIdentifier = require("../validators/isValidIdentifier");
+
+var _helperValidatorIdentifier = require("@babel/helper-validator-identifier");
+
+function toIdentifier(input) {
+ input = input + "";
+ let name = "";
+
+ for (const c of input) {
+ name += (0, _helperValidatorIdentifier.isIdentifierChar)(c.codePointAt(0)) ? c : "-";
+ }
+
+ name = name.replace(/^[-0-9]+/, "");
+ name = name.replace(/[-\s]+(.)?/g, function (match, c) {
+ return c ? c.toUpperCase() : "";
+ });
+
+ if (!(0, _isValidIdentifier.default)(name)) {
+ name = `_${name}`;
+ }
+
+ return name || "_";
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/converters/toKeyAlias.js b/chromium/third_party/node/node_modules/@babel/types/lib/converters/toKeyAlias.js
new file mode 100644
index 00000000000..49ef4b8ad64
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/converters/toKeyAlias.js
@@ -0,0 +1,46 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = toKeyAlias;
+
+var _generated = require("../validators/generated");
+
+var _cloneNode = require("../clone/cloneNode");
+
+var _removePropertiesDeep = require("../modifications/removePropertiesDeep");
+
+function toKeyAlias(node, key = node.key) {
+ let alias;
+
+ if (node.kind === "method") {
+ return toKeyAlias.increment() + "";
+ } else if ((0, _generated.isIdentifier)(key)) {
+ alias = key.name;
+ } else if ((0, _generated.isStringLiteral)(key)) {
+ alias = JSON.stringify(key.value);
+ } else {
+ alias = JSON.stringify((0, _removePropertiesDeep.default)((0, _cloneNode.default)(key)));
+ }
+
+ if (node.computed) {
+ alias = `[${alias}]`;
+ }
+
+ if (node.static) {
+ alias = `static:${alias}`;
+ }
+
+ return alias;
+}
+
+toKeyAlias.uid = 0;
+
+toKeyAlias.increment = function () {
+ if (toKeyAlias.uid >= Number.MAX_SAFE_INTEGER) {
+ return toKeyAlias.uid = 0;
+ } else {
+ return toKeyAlias.uid++;
+ }
+}; \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/converters/toSequenceExpression.js b/chromium/third_party/node/node_modules/@babel/types/lib/converters/toSequenceExpression.js
new file mode 100644
index 00000000000..c3d3133ecf3
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/converters/toSequenceExpression.js
@@ -0,0 +1,21 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = toSequenceExpression;
+
+var _gatherSequenceExpressions = require("./gatherSequenceExpressions");
+
+function toSequenceExpression(nodes, scope) {
+ if (!(nodes != null && nodes.length)) return;
+ const declars = [];
+ const result = (0, _gatherSequenceExpressions.default)(nodes, scope, declars);
+ if (!result) return;
+
+ for (const declar of declars) {
+ scope.push(declar);
+ }
+
+ return result;
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/converters/toStatement.js b/chromium/third_party/node/node_modules/@babel/types/lib/converters/toStatement.js
new file mode 100644
index 00000000000..da020a61a01
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/converters/toStatement.js
@@ -0,0 +1,47 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = void 0;
+
+var _generated = require("../validators/generated");
+
+var _generated2 = require("../builders/generated");
+
+var _default = toStatement;
+exports.default = _default;
+
+function toStatement(node, ignore) {
+ if ((0, _generated.isStatement)(node)) {
+ return node;
+ }
+
+ let mustHaveId = false;
+ let newType;
+
+ if ((0, _generated.isClass)(node)) {
+ mustHaveId = true;
+ newType = "ClassDeclaration";
+ } else if ((0, _generated.isFunction)(node)) {
+ mustHaveId = true;
+ newType = "FunctionDeclaration";
+ } else if ((0, _generated.isAssignmentExpression)(node)) {
+ return (0, _generated2.expressionStatement)(node);
+ }
+
+ if (mustHaveId && !node.id) {
+ newType = false;
+ }
+
+ if (!newType) {
+ if (ignore) {
+ return false;
+ } else {
+ throw new Error(`cannot turn ${node.type} to a statement`);
+ }
+ }
+
+ node.type = newType;
+ return node;
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/converters/valueToNode.js b/chromium/third_party/node/node_modules/@babel/types/lib/converters/valueToNode.js
new file mode 100644
index 00000000000..b3e531b3551
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/converters/valueToNode.js
@@ -0,0 +1,99 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = void 0;
+
+var _isValidIdentifier = require("../validators/isValidIdentifier");
+
+var _generated = require("../builders/generated");
+
+var _default = valueToNode;
+exports.default = _default;
+const objectToString = Function.call.bind(Object.prototype.toString);
+
+function isRegExp(value) {
+ return objectToString(value) === "[object RegExp]";
+}
+
+function isPlainObject(value) {
+ if (typeof value !== "object" || value === null || Object.prototype.toString.call(value) !== "[object Object]") {
+ return false;
+ }
+
+ const proto = Object.getPrototypeOf(value);
+ return proto === null || Object.getPrototypeOf(proto) === null;
+}
+
+function valueToNode(value) {
+ if (value === undefined) {
+ return (0, _generated.identifier)("undefined");
+ }
+
+ if (value === true || value === false) {
+ return (0, _generated.booleanLiteral)(value);
+ }
+
+ if (value === null) {
+ return (0, _generated.nullLiteral)();
+ }
+
+ if (typeof value === "string") {
+ return (0, _generated.stringLiteral)(value);
+ }
+
+ if (typeof value === "number") {
+ let result;
+
+ if (Number.isFinite(value)) {
+ result = (0, _generated.numericLiteral)(Math.abs(value));
+ } else {
+ let numerator;
+
+ if (Number.isNaN(value)) {
+ numerator = (0, _generated.numericLiteral)(0);
+ } else {
+ numerator = (0, _generated.numericLiteral)(1);
+ }
+
+ result = (0, _generated.binaryExpression)("/", numerator, (0, _generated.numericLiteral)(0));
+ }
+
+ if (value < 0 || Object.is(value, -0)) {
+ result = (0, _generated.unaryExpression)("-", result);
+ }
+
+ return result;
+ }
+
+ if (isRegExp(value)) {
+ const pattern = value.source;
+ const flags = value.toString().match(/\/([a-z]+|)$/)[1];
+ return (0, _generated.regExpLiteral)(pattern, flags);
+ }
+
+ if (Array.isArray(value)) {
+ return (0, _generated.arrayExpression)(value.map(valueToNode));
+ }
+
+ if (isPlainObject(value)) {
+ const props = [];
+
+ for (const key of Object.keys(value)) {
+ let nodeKey;
+
+ if ((0, _isValidIdentifier.default)(key)) {
+ nodeKey = (0, _generated.identifier)(key);
+ } else {
+ nodeKey = (0, _generated.stringLiteral)(key);
+ }
+
+ props.push((0, _generated.objectProperty)(nodeKey, valueToNode(value[key])));
+ }
+
+ return (0, _generated.objectExpression)(props);
+ }
+
+ throw new Error("don't know how to turn this value into a node");
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/definitions/core.js b/chromium/third_party/node/node_modules/@babel/types/lib/definitions/core.js
new file mode 100644
index 00000000000..c90f6dfafa2
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/definitions/core.js
@@ -0,0 +1,1590 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.classMethodOrDeclareMethodCommon = exports.classMethodOrPropertyCommon = exports.patternLikeCommon = exports.functionDeclarationCommon = exports.functionTypeAnnotationCommon = exports.functionCommon = void 0;
+
+var _is = require("../validators/is");
+
+var _isValidIdentifier = require("../validators/isValidIdentifier");
+
+var _helperValidatorIdentifier = require("@babel/helper-validator-identifier");
+
+var _constants = require("../constants");
+
+var _utils = require("./utils");
+
+(0, _utils.default)("ArrayExpression", {
+ fields: {
+ elements: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeOrValueType)("null", "Expression", "SpreadElement"))),
+ default: !process.env.BABEL_TYPES_8_BREAKING ? [] : undefined
+ }
+ },
+ visitor: ["elements"],
+ aliases: ["Expression"]
+});
+(0, _utils.default)("AssignmentExpression", {
+ fields: {
+ operator: {
+ validate: function () {
+ if (!process.env.BABEL_TYPES_8_BREAKING) {
+ return (0, _utils.assertValueType)("string");
+ }
+
+ const identifier = (0, _utils.assertOneOf)(..._constants.ASSIGNMENT_OPERATORS);
+ const pattern = (0, _utils.assertOneOf)("=");
+ return function (node, key, val) {
+ const validator = (0, _is.default)("Pattern", node.left) ? pattern : identifier;
+ validator(node, key, val);
+ };
+ }()
+ },
+ left: {
+ validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("LVal") : (0, _utils.assertNodeType)("Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern")
+ },
+ right: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ },
+ builder: ["operator", "left", "right"],
+ visitor: ["left", "right"],
+ aliases: ["Expression"]
+});
+(0, _utils.default)("BinaryExpression", {
+ builder: ["operator", "left", "right"],
+ fields: {
+ operator: {
+ validate: (0, _utils.assertOneOf)(..._constants.BINARY_OPERATORS)
+ },
+ left: {
+ validate: function () {
+ const expression = (0, _utils.assertNodeType)("Expression");
+ const inOp = (0, _utils.assertNodeType)("Expression", "PrivateName");
+
+ const validator = function (node, key, val) {
+ const validator = node.operator === "in" ? inOp : expression;
+ validator(node, key, val);
+ };
+
+ validator.oneOfNodeTypes = ["Expression", "PrivateName"];
+ return validator;
+ }()
+ },
+ right: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ },
+ visitor: ["left", "right"],
+ aliases: ["Binary", "Expression"]
+});
+(0, _utils.default)("InterpreterDirective", {
+ builder: ["value"],
+ fields: {
+ value: {
+ validate: (0, _utils.assertValueType)("string")
+ }
+ }
+});
+(0, _utils.default)("Directive", {
+ visitor: ["value"],
+ fields: {
+ value: {
+ validate: (0, _utils.assertNodeType)("DirectiveLiteral")
+ }
+ }
+});
+(0, _utils.default)("DirectiveLiteral", {
+ builder: ["value"],
+ fields: {
+ value: {
+ validate: (0, _utils.assertValueType)("string")
+ }
+ }
+});
+(0, _utils.default)("BlockStatement", {
+ builder: ["body", "directives"],
+ visitor: ["directives", "body"],
+ fields: {
+ directives: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Directive"))),
+ default: []
+ },
+ body: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Statement")))
+ }
+ },
+ aliases: ["Scopable", "BlockParent", "Block", "Statement"]
+});
+(0, _utils.default)("BreakStatement", {
+ visitor: ["label"],
+ fields: {
+ label: {
+ validate: (0, _utils.assertNodeType)("Identifier"),
+ optional: true
+ }
+ },
+ aliases: ["Statement", "Terminatorless", "CompletionStatement"]
+});
+(0, _utils.default)("CallExpression", {
+ visitor: ["callee", "arguments", "typeParameters", "typeArguments"],
+ builder: ["callee", "arguments"],
+ aliases: ["Expression"],
+ fields: Object.assign({
+ callee: {
+ validate: (0, _utils.assertNodeType)("Expression", "V8IntrinsicIdentifier")
+ },
+ arguments: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression", "SpreadElement", "JSXNamespacedName", "ArgumentPlaceholder")))
+ }
+ }, !process.env.BABEL_TYPES_8_BREAKING ? {
+ optional: {
+ validate: (0, _utils.assertOneOf)(true, false),
+ optional: true
+ }
+ } : {}, {
+ typeArguments: {
+ validate: (0, _utils.assertNodeType)("TypeParameterInstantiation"),
+ optional: true
+ },
+ typeParameters: {
+ validate: (0, _utils.assertNodeType)("TSTypeParameterInstantiation"),
+ optional: true
+ }
+ })
+});
+(0, _utils.default)("CatchClause", {
+ visitor: ["param", "body"],
+ fields: {
+ param: {
+ validate: (0, _utils.assertNodeType)("Identifier", "ArrayPattern", "ObjectPattern"),
+ optional: true
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("BlockStatement")
+ }
+ },
+ aliases: ["Scopable", "BlockParent"]
+});
+(0, _utils.default)("ConditionalExpression", {
+ visitor: ["test", "consequent", "alternate"],
+ fields: {
+ test: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ consequent: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ alternate: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ },
+ aliases: ["Expression", "Conditional"]
+});
+(0, _utils.default)("ContinueStatement", {
+ visitor: ["label"],
+ fields: {
+ label: {
+ validate: (0, _utils.assertNodeType)("Identifier"),
+ optional: true
+ }
+ },
+ aliases: ["Statement", "Terminatorless", "CompletionStatement"]
+});
+(0, _utils.default)("DebuggerStatement", {
+ aliases: ["Statement"]
+});
+(0, _utils.default)("DoWhileStatement", {
+ visitor: ["test", "body"],
+ fields: {
+ test: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("Statement")
+ }
+ },
+ aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"]
+});
+(0, _utils.default)("EmptyStatement", {
+ aliases: ["Statement"]
+});
+(0, _utils.default)("ExpressionStatement", {
+ visitor: ["expression"],
+ fields: {
+ expression: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ },
+ aliases: ["Statement", "ExpressionWrapper"]
+});
+(0, _utils.default)("File", {
+ builder: ["program", "comments", "tokens"],
+ visitor: ["program"],
+ fields: {
+ program: {
+ validate: (0, _utils.assertNodeType)("Program")
+ },
+ comments: {
+ validate: !process.env.BABEL_TYPES_8_BREAKING ? Object.assign(() => {}, {
+ each: {
+ oneOfNodeTypes: ["CommentBlock", "CommentLine"]
+ }
+ }) : (0, _utils.assertEach)((0, _utils.assertNodeType)("CommentBlock", "CommentLine")),
+ optional: true
+ },
+ tokens: {
+ validate: (0, _utils.assertEach)(Object.assign(() => {}, {
+ type: "any"
+ })),
+ optional: true
+ }
+ }
+});
+(0, _utils.default)("ForInStatement", {
+ visitor: ["left", "right", "body"],
+ aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"],
+ fields: {
+ left: {
+ validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("VariableDeclaration", "LVal") : (0, _utils.assertNodeType)("VariableDeclaration", "Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern")
+ },
+ right: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("Statement")
+ }
+ }
+});
+(0, _utils.default)("ForStatement", {
+ visitor: ["init", "test", "update", "body"],
+ aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop"],
+ fields: {
+ init: {
+ validate: (0, _utils.assertNodeType)("VariableDeclaration", "Expression"),
+ optional: true
+ },
+ test: {
+ validate: (0, _utils.assertNodeType)("Expression"),
+ optional: true
+ },
+ update: {
+ validate: (0, _utils.assertNodeType)("Expression"),
+ optional: true
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("Statement")
+ }
+ }
+});
+const functionCommon = {
+ params: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Identifier", "Pattern", "RestElement")))
+ },
+ generator: {
+ default: false
+ },
+ async: {
+ default: false
+ }
+};
+exports.functionCommon = functionCommon;
+const functionTypeAnnotationCommon = {
+ returnType: {
+ validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
+ optional: true
+ },
+ typeParameters: {
+ validate: (0, _utils.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"),
+ optional: true
+ }
+};
+exports.functionTypeAnnotationCommon = functionTypeAnnotationCommon;
+const functionDeclarationCommon = Object.assign({}, functionCommon, {
+ declare: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ },
+ id: {
+ validate: (0, _utils.assertNodeType)("Identifier"),
+ optional: true
+ }
+});
+exports.functionDeclarationCommon = functionDeclarationCommon;
+(0, _utils.default)("FunctionDeclaration", {
+ builder: ["id", "params", "body", "generator", "async"],
+ visitor: ["id", "params", "body", "returnType", "typeParameters"],
+ fields: Object.assign({}, functionDeclarationCommon, functionTypeAnnotationCommon, {
+ body: {
+ validate: (0, _utils.assertNodeType)("BlockStatement")
+ }
+ }),
+ aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Statement", "Pureish", "Declaration"],
+ validate: function () {
+ if (!process.env.BABEL_TYPES_8_BREAKING) return () => {};
+ const identifier = (0, _utils.assertNodeType)("Identifier");
+ return function (parent, key, node) {
+ if (!(0, _is.default)("ExportDefaultDeclaration", parent)) {
+ identifier(node, "id", node.id);
+ }
+ };
+ }()
+});
+(0, _utils.default)("FunctionExpression", {
+ inherits: "FunctionDeclaration",
+ aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"],
+ fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, {
+ id: {
+ validate: (0, _utils.assertNodeType)("Identifier"),
+ optional: true
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("BlockStatement")
+ }
+ })
+});
+const patternLikeCommon = {
+ typeAnnotation: {
+ validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
+ optional: true
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator")))
+ }
+};
+exports.patternLikeCommon = patternLikeCommon;
+(0, _utils.default)("Identifier", {
+ builder: ["name"],
+ visitor: ["typeAnnotation", "decorators"],
+ aliases: ["Expression", "PatternLike", "LVal", "TSEntityName"],
+ fields: Object.assign({}, patternLikeCommon, {
+ name: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), Object.assign(function (node, key, val) {
+ if (!process.env.BABEL_TYPES_8_BREAKING) return;
+
+ if (!(0, _isValidIdentifier.default)(val, false)) {
+ throw new TypeError(`"${val}" is not a valid identifier name`);
+ }
+ }, {
+ type: "string"
+ }))
+ },
+ optional: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ }
+ }),
+
+ validate(parent, key, node) {
+ if (!process.env.BABEL_TYPES_8_BREAKING) return;
+ const match = /\.(\w+)$/.exec(key);
+ if (!match) return;
+ const [, parentKey] = match;
+ const nonComp = {
+ computed: false
+ };
+
+ if (parentKey === "property") {
+ if ((0, _is.default)("MemberExpression", parent, nonComp)) return;
+ if ((0, _is.default)("OptionalMemberExpression", parent, nonComp)) return;
+ } else if (parentKey === "key") {
+ if ((0, _is.default)("Property", parent, nonComp)) return;
+ if ((0, _is.default)("Method", parent, nonComp)) return;
+ } else if (parentKey === "exported") {
+ if ((0, _is.default)("ExportSpecifier", parent)) return;
+ } else if (parentKey === "imported") {
+ if ((0, _is.default)("ImportSpecifier", parent, {
+ imported: node
+ })) return;
+ } else if (parentKey === "meta") {
+ if ((0, _is.default)("MetaProperty", parent, {
+ meta: node
+ })) return;
+ }
+
+ if (((0, _helperValidatorIdentifier.isKeyword)(node.name) || (0, _helperValidatorIdentifier.isReservedWord)(node.name, false)) && node.name !== "this") {
+ throw new TypeError(`"${node.name}" is not a valid identifier`);
+ }
+ }
+
+});
+(0, _utils.default)("IfStatement", {
+ visitor: ["test", "consequent", "alternate"],
+ aliases: ["Statement", "Conditional"],
+ fields: {
+ test: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ consequent: {
+ validate: (0, _utils.assertNodeType)("Statement")
+ },
+ alternate: {
+ optional: true,
+ validate: (0, _utils.assertNodeType)("Statement")
+ }
+ }
+});
+(0, _utils.default)("LabeledStatement", {
+ visitor: ["label", "body"],
+ aliases: ["Statement"],
+ fields: {
+ label: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("Statement")
+ }
+ }
+});
+(0, _utils.default)("StringLiteral", {
+ builder: ["value"],
+ fields: {
+ value: {
+ validate: (0, _utils.assertValueType)("string")
+ }
+ },
+ aliases: ["Expression", "Pureish", "Literal", "Immutable"]
+});
+(0, _utils.default)("NumericLiteral", {
+ builder: ["value"],
+ deprecatedAlias: "NumberLiteral",
+ fields: {
+ value: {
+ validate: (0, _utils.assertValueType)("number")
+ }
+ },
+ aliases: ["Expression", "Pureish", "Literal", "Immutable"]
+});
+(0, _utils.default)("NullLiteral", {
+ aliases: ["Expression", "Pureish", "Literal", "Immutable"]
+});
+(0, _utils.default)("BooleanLiteral", {
+ builder: ["value"],
+ fields: {
+ value: {
+ validate: (0, _utils.assertValueType)("boolean")
+ }
+ },
+ aliases: ["Expression", "Pureish", "Literal", "Immutable"]
+});
+(0, _utils.default)("RegExpLiteral", {
+ builder: ["pattern", "flags"],
+ deprecatedAlias: "RegexLiteral",
+ aliases: ["Expression", "Pureish", "Literal"],
+ fields: {
+ pattern: {
+ validate: (0, _utils.assertValueType)("string")
+ },
+ flags: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), Object.assign(function (node, key, val) {
+ if (!process.env.BABEL_TYPES_8_BREAKING) return;
+ const invalid = /[^gimsuy]/.exec(val);
+
+ if (invalid) {
+ throw new TypeError(`"${invalid[0]}" is not a valid RegExp flag`);
+ }
+ }, {
+ type: "string"
+ })),
+ default: ""
+ }
+ }
+});
+(0, _utils.default)("LogicalExpression", {
+ builder: ["operator", "left", "right"],
+ visitor: ["left", "right"],
+ aliases: ["Binary", "Expression"],
+ fields: {
+ operator: {
+ validate: (0, _utils.assertOneOf)(..._constants.LOGICAL_OPERATORS)
+ },
+ left: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ right: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+});
+(0, _utils.default)("MemberExpression", {
+ builder: ["object", "property", "computed", ...(!process.env.BABEL_TYPES_8_BREAKING ? ["optional"] : [])],
+ visitor: ["object", "property"],
+ aliases: ["Expression", "LVal"],
+ fields: Object.assign({
+ object: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ property: {
+ validate: function () {
+ const normal = (0, _utils.assertNodeType)("Identifier", "PrivateName");
+ const computed = (0, _utils.assertNodeType)("Expression");
+
+ const validator = function (node, key, val) {
+ const validator = node.computed ? computed : normal;
+ validator(node, key, val);
+ };
+
+ validator.oneOfNodeTypes = ["Expression", "Identifier", "PrivateName"];
+ return validator;
+ }()
+ },
+ computed: {
+ default: false
+ }
+ }, !process.env.BABEL_TYPES_8_BREAKING ? {
+ optional: {
+ validate: (0, _utils.assertOneOf)(true, false),
+ optional: true
+ }
+ } : {})
+});
+(0, _utils.default)("NewExpression", {
+ inherits: "CallExpression"
+});
+(0, _utils.default)("Program", {
+ visitor: ["directives", "body"],
+ builder: ["body", "directives", "sourceType", "interpreter"],
+ fields: {
+ sourceFile: {
+ validate: (0, _utils.assertValueType)("string")
+ },
+ sourceType: {
+ validate: (0, _utils.assertOneOf)("script", "module"),
+ default: "script"
+ },
+ interpreter: {
+ validate: (0, _utils.assertNodeType)("InterpreterDirective"),
+ default: null,
+ optional: true
+ },
+ directives: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Directive"))),
+ default: []
+ },
+ body: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Statement")))
+ }
+ },
+ aliases: ["Scopable", "BlockParent", "Block"]
+});
+(0, _utils.default)("ObjectExpression", {
+ visitor: ["properties"],
+ aliases: ["Expression"],
+ fields: {
+ properties: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ObjectMethod", "ObjectProperty", "SpreadElement")))
+ }
+ }
+});
+(0, _utils.default)("ObjectMethod", {
+ builder: ["kind", "key", "params", "body", "computed", "generator", "async"],
+ fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, {
+ kind: Object.assign({
+ validate: (0, _utils.assertOneOf)("method", "get", "set")
+ }, !process.env.BABEL_TYPES_8_BREAKING ? {
+ default: "method"
+ } : {}),
+ computed: {
+ default: false
+ },
+ key: {
+ validate: function () {
+ const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral");
+ const computed = (0, _utils.assertNodeType)("Expression");
+
+ const validator = function (node, key, val) {
+ const validator = node.computed ? computed : normal;
+ validator(node, key, val);
+ };
+
+ validator.oneOfNodeTypes = ["Expression", "Identifier", "StringLiteral", "NumericLiteral"];
+ return validator;
+ }()
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
+ optional: true
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("BlockStatement")
+ }
+ }),
+ visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
+ aliases: ["UserWhitespacable", "Function", "Scopable", "BlockParent", "FunctionParent", "Method", "ObjectMember"]
+});
+(0, _utils.default)("ObjectProperty", {
+ builder: ["key", "value", "computed", "shorthand", ...(!process.env.BABEL_TYPES_8_BREAKING ? ["decorators"] : [])],
+ fields: {
+ computed: {
+ default: false
+ },
+ key: {
+ validate: function () {
+ const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral");
+ const computed = (0, _utils.assertNodeType)("Expression");
+
+ const validator = function (node, key, val) {
+ const validator = node.computed ? computed : normal;
+ validator(node, key, val);
+ };
+
+ validator.oneOfNodeTypes = ["Expression", "Identifier", "StringLiteral", "NumericLiteral"];
+ return validator;
+ }()
+ },
+ value: {
+ validate: (0, _utils.assertNodeType)("Expression", "PatternLike")
+ },
+ shorthand: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("boolean"), Object.assign(function (node, key, val) {
+ if (!process.env.BABEL_TYPES_8_BREAKING) return;
+
+ if (val && node.computed) {
+ throw new TypeError("Property shorthand of ObjectProperty cannot be true if computed is true");
+ }
+ }, {
+ type: "boolean"
+ }), function (node, key, val) {
+ if (!process.env.BABEL_TYPES_8_BREAKING) return;
+
+ if (val && !(0, _is.default)("Identifier", node.key)) {
+ throw new TypeError("Property shorthand of ObjectProperty cannot be true if key is not an Identifier");
+ }
+ }),
+ default: false
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
+ optional: true
+ }
+ },
+ visitor: ["key", "value", "decorators"],
+ aliases: ["UserWhitespacable", "Property", "ObjectMember"],
+ validate: function () {
+ const pattern = (0, _utils.assertNodeType)("Identifier", "Pattern");
+ const expression = (0, _utils.assertNodeType)("Expression");
+ return function (parent, key, node) {
+ if (!process.env.BABEL_TYPES_8_BREAKING) return;
+ const validator = (0, _is.default)("ObjectPattern", parent) ? pattern : expression;
+ validator(node, "value", node.value);
+ };
+ }()
+});
+(0, _utils.default)("RestElement", {
+ visitor: ["argument", "typeAnnotation"],
+ builder: ["argument"],
+ aliases: ["LVal", "PatternLike"],
+ deprecatedAlias: "RestProperty",
+ fields: Object.assign({}, patternLikeCommon, {
+ argument: {
+ validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("LVal") : (0, _utils.assertNodeType)("Identifier", "ArrayPattern", "ObjectPattern", "MemberExpression")
+ },
+ optional: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ }
+ }),
+
+ validate(parent, key) {
+ if (!process.env.BABEL_TYPES_8_BREAKING) return;
+ const match = /(\w+)\[(\d+)\]/.exec(key);
+ if (!match) throw new Error("Internal Babel error: malformed key.");
+ const [, listKey, index] = match;
+
+ if (parent[listKey].length > index + 1) {
+ throw new TypeError(`RestElement must be last element of ${listKey}`);
+ }
+ }
+
+});
+(0, _utils.default)("ReturnStatement", {
+ visitor: ["argument"],
+ aliases: ["Statement", "Terminatorless", "CompletionStatement"],
+ fields: {
+ argument: {
+ validate: (0, _utils.assertNodeType)("Expression"),
+ optional: true
+ }
+ }
+});
+(0, _utils.default)("SequenceExpression", {
+ visitor: ["expressions"],
+ fields: {
+ expressions: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression")))
+ }
+ },
+ aliases: ["Expression"]
+});
+(0, _utils.default)("ParenthesizedExpression", {
+ visitor: ["expression"],
+ aliases: ["Expression", "ExpressionWrapper"],
+ fields: {
+ expression: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+});
+(0, _utils.default)("SwitchCase", {
+ visitor: ["test", "consequent"],
+ fields: {
+ test: {
+ validate: (0, _utils.assertNodeType)("Expression"),
+ optional: true
+ },
+ consequent: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Statement")))
+ }
+ }
+});
+(0, _utils.default)("SwitchStatement", {
+ visitor: ["discriminant", "cases"],
+ aliases: ["Statement", "BlockParent", "Scopable"],
+ fields: {
+ discriminant: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ cases: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("SwitchCase")))
+ }
+ }
+});
+(0, _utils.default)("ThisExpression", {
+ aliases: ["Expression"]
+});
+(0, _utils.default)("ThrowStatement", {
+ visitor: ["argument"],
+ aliases: ["Statement", "Terminatorless", "CompletionStatement"],
+ fields: {
+ argument: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+});
+(0, _utils.default)("TryStatement", {
+ visitor: ["block", "handler", "finalizer"],
+ aliases: ["Statement"],
+ fields: {
+ block: {
+ validate: (0, _utils.chain)((0, _utils.assertNodeType)("BlockStatement"), Object.assign(function (node) {
+ if (!process.env.BABEL_TYPES_8_BREAKING) return;
+
+ if (!node.handler && !node.finalizer) {
+ throw new TypeError("TryStatement expects either a handler or finalizer, or both");
+ }
+ }, {
+ oneOfNodeTypes: ["BlockStatement"]
+ }))
+ },
+ handler: {
+ optional: true,
+ validate: (0, _utils.assertNodeType)("CatchClause")
+ },
+ finalizer: {
+ optional: true,
+ validate: (0, _utils.assertNodeType)("BlockStatement")
+ }
+ }
+});
+(0, _utils.default)("UnaryExpression", {
+ builder: ["operator", "argument", "prefix"],
+ fields: {
+ prefix: {
+ default: true
+ },
+ argument: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ operator: {
+ validate: (0, _utils.assertOneOf)(..._constants.UNARY_OPERATORS)
+ }
+ },
+ visitor: ["argument"],
+ aliases: ["UnaryLike", "Expression"]
+});
+(0, _utils.default)("UpdateExpression", {
+ builder: ["operator", "argument", "prefix"],
+ fields: {
+ prefix: {
+ default: false
+ },
+ argument: {
+ validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("Expression") : (0, _utils.assertNodeType)("Identifier", "MemberExpression")
+ },
+ operator: {
+ validate: (0, _utils.assertOneOf)(..._constants.UPDATE_OPERATORS)
+ }
+ },
+ visitor: ["argument"],
+ aliases: ["Expression"]
+});
+(0, _utils.default)("VariableDeclaration", {
+ builder: ["kind", "declarations"],
+ visitor: ["declarations"],
+ aliases: ["Statement", "Declaration"],
+ fields: {
+ declare: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ },
+ kind: {
+ validate: (0, _utils.assertOneOf)("var", "let", "const")
+ },
+ declarations: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("VariableDeclarator")))
+ }
+ },
+
+ validate(parent, key, node) {
+ if (!process.env.BABEL_TYPES_8_BREAKING) return;
+ if (!(0, _is.default)("ForXStatement", parent, {
+ left: node
+ })) return;
+
+ if (node.declarations.length !== 1) {
+ throw new TypeError(`Exactly one VariableDeclarator is required in the VariableDeclaration of a ${parent.type}`);
+ }
+ }
+
+});
+(0, _utils.default)("VariableDeclarator", {
+ visitor: ["id", "init"],
+ fields: {
+ id: {
+ validate: function () {
+ if (!process.env.BABEL_TYPES_8_BREAKING) {
+ return (0, _utils.assertNodeType)("LVal");
+ }
+
+ const normal = (0, _utils.assertNodeType)("Identifier", "ArrayPattern", "ObjectPattern");
+ const without = (0, _utils.assertNodeType)("Identifier");
+ return function (node, key, val) {
+ const validator = node.init ? normal : without;
+ validator(node, key, val);
+ };
+ }()
+ },
+ definite: {
+ optional: true,
+ validate: (0, _utils.assertValueType)("boolean")
+ },
+ init: {
+ optional: true,
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+});
+(0, _utils.default)("WhileStatement", {
+ visitor: ["test", "body"],
+ aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"],
+ fields: {
+ test: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("Statement")
+ }
+ }
+});
+(0, _utils.default)("WithStatement", {
+ visitor: ["object", "body"],
+ aliases: ["Statement"],
+ fields: {
+ object: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("Statement")
+ }
+ }
+});
+(0, _utils.default)("AssignmentPattern", {
+ visitor: ["left", "right", "decorators"],
+ builder: ["left", "right"],
+ aliases: ["Pattern", "PatternLike", "LVal"],
+ fields: Object.assign({}, patternLikeCommon, {
+ left: {
+ validate: (0, _utils.assertNodeType)("Identifier", "ObjectPattern", "ArrayPattern", "MemberExpression")
+ },
+ right: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
+ optional: true
+ }
+ })
+});
+(0, _utils.default)("ArrayPattern", {
+ visitor: ["elements", "typeAnnotation"],
+ builder: ["elements"],
+ aliases: ["Pattern", "PatternLike", "LVal"],
+ fields: Object.assign({}, patternLikeCommon, {
+ elements: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeOrValueType)("null", "PatternLike")))
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
+ optional: true
+ },
+ optional: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ }
+ })
+});
+(0, _utils.default)("ArrowFunctionExpression", {
+ builder: ["params", "body", "async"],
+ visitor: ["params", "body", "returnType", "typeParameters"],
+ aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"],
+ fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, {
+ expression: {
+ validate: (0, _utils.assertValueType)("boolean")
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("BlockStatement", "Expression")
+ }
+ })
+});
+(0, _utils.default)("ClassBody", {
+ visitor: ["body"],
+ fields: {
+ body: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ClassMethod", "ClassPrivateMethod", "ClassProperty", "ClassPrivateProperty", "TSDeclareMethod", "TSIndexSignature")))
+ }
+ }
+});
+(0, _utils.default)("ClassExpression", {
+ builder: ["id", "superClass", "body", "decorators"],
+ visitor: ["id", "body", "superClass", "mixins", "typeParameters", "superTypeParameters", "implements", "decorators"],
+ aliases: ["Scopable", "Class", "Expression"],
+ fields: {
+ id: {
+ validate: (0, _utils.assertNodeType)("Identifier"),
+ optional: true
+ },
+ typeParameters: {
+ validate: (0, _utils.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"),
+ optional: true
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("ClassBody")
+ },
+ superClass: {
+ optional: true,
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ superTypeParameters: {
+ validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
+ optional: true
+ },
+ implements: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSExpressionWithTypeArguments", "ClassImplements"))),
+ optional: true
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
+ optional: true
+ },
+ mixins: {
+ validate: (0, _utils.assertNodeType)("InterfaceExtends"),
+ optional: true
+ }
+ }
+});
+(0, _utils.default)("ClassDeclaration", {
+ inherits: "ClassExpression",
+ aliases: ["Scopable", "Class", "Statement", "Declaration"],
+ fields: {
+ id: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ },
+ typeParameters: {
+ validate: (0, _utils.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"),
+ optional: true
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("ClassBody")
+ },
+ superClass: {
+ optional: true,
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ superTypeParameters: {
+ validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
+ optional: true
+ },
+ implements: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSExpressionWithTypeArguments", "ClassImplements"))),
+ optional: true
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
+ optional: true
+ },
+ mixins: {
+ validate: (0, _utils.assertNodeType)("InterfaceExtends"),
+ optional: true
+ },
+ declare: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ },
+ abstract: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ }
+ },
+ validate: function () {
+ const identifier = (0, _utils.assertNodeType)("Identifier");
+ return function (parent, key, node) {
+ if (!process.env.BABEL_TYPES_8_BREAKING) return;
+
+ if (!(0, _is.default)("ExportDefaultDeclaration", parent)) {
+ identifier(node, "id", node.id);
+ }
+ };
+ }()
+});
+(0, _utils.default)("ExportAllDeclaration", {
+ visitor: ["source"],
+ aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
+ fields: {
+ source: {
+ validate: (0, _utils.assertNodeType)("StringLiteral")
+ },
+ exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("type", "value")),
+ assertions: {
+ optional: true,
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ImportAttribute")))
+ }
+ }
+});
+(0, _utils.default)("ExportDefaultDeclaration", {
+ visitor: ["declaration"],
+ aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
+ fields: {
+ declaration: {
+ validate: (0, _utils.assertNodeType)("FunctionDeclaration", "TSDeclareFunction", "ClassDeclaration", "Expression")
+ },
+ exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("value"))
+ }
+});
+(0, _utils.default)("ExportNamedDeclaration", {
+ visitor: ["declaration", "specifiers", "source"],
+ aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
+ fields: {
+ declaration: {
+ optional: true,
+ validate: (0, _utils.chain)((0, _utils.assertNodeType)("Declaration"), Object.assign(function (node, key, val) {
+ if (!process.env.BABEL_TYPES_8_BREAKING) return;
+
+ if (val && node.specifiers.length) {
+ throw new TypeError("Only declaration or specifiers is allowed on ExportNamedDeclaration");
+ }
+ }, {
+ oneOfNodeTypes: ["Declaration"]
+ }), function (node, key, val) {
+ if (!process.env.BABEL_TYPES_8_BREAKING) return;
+
+ if (val && node.source) {
+ throw new TypeError("Cannot export a declaration from a source");
+ }
+ })
+ },
+ assertions: {
+ optional: true,
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ImportAttribute")))
+ },
+ specifiers: {
+ default: [],
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)(function () {
+ const sourced = (0, _utils.assertNodeType)("ExportSpecifier", "ExportDefaultSpecifier", "ExportNamespaceSpecifier");
+ const sourceless = (0, _utils.assertNodeType)("ExportSpecifier");
+ if (!process.env.BABEL_TYPES_8_BREAKING) return sourced;
+ return function (node, key, val) {
+ const validator = node.source ? sourced : sourceless;
+ validator(node, key, val);
+ };
+ }()))
+ },
+ source: {
+ validate: (0, _utils.assertNodeType)("StringLiteral"),
+ optional: true
+ },
+ exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("type", "value"))
+ }
+});
+(0, _utils.default)("ExportSpecifier", {
+ visitor: ["local", "exported"],
+ aliases: ["ModuleSpecifier"],
+ fields: {
+ local: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ },
+ exported: {
+ validate: (0, _utils.assertNodeType)("Identifier", "StringLiteral")
+ }
+ }
+});
+(0, _utils.default)("ForOfStatement", {
+ visitor: ["left", "right", "body"],
+ builder: ["left", "right", "body", "await"],
+ aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"],
+ fields: {
+ left: {
+ validate: function () {
+ if (!process.env.BABEL_TYPES_8_BREAKING) {
+ return (0, _utils.assertNodeType)("VariableDeclaration", "LVal");
+ }
+
+ const declaration = (0, _utils.assertNodeType)("VariableDeclaration");
+ const lval = (0, _utils.assertNodeType)("Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern");
+ return function (node, key, val) {
+ if ((0, _is.default)("VariableDeclaration", val)) {
+ declaration(node, key, val);
+ } else {
+ lval(node, key, val);
+ }
+ };
+ }()
+ },
+ right: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("Statement")
+ },
+ await: {
+ default: false
+ }
+ }
+});
+(0, _utils.default)("ImportDeclaration", {
+ visitor: ["specifiers", "source"],
+ aliases: ["Statement", "Declaration", "ModuleDeclaration"],
+ fields: {
+ assertions: {
+ optional: true,
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ImportAttribute")))
+ },
+ specifiers: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ImportSpecifier", "ImportDefaultSpecifier", "ImportNamespaceSpecifier")))
+ },
+ source: {
+ validate: (0, _utils.assertNodeType)("StringLiteral")
+ },
+ importKind: {
+ validate: (0, _utils.assertOneOf)("type", "typeof", "value"),
+ optional: true
+ }
+ }
+});
+(0, _utils.default)("ImportDefaultSpecifier", {
+ visitor: ["local"],
+ aliases: ["ModuleSpecifier"],
+ fields: {
+ local: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ }
+ }
+});
+(0, _utils.default)("ImportNamespaceSpecifier", {
+ visitor: ["local"],
+ aliases: ["ModuleSpecifier"],
+ fields: {
+ local: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ }
+ }
+});
+(0, _utils.default)("ImportSpecifier", {
+ visitor: ["local", "imported"],
+ aliases: ["ModuleSpecifier"],
+ fields: {
+ local: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ },
+ imported: {
+ validate: (0, _utils.assertNodeType)("Identifier", "StringLiteral")
+ },
+ importKind: {
+ validate: (0, _utils.assertOneOf)("type", "typeof"),
+ optional: true
+ }
+ }
+});
+(0, _utils.default)("MetaProperty", {
+ visitor: ["meta", "property"],
+ aliases: ["Expression"],
+ fields: {
+ meta: {
+ validate: (0, _utils.chain)((0, _utils.assertNodeType)("Identifier"), Object.assign(function (node, key, val) {
+ if (!process.env.BABEL_TYPES_8_BREAKING) return;
+ let property;
+
+ switch (val.name) {
+ case "function":
+ property = "sent";
+ break;
+
+ case "new":
+ property = "target";
+ break;
+
+ case "import":
+ property = "meta";
+ break;
+ }
+
+ if (!(0, _is.default)("Identifier", node.property, {
+ name: property
+ })) {
+ throw new TypeError("Unrecognised MetaProperty");
+ }
+ }, {
+ oneOfNodeTypes: ["Identifier"]
+ }))
+ },
+ property: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ }
+ }
+});
+const classMethodOrPropertyCommon = {
+ abstract: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ },
+ accessibility: {
+ validate: (0, _utils.assertOneOf)("public", "private", "protected"),
+ optional: true
+ },
+ static: {
+ default: false
+ },
+ override: {
+ default: false
+ },
+ computed: {
+ default: false
+ },
+ optional: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ },
+ key: {
+ validate: (0, _utils.chain)(function () {
+ const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral");
+ const computed = (0, _utils.assertNodeType)("Expression");
+ return function (node, key, val) {
+ const validator = node.computed ? computed : normal;
+ validator(node, key, val);
+ };
+ }(), (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral", "Expression"))
+ }
+};
+exports.classMethodOrPropertyCommon = classMethodOrPropertyCommon;
+const classMethodOrDeclareMethodCommon = Object.assign({}, functionCommon, classMethodOrPropertyCommon, {
+ params: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Identifier", "Pattern", "RestElement", "TSParameterProperty")))
+ },
+ kind: {
+ validate: (0, _utils.assertOneOf)("get", "set", "method", "constructor"),
+ default: "method"
+ },
+ access: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), (0, _utils.assertOneOf)("public", "private", "protected")),
+ optional: true
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
+ optional: true
+ }
+});
+exports.classMethodOrDeclareMethodCommon = classMethodOrDeclareMethodCommon;
+(0, _utils.default)("ClassMethod", {
+ aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method"],
+ builder: ["kind", "key", "params", "body", "computed", "static", "generator", "async"],
+ visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
+ fields: Object.assign({}, classMethodOrDeclareMethodCommon, functionTypeAnnotationCommon, {
+ body: {
+ validate: (0, _utils.assertNodeType)("BlockStatement")
+ }
+ })
+});
+(0, _utils.default)("ObjectPattern", {
+ visitor: ["properties", "typeAnnotation", "decorators"],
+ builder: ["properties"],
+ aliases: ["Pattern", "PatternLike", "LVal"],
+ fields: Object.assign({}, patternLikeCommon, {
+ properties: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("RestElement", "ObjectProperty")))
+ }
+ })
+});
+(0, _utils.default)("SpreadElement", {
+ visitor: ["argument"],
+ aliases: ["UnaryLike"],
+ deprecatedAlias: "SpreadProperty",
+ fields: {
+ argument: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+});
+(0, _utils.default)("Super", {
+ aliases: ["Expression"]
+});
+(0, _utils.default)("TaggedTemplateExpression", {
+ visitor: ["tag", "quasi", "typeParameters"],
+ builder: ["tag", "quasi"],
+ aliases: ["Expression"],
+ fields: {
+ tag: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ quasi: {
+ validate: (0, _utils.assertNodeType)("TemplateLiteral")
+ },
+ typeParameters: {
+ validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
+ optional: true
+ }
+ }
+});
+(0, _utils.default)("TemplateElement", {
+ builder: ["value", "tail"],
+ fields: {
+ value: {
+ validate: (0, _utils.assertShape)({
+ raw: {
+ validate: (0, _utils.assertValueType)("string")
+ },
+ cooked: {
+ validate: (0, _utils.assertValueType)("string"),
+ optional: true
+ }
+ })
+ },
+ tail: {
+ default: false
+ }
+ }
+});
+(0, _utils.default)("TemplateLiteral", {
+ visitor: ["quasis", "expressions"],
+ aliases: ["Expression", "Literal"],
+ fields: {
+ quasis: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TemplateElement")))
+ },
+ expressions: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression", "TSType")), function (node, key, val) {
+ if (node.quasis.length !== val.length + 1) {
+ throw new TypeError(`Number of ${node.type} quasis should be exactly one more than the number of expressions.\nExpected ${val.length + 1} quasis but got ${node.quasis.length}`);
+ }
+ })
+ }
+ }
+});
+(0, _utils.default)("YieldExpression", {
+ builder: ["argument", "delegate"],
+ visitor: ["argument"],
+ aliases: ["Expression", "Terminatorless"],
+ fields: {
+ delegate: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("boolean"), Object.assign(function (node, key, val) {
+ if (!process.env.BABEL_TYPES_8_BREAKING) return;
+
+ if (val && !node.argument) {
+ throw new TypeError("Property delegate of YieldExpression cannot be true if there is no argument");
+ }
+ }, {
+ type: "boolean"
+ })),
+ default: false
+ },
+ argument: {
+ optional: true,
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+});
+(0, _utils.default)("AwaitExpression", {
+ builder: ["argument"],
+ visitor: ["argument"],
+ aliases: ["Expression", "Terminatorless"],
+ fields: {
+ argument: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+});
+(0, _utils.default)("Import", {
+ aliases: ["Expression"]
+});
+(0, _utils.default)("BigIntLiteral", {
+ builder: ["value"],
+ fields: {
+ value: {
+ validate: (0, _utils.assertValueType)("string")
+ }
+ },
+ aliases: ["Expression", "Pureish", "Literal", "Immutable"]
+});
+(0, _utils.default)("ExportNamespaceSpecifier", {
+ visitor: ["exported"],
+ aliases: ["ModuleSpecifier"],
+ fields: {
+ exported: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ }
+ }
+});
+(0, _utils.default)("OptionalMemberExpression", {
+ builder: ["object", "property", "computed", "optional"],
+ visitor: ["object", "property"],
+ aliases: ["Expression"],
+ fields: {
+ object: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ property: {
+ validate: function () {
+ const normal = (0, _utils.assertNodeType)("Identifier");
+ const computed = (0, _utils.assertNodeType)("Expression");
+
+ const validator = function (node, key, val) {
+ const validator = node.computed ? computed : normal;
+ validator(node, key, val);
+ };
+
+ validator.oneOfNodeTypes = ["Expression", "Identifier"];
+ return validator;
+ }()
+ },
+ computed: {
+ default: false
+ },
+ optional: {
+ validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertValueType)("boolean") : (0, _utils.chain)((0, _utils.assertValueType)("boolean"), (0, _utils.assertOptionalChainStart)())
+ }
+ }
+});
+(0, _utils.default)("OptionalCallExpression", {
+ visitor: ["callee", "arguments", "typeParameters", "typeArguments"],
+ builder: ["callee", "arguments", "optional"],
+ aliases: ["Expression"],
+ fields: {
+ callee: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ arguments: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression", "SpreadElement", "JSXNamespacedName", "ArgumentPlaceholder")))
+ },
+ optional: {
+ validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertValueType)("boolean") : (0, _utils.chain)((0, _utils.assertValueType)("boolean"), (0, _utils.assertOptionalChainStart)())
+ },
+ typeArguments: {
+ validate: (0, _utils.assertNodeType)("TypeParameterInstantiation"),
+ optional: true
+ },
+ typeParameters: {
+ validate: (0, _utils.assertNodeType)("TSTypeParameterInstantiation"),
+ optional: true
+ }
+ }
+});
+(0, _utils.default)("ClassProperty", {
+ visitor: ["key", "value", "typeAnnotation", "decorators"],
+ builder: ["key", "value", "typeAnnotation", "decorators", "computed", "static"],
+ aliases: ["Property"],
+ fields: Object.assign({}, classMethodOrPropertyCommon, {
+ value: {
+ validate: (0, _utils.assertNodeType)("Expression"),
+ optional: true
+ },
+ definite: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ },
+ typeAnnotation: {
+ validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
+ optional: true
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
+ optional: true
+ },
+ readonly: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ },
+ declare: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ },
+ variance: {
+ validate: (0, _utils.assertNodeType)("Variance"),
+ optional: true
+ }
+ })
+});
+(0, _utils.default)("ClassPrivateProperty", {
+ visitor: ["key", "value", "decorators", "typeAnnotation"],
+ builder: ["key", "value", "decorators", "static"],
+ aliases: ["Property", "Private"],
+ fields: {
+ key: {
+ validate: (0, _utils.assertNodeType)("PrivateName")
+ },
+ value: {
+ validate: (0, _utils.assertNodeType)("Expression"),
+ optional: true
+ },
+ typeAnnotation: {
+ validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
+ optional: true
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
+ optional: true
+ },
+ readonly: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ },
+ definite: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ },
+ variance: {
+ validate: (0, _utils.assertNodeType)("Variance"),
+ optional: true
+ }
+ }
+});
+(0, _utils.default)("ClassPrivateMethod", {
+ builder: ["kind", "key", "params", "body", "static"],
+ visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
+ aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method", "Private"],
+ fields: Object.assign({}, classMethodOrDeclareMethodCommon, functionTypeAnnotationCommon, {
+ key: {
+ validate: (0, _utils.assertNodeType)("PrivateName")
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("BlockStatement")
+ }
+ })
+});
+(0, _utils.default)("PrivateName", {
+ visitor: ["id"],
+ aliases: ["Private"],
+ fields: {
+ id: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ }
+ }
+}); \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/definitions/experimental.js b/chromium/third_party/node/node_modules/@babel/types/lib/definitions/experimental.js
new file mode 100644
index 00000000000..6a8e14ea7e0
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/definitions/experimental.js
@@ -0,0 +1,142 @@
+"use strict";
+
+var _utils = require("./utils");
+
+(0, _utils.default)("ArgumentPlaceholder", {});
+(0, _utils.default)("BindExpression", {
+ visitor: ["object", "callee"],
+ aliases: ["Expression"],
+ fields: !process.env.BABEL_TYPES_8_BREAKING ? {
+ object: {
+ validate: Object.assign(() => {}, {
+ oneOfNodeTypes: ["Expression"]
+ })
+ },
+ callee: {
+ validate: Object.assign(() => {}, {
+ oneOfNodeTypes: ["Expression"]
+ })
+ }
+ } : {
+ object: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ callee: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+});
+(0, _utils.default)("ImportAttribute", {
+ visitor: ["key", "value"],
+ fields: {
+ key: {
+ validate: (0, _utils.assertNodeType)("Identifier", "StringLiteral")
+ },
+ value: {
+ validate: (0, _utils.assertNodeType)("StringLiteral")
+ }
+ }
+});
+(0, _utils.default)("Decorator", {
+ visitor: ["expression"],
+ fields: {
+ expression: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+});
+(0, _utils.default)("DoExpression", {
+ visitor: ["body"],
+ builder: ["body", "async"],
+ aliases: ["Expression"],
+ fields: {
+ body: {
+ validate: (0, _utils.assertNodeType)("BlockStatement")
+ },
+ async: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ default: false
+ }
+ }
+});
+(0, _utils.default)("ExportDefaultSpecifier", {
+ visitor: ["exported"],
+ aliases: ["ModuleSpecifier"],
+ fields: {
+ exported: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ }
+ }
+});
+(0, _utils.default)("RecordExpression", {
+ visitor: ["properties"],
+ aliases: ["Expression"],
+ fields: {
+ properties: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ObjectProperty", "SpreadElement")))
+ }
+ }
+});
+(0, _utils.default)("TupleExpression", {
+ fields: {
+ elements: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression", "SpreadElement"))),
+ default: []
+ }
+ },
+ visitor: ["elements"],
+ aliases: ["Expression"]
+});
+(0, _utils.default)("DecimalLiteral", {
+ builder: ["value"],
+ fields: {
+ value: {
+ validate: (0, _utils.assertValueType)("string")
+ }
+ },
+ aliases: ["Expression", "Pureish", "Literal", "Immutable"]
+});
+(0, _utils.default)("StaticBlock", {
+ visitor: ["body"],
+ fields: {
+ body: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Statement")))
+ }
+ },
+ aliases: ["Scopable", "BlockParent"]
+});
+(0, _utils.default)("ModuleExpression", {
+ visitor: ["body"],
+ fields: {
+ body: {
+ validate: (0, _utils.assertNodeType)("Program")
+ }
+ },
+ aliases: ["Expression"]
+});
+(0, _utils.default)("TopicReference", {
+ aliases: ["Expression"]
+});
+(0, _utils.default)("PipelineTopicExpression", {
+ builder: ["expression"],
+ visitor: ["expression"],
+ fields: {
+ expression: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ },
+ aliases: ["Expression"]
+});
+(0, _utils.default)("PipelineBareFunction", {
+ builder: ["callee"],
+ visitor: ["callee"],
+ fields: {
+ callee: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ },
+ aliases: ["Expression"]
+});
+(0, _utils.default)("PipelinePrimaryTopicReference", {
+ aliases: ["Expression"]
+}); \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/definitions/flow.js b/chromium/third_party/node/node_modules/@babel/types/lib/definitions/flow.js
new file mode 100644
index 00000000000..e658a91d548
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/definitions/flow.js
@@ -0,0 +1,481 @@
+"use strict";
+
+var _utils = require("./utils");
+
+const defineInterfaceishType = (name, typeParameterType = "TypeParameterDeclaration") => {
+ (0, _utils.default)(name, {
+ builder: ["id", "typeParameters", "extends", "body"],
+ visitor: ["id", "typeParameters", "extends", "mixins", "implements", "body"],
+ aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ typeParameters: (0, _utils.validateOptionalType)(typeParameterType),
+ extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)("InterfaceExtends")),
+ mixins: (0, _utils.validateOptional)((0, _utils.arrayOfType)("InterfaceExtends")),
+ implements: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ClassImplements")),
+ body: (0, _utils.validateType)("ObjectTypeAnnotation")
+ }
+ });
+};
+
+(0, _utils.default)("AnyTypeAnnotation", {
+ aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
+});
+(0, _utils.default)("ArrayTypeAnnotation", {
+ visitor: ["elementType"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ elementType: (0, _utils.validateType)("FlowType")
+ }
+});
+(0, _utils.default)("BooleanTypeAnnotation", {
+ aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
+});
+(0, _utils.default)("BooleanLiteralTypeAnnotation", {
+ builder: ["value"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ value: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
+ }
+});
+(0, _utils.default)("NullLiteralTypeAnnotation", {
+ aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
+});
+(0, _utils.default)("ClassImplements", {
+ visitor: ["id", "typeParameters"],
+ aliases: ["Flow"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ typeParameters: (0, _utils.validateOptionalType)("TypeParameterInstantiation")
+ }
+});
+defineInterfaceishType("DeclareClass");
+(0, _utils.default)("DeclareFunction", {
+ visitor: ["id"],
+ aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ predicate: (0, _utils.validateOptionalType)("DeclaredPredicate")
+ }
+});
+defineInterfaceishType("DeclareInterface");
+(0, _utils.default)("DeclareModule", {
+ builder: ["id", "body", "kind"],
+ visitor: ["id", "body"],
+ aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
+ fields: {
+ id: (0, _utils.validateType)(["Identifier", "StringLiteral"]),
+ body: (0, _utils.validateType)("BlockStatement"),
+ kind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("CommonJS", "ES"))
+ }
+});
+(0, _utils.default)("DeclareModuleExports", {
+ visitor: ["typeAnnotation"],
+ aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
+ fields: {
+ typeAnnotation: (0, _utils.validateType)("TypeAnnotation")
+ }
+});
+(0, _utils.default)("DeclareTypeAlias", {
+ visitor: ["id", "typeParameters", "right"],
+ aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"),
+ right: (0, _utils.validateType)("FlowType")
+ }
+});
+(0, _utils.default)("DeclareOpaqueType", {
+ visitor: ["id", "typeParameters", "supertype"],
+ aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"),
+ supertype: (0, _utils.validateOptionalType)("FlowType"),
+ impltype: (0, _utils.validateOptionalType)("FlowType")
+ }
+});
+(0, _utils.default)("DeclareVariable", {
+ visitor: ["id"],
+ aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier")
+ }
+});
+(0, _utils.default)("DeclareExportDeclaration", {
+ visitor: ["declaration", "specifiers", "source"],
+ aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
+ fields: {
+ declaration: (0, _utils.validateOptionalType)("Flow"),
+ specifiers: (0, _utils.validateOptional)((0, _utils.arrayOfType)(["ExportSpecifier", "ExportNamespaceSpecifier"])),
+ source: (0, _utils.validateOptionalType)("StringLiteral"),
+ default: (0, _utils.validateOptional)((0, _utils.assertValueType)("boolean"))
+ }
+});
+(0, _utils.default)("DeclareExportAllDeclaration", {
+ visitor: ["source"],
+ aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
+ fields: {
+ source: (0, _utils.validateType)("StringLiteral"),
+ exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("type", "value"))
+ }
+});
+(0, _utils.default)("DeclaredPredicate", {
+ visitor: ["value"],
+ aliases: ["Flow", "FlowPredicate"],
+ fields: {
+ value: (0, _utils.validateType)("Flow")
+ }
+});
+(0, _utils.default)("ExistsTypeAnnotation", {
+ aliases: ["Flow", "FlowType"]
+});
+(0, _utils.default)("FunctionTypeAnnotation", {
+ visitor: ["typeParameters", "params", "rest", "returnType"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"),
+ params: (0, _utils.validate)((0, _utils.arrayOfType)("FunctionTypeParam")),
+ rest: (0, _utils.validateOptionalType)("FunctionTypeParam"),
+ this: (0, _utils.validateOptionalType)("FunctionTypeParam"),
+ returnType: (0, _utils.validateType)("FlowType")
+ }
+});
+(0, _utils.default)("FunctionTypeParam", {
+ visitor: ["name", "typeAnnotation"],
+ aliases: ["Flow"],
+ fields: {
+ name: (0, _utils.validateOptionalType)("Identifier"),
+ typeAnnotation: (0, _utils.validateType)("FlowType"),
+ optional: (0, _utils.validateOptional)((0, _utils.assertValueType)("boolean"))
+ }
+});
+(0, _utils.default)("GenericTypeAnnotation", {
+ visitor: ["id", "typeParameters"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ id: (0, _utils.validateType)(["Identifier", "QualifiedTypeIdentifier"]),
+ typeParameters: (0, _utils.validateOptionalType)("TypeParameterInstantiation")
+ }
+});
+(0, _utils.default)("InferredPredicate", {
+ aliases: ["Flow", "FlowPredicate"]
+});
+(0, _utils.default)("InterfaceExtends", {
+ visitor: ["id", "typeParameters"],
+ aliases: ["Flow"],
+ fields: {
+ id: (0, _utils.validateType)(["Identifier", "QualifiedTypeIdentifier"]),
+ typeParameters: (0, _utils.validateOptionalType)("TypeParameterInstantiation")
+ }
+});
+defineInterfaceishType("InterfaceDeclaration");
+(0, _utils.default)("InterfaceTypeAnnotation", {
+ visitor: ["extends", "body"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)("InterfaceExtends")),
+ body: (0, _utils.validateType)("ObjectTypeAnnotation")
+ }
+});
+(0, _utils.default)("IntersectionTypeAnnotation", {
+ visitor: ["types"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ types: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType"))
+ }
+});
+(0, _utils.default)("MixedTypeAnnotation", {
+ aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
+});
+(0, _utils.default)("EmptyTypeAnnotation", {
+ aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
+});
+(0, _utils.default)("NullableTypeAnnotation", {
+ visitor: ["typeAnnotation"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ typeAnnotation: (0, _utils.validateType)("FlowType")
+ }
+});
+(0, _utils.default)("NumberLiteralTypeAnnotation", {
+ builder: ["value"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ value: (0, _utils.validate)((0, _utils.assertValueType)("number"))
+ }
+});
+(0, _utils.default)("NumberTypeAnnotation", {
+ aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
+});
+(0, _utils.default)("ObjectTypeAnnotation", {
+ visitor: ["properties", "indexers", "callProperties", "internalSlots"],
+ aliases: ["Flow", "FlowType"],
+ builder: ["properties", "indexers", "callProperties", "internalSlots", "exact"],
+ fields: {
+ properties: (0, _utils.validate)((0, _utils.arrayOfType)(["ObjectTypeProperty", "ObjectTypeSpreadProperty"])),
+ indexers: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ObjectTypeIndexer")),
+ callProperties: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ObjectTypeCallProperty")),
+ internalSlots: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ObjectTypeInternalSlot")),
+ exact: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ default: false
+ },
+ inexact: (0, _utils.validateOptional)((0, _utils.assertValueType)("boolean"))
+ }
+});
+(0, _utils.default)("ObjectTypeInternalSlot", {
+ visitor: ["id", "value", "optional", "static", "method"],
+ aliases: ["Flow", "UserWhitespacable"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ value: (0, _utils.validateType)("FlowType"),
+ optional: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
+ static: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
+ method: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
+ }
+});
+(0, _utils.default)("ObjectTypeCallProperty", {
+ visitor: ["value"],
+ aliases: ["Flow", "UserWhitespacable"],
+ fields: {
+ value: (0, _utils.validateType)("FlowType"),
+ static: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
+ }
+});
+(0, _utils.default)("ObjectTypeIndexer", {
+ visitor: ["id", "key", "value", "variance"],
+ aliases: ["Flow", "UserWhitespacable"],
+ fields: {
+ id: (0, _utils.validateOptionalType)("Identifier"),
+ key: (0, _utils.validateType)("FlowType"),
+ value: (0, _utils.validateType)("FlowType"),
+ static: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
+ variance: (0, _utils.validateOptionalType)("Variance")
+ }
+});
+(0, _utils.default)("ObjectTypeProperty", {
+ visitor: ["key", "value", "variance"],
+ aliases: ["Flow", "UserWhitespacable"],
+ fields: {
+ key: (0, _utils.validateType)(["Identifier", "StringLiteral"]),
+ value: (0, _utils.validateType)("FlowType"),
+ kind: (0, _utils.validate)((0, _utils.assertOneOf)("init", "get", "set")),
+ static: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
+ proto: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
+ optional: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
+ variance: (0, _utils.validateOptionalType)("Variance"),
+ method: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
+ }
+});
+(0, _utils.default)("ObjectTypeSpreadProperty", {
+ visitor: ["argument"],
+ aliases: ["Flow", "UserWhitespacable"],
+ fields: {
+ argument: (0, _utils.validateType)("FlowType")
+ }
+});
+(0, _utils.default)("OpaqueType", {
+ visitor: ["id", "typeParameters", "supertype", "impltype"],
+ aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"),
+ supertype: (0, _utils.validateOptionalType)("FlowType"),
+ impltype: (0, _utils.validateType)("FlowType")
+ }
+});
+(0, _utils.default)("QualifiedTypeIdentifier", {
+ visitor: ["id", "qualification"],
+ aliases: ["Flow"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ qualification: (0, _utils.validateType)(["Identifier", "QualifiedTypeIdentifier"])
+ }
+});
+(0, _utils.default)("StringLiteralTypeAnnotation", {
+ builder: ["value"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ value: (0, _utils.validate)((0, _utils.assertValueType)("string"))
+ }
+});
+(0, _utils.default)("StringTypeAnnotation", {
+ aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
+});
+(0, _utils.default)("SymbolTypeAnnotation", {
+ aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
+});
+(0, _utils.default)("ThisTypeAnnotation", {
+ aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
+});
+(0, _utils.default)("TupleTypeAnnotation", {
+ visitor: ["types"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ types: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType"))
+ }
+});
+(0, _utils.default)("TypeofTypeAnnotation", {
+ visitor: ["argument"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ argument: (0, _utils.validateType)("FlowType")
+ }
+});
+(0, _utils.default)("TypeAlias", {
+ visitor: ["id", "typeParameters", "right"],
+ aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"),
+ right: (0, _utils.validateType)("FlowType")
+ }
+});
+(0, _utils.default)("TypeAnnotation", {
+ aliases: ["Flow"],
+ visitor: ["typeAnnotation"],
+ fields: {
+ typeAnnotation: (0, _utils.validateType)("FlowType")
+ }
+});
+(0, _utils.default)("TypeCastExpression", {
+ visitor: ["expression", "typeAnnotation"],
+ aliases: ["Flow", "ExpressionWrapper", "Expression"],
+ fields: {
+ expression: (0, _utils.validateType)("Expression"),
+ typeAnnotation: (0, _utils.validateType)("TypeAnnotation")
+ }
+});
+(0, _utils.default)("TypeParameter", {
+ aliases: ["Flow"],
+ visitor: ["bound", "default", "variance"],
+ fields: {
+ name: (0, _utils.validate)((0, _utils.assertValueType)("string")),
+ bound: (0, _utils.validateOptionalType)("TypeAnnotation"),
+ default: (0, _utils.validateOptionalType)("FlowType"),
+ variance: (0, _utils.validateOptionalType)("Variance")
+ }
+});
+(0, _utils.default)("TypeParameterDeclaration", {
+ aliases: ["Flow"],
+ visitor: ["params"],
+ fields: {
+ params: (0, _utils.validate)((0, _utils.arrayOfType)("TypeParameter"))
+ }
+});
+(0, _utils.default)("TypeParameterInstantiation", {
+ aliases: ["Flow"],
+ visitor: ["params"],
+ fields: {
+ params: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType"))
+ }
+});
+(0, _utils.default)("UnionTypeAnnotation", {
+ visitor: ["types"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ types: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType"))
+ }
+});
+(0, _utils.default)("Variance", {
+ aliases: ["Flow"],
+ builder: ["kind"],
+ fields: {
+ kind: (0, _utils.validate)((0, _utils.assertOneOf)("minus", "plus"))
+ }
+});
+(0, _utils.default)("VoidTypeAnnotation", {
+ aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
+});
+(0, _utils.default)("EnumDeclaration", {
+ aliases: ["Statement", "Declaration"],
+ visitor: ["id", "body"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ body: (0, _utils.validateType)(["EnumBooleanBody", "EnumNumberBody", "EnumStringBody", "EnumSymbolBody"])
+ }
+});
+(0, _utils.default)("EnumBooleanBody", {
+ aliases: ["EnumBody"],
+ visitor: ["members"],
+ fields: {
+ explicitType: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
+ members: (0, _utils.validateArrayOfType)("EnumBooleanMember"),
+ hasUnknownMembers: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
+ }
+});
+(0, _utils.default)("EnumNumberBody", {
+ aliases: ["EnumBody"],
+ visitor: ["members"],
+ fields: {
+ explicitType: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
+ members: (0, _utils.validateArrayOfType)("EnumNumberMember"),
+ hasUnknownMembers: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
+ }
+});
+(0, _utils.default)("EnumStringBody", {
+ aliases: ["EnumBody"],
+ visitor: ["members"],
+ fields: {
+ explicitType: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
+ members: (0, _utils.validateArrayOfType)(["EnumStringMember", "EnumDefaultedMember"]),
+ hasUnknownMembers: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
+ }
+});
+(0, _utils.default)("EnumSymbolBody", {
+ aliases: ["EnumBody"],
+ visitor: ["members"],
+ fields: {
+ members: (0, _utils.validateArrayOfType)("EnumDefaultedMember"),
+ hasUnknownMembers: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
+ }
+});
+(0, _utils.default)("EnumBooleanMember", {
+ aliases: ["EnumMember"],
+ visitor: ["id"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ init: (0, _utils.validateType)("BooleanLiteral")
+ }
+});
+(0, _utils.default)("EnumNumberMember", {
+ aliases: ["EnumMember"],
+ visitor: ["id", "init"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ init: (0, _utils.validateType)("NumericLiteral")
+ }
+});
+(0, _utils.default)("EnumStringMember", {
+ aliases: ["EnumMember"],
+ visitor: ["id", "init"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ init: (0, _utils.validateType)("StringLiteral")
+ }
+});
+(0, _utils.default)("EnumDefaultedMember", {
+ aliases: ["EnumMember"],
+ visitor: ["id"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier")
+ }
+});
+(0, _utils.default)("IndexedAccessType", {
+ visitor: ["objectType", "indexType"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ objectType: (0, _utils.validateType)("FlowType"),
+ indexType: (0, _utils.validateType)("FlowType")
+ }
+});
+(0, _utils.default)("OptionalIndexedAccessType", {
+ visitor: ["objectType", "indexType"],
+ aliases: ["Flow", "FlowType"],
+ fields: {
+ objectType: (0, _utils.validateType)("FlowType"),
+ indexType: (0, _utils.validateType)("FlowType"),
+ optional: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
+ }
+}); \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/definitions/index.js b/chromium/third_party/node/node_modules/@babel/types/lib/definitions/index.js
new file mode 100644
index 00000000000..897fc24d361
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/definitions/index.js
@@ -0,0 +1,103 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+Object.defineProperty(exports, "VISITOR_KEYS", {
+ enumerable: true,
+ get: function () {
+ return _utils.VISITOR_KEYS;
+ }
+});
+Object.defineProperty(exports, "ALIAS_KEYS", {
+ enumerable: true,
+ get: function () {
+ return _utils.ALIAS_KEYS;
+ }
+});
+Object.defineProperty(exports, "FLIPPED_ALIAS_KEYS", {
+ enumerable: true,
+ get: function () {
+ return _utils.FLIPPED_ALIAS_KEYS;
+ }
+});
+Object.defineProperty(exports, "NODE_FIELDS", {
+ enumerable: true,
+ get: function () {
+ return _utils.NODE_FIELDS;
+ }
+});
+Object.defineProperty(exports, "BUILDER_KEYS", {
+ enumerable: true,
+ get: function () {
+ return _utils.BUILDER_KEYS;
+ }
+});
+Object.defineProperty(exports, "DEPRECATED_KEYS", {
+ enumerable: true,
+ get: function () {
+ return _utils.DEPRECATED_KEYS;
+ }
+});
+Object.defineProperty(exports, "NODE_PARENT_VALIDATIONS", {
+ enumerable: true,
+ get: function () {
+ return _utils.NODE_PARENT_VALIDATIONS;
+ }
+});
+Object.defineProperty(exports, "PLACEHOLDERS", {
+ enumerable: true,
+ get: function () {
+ return _placeholders.PLACEHOLDERS;
+ }
+});
+Object.defineProperty(exports, "PLACEHOLDERS_ALIAS", {
+ enumerable: true,
+ get: function () {
+ return _placeholders.PLACEHOLDERS_ALIAS;
+ }
+});
+Object.defineProperty(exports, "PLACEHOLDERS_FLIPPED_ALIAS", {
+ enumerable: true,
+ get: function () {
+ return _placeholders.PLACEHOLDERS_FLIPPED_ALIAS;
+ }
+});
+exports.TYPES = void 0;
+
+var _toFastProperties = require("to-fast-properties");
+
+require("./core");
+
+require("./flow");
+
+require("./jsx");
+
+require("./misc");
+
+require("./experimental");
+
+require("./typescript");
+
+var _utils = require("./utils");
+
+var _placeholders = require("./placeholders");
+
+_toFastProperties(_utils.VISITOR_KEYS);
+
+_toFastProperties(_utils.ALIAS_KEYS);
+
+_toFastProperties(_utils.FLIPPED_ALIAS_KEYS);
+
+_toFastProperties(_utils.NODE_FIELDS);
+
+_toFastProperties(_utils.BUILDER_KEYS);
+
+_toFastProperties(_utils.DEPRECATED_KEYS);
+
+_toFastProperties(_placeholders.PLACEHOLDERS_ALIAS);
+
+_toFastProperties(_placeholders.PLACEHOLDERS_FLIPPED_ALIAS);
+
+const TYPES = Object.keys(_utils.VISITOR_KEYS).concat(Object.keys(_utils.FLIPPED_ALIAS_KEYS)).concat(Object.keys(_utils.DEPRECATED_KEYS));
+exports.TYPES = TYPES; \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/definitions/jsx.js b/chromium/third_party/node/node_modules/@babel/types/lib/definitions/jsx.js
new file mode 100644
index 00000000000..fc8e9071c37
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/definitions/jsx.js
@@ -0,0 +1,161 @@
+"use strict";
+
+var _utils = require("./utils");
+
+(0, _utils.default)("JSXAttribute", {
+ visitor: ["name", "value"],
+ aliases: ["JSX", "Immutable"],
+ fields: {
+ name: {
+ validate: (0, _utils.assertNodeType)("JSXIdentifier", "JSXNamespacedName")
+ },
+ value: {
+ optional: true,
+ validate: (0, _utils.assertNodeType)("JSXElement", "JSXFragment", "StringLiteral", "JSXExpressionContainer")
+ }
+ }
+});
+(0, _utils.default)("JSXClosingElement", {
+ visitor: ["name"],
+ aliases: ["JSX", "Immutable"],
+ fields: {
+ name: {
+ validate: (0, _utils.assertNodeType)("JSXIdentifier", "JSXMemberExpression", "JSXNamespacedName")
+ }
+ }
+});
+(0, _utils.default)("JSXElement", {
+ builder: ["openingElement", "closingElement", "children", "selfClosing"],
+ visitor: ["openingElement", "children", "closingElement"],
+ aliases: ["JSX", "Immutable", "Expression"],
+ fields: {
+ openingElement: {
+ validate: (0, _utils.assertNodeType)("JSXOpeningElement")
+ },
+ closingElement: {
+ optional: true,
+ validate: (0, _utils.assertNodeType)("JSXClosingElement")
+ },
+ children: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("JSXText", "JSXExpressionContainer", "JSXSpreadChild", "JSXElement", "JSXFragment")))
+ },
+ selfClosing: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ }
+ }
+});
+(0, _utils.default)("JSXEmptyExpression", {
+ aliases: ["JSX"]
+});
+(0, _utils.default)("JSXExpressionContainer", {
+ visitor: ["expression"],
+ aliases: ["JSX", "Immutable"],
+ fields: {
+ expression: {
+ validate: (0, _utils.assertNodeType)("Expression", "JSXEmptyExpression")
+ }
+ }
+});
+(0, _utils.default)("JSXSpreadChild", {
+ visitor: ["expression"],
+ aliases: ["JSX", "Immutable"],
+ fields: {
+ expression: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+});
+(0, _utils.default)("JSXIdentifier", {
+ builder: ["name"],
+ aliases: ["JSX"],
+ fields: {
+ name: {
+ validate: (0, _utils.assertValueType)("string")
+ }
+ }
+});
+(0, _utils.default)("JSXMemberExpression", {
+ visitor: ["object", "property"],
+ aliases: ["JSX"],
+ fields: {
+ object: {
+ validate: (0, _utils.assertNodeType)("JSXMemberExpression", "JSXIdentifier")
+ },
+ property: {
+ validate: (0, _utils.assertNodeType)("JSXIdentifier")
+ }
+ }
+});
+(0, _utils.default)("JSXNamespacedName", {
+ visitor: ["namespace", "name"],
+ aliases: ["JSX"],
+ fields: {
+ namespace: {
+ validate: (0, _utils.assertNodeType)("JSXIdentifier")
+ },
+ name: {
+ validate: (0, _utils.assertNodeType)("JSXIdentifier")
+ }
+ }
+});
+(0, _utils.default)("JSXOpeningElement", {
+ builder: ["name", "attributes", "selfClosing"],
+ visitor: ["name", "attributes"],
+ aliases: ["JSX", "Immutable"],
+ fields: {
+ name: {
+ validate: (0, _utils.assertNodeType)("JSXIdentifier", "JSXMemberExpression", "JSXNamespacedName")
+ },
+ selfClosing: {
+ default: false
+ },
+ attributes: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("JSXAttribute", "JSXSpreadAttribute")))
+ },
+ typeParameters: {
+ validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
+ optional: true
+ }
+ }
+});
+(0, _utils.default)("JSXSpreadAttribute", {
+ visitor: ["argument"],
+ aliases: ["JSX"],
+ fields: {
+ argument: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+});
+(0, _utils.default)("JSXText", {
+ aliases: ["JSX", "Immutable"],
+ builder: ["value"],
+ fields: {
+ value: {
+ validate: (0, _utils.assertValueType)("string")
+ }
+ }
+});
+(0, _utils.default)("JSXFragment", {
+ builder: ["openingFragment", "closingFragment", "children"],
+ visitor: ["openingFragment", "children", "closingFragment"],
+ aliases: ["JSX", "Immutable", "Expression"],
+ fields: {
+ openingFragment: {
+ validate: (0, _utils.assertNodeType)("JSXOpeningFragment")
+ },
+ closingFragment: {
+ validate: (0, _utils.assertNodeType)("JSXClosingFragment")
+ },
+ children: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("JSXText", "JSXExpressionContainer", "JSXSpreadChild", "JSXElement", "JSXFragment")))
+ }
+ }
+});
+(0, _utils.default)("JSXOpeningFragment", {
+ aliases: ["JSX", "Immutable"]
+});
+(0, _utils.default)("JSXClosingFragment", {
+ aliases: ["JSX", "Immutable"]
+}); \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/definitions/misc.js b/chromium/third_party/node/node_modules/@babel/types/lib/definitions/misc.js
new file mode 100644
index 00000000000..d8d79b9640b
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/definitions/misc.js
@@ -0,0 +1,31 @@
+"use strict";
+
+var _utils = require("./utils");
+
+var _placeholders = require("./placeholders");
+
+{
+ (0, _utils.default)("Noop", {
+ visitor: []
+ });
+}
+(0, _utils.default)("Placeholder", {
+ visitor: [],
+ builder: ["expectedNode", "name"],
+ fields: {
+ name: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ },
+ expectedNode: {
+ validate: (0, _utils.assertOneOf)(..._placeholders.PLACEHOLDERS)
+ }
+ }
+});
+(0, _utils.default)("V8IntrinsicIdentifier", {
+ builder: ["name"],
+ fields: {
+ name: {
+ validate: (0, _utils.assertValueType)("string")
+ }
+ }
+}); \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/definitions/placeholders.js b/chromium/third_party/node/node_modules/@babel/types/lib/definitions/placeholders.js
new file mode 100644
index 00000000000..7277239ae41
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/definitions/placeholders.js
@@ -0,0 +1,33 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.PLACEHOLDERS_FLIPPED_ALIAS = exports.PLACEHOLDERS_ALIAS = exports.PLACEHOLDERS = void 0;
+
+var _utils = require("./utils");
+
+const PLACEHOLDERS = ["Identifier", "StringLiteral", "Expression", "Statement", "Declaration", "BlockStatement", "ClassBody", "Pattern"];
+exports.PLACEHOLDERS = PLACEHOLDERS;
+const PLACEHOLDERS_ALIAS = {
+ Declaration: ["Statement"],
+ Pattern: ["PatternLike", "LVal"]
+};
+exports.PLACEHOLDERS_ALIAS = PLACEHOLDERS_ALIAS;
+
+for (const type of PLACEHOLDERS) {
+ const alias = _utils.ALIAS_KEYS[type];
+ if (alias != null && alias.length) PLACEHOLDERS_ALIAS[type] = alias;
+}
+
+const PLACEHOLDERS_FLIPPED_ALIAS = {};
+exports.PLACEHOLDERS_FLIPPED_ALIAS = PLACEHOLDERS_FLIPPED_ALIAS;
+Object.keys(PLACEHOLDERS_ALIAS).forEach(type => {
+ PLACEHOLDERS_ALIAS[type].forEach(alias => {
+ if (!Object.hasOwnProperty.call(PLACEHOLDERS_FLIPPED_ALIAS, alias)) {
+ PLACEHOLDERS_FLIPPED_ALIAS[alias] = [];
+ }
+
+ PLACEHOLDERS_FLIPPED_ALIAS[alias].push(type);
+ });
+}); \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/definitions/typescript.js b/chromium/third_party/node/node_modules/@babel/types/lib/definitions/typescript.js
new file mode 100644
index 00000000000..7abbf046d76
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/definitions/typescript.js
@@ -0,0 +1,469 @@
+"use strict";
+
+var _utils = require("./utils");
+
+var _core = require("./core");
+
+var _is = require("../validators/is");
+
+const bool = (0, _utils.assertValueType)("boolean");
+const tSFunctionTypeAnnotationCommon = {
+ returnType: {
+ validate: (0, _utils.assertNodeType)("TSTypeAnnotation", "Noop"),
+ optional: true
+ },
+ typeParameters: {
+ validate: (0, _utils.assertNodeType)("TSTypeParameterDeclaration", "Noop"),
+ optional: true
+ }
+};
+(0, _utils.default)("TSParameterProperty", {
+ aliases: ["LVal"],
+ visitor: ["parameter"],
+ fields: {
+ accessibility: {
+ validate: (0, _utils.assertOneOf)("public", "private", "protected"),
+ optional: true
+ },
+ readonly: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ },
+ parameter: {
+ validate: (0, _utils.assertNodeType)("Identifier", "AssignmentPattern")
+ },
+ override: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
+ optional: true
+ }
+ }
+});
+(0, _utils.default)("TSDeclareFunction", {
+ aliases: ["Statement", "Declaration"],
+ visitor: ["id", "typeParameters", "params", "returnType"],
+ fields: Object.assign({}, _core.functionDeclarationCommon, tSFunctionTypeAnnotationCommon)
+});
+(0, _utils.default)("TSDeclareMethod", {
+ visitor: ["decorators", "key", "typeParameters", "params", "returnType"],
+ fields: Object.assign({}, _core.classMethodOrDeclareMethodCommon, tSFunctionTypeAnnotationCommon)
+});
+(0, _utils.default)("TSQualifiedName", {
+ aliases: ["TSEntityName"],
+ visitor: ["left", "right"],
+ fields: {
+ left: (0, _utils.validateType)("TSEntityName"),
+ right: (0, _utils.validateType)("Identifier")
+ }
+});
+const signatureDeclarationCommon = {
+ typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"),
+ parameters: (0, _utils.validateArrayOfType)(["Identifier", "RestElement"]),
+ typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation")
+};
+const callConstructSignatureDeclaration = {
+ aliases: ["TSTypeElement"],
+ visitor: ["typeParameters", "parameters", "typeAnnotation"],
+ fields: signatureDeclarationCommon
+};
+(0, _utils.default)("TSCallSignatureDeclaration", callConstructSignatureDeclaration);
+(0, _utils.default)("TSConstructSignatureDeclaration", callConstructSignatureDeclaration);
+const namedTypeElementCommon = {
+ key: (0, _utils.validateType)("Expression"),
+ computed: (0, _utils.validate)(bool),
+ optional: (0, _utils.validateOptional)(bool)
+};
+(0, _utils.default)("TSPropertySignature", {
+ aliases: ["TSTypeElement"],
+ visitor: ["key", "typeAnnotation", "initializer"],
+ fields: Object.assign({}, namedTypeElementCommon, {
+ readonly: (0, _utils.validateOptional)(bool),
+ typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation"),
+ initializer: (0, _utils.validateOptionalType)("Expression"),
+ kind: {
+ validate: (0, _utils.assertOneOf)("get", "set")
+ }
+ })
+});
+(0, _utils.default)("TSMethodSignature", {
+ aliases: ["TSTypeElement"],
+ visitor: ["key", "typeParameters", "parameters", "typeAnnotation"],
+ fields: Object.assign({}, signatureDeclarationCommon, namedTypeElementCommon, {
+ kind: {
+ validate: (0, _utils.assertOneOf)("method", "get", "set")
+ }
+ })
+});
+(0, _utils.default)("TSIndexSignature", {
+ aliases: ["TSTypeElement"],
+ visitor: ["parameters", "typeAnnotation"],
+ fields: {
+ readonly: (0, _utils.validateOptional)(bool),
+ static: (0, _utils.validateOptional)(bool),
+ parameters: (0, _utils.validateArrayOfType)("Identifier"),
+ typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation")
+ }
+});
+const tsKeywordTypes = ["TSAnyKeyword", "TSBooleanKeyword", "TSBigIntKeyword", "TSIntrinsicKeyword", "TSNeverKeyword", "TSNullKeyword", "TSNumberKeyword", "TSObjectKeyword", "TSStringKeyword", "TSSymbolKeyword", "TSUndefinedKeyword", "TSUnknownKeyword", "TSVoidKeyword"];
+
+for (const type of tsKeywordTypes) {
+ (0, _utils.default)(type, {
+ aliases: ["TSType", "TSBaseType"],
+ visitor: [],
+ fields: {}
+ });
+}
+
+(0, _utils.default)("TSThisType", {
+ aliases: ["TSType", "TSBaseType"],
+ visitor: [],
+ fields: {}
+});
+const fnOrCtrBase = {
+ aliases: ["TSType"],
+ visitor: ["typeParameters", "parameters", "typeAnnotation"]
+};
+(0, _utils.default)("TSFunctionType", Object.assign({}, fnOrCtrBase, {
+ fields: signatureDeclarationCommon
+}));
+(0, _utils.default)("TSConstructorType", Object.assign({}, fnOrCtrBase, {
+ fields: Object.assign({}, signatureDeclarationCommon, {
+ abstract: (0, _utils.validateOptional)(bool)
+ })
+}));
+(0, _utils.default)("TSTypeReference", {
+ aliases: ["TSType"],
+ visitor: ["typeName", "typeParameters"],
+ fields: {
+ typeName: (0, _utils.validateType)("TSEntityName"),
+ typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation")
+ }
+});
+(0, _utils.default)("TSTypePredicate", {
+ aliases: ["TSType"],
+ visitor: ["parameterName", "typeAnnotation"],
+ builder: ["parameterName", "typeAnnotation", "asserts"],
+ fields: {
+ parameterName: (0, _utils.validateType)(["Identifier", "TSThisType"]),
+ typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation"),
+ asserts: (0, _utils.validateOptional)(bool)
+ }
+});
+(0, _utils.default)("TSTypeQuery", {
+ aliases: ["TSType"],
+ visitor: ["exprName"],
+ fields: {
+ exprName: (0, _utils.validateType)(["TSEntityName", "TSImportType"])
+ }
+});
+(0, _utils.default)("TSTypeLiteral", {
+ aliases: ["TSType"],
+ visitor: ["members"],
+ fields: {
+ members: (0, _utils.validateArrayOfType)("TSTypeElement")
+ }
+});
+(0, _utils.default)("TSArrayType", {
+ aliases: ["TSType"],
+ visitor: ["elementType"],
+ fields: {
+ elementType: (0, _utils.validateType)("TSType")
+ }
+});
+(0, _utils.default)("TSTupleType", {
+ aliases: ["TSType"],
+ visitor: ["elementTypes"],
+ fields: {
+ elementTypes: (0, _utils.validateArrayOfType)(["TSType", "TSNamedTupleMember"])
+ }
+});
+(0, _utils.default)("TSOptionalType", {
+ aliases: ["TSType"],
+ visitor: ["typeAnnotation"],
+ fields: {
+ typeAnnotation: (0, _utils.validateType)("TSType")
+ }
+});
+(0, _utils.default)("TSRestType", {
+ aliases: ["TSType"],
+ visitor: ["typeAnnotation"],
+ fields: {
+ typeAnnotation: (0, _utils.validateType)("TSType")
+ }
+});
+(0, _utils.default)("TSNamedTupleMember", {
+ visitor: ["label", "elementType"],
+ builder: ["label", "elementType", "optional"],
+ fields: {
+ label: (0, _utils.validateType)("Identifier"),
+ optional: {
+ validate: bool,
+ default: false
+ },
+ elementType: (0, _utils.validateType)("TSType")
+ }
+});
+const unionOrIntersection = {
+ aliases: ["TSType"],
+ visitor: ["types"],
+ fields: {
+ types: (0, _utils.validateArrayOfType)("TSType")
+ }
+};
+(0, _utils.default)("TSUnionType", unionOrIntersection);
+(0, _utils.default)("TSIntersectionType", unionOrIntersection);
+(0, _utils.default)("TSConditionalType", {
+ aliases: ["TSType"],
+ visitor: ["checkType", "extendsType", "trueType", "falseType"],
+ fields: {
+ checkType: (0, _utils.validateType)("TSType"),
+ extendsType: (0, _utils.validateType)("TSType"),
+ trueType: (0, _utils.validateType)("TSType"),
+ falseType: (0, _utils.validateType)("TSType")
+ }
+});
+(0, _utils.default)("TSInferType", {
+ aliases: ["TSType"],
+ visitor: ["typeParameter"],
+ fields: {
+ typeParameter: (0, _utils.validateType)("TSTypeParameter")
+ }
+});
+(0, _utils.default)("TSParenthesizedType", {
+ aliases: ["TSType"],
+ visitor: ["typeAnnotation"],
+ fields: {
+ typeAnnotation: (0, _utils.validateType)("TSType")
+ }
+});
+(0, _utils.default)("TSTypeOperator", {
+ aliases: ["TSType"],
+ visitor: ["typeAnnotation"],
+ fields: {
+ operator: (0, _utils.validate)((0, _utils.assertValueType)("string")),
+ typeAnnotation: (0, _utils.validateType)("TSType")
+ }
+});
+(0, _utils.default)("TSIndexedAccessType", {
+ aliases: ["TSType"],
+ visitor: ["objectType", "indexType"],
+ fields: {
+ objectType: (0, _utils.validateType)("TSType"),
+ indexType: (0, _utils.validateType)("TSType")
+ }
+});
+(0, _utils.default)("TSMappedType", {
+ aliases: ["TSType"],
+ visitor: ["typeParameter", "typeAnnotation", "nameType"],
+ fields: {
+ readonly: (0, _utils.validateOptional)(bool),
+ typeParameter: (0, _utils.validateType)("TSTypeParameter"),
+ optional: (0, _utils.validateOptional)(bool),
+ typeAnnotation: (0, _utils.validateOptionalType)("TSType"),
+ nameType: (0, _utils.validateOptionalType)("TSType")
+ }
+});
+(0, _utils.default)("TSLiteralType", {
+ aliases: ["TSType", "TSBaseType"],
+ visitor: ["literal"],
+ fields: {
+ literal: {
+ validate: function () {
+ const unaryExpression = (0, _utils.assertNodeType)("NumericLiteral", "BigIntLiteral");
+ const unaryOperator = (0, _utils.assertOneOf)("-");
+ const literal = (0, _utils.assertNodeType)("NumericLiteral", "StringLiteral", "BooleanLiteral", "BigIntLiteral");
+
+ function validator(parent, key, node) {
+ if ((0, _is.default)("UnaryExpression", node)) {
+ unaryOperator(node, "operator", node.operator);
+ unaryExpression(node, "argument", node.argument);
+ } else {
+ literal(parent, key, node);
+ }
+ }
+
+ validator.oneOfNodeTypes = ["NumericLiteral", "StringLiteral", "BooleanLiteral", "BigIntLiteral", "UnaryExpression"];
+ return validator;
+ }()
+ }
+ }
+});
+(0, _utils.default)("TSExpressionWithTypeArguments", {
+ aliases: ["TSType"],
+ visitor: ["expression", "typeParameters"],
+ fields: {
+ expression: (0, _utils.validateType)("TSEntityName"),
+ typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation")
+ }
+});
+(0, _utils.default)("TSInterfaceDeclaration", {
+ aliases: ["Statement", "Declaration"],
+ visitor: ["id", "typeParameters", "extends", "body"],
+ fields: {
+ declare: (0, _utils.validateOptional)(bool),
+ id: (0, _utils.validateType)("Identifier"),
+ typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"),
+ extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)("TSExpressionWithTypeArguments")),
+ body: (0, _utils.validateType)("TSInterfaceBody")
+ }
+});
+(0, _utils.default)("TSInterfaceBody", {
+ visitor: ["body"],
+ fields: {
+ body: (0, _utils.validateArrayOfType)("TSTypeElement")
+ }
+});
+(0, _utils.default)("TSTypeAliasDeclaration", {
+ aliases: ["Statement", "Declaration"],
+ visitor: ["id", "typeParameters", "typeAnnotation"],
+ fields: {
+ declare: (0, _utils.validateOptional)(bool),
+ id: (0, _utils.validateType)("Identifier"),
+ typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"),
+ typeAnnotation: (0, _utils.validateType)("TSType")
+ }
+});
+(0, _utils.default)("TSAsExpression", {
+ aliases: ["Expression"],
+ visitor: ["expression", "typeAnnotation"],
+ fields: {
+ expression: (0, _utils.validateType)("Expression"),
+ typeAnnotation: (0, _utils.validateType)("TSType")
+ }
+});
+(0, _utils.default)("TSTypeAssertion", {
+ aliases: ["Expression"],
+ visitor: ["typeAnnotation", "expression"],
+ fields: {
+ typeAnnotation: (0, _utils.validateType)("TSType"),
+ expression: (0, _utils.validateType)("Expression")
+ }
+});
+(0, _utils.default)("TSEnumDeclaration", {
+ aliases: ["Statement", "Declaration"],
+ visitor: ["id", "members"],
+ fields: {
+ declare: (0, _utils.validateOptional)(bool),
+ const: (0, _utils.validateOptional)(bool),
+ id: (0, _utils.validateType)("Identifier"),
+ members: (0, _utils.validateArrayOfType)("TSEnumMember"),
+ initializer: (0, _utils.validateOptionalType)("Expression")
+ }
+});
+(0, _utils.default)("TSEnumMember", {
+ visitor: ["id", "initializer"],
+ fields: {
+ id: (0, _utils.validateType)(["Identifier", "StringLiteral"]),
+ initializer: (0, _utils.validateOptionalType)("Expression")
+ }
+});
+(0, _utils.default)("TSModuleDeclaration", {
+ aliases: ["Statement", "Declaration"],
+ visitor: ["id", "body"],
+ fields: {
+ declare: (0, _utils.validateOptional)(bool),
+ global: (0, _utils.validateOptional)(bool),
+ id: (0, _utils.validateType)(["Identifier", "StringLiteral"]),
+ body: (0, _utils.validateType)(["TSModuleBlock", "TSModuleDeclaration"])
+ }
+});
+(0, _utils.default)("TSModuleBlock", {
+ aliases: ["Scopable", "Block", "BlockParent"],
+ visitor: ["body"],
+ fields: {
+ body: (0, _utils.validateArrayOfType)("Statement")
+ }
+});
+(0, _utils.default)("TSImportType", {
+ aliases: ["TSType"],
+ visitor: ["argument", "qualifier", "typeParameters"],
+ fields: {
+ argument: (0, _utils.validateType)("StringLiteral"),
+ qualifier: (0, _utils.validateOptionalType)("TSEntityName"),
+ typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation")
+ }
+});
+(0, _utils.default)("TSImportEqualsDeclaration", {
+ aliases: ["Statement"],
+ visitor: ["id", "moduleReference"],
+ fields: {
+ isExport: (0, _utils.validate)(bool),
+ id: (0, _utils.validateType)("Identifier"),
+ moduleReference: (0, _utils.validateType)(["TSEntityName", "TSExternalModuleReference"]),
+ importKind: {
+ validate: (0, _utils.assertOneOf)("type", "value"),
+ optional: true
+ }
+ }
+});
+(0, _utils.default)("TSExternalModuleReference", {
+ visitor: ["expression"],
+ fields: {
+ expression: (0, _utils.validateType)("StringLiteral")
+ }
+});
+(0, _utils.default)("TSNonNullExpression", {
+ aliases: ["Expression"],
+ visitor: ["expression"],
+ fields: {
+ expression: (0, _utils.validateType)("Expression")
+ }
+});
+(0, _utils.default)("TSExportAssignment", {
+ aliases: ["Statement"],
+ visitor: ["expression"],
+ fields: {
+ expression: (0, _utils.validateType)("Expression")
+ }
+});
+(0, _utils.default)("TSNamespaceExportDeclaration", {
+ aliases: ["Statement"],
+ visitor: ["id"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier")
+ }
+});
+(0, _utils.default)("TSTypeAnnotation", {
+ visitor: ["typeAnnotation"],
+ fields: {
+ typeAnnotation: {
+ validate: (0, _utils.assertNodeType)("TSType")
+ }
+ }
+});
+(0, _utils.default)("TSTypeParameterInstantiation", {
+ visitor: ["params"],
+ fields: {
+ params: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSType")))
+ }
+ }
+});
+(0, _utils.default)("TSTypeParameterDeclaration", {
+ visitor: ["params"],
+ fields: {
+ params: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSTypeParameter")))
+ }
+ }
+});
+(0, _utils.default)("TSTypeParameter", {
+ builder: ["constraint", "default", "name"],
+ visitor: ["constraint", "default"],
+ fields: {
+ name: {
+ validate: (0, _utils.assertValueType)("string")
+ },
+ constraint: {
+ validate: (0, _utils.assertNodeType)("TSType"),
+ optional: true
+ },
+ default: {
+ validate: (0, _utils.assertNodeType)("TSType"),
+ optional: true
+ }
+ }
+}); \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/definitions/utils.js b/chromium/third_party/node/node_modules/@babel/types/lib/definitions/utils.js
new file mode 100644
index 00000000000..2acdae532aa
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/definitions/utils.js
@@ -0,0 +1,324 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.validate = validate;
+exports.typeIs = typeIs;
+exports.validateType = validateType;
+exports.validateOptional = validateOptional;
+exports.validateOptionalType = validateOptionalType;
+exports.arrayOf = arrayOf;
+exports.arrayOfType = arrayOfType;
+exports.validateArrayOfType = validateArrayOfType;
+exports.assertEach = assertEach;
+exports.assertOneOf = assertOneOf;
+exports.assertNodeType = assertNodeType;
+exports.assertNodeOrValueType = assertNodeOrValueType;
+exports.assertValueType = assertValueType;
+exports.assertShape = assertShape;
+exports.assertOptionalChainStart = assertOptionalChainStart;
+exports.chain = chain;
+exports.default = defineType;
+exports.NODE_PARENT_VALIDATIONS = exports.DEPRECATED_KEYS = exports.BUILDER_KEYS = exports.NODE_FIELDS = exports.FLIPPED_ALIAS_KEYS = exports.ALIAS_KEYS = exports.VISITOR_KEYS = void 0;
+
+var _is = require("../validators/is");
+
+var _validate = require("../validators/validate");
+
+const VISITOR_KEYS = {};
+exports.VISITOR_KEYS = VISITOR_KEYS;
+const ALIAS_KEYS = {};
+exports.ALIAS_KEYS = ALIAS_KEYS;
+const FLIPPED_ALIAS_KEYS = {};
+exports.FLIPPED_ALIAS_KEYS = FLIPPED_ALIAS_KEYS;
+const NODE_FIELDS = {};
+exports.NODE_FIELDS = NODE_FIELDS;
+const BUILDER_KEYS = {};
+exports.BUILDER_KEYS = BUILDER_KEYS;
+const DEPRECATED_KEYS = {};
+exports.DEPRECATED_KEYS = DEPRECATED_KEYS;
+const NODE_PARENT_VALIDATIONS = {};
+exports.NODE_PARENT_VALIDATIONS = NODE_PARENT_VALIDATIONS;
+
+function getType(val) {
+ if (Array.isArray(val)) {
+ return "array";
+ } else if (val === null) {
+ return "null";
+ } else {
+ return typeof val;
+ }
+}
+
+function validate(validate) {
+ return {
+ validate
+ };
+}
+
+function typeIs(typeName) {
+ return typeof typeName === "string" ? assertNodeType(typeName) : assertNodeType(...typeName);
+}
+
+function validateType(typeName) {
+ return validate(typeIs(typeName));
+}
+
+function validateOptional(validate) {
+ return {
+ validate,
+ optional: true
+ };
+}
+
+function validateOptionalType(typeName) {
+ return {
+ validate: typeIs(typeName),
+ optional: true
+ };
+}
+
+function arrayOf(elementType) {
+ return chain(assertValueType("array"), assertEach(elementType));
+}
+
+function arrayOfType(typeName) {
+ return arrayOf(typeIs(typeName));
+}
+
+function validateArrayOfType(typeName) {
+ return validate(arrayOfType(typeName));
+}
+
+function assertEach(callback) {
+ function validator(node, key, val) {
+ if (!Array.isArray(val)) return;
+
+ for (let i = 0; i < val.length; i++) {
+ const subkey = `${key}[${i}]`;
+ const v = val[i];
+ callback(node, subkey, v);
+ if (process.env.BABEL_TYPES_8_BREAKING) (0, _validate.validateChild)(node, subkey, v);
+ }
+ }
+
+ validator.each = callback;
+ return validator;
+}
+
+function assertOneOf(...values) {
+ function validate(node, key, val) {
+ if (values.indexOf(val) < 0) {
+ throw new TypeError(`Property ${key} expected value to be one of ${JSON.stringify(values)} but got ${JSON.stringify(val)}`);
+ }
+ }
+
+ validate.oneOf = values;
+ return validate;
+}
+
+function assertNodeType(...types) {
+ function validate(node, key, val) {
+ for (const type of types) {
+ if ((0, _is.default)(type, val)) {
+ (0, _validate.validateChild)(node, key, val);
+ return;
+ }
+ }
+
+ throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types)} but instead got ${JSON.stringify(val == null ? void 0 : val.type)}`);
+ }
+
+ validate.oneOfNodeTypes = types;
+ return validate;
+}
+
+function assertNodeOrValueType(...types) {
+ function validate(node, key, val) {
+ for (const type of types) {
+ if (getType(val) === type || (0, _is.default)(type, val)) {
+ (0, _validate.validateChild)(node, key, val);
+ return;
+ }
+ }
+
+ throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types)} but instead got ${JSON.stringify(val == null ? void 0 : val.type)}`);
+ }
+
+ validate.oneOfNodeOrValueTypes = types;
+ return validate;
+}
+
+function assertValueType(type) {
+ function validate(node, key, val) {
+ const valid = getType(val) === type;
+
+ if (!valid) {
+ throw new TypeError(`Property ${key} expected type of ${type} but got ${getType(val)}`);
+ }
+ }
+
+ validate.type = type;
+ return validate;
+}
+
+function assertShape(shape) {
+ function validate(node, key, val) {
+ const errors = [];
+
+ for (const property of Object.keys(shape)) {
+ try {
+ (0, _validate.validateField)(node, property, val[property], shape[property]);
+ } catch (error) {
+ if (error instanceof TypeError) {
+ errors.push(error.message);
+ continue;
+ }
+
+ throw error;
+ }
+ }
+
+ if (errors.length) {
+ throw new TypeError(`Property ${key} of ${node.type} expected to have the following:\n${errors.join("\n")}`);
+ }
+ }
+
+ validate.shapeOf = shape;
+ return validate;
+}
+
+function assertOptionalChainStart() {
+ function validate(node) {
+ var _current;
+
+ let current = node;
+
+ while (node) {
+ const {
+ type
+ } = current;
+
+ if (type === "OptionalCallExpression") {
+ if (current.optional) return;
+ current = current.callee;
+ continue;
+ }
+
+ if (type === "OptionalMemberExpression") {
+ if (current.optional) return;
+ current = current.object;
+ continue;
+ }
+
+ break;
+ }
+
+ throw new TypeError(`Non-optional ${node.type} must chain from an optional OptionalMemberExpression or OptionalCallExpression. Found chain from ${(_current = current) == null ? void 0 : _current.type}`);
+ }
+
+ return validate;
+}
+
+function chain(...fns) {
+ function validate(...args) {
+ for (const fn of fns) {
+ fn(...args);
+ }
+ }
+
+ validate.chainOf = fns;
+
+ if (fns.length >= 2 && "type" in fns[0] && fns[0].type === "array" && !("each" in fns[1])) {
+ throw new Error(`An assertValueType("array") validator can only be followed by an assertEach(...) validator.`);
+ }
+
+ return validate;
+}
+
+const validTypeOpts = ["aliases", "builder", "deprecatedAlias", "fields", "inherits", "visitor", "validate"];
+const validFieldKeys = ["default", "optional", "validate"];
+
+function defineType(type, opts = {}) {
+ const inherits = opts.inherits && store[opts.inherits] || {};
+ let fields = opts.fields;
+
+ if (!fields) {
+ fields = {};
+
+ if (inherits.fields) {
+ const keys = Object.getOwnPropertyNames(inherits.fields);
+
+ for (const key of keys) {
+ const field = inherits.fields[key];
+ const def = field.default;
+
+ if (Array.isArray(def) ? def.length > 0 : def && typeof def === "object") {
+ throw new Error("field defaults can only be primitives or empty arrays currently");
+ }
+
+ fields[key] = {
+ default: Array.isArray(def) ? [] : def,
+ optional: field.optional,
+ validate: field.validate
+ };
+ }
+ }
+ }
+
+ const visitor = opts.visitor || inherits.visitor || [];
+ const aliases = opts.aliases || inherits.aliases || [];
+ const builder = opts.builder || inherits.builder || opts.visitor || [];
+
+ for (const k of Object.keys(opts)) {
+ if (validTypeOpts.indexOf(k) === -1) {
+ throw new Error(`Unknown type option "${k}" on ${type}`);
+ }
+ }
+
+ if (opts.deprecatedAlias) {
+ DEPRECATED_KEYS[opts.deprecatedAlias] = type;
+ }
+
+ for (const key of visitor.concat(builder)) {
+ fields[key] = fields[key] || {};
+ }
+
+ for (const key of Object.keys(fields)) {
+ const field = fields[key];
+
+ if (field.default !== undefined && builder.indexOf(key) === -1) {
+ field.optional = true;
+ }
+
+ if (field.default === undefined) {
+ field.default = null;
+ } else if (!field.validate && field.default != null) {
+ field.validate = assertValueType(getType(field.default));
+ }
+
+ for (const k of Object.keys(field)) {
+ if (validFieldKeys.indexOf(k) === -1) {
+ throw new Error(`Unknown field key "${k}" on ${type}.${key}`);
+ }
+ }
+ }
+
+ VISITOR_KEYS[type] = opts.visitor = visitor;
+ BUILDER_KEYS[type] = opts.builder = builder;
+ NODE_FIELDS[type] = opts.fields = fields;
+ ALIAS_KEYS[type] = opts.aliases = aliases;
+ aliases.forEach(alias => {
+ FLIPPED_ALIAS_KEYS[alias] = FLIPPED_ALIAS_KEYS[alias] || [];
+ FLIPPED_ALIAS_KEYS[alias].push(type);
+ });
+
+ if (opts.validate) {
+ NODE_PARENT_VALIDATIONS[type] = opts.validate;
+ }
+
+ store[type] = opts;
+}
+
+const store = {}; \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/index.js b/chromium/third_party/node/node_modules/@babel/types/lib/index.js
new file mode 100644
index 00000000000..6fd730b5223
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/index.js
@@ -0,0 +1,647 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+var _exportNames = {
+ react: true,
+ assertNode: true,
+ createTypeAnnotationBasedOnTypeof: true,
+ createUnionTypeAnnotation: true,
+ createFlowUnionType: true,
+ createTSUnionType: true,
+ cloneNode: true,
+ clone: true,
+ cloneDeep: true,
+ cloneDeepWithoutLoc: true,
+ cloneWithoutLoc: true,
+ addComment: true,
+ addComments: true,
+ inheritInnerComments: true,
+ inheritLeadingComments: true,
+ inheritsComments: true,
+ inheritTrailingComments: true,
+ removeComments: true,
+ ensureBlock: true,
+ toBindingIdentifierName: true,
+ toBlock: true,
+ toComputedKey: true,
+ toExpression: true,
+ toIdentifier: true,
+ toKeyAlias: true,
+ toSequenceExpression: true,
+ toStatement: true,
+ valueToNode: true,
+ appendToMemberExpression: true,
+ inherits: true,
+ prependToMemberExpression: true,
+ removeProperties: true,
+ removePropertiesDeep: true,
+ removeTypeDuplicates: true,
+ getBindingIdentifiers: true,
+ getOuterBindingIdentifiers: true,
+ traverse: true,
+ traverseFast: true,
+ shallowEqual: true,
+ is: true,
+ isBinding: true,
+ isBlockScoped: true,
+ isImmutable: true,
+ isLet: true,
+ isNode: true,
+ isNodesEquivalent: true,
+ isPlaceholderType: true,
+ isReferenced: true,
+ isScope: true,
+ isSpecifierDefault: true,
+ isType: true,
+ isValidES3Identifier: true,
+ isValidIdentifier: true,
+ isVar: true,
+ matchesPattern: true,
+ validate: true,
+ buildMatchMemberExpression: true
+};
+Object.defineProperty(exports, "assertNode", {
+ enumerable: true,
+ get: function () {
+ return _assertNode.default;
+ }
+});
+Object.defineProperty(exports, "createTypeAnnotationBasedOnTypeof", {
+ enumerable: true,
+ get: function () {
+ return _createTypeAnnotationBasedOnTypeof.default;
+ }
+});
+Object.defineProperty(exports, "createUnionTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _createFlowUnionType.default;
+ }
+});
+Object.defineProperty(exports, "createFlowUnionType", {
+ enumerable: true,
+ get: function () {
+ return _createFlowUnionType.default;
+ }
+});
+Object.defineProperty(exports, "createTSUnionType", {
+ enumerable: true,
+ get: function () {
+ return _createTSUnionType.default;
+ }
+});
+Object.defineProperty(exports, "cloneNode", {
+ enumerable: true,
+ get: function () {
+ return _cloneNode.default;
+ }
+});
+Object.defineProperty(exports, "clone", {
+ enumerable: true,
+ get: function () {
+ return _clone.default;
+ }
+});
+Object.defineProperty(exports, "cloneDeep", {
+ enumerable: true,
+ get: function () {
+ return _cloneDeep.default;
+ }
+});
+Object.defineProperty(exports, "cloneDeepWithoutLoc", {
+ enumerable: true,
+ get: function () {
+ return _cloneDeepWithoutLoc.default;
+ }
+});
+Object.defineProperty(exports, "cloneWithoutLoc", {
+ enumerable: true,
+ get: function () {
+ return _cloneWithoutLoc.default;
+ }
+});
+Object.defineProperty(exports, "addComment", {
+ enumerable: true,
+ get: function () {
+ return _addComment.default;
+ }
+});
+Object.defineProperty(exports, "addComments", {
+ enumerable: true,
+ get: function () {
+ return _addComments.default;
+ }
+});
+Object.defineProperty(exports, "inheritInnerComments", {
+ enumerable: true,
+ get: function () {
+ return _inheritInnerComments.default;
+ }
+});
+Object.defineProperty(exports, "inheritLeadingComments", {
+ enumerable: true,
+ get: function () {
+ return _inheritLeadingComments.default;
+ }
+});
+Object.defineProperty(exports, "inheritsComments", {
+ enumerable: true,
+ get: function () {
+ return _inheritsComments.default;
+ }
+});
+Object.defineProperty(exports, "inheritTrailingComments", {
+ enumerable: true,
+ get: function () {
+ return _inheritTrailingComments.default;
+ }
+});
+Object.defineProperty(exports, "removeComments", {
+ enumerable: true,
+ get: function () {
+ return _removeComments.default;
+ }
+});
+Object.defineProperty(exports, "ensureBlock", {
+ enumerable: true,
+ get: function () {
+ return _ensureBlock.default;
+ }
+});
+Object.defineProperty(exports, "toBindingIdentifierName", {
+ enumerable: true,
+ get: function () {
+ return _toBindingIdentifierName.default;
+ }
+});
+Object.defineProperty(exports, "toBlock", {
+ enumerable: true,
+ get: function () {
+ return _toBlock.default;
+ }
+});
+Object.defineProperty(exports, "toComputedKey", {
+ enumerable: true,
+ get: function () {
+ return _toComputedKey.default;
+ }
+});
+Object.defineProperty(exports, "toExpression", {
+ enumerable: true,
+ get: function () {
+ return _toExpression.default;
+ }
+});
+Object.defineProperty(exports, "toIdentifier", {
+ enumerable: true,
+ get: function () {
+ return _toIdentifier.default;
+ }
+});
+Object.defineProperty(exports, "toKeyAlias", {
+ enumerable: true,
+ get: function () {
+ return _toKeyAlias.default;
+ }
+});
+Object.defineProperty(exports, "toSequenceExpression", {
+ enumerable: true,
+ get: function () {
+ return _toSequenceExpression.default;
+ }
+});
+Object.defineProperty(exports, "toStatement", {
+ enumerable: true,
+ get: function () {
+ return _toStatement.default;
+ }
+});
+Object.defineProperty(exports, "valueToNode", {
+ enumerable: true,
+ get: function () {
+ return _valueToNode.default;
+ }
+});
+Object.defineProperty(exports, "appendToMemberExpression", {
+ enumerable: true,
+ get: function () {
+ return _appendToMemberExpression.default;
+ }
+});
+Object.defineProperty(exports, "inherits", {
+ enumerable: true,
+ get: function () {
+ return _inherits.default;
+ }
+});
+Object.defineProperty(exports, "prependToMemberExpression", {
+ enumerable: true,
+ get: function () {
+ return _prependToMemberExpression.default;
+ }
+});
+Object.defineProperty(exports, "removeProperties", {
+ enumerable: true,
+ get: function () {
+ return _removeProperties.default;
+ }
+});
+Object.defineProperty(exports, "removePropertiesDeep", {
+ enumerable: true,
+ get: function () {
+ return _removePropertiesDeep.default;
+ }
+});
+Object.defineProperty(exports, "removeTypeDuplicates", {
+ enumerable: true,
+ get: function () {
+ return _removeTypeDuplicates.default;
+ }
+});
+Object.defineProperty(exports, "getBindingIdentifiers", {
+ enumerable: true,
+ get: function () {
+ return _getBindingIdentifiers.default;
+ }
+});
+Object.defineProperty(exports, "getOuterBindingIdentifiers", {
+ enumerable: true,
+ get: function () {
+ return _getOuterBindingIdentifiers.default;
+ }
+});
+Object.defineProperty(exports, "traverse", {
+ enumerable: true,
+ get: function () {
+ return _traverse.default;
+ }
+});
+Object.defineProperty(exports, "traverseFast", {
+ enumerable: true,
+ get: function () {
+ return _traverseFast.default;
+ }
+});
+Object.defineProperty(exports, "shallowEqual", {
+ enumerable: true,
+ get: function () {
+ return _shallowEqual.default;
+ }
+});
+Object.defineProperty(exports, "is", {
+ enumerable: true,
+ get: function () {
+ return _is.default;
+ }
+});
+Object.defineProperty(exports, "isBinding", {
+ enumerable: true,
+ get: function () {
+ return _isBinding.default;
+ }
+});
+Object.defineProperty(exports, "isBlockScoped", {
+ enumerable: true,
+ get: function () {
+ return _isBlockScoped.default;
+ }
+});
+Object.defineProperty(exports, "isImmutable", {
+ enumerable: true,
+ get: function () {
+ return _isImmutable.default;
+ }
+});
+Object.defineProperty(exports, "isLet", {
+ enumerable: true,
+ get: function () {
+ return _isLet.default;
+ }
+});
+Object.defineProperty(exports, "isNode", {
+ enumerable: true,
+ get: function () {
+ return _isNode.default;
+ }
+});
+Object.defineProperty(exports, "isNodesEquivalent", {
+ enumerable: true,
+ get: function () {
+ return _isNodesEquivalent.default;
+ }
+});
+Object.defineProperty(exports, "isPlaceholderType", {
+ enumerable: true,
+ get: function () {
+ return _isPlaceholderType.default;
+ }
+});
+Object.defineProperty(exports, "isReferenced", {
+ enumerable: true,
+ get: function () {
+ return _isReferenced.default;
+ }
+});
+Object.defineProperty(exports, "isScope", {
+ enumerable: true,
+ get: function () {
+ return _isScope.default;
+ }
+});
+Object.defineProperty(exports, "isSpecifierDefault", {
+ enumerable: true,
+ get: function () {
+ return _isSpecifierDefault.default;
+ }
+});
+Object.defineProperty(exports, "isType", {
+ enumerable: true,
+ get: function () {
+ return _isType.default;
+ }
+});
+Object.defineProperty(exports, "isValidES3Identifier", {
+ enumerable: true,
+ get: function () {
+ return _isValidES3Identifier.default;
+ }
+});
+Object.defineProperty(exports, "isValidIdentifier", {
+ enumerable: true,
+ get: function () {
+ return _isValidIdentifier.default;
+ }
+});
+Object.defineProperty(exports, "isVar", {
+ enumerable: true,
+ get: function () {
+ return _isVar.default;
+ }
+});
+Object.defineProperty(exports, "matchesPattern", {
+ enumerable: true,
+ get: function () {
+ return _matchesPattern.default;
+ }
+});
+Object.defineProperty(exports, "validate", {
+ enumerable: true,
+ get: function () {
+ return _validate.default;
+ }
+});
+Object.defineProperty(exports, "buildMatchMemberExpression", {
+ enumerable: true,
+ get: function () {
+ return _buildMatchMemberExpression.default;
+ }
+});
+exports.react = void 0;
+
+var _isReactComponent = require("./validators/react/isReactComponent");
+
+var _isCompatTag = require("./validators/react/isCompatTag");
+
+var _buildChildren = require("./builders/react/buildChildren");
+
+var _assertNode = require("./asserts/assertNode");
+
+var _generated = require("./asserts/generated");
+
+Object.keys(_generated).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
+ if (key in exports && exports[key] === _generated[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _generated[key];
+ }
+ });
+});
+
+var _createTypeAnnotationBasedOnTypeof = require("./builders/flow/createTypeAnnotationBasedOnTypeof");
+
+var _createFlowUnionType = require("./builders/flow/createFlowUnionType");
+
+var _createTSUnionType = require("./builders/typescript/createTSUnionType");
+
+var _generated2 = require("./builders/generated");
+
+Object.keys(_generated2).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
+ if (key in exports && exports[key] === _generated2[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _generated2[key];
+ }
+ });
+});
+
+var _uppercase = require("./builders/generated/uppercase");
+
+Object.keys(_uppercase).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
+ if (key in exports && exports[key] === _uppercase[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _uppercase[key];
+ }
+ });
+});
+
+var _cloneNode = require("./clone/cloneNode");
+
+var _clone = require("./clone/clone");
+
+var _cloneDeep = require("./clone/cloneDeep");
+
+var _cloneDeepWithoutLoc = require("./clone/cloneDeepWithoutLoc");
+
+var _cloneWithoutLoc = require("./clone/cloneWithoutLoc");
+
+var _addComment = require("./comments/addComment");
+
+var _addComments = require("./comments/addComments");
+
+var _inheritInnerComments = require("./comments/inheritInnerComments");
+
+var _inheritLeadingComments = require("./comments/inheritLeadingComments");
+
+var _inheritsComments = require("./comments/inheritsComments");
+
+var _inheritTrailingComments = require("./comments/inheritTrailingComments");
+
+var _removeComments = require("./comments/removeComments");
+
+var _generated3 = require("./constants/generated");
+
+Object.keys(_generated3).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
+ if (key in exports && exports[key] === _generated3[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _generated3[key];
+ }
+ });
+});
+
+var _constants = require("./constants");
+
+Object.keys(_constants).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
+ if (key in exports && exports[key] === _constants[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _constants[key];
+ }
+ });
+});
+
+var _ensureBlock = require("./converters/ensureBlock");
+
+var _toBindingIdentifierName = require("./converters/toBindingIdentifierName");
+
+var _toBlock = require("./converters/toBlock");
+
+var _toComputedKey = require("./converters/toComputedKey");
+
+var _toExpression = require("./converters/toExpression");
+
+var _toIdentifier = require("./converters/toIdentifier");
+
+var _toKeyAlias = require("./converters/toKeyAlias");
+
+var _toSequenceExpression = require("./converters/toSequenceExpression");
+
+var _toStatement = require("./converters/toStatement");
+
+var _valueToNode = require("./converters/valueToNode");
+
+var _definitions = require("./definitions");
+
+Object.keys(_definitions).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
+ if (key in exports && exports[key] === _definitions[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _definitions[key];
+ }
+ });
+});
+
+var _appendToMemberExpression = require("./modifications/appendToMemberExpression");
+
+var _inherits = require("./modifications/inherits");
+
+var _prependToMemberExpression = require("./modifications/prependToMemberExpression");
+
+var _removeProperties = require("./modifications/removeProperties");
+
+var _removePropertiesDeep = require("./modifications/removePropertiesDeep");
+
+var _removeTypeDuplicates = require("./modifications/flow/removeTypeDuplicates");
+
+var _getBindingIdentifiers = require("./retrievers/getBindingIdentifiers");
+
+var _getOuterBindingIdentifiers = require("./retrievers/getOuterBindingIdentifiers");
+
+var _traverse = require("./traverse/traverse");
+
+Object.keys(_traverse).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
+ if (key in exports && exports[key] === _traverse[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _traverse[key];
+ }
+ });
+});
+
+var _traverseFast = require("./traverse/traverseFast");
+
+var _shallowEqual = require("./utils/shallowEqual");
+
+var _is = require("./validators/is");
+
+var _isBinding = require("./validators/isBinding");
+
+var _isBlockScoped = require("./validators/isBlockScoped");
+
+var _isImmutable = require("./validators/isImmutable");
+
+var _isLet = require("./validators/isLet");
+
+var _isNode = require("./validators/isNode");
+
+var _isNodesEquivalent = require("./validators/isNodesEquivalent");
+
+var _isPlaceholderType = require("./validators/isPlaceholderType");
+
+var _isReferenced = require("./validators/isReferenced");
+
+var _isScope = require("./validators/isScope");
+
+var _isSpecifierDefault = require("./validators/isSpecifierDefault");
+
+var _isType = require("./validators/isType");
+
+var _isValidES3Identifier = require("./validators/isValidES3Identifier");
+
+var _isValidIdentifier = require("./validators/isValidIdentifier");
+
+var _isVar = require("./validators/isVar");
+
+var _matchesPattern = require("./validators/matchesPattern");
+
+var _validate = require("./validators/validate");
+
+var _buildMatchMemberExpression = require("./validators/buildMatchMemberExpression");
+
+var _generated4 = require("./validators/generated");
+
+Object.keys(_generated4).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
+ if (key in exports && exports[key] === _generated4[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _generated4[key];
+ }
+ });
+});
+
+var _generated5 = require("./ast-types/generated");
+
+Object.keys(_generated5).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
+ if (key in exports && exports[key] === _generated5[key]) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _generated5[key];
+ }
+ });
+});
+const react = {
+ isReactComponent: _isReactComponent.default,
+ isCompatTag: _isCompatTag.default,
+ buildChildren: _buildChildren.default
+};
+exports.react = react; \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/index.js.flow b/chromium/third_party/node/node_modules/@babel/types/lib/index.js.flow
new file mode 100644
index 00000000000..315ab9c9e8a
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/index.js.flow
@@ -0,0 +1,2539 @@
+// NOTE: This file is autogenerated. Do not modify.
+// See packages/babel-types/scripts/generators/flow.js for script used.
+
+declare class BabelNodeComment {
+ value: string;
+ start: number;
+ end: number;
+ loc: BabelNodeSourceLocation;
+}
+
+declare class BabelNodeCommentBlock extends BabelNodeComment {
+ type: "CommentBlock";
+}
+
+declare class BabelNodeCommentLine extends BabelNodeComment {
+ type: "CommentLine";
+}
+
+declare class BabelNodeSourceLocation {
+ start: {
+ line: number;
+ column: number;
+ };
+
+ end: {
+ line: number;
+ column: number;
+ };
+}
+
+declare class BabelNode {
+ leadingComments?: Array<BabelNodeComment>;
+ innerComments?: Array<BabelNodeComment>;
+ trailingComments?: Array<BabelNodeComment>;
+ start: ?number;
+ end: ?number;
+ loc: ?BabelNodeSourceLocation;
+ extra?: { [string]: mixed };
+}
+
+declare class BabelNodeArrayExpression extends BabelNode {
+ type: "ArrayExpression";
+ elements?: Array<null | BabelNodeExpression | BabelNodeSpreadElement>;
+}
+
+declare class BabelNodeAssignmentExpression extends BabelNode {
+ type: "AssignmentExpression";
+ operator: string;
+ left: BabelNodeLVal;
+ right: BabelNodeExpression;
+}
+
+declare class BabelNodeBinaryExpression extends BabelNode {
+ type: "BinaryExpression";
+ operator: "+" | "-" | "/" | "%" | "*" | "**" | "&" | "|" | ">>" | ">>>" | "<<" | "^" | "==" | "===" | "!=" | "!==" | "in" | "instanceof" | ">" | "<" | ">=" | "<=";
+ left: BabelNodeExpression | BabelNodePrivateName;
+ right: BabelNodeExpression;
+}
+
+declare class BabelNodeInterpreterDirective extends BabelNode {
+ type: "InterpreterDirective";
+ value: string;
+}
+
+declare class BabelNodeDirective extends BabelNode {
+ type: "Directive";
+ value: BabelNodeDirectiveLiteral;
+}
+
+declare class BabelNodeDirectiveLiteral extends BabelNode {
+ type: "DirectiveLiteral";
+ value: string;
+}
+
+declare class BabelNodeBlockStatement extends BabelNode {
+ type: "BlockStatement";
+ body: Array<BabelNodeStatement>;
+ directives?: Array<BabelNodeDirective>;
+}
+
+declare class BabelNodeBreakStatement extends BabelNode {
+ type: "BreakStatement";
+ label?: BabelNodeIdentifier;
+}
+
+declare class BabelNodeCallExpression extends BabelNode {
+ type: "CallExpression";
+ callee: BabelNodeExpression | BabelNodeV8IntrinsicIdentifier;
+ arguments: Array<BabelNodeExpression | BabelNodeSpreadElement | BabelNodeJSXNamespacedName | BabelNodeArgumentPlaceholder>;
+ optional?: true | false;
+ typeArguments?: BabelNodeTypeParameterInstantiation;
+ typeParameters?: BabelNodeTSTypeParameterInstantiation;
+}
+
+declare class BabelNodeCatchClause extends BabelNode {
+ type: "CatchClause";
+ param?: BabelNodeIdentifier | BabelNodeArrayPattern | BabelNodeObjectPattern;
+ body: BabelNodeBlockStatement;
+}
+
+declare class BabelNodeConditionalExpression extends BabelNode {
+ type: "ConditionalExpression";
+ test: BabelNodeExpression;
+ consequent: BabelNodeExpression;
+ alternate: BabelNodeExpression;
+}
+
+declare class BabelNodeContinueStatement extends BabelNode {
+ type: "ContinueStatement";
+ label?: BabelNodeIdentifier;
+}
+
+declare class BabelNodeDebuggerStatement extends BabelNode {
+ type: "DebuggerStatement";
+}
+
+declare class BabelNodeDoWhileStatement extends BabelNode {
+ type: "DoWhileStatement";
+ test: BabelNodeExpression;
+ body: BabelNodeStatement;
+}
+
+declare class BabelNodeEmptyStatement extends BabelNode {
+ type: "EmptyStatement";
+}
+
+declare class BabelNodeExpressionStatement extends BabelNode {
+ type: "ExpressionStatement";
+ expression: BabelNodeExpression;
+}
+
+declare class BabelNodeFile extends BabelNode {
+ type: "File";
+ program: BabelNodeProgram;
+ comments?: Array<BabelNodeCommentBlock | BabelNodeCommentLine>;
+ tokens?: Array<any>;
+}
+
+declare class BabelNodeForInStatement extends BabelNode {
+ type: "ForInStatement";
+ left: BabelNodeVariableDeclaration | BabelNodeLVal;
+ right: BabelNodeExpression;
+ body: BabelNodeStatement;
+}
+
+declare class BabelNodeForStatement extends BabelNode {
+ type: "ForStatement";
+ init?: BabelNodeVariableDeclaration | BabelNodeExpression;
+ test?: BabelNodeExpression;
+ update?: BabelNodeExpression;
+ body: BabelNodeStatement;
+}
+
+declare class BabelNodeFunctionDeclaration extends BabelNode {
+ type: "FunctionDeclaration";
+ id?: BabelNodeIdentifier;
+ params: Array<BabelNodeIdentifier | BabelNodePattern | BabelNodeRestElement>;
+ body: BabelNodeBlockStatement;
+ generator?: boolean;
+ async?: boolean;
+ declare?: boolean;
+ returnType?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop;
+ typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop;
+}
+
+declare class BabelNodeFunctionExpression extends BabelNode {
+ type: "FunctionExpression";
+ id?: BabelNodeIdentifier;
+ params: Array<BabelNodeIdentifier | BabelNodePattern | BabelNodeRestElement>;
+ body: BabelNodeBlockStatement;
+ generator?: boolean;
+ async?: boolean;
+ returnType?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop;
+ typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop;
+}
+
+declare class BabelNodeIdentifier extends BabelNode {
+ type: "Identifier";
+ name: string;
+ decorators?: Array<BabelNodeDecorator>;
+ optional?: boolean;
+ typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop;
+}
+
+declare class BabelNodeIfStatement extends BabelNode {
+ type: "IfStatement";
+ test: BabelNodeExpression;
+ consequent: BabelNodeStatement;
+ alternate?: BabelNodeStatement;
+}
+
+declare class BabelNodeLabeledStatement extends BabelNode {
+ type: "LabeledStatement";
+ label: BabelNodeIdentifier;
+ body: BabelNodeStatement;
+}
+
+declare class BabelNodeStringLiteral extends BabelNode {
+ type: "StringLiteral";
+ value: string;
+}
+
+declare class BabelNodeNumericLiteral extends BabelNode {
+ type: "NumericLiteral";
+ value: number;
+}
+
+declare class BabelNodeNullLiteral extends BabelNode {
+ type: "NullLiteral";
+}
+
+declare class BabelNodeBooleanLiteral extends BabelNode {
+ type: "BooleanLiteral";
+ value: boolean;
+}
+
+declare class BabelNodeRegExpLiteral extends BabelNode {
+ type: "RegExpLiteral";
+ pattern: string;
+ flags?: string;
+}
+
+declare class BabelNodeLogicalExpression extends BabelNode {
+ type: "LogicalExpression";
+ operator: "||" | "&&" | "??";
+ left: BabelNodeExpression;
+ right: BabelNodeExpression;
+}
+
+declare class BabelNodeMemberExpression extends BabelNode {
+ type: "MemberExpression";
+ object: BabelNodeExpression;
+ property: BabelNodeExpression | BabelNodeIdentifier | BabelNodePrivateName;
+ computed?: boolean;
+ optional?: true | false;
+}
+
+declare class BabelNodeNewExpression extends BabelNode {
+ type: "NewExpression";
+ callee: BabelNodeExpression | BabelNodeV8IntrinsicIdentifier;
+ arguments: Array<BabelNodeExpression | BabelNodeSpreadElement | BabelNodeJSXNamespacedName | BabelNodeArgumentPlaceholder>;
+ optional?: true | false;
+ typeArguments?: BabelNodeTypeParameterInstantiation;
+ typeParameters?: BabelNodeTSTypeParameterInstantiation;
+}
+
+declare class BabelNodeProgram extends BabelNode {
+ type: "Program";
+ body: Array<BabelNodeStatement>;
+ directives?: Array<BabelNodeDirective>;
+ sourceType?: "script" | "module";
+ interpreter?: BabelNodeInterpreterDirective;
+ sourceFile: string;
+}
+
+declare class BabelNodeObjectExpression extends BabelNode {
+ type: "ObjectExpression";
+ properties: Array<BabelNodeObjectMethod | BabelNodeObjectProperty | BabelNodeSpreadElement>;
+}
+
+declare class BabelNodeObjectMethod extends BabelNode {
+ type: "ObjectMethod";
+ kind?: "method" | "get" | "set";
+ key: BabelNodeExpression | BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral;
+ params: Array<BabelNodeIdentifier | BabelNodePattern | BabelNodeRestElement>;
+ body: BabelNodeBlockStatement;
+ computed?: boolean;
+ generator?: boolean;
+ async?: boolean;
+ decorators?: Array<BabelNodeDecorator>;
+ returnType?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop;
+ typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop;
+}
+
+declare class BabelNodeObjectProperty extends BabelNode {
+ type: "ObjectProperty";
+ key: BabelNodeExpression | BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral;
+ value: BabelNodeExpression | BabelNodePatternLike;
+ computed?: boolean;
+ shorthand?: boolean;
+ decorators?: Array<BabelNodeDecorator>;
+}
+
+declare class BabelNodeRestElement extends BabelNode {
+ type: "RestElement";
+ argument: BabelNodeLVal;
+ decorators?: Array<BabelNodeDecorator>;
+ optional?: boolean;
+ typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop;
+}
+
+declare class BabelNodeReturnStatement extends BabelNode {
+ type: "ReturnStatement";
+ argument?: BabelNodeExpression;
+}
+
+declare class BabelNodeSequenceExpression extends BabelNode {
+ type: "SequenceExpression";
+ expressions: Array<BabelNodeExpression>;
+}
+
+declare class BabelNodeParenthesizedExpression extends BabelNode {
+ type: "ParenthesizedExpression";
+ expression: BabelNodeExpression;
+}
+
+declare class BabelNodeSwitchCase extends BabelNode {
+ type: "SwitchCase";
+ test?: BabelNodeExpression;
+ consequent: Array<BabelNodeStatement>;
+}
+
+declare class BabelNodeSwitchStatement extends BabelNode {
+ type: "SwitchStatement";
+ discriminant: BabelNodeExpression;
+ cases: Array<BabelNodeSwitchCase>;
+}
+
+declare class BabelNodeThisExpression extends BabelNode {
+ type: "ThisExpression";
+}
+
+declare class BabelNodeThrowStatement extends BabelNode {
+ type: "ThrowStatement";
+ argument: BabelNodeExpression;
+}
+
+declare class BabelNodeTryStatement extends BabelNode {
+ type: "TryStatement";
+ block: BabelNodeBlockStatement;
+ handler?: BabelNodeCatchClause;
+ finalizer?: BabelNodeBlockStatement;
+}
+
+declare class BabelNodeUnaryExpression extends BabelNode {
+ type: "UnaryExpression";
+ operator: "void" | "throw" | "delete" | "!" | "+" | "-" | "~" | "typeof";
+ argument: BabelNodeExpression;
+ prefix?: boolean;
+}
+
+declare class BabelNodeUpdateExpression extends BabelNode {
+ type: "UpdateExpression";
+ operator: "++" | "--";
+ argument: BabelNodeExpression;
+ prefix?: boolean;
+}
+
+declare class BabelNodeVariableDeclaration extends BabelNode {
+ type: "VariableDeclaration";
+ kind: "var" | "let" | "const";
+ declarations: Array<BabelNodeVariableDeclarator>;
+ declare?: boolean;
+}
+
+declare class BabelNodeVariableDeclarator extends BabelNode {
+ type: "VariableDeclarator";
+ id: BabelNodeLVal;
+ init?: BabelNodeExpression;
+ definite?: boolean;
+}
+
+declare class BabelNodeWhileStatement extends BabelNode {
+ type: "WhileStatement";
+ test: BabelNodeExpression;
+ body: BabelNodeStatement;
+}
+
+declare class BabelNodeWithStatement extends BabelNode {
+ type: "WithStatement";
+ object: BabelNodeExpression;
+ body: BabelNodeStatement;
+}
+
+declare class BabelNodeAssignmentPattern extends BabelNode {
+ type: "AssignmentPattern";
+ left: BabelNodeIdentifier | BabelNodeObjectPattern | BabelNodeArrayPattern | BabelNodeMemberExpression;
+ right: BabelNodeExpression;
+ decorators?: Array<BabelNodeDecorator>;
+ typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop;
+}
+
+declare class BabelNodeArrayPattern extends BabelNode {
+ type: "ArrayPattern";
+ elements: Array<null | BabelNodePatternLike>;
+ decorators?: Array<BabelNodeDecorator>;
+ optional?: boolean;
+ typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop;
+}
+
+declare class BabelNodeArrowFunctionExpression extends BabelNode {
+ type: "ArrowFunctionExpression";
+ params: Array<BabelNodeIdentifier | BabelNodePattern | BabelNodeRestElement>;
+ body: BabelNodeBlockStatement | BabelNodeExpression;
+ async?: boolean;
+ expression: boolean;
+ generator?: boolean;
+ returnType?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop;
+ typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop;
+}
+
+declare class BabelNodeClassBody extends BabelNode {
+ type: "ClassBody";
+ body: Array<BabelNodeClassMethod | BabelNodeClassPrivateMethod | BabelNodeClassProperty | BabelNodeClassPrivateProperty | BabelNodeTSDeclareMethod | BabelNodeTSIndexSignature>;
+}
+
+declare class BabelNodeClassExpression extends BabelNode {
+ type: "ClassExpression";
+ id?: BabelNodeIdentifier;
+ superClass?: BabelNodeExpression;
+ body: BabelNodeClassBody;
+ decorators?: Array<BabelNodeDecorator>;
+ mixins?: BabelNodeInterfaceExtends;
+ superTypeParameters?: BabelNodeTypeParameterInstantiation | BabelNodeTSTypeParameterInstantiation;
+ typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop;
+}
+
+declare class BabelNodeClassDeclaration extends BabelNode {
+ type: "ClassDeclaration";
+ id: BabelNodeIdentifier;
+ superClass?: BabelNodeExpression;
+ body: BabelNodeClassBody;
+ decorators?: Array<BabelNodeDecorator>;
+ abstract?: boolean;
+ declare?: boolean;
+ mixins?: BabelNodeInterfaceExtends;
+ superTypeParameters?: BabelNodeTypeParameterInstantiation | BabelNodeTSTypeParameterInstantiation;
+ typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop;
+}
+
+declare class BabelNodeExportAllDeclaration extends BabelNode {
+ type: "ExportAllDeclaration";
+ source: BabelNodeStringLiteral;
+ assertions?: Array<BabelNodeImportAttribute>;
+ exportKind?: "type" | "value";
+}
+
+declare class BabelNodeExportDefaultDeclaration extends BabelNode {
+ type: "ExportDefaultDeclaration";
+ declaration: BabelNodeFunctionDeclaration | BabelNodeTSDeclareFunction | BabelNodeClassDeclaration | BabelNodeExpression;
+ exportKind?: "value";
+}
+
+declare class BabelNodeExportNamedDeclaration extends BabelNode {
+ type: "ExportNamedDeclaration";
+ declaration?: BabelNodeDeclaration;
+ specifiers?: Array<BabelNodeExportSpecifier | BabelNodeExportDefaultSpecifier | BabelNodeExportNamespaceSpecifier>;
+ source?: BabelNodeStringLiteral;
+ assertions?: Array<BabelNodeImportAttribute>;
+ exportKind?: "type" | "value";
+}
+
+declare class BabelNodeExportSpecifier extends BabelNode {
+ type: "ExportSpecifier";
+ local: BabelNodeIdentifier;
+ exported: BabelNodeIdentifier | BabelNodeStringLiteral;
+}
+
+declare class BabelNodeForOfStatement extends BabelNode {
+ type: "ForOfStatement";
+ left: BabelNodeVariableDeclaration | BabelNodeLVal;
+ right: BabelNodeExpression;
+ body: BabelNodeStatement;
+}
+
+declare class BabelNodeImportDeclaration extends BabelNode {
+ type: "ImportDeclaration";
+ specifiers: Array<BabelNodeImportSpecifier | BabelNodeImportDefaultSpecifier | BabelNodeImportNamespaceSpecifier>;
+ source: BabelNodeStringLiteral;
+ assertions?: Array<BabelNodeImportAttribute>;
+ importKind?: "type" | "typeof" | "value";
+}
+
+declare class BabelNodeImportDefaultSpecifier extends BabelNode {
+ type: "ImportDefaultSpecifier";
+ local: BabelNodeIdentifier;
+}
+
+declare class BabelNodeImportNamespaceSpecifier extends BabelNode {
+ type: "ImportNamespaceSpecifier";
+ local: BabelNodeIdentifier;
+}
+
+declare class BabelNodeImportSpecifier extends BabelNode {
+ type: "ImportSpecifier";
+ local: BabelNodeIdentifier;
+ imported: BabelNodeIdentifier | BabelNodeStringLiteral;
+ importKind?: "type" | "typeof";
+}
+
+declare class BabelNodeMetaProperty extends BabelNode {
+ type: "MetaProperty";
+ meta: BabelNodeIdentifier;
+ property: BabelNodeIdentifier;
+}
+
+declare class BabelNodeClassMethod extends BabelNode {
+ type: "ClassMethod";
+ kind?: "get" | "set" | "method" | "constructor";
+ key: BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeExpression;
+ params: Array<BabelNodeIdentifier | BabelNodePattern | BabelNodeRestElement | BabelNodeTSParameterProperty>;
+ body: BabelNodeBlockStatement;
+ computed?: boolean;
+ generator?: boolean;
+ async?: boolean;
+ abstract?: boolean;
+ access?: "public" | "private" | "protected";
+ accessibility?: "public" | "private" | "protected";
+ decorators?: Array<BabelNodeDecorator>;
+ optional?: boolean;
+ override?: boolean;
+ returnType?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop;
+ typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop;
+}
+
+declare class BabelNodeObjectPattern extends BabelNode {
+ type: "ObjectPattern";
+ properties: Array<BabelNodeRestElement | BabelNodeObjectProperty>;
+ decorators?: Array<BabelNodeDecorator>;
+ typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop;
+}
+
+declare class BabelNodeSpreadElement extends BabelNode {
+ type: "SpreadElement";
+ argument: BabelNodeExpression;
+}
+
+declare class BabelNodeSuper extends BabelNode {
+ type: "Super";
+}
+
+declare class BabelNodeTaggedTemplateExpression extends BabelNode {
+ type: "TaggedTemplateExpression";
+ tag: BabelNodeExpression;
+ quasi: BabelNodeTemplateLiteral;
+ typeParameters?: BabelNodeTypeParameterInstantiation | BabelNodeTSTypeParameterInstantiation;
+}
+
+declare class BabelNodeTemplateElement extends BabelNode {
+ type: "TemplateElement";
+ value: { raw: string, cooked?: string };
+ tail?: boolean;
+}
+
+declare class BabelNodeTemplateLiteral extends BabelNode {
+ type: "TemplateLiteral";
+ quasis: Array<BabelNodeTemplateElement>;
+ expressions: Array<BabelNodeExpression | BabelNodeTSType>;
+}
+
+declare class BabelNodeYieldExpression extends BabelNode {
+ type: "YieldExpression";
+ argument?: BabelNodeExpression;
+ delegate?: boolean;
+}
+
+declare class BabelNodeAwaitExpression extends BabelNode {
+ type: "AwaitExpression";
+ argument: BabelNodeExpression;
+}
+
+declare class BabelNodeImport extends BabelNode {
+ type: "Import";
+}
+
+declare class BabelNodeBigIntLiteral extends BabelNode {
+ type: "BigIntLiteral";
+ value: string;
+}
+
+declare class BabelNodeExportNamespaceSpecifier extends BabelNode {
+ type: "ExportNamespaceSpecifier";
+ exported: BabelNodeIdentifier;
+}
+
+declare class BabelNodeOptionalMemberExpression extends BabelNode {
+ type: "OptionalMemberExpression";
+ object: BabelNodeExpression;
+ property: BabelNodeExpression | BabelNodeIdentifier;
+ computed?: boolean;
+ optional: boolean;
+}
+
+declare class BabelNodeOptionalCallExpression extends BabelNode {
+ type: "OptionalCallExpression";
+ callee: BabelNodeExpression;
+ arguments: Array<BabelNodeExpression | BabelNodeSpreadElement | BabelNodeJSXNamespacedName | BabelNodeArgumentPlaceholder>;
+ optional: boolean;
+ typeArguments?: BabelNodeTypeParameterInstantiation;
+ typeParameters?: BabelNodeTSTypeParameterInstantiation;
+}
+
+declare class BabelNodeClassProperty extends BabelNode {
+ type: "ClassProperty";
+ key: BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeExpression;
+ value?: BabelNodeExpression;
+ typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop;
+ decorators?: Array<BabelNodeDecorator>;
+ computed?: boolean;
+ abstract?: boolean;
+ accessibility?: "public" | "private" | "protected";
+ declare?: boolean;
+ definite?: boolean;
+ optional?: boolean;
+ override?: boolean;
+ readonly?: boolean;
+ variance?: BabelNodeVariance;
+}
+
+declare class BabelNodeClassPrivateProperty extends BabelNode {
+ type: "ClassPrivateProperty";
+ key: BabelNodePrivateName;
+ value?: BabelNodeExpression;
+ decorators?: Array<BabelNodeDecorator>;
+ definite?: boolean;
+ readonly?: boolean;
+ typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop;
+ variance?: BabelNodeVariance;
+}
+
+declare class BabelNodeClassPrivateMethod extends BabelNode {
+ type: "ClassPrivateMethod";
+ kind?: "get" | "set" | "method" | "constructor";
+ key: BabelNodePrivateName;
+ params: Array<BabelNodeIdentifier | BabelNodePattern | BabelNodeRestElement | BabelNodeTSParameterProperty>;
+ body: BabelNodeBlockStatement;
+ abstract?: boolean;
+ access?: "public" | "private" | "protected";
+ accessibility?: "public" | "private" | "protected";
+ async?: boolean;
+ computed?: boolean;
+ decorators?: Array<BabelNodeDecorator>;
+ generator?: boolean;
+ optional?: boolean;
+ override?: boolean;
+ returnType?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop;
+ typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop;
+}
+
+declare class BabelNodePrivateName extends BabelNode {
+ type: "PrivateName";
+ id: BabelNodeIdentifier;
+}
+
+declare class BabelNodeAnyTypeAnnotation extends BabelNode {
+ type: "AnyTypeAnnotation";
+}
+
+declare class BabelNodeArrayTypeAnnotation extends BabelNode {
+ type: "ArrayTypeAnnotation";
+ elementType: BabelNodeFlowType;
+}
+
+declare class BabelNodeBooleanTypeAnnotation extends BabelNode {
+ type: "BooleanTypeAnnotation";
+}
+
+declare class BabelNodeBooleanLiteralTypeAnnotation extends BabelNode {
+ type: "BooleanLiteralTypeAnnotation";
+ value: boolean;
+}
+
+declare class BabelNodeNullLiteralTypeAnnotation extends BabelNode {
+ type: "NullLiteralTypeAnnotation";
+}
+
+declare class BabelNodeClassImplements extends BabelNode {
+ type: "ClassImplements";
+ id: BabelNodeIdentifier;
+ typeParameters?: BabelNodeTypeParameterInstantiation;
+}
+
+declare class BabelNodeDeclareClass extends BabelNode {
+ type: "DeclareClass";
+ id: BabelNodeIdentifier;
+ typeParameters?: BabelNodeTypeParameterDeclaration;
+ body: BabelNodeObjectTypeAnnotation;
+ mixins?: Array<BabelNodeInterfaceExtends>;
+}
+
+declare class BabelNodeDeclareFunction extends BabelNode {
+ type: "DeclareFunction";
+ id: BabelNodeIdentifier;
+ predicate?: BabelNodeDeclaredPredicate;
+}
+
+declare class BabelNodeDeclareInterface extends BabelNode {
+ type: "DeclareInterface";
+ id: BabelNodeIdentifier;
+ typeParameters?: BabelNodeTypeParameterDeclaration;
+ body: BabelNodeObjectTypeAnnotation;
+ mixins?: Array<BabelNodeInterfaceExtends>;
+}
+
+declare class BabelNodeDeclareModule extends BabelNode {
+ type: "DeclareModule";
+ id: BabelNodeIdentifier | BabelNodeStringLiteral;
+ body: BabelNodeBlockStatement;
+ kind?: "CommonJS" | "ES";
+}
+
+declare class BabelNodeDeclareModuleExports extends BabelNode {
+ type: "DeclareModuleExports";
+ typeAnnotation: BabelNodeTypeAnnotation;
+}
+
+declare class BabelNodeDeclareTypeAlias extends BabelNode {
+ type: "DeclareTypeAlias";
+ id: BabelNodeIdentifier;
+ typeParameters?: BabelNodeTypeParameterDeclaration;
+ right: BabelNodeFlowType;
+}
+
+declare class BabelNodeDeclareOpaqueType extends BabelNode {
+ type: "DeclareOpaqueType";
+ id: BabelNodeIdentifier;
+ typeParameters?: BabelNodeTypeParameterDeclaration;
+ supertype?: BabelNodeFlowType;
+ impltype?: BabelNodeFlowType;
+}
+
+declare class BabelNodeDeclareVariable extends BabelNode {
+ type: "DeclareVariable";
+ id: BabelNodeIdentifier;
+}
+
+declare class BabelNodeDeclareExportDeclaration extends BabelNode {
+ type: "DeclareExportDeclaration";
+ declaration?: BabelNodeFlow;
+ specifiers?: Array<BabelNodeExportSpecifier | BabelNodeExportNamespaceSpecifier>;
+ source?: BabelNodeStringLiteral;
+}
+
+declare class BabelNodeDeclareExportAllDeclaration extends BabelNode {
+ type: "DeclareExportAllDeclaration";
+ source: BabelNodeStringLiteral;
+ exportKind?: "type" | "value";
+}
+
+declare class BabelNodeDeclaredPredicate extends BabelNode {
+ type: "DeclaredPredicate";
+ value: BabelNodeFlow;
+}
+
+declare class BabelNodeExistsTypeAnnotation extends BabelNode {
+ type: "ExistsTypeAnnotation";
+}
+
+declare class BabelNodeFunctionTypeAnnotation extends BabelNode {
+ type: "FunctionTypeAnnotation";
+ typeParameters?: BabelNodeTypeParameterDeclaration;
+ params: Array<BabelNodeFunctionTypeParam>;
+ rest?: BabelNodeFunctionTypeParam;
+ returnType: BabelNodeFlowType;
+}
+
+declare class BabelNodeFunctionTypeParam extends BabelNode {
+ type: "FunctionTypeParam";
+ name?: BabelNodeIdentifier;
+ typeAnnotation: BabelNodeFlowType;
+ optional?: boolean;
+}
+
+declare class BabelNodeGenericTypeAnnotation extends BabelNode {
+ type: "GenericTypeAnnotation";
+ id: BabelNodeIdentifier | BabelNodeQualifiedTypeIdentifier;
+ typeParameters?: BabelNodeTypeParameterInstantiation;
+}
+
+declare class BabelNodeInferredPredicate extends BabelNode {
+ type: "InferredPredicate";
+}
+
+declare class BabelNodeInterfaceExtends extends BabelNode {
+ type: "InterfaceExtends";
+ id: BabelNodeIdentifier | BabelNodeQualifiedTypeIdentifier;
+ typeParameters?: BabelNodeTypeParameterInstantiation;
+}
+
+declare class BabelNodeInterfaceDeclaration extends BabelNode {
+ type: "InterfaceDeclaration";
+ id: BabelNodeIdentifier;
+ typeParameters?: BabelNodeTypeParameterDeclaration;
+ body: BabelNodeObjectTypeAnnotation;
+ mixins?: Array<BabelNodeInterfaceExtends>;
+}
+
+declare class BabelNodeInterfaceTypeAnnotation extends BabelNode {
+ type: "InterfaceTypeAnnotation";
+ body: BabelNodeObjectTypeAnnotation;
+}
+
+declare class BabelNodeIntersectionTypeAnnotation extends BabelNode {
+ type: "IntersectionTypeAnnotation";
+ types: Array<BabelNodeFlowType>;
+}
+
+declare class BabelNodeMixedTypeAnnotation extends BabelNode {
+ type: "MixedTypeAnnotation";
+}
+
+declare class BabelNodeEmptyTypeAnnotation extends BabelNode {
+ type: "EmptyTypeAnnotation";
+}
+
+declare class BabelNodeNullableTypeAnnotation extends BabelNode {
+ type: "NullableTypeAnnotation";
+ typeAnnotation: BabelNodeFlowType;
+}
+
+declare class BabelNodeNumberLiteralTypeAnnotation extends BabelNode {
+ type: "NumberLiteralTypeAnnotation";
+ value: number;
+}
+
+declare class BabelNodeNumberTypeAnnotation extends BabelNode {
+ type: "NumberTypeAnnotation";
+}
+
+declare class BabelNodeObjectTypeAnnotation extends BabelNode {
+ type: "ObjectTypeAnnotation";
+ properties: Array<BabelNodeObjectTypeProperty | BabelNodeObjectTypeSpreadProperty>;
+ indexers?: Array<BabelNodeObjectTypeIndexer>;
+ callProperties?: Array<BabelNodeObjectTypeCallProperty>;
+ internalSlots?: Array<BabelNodeObjectTypeInternalSlot>;
+ exact?: boolean;
+ inexact?: boolean;
+}
+
+declare class BabelNodeObjectTypeInternalSlot extends BabelNode {
+ type: "ObjectTypeInternalSlot";
+ id: BabelNodeIdentifier;
+ value: BabelNodeFlowType;
+ optional: boolean;
+ method: boolean;
+}
+
+declare class BabelNodeObjectTypeCallProperty extends BabelNode {
+ type: "ObjectTypeCallProperty";
+ value: BabelNodeFlowType;
+}
+
+declare class BabelNodeObjectTypeIndexer extends BabelNode {
+ type: "ObjectTypeIndexer";
+ id?: BabelNodeIdentifier;
+ key: BabelNodeFlowType;
+ value: BabelNodeFlowType;
+ variance?: BabelNodeVariance;
+}
+
+declare class BabelNodeObjectTypeProperty extends BabelNode {
+ type: "ObjectTypeProperty";
+ key: BabelNodeIdentifier | BabelNodeStringLiteral;
+ value: BabelNodeFlowType;
+ variance?: BabelNodeVariance;
+ kind: "init" | "get" | "set";
+ method: boolean;
+ optional: boolean;
+ proto: boolean;
+}
+
+declare class BabelNodeObjectTypeSpreadProperty extends BabelNode {
+ type: "ObjectTypeSpreadProperty";
+ argument: BabelNodeFlowType;
+}
+
+declare class BabelNodeOpaqueType extends BabelNode {
+ type: "OpaqueType";
+ id: BabelNodeIdentifier;
+ typeParameters?: BabelNodeTypeParameterDeclaration;
+ supertype?: BabelNodeFlowType;
+ impltype: BabelNodeFlowType;
+}
+
+declare class BabelNodeQualifiedTypeIdentifier extends BabelNode {
+ type: "QualifiedTypeIdentifier";
+ id: BabelNodeIdentifier;
+ qualification: BabelNodeIdentifier | BabelNodeQualifiedTypeIdentifier;
+}
+
+declare class BabelNodeStringLiteralTypeAnnotation extends BabelNode {
+ type: "StringLiteralTypeAnnotation";
+ value: string;
+}
+
+declare class BabelNodeStringTypeAnnotation extends BabelNode {
+ type: "StringTypeAnnotation";
+}
+
+declare class BabelNodeSymbolTypeAnnotation extends BabelNode {
+ type: "SymbolTypeAnnotation";
+}
+
+declare class BabelNodeThisTypeAnnotation extends BabelNode {
+ type: "ThisTypeAnnotation";
+}
+
+declare class BabelNodeTupleTypeAnnotation extends BabelNode {
+ type: "TupleTypeAnnotation";
+ types: Array<BabelNodeFlowType>;
+}
+
+declare class BabelNodeTypeofTypeAnnotation extends BabelNode {
+ type: "TypeofTypeAnnotation";
+ argument: BabelNodeFlowType;
+}
+
+declare class BabelNodeTypeAlias extends BabelNode {
+ type: "TypeAlias";
+ id: BabelNodeIdentifier;
+ typeParameters?: BabelNodeTypeParameterDeclaration;
+ right: BabelNodeFlowType;
+}
+
+declare class BabelNodeTypeAnnotation extends BabelNode {
+ type: "TypeAnnotation";
+ typeAnnotation: BabelNodeFlowType;
+}
+
+declare class BabelNodeTypeCastExpression extends BabelNode {
+ type: "TypeCastExpression";
+ expression: BabelNodeExpression;
+ typeAnnotation: BabelNodeTypeAnnotation;
+}
+
+declare class BabelNodeTypeParameter extends BabelNode {
+ type: "TypeParameter";
+ bound?: BabelNodeTypeAnnotation;
+ variance?: BabelNodeVariance;
+ name: string;
+}
+
+declare class BabelNodeTypeParameterDeclaration extends BabelNode {
+ type: "TypeParameterDeclaration";
+ params: Array<BabelNodeTypeParameter>;
+}
+
+declare class BabelNodeTypeParameterInstantiation extends BabelNode {
+ type: "TypeParameterInstantiation";
+ params: Array<BabelNodeFlowType>;
+}
+
+declare class BabelNodeUnionTypeAnnotation extends BabelNode {
+ type: "UnionTypeAnnotation";
+ types: Array<BabelNodeFlowType>;
+}
+
+declare class BabelNodeVariance extends BabelNode {
+ type: "Variance";
+ kind: "minus" | "plus";
+}
+
+declare class BabelNodeVoidTypeAnnotation extends BabelNode {
+ type: "VoidTypeAnnotation";
+}
+
+declare class BabelNodeEnumDeclaration extends BabelNode {
+ type: "EnumDeclaration";
+ id: BabelNodeIdentifier;
+ body: BabelNodeEnumBooleanBody | BabelNodeEnumNumberBody | BabelNodeEnumStringBody | BabelNodeEnumSymbolBody;
+}
+
+declare class BabelNodeEnumBooleanBody extends BabelNode {
+ type: "EnumBooleanBody";
+ members: Array<BabelNodeEnumBooleanMember>;
+ explicitType: boolean;
+ hasUnknownMembers: boolean;
+}
+
+declare class BabelNodeEnumNumberBody extends BabelNode {
+ type: "EnumNumberBody";
+ members: Array<BabelNodeEnumNumberMember>;
+ explicitType: boolean;
+ hasUnknownMembers: boolean;
+}
+
+declare class BabelNodeEnumStringBody extends BabelNode {
+ type: "EnumStringBody";
+ members: Array<BabelNodeEnumStringMember | BabelNodeEnumDefaultedMember>;
+ explicitType: boolean;
+ hasUnknownMembers: boolean;
+}
+
+declare class BabelNodeEnumSymbolBody extends BabelNode {
+ type: "EnumSymbolBody";
+ members: Array<BabelNodeEnumDefaultedMember>;
+ hasUnknownMembers: boolean;
+}
+
+declare class BabelNodeEnumBooleanMember extends BabelNode {
+ type: "EnumBooleanMember";
+ id: BabelNodeIdentifier;
+ init: BabelNodeBooleanLiteral;
+}
+
+declare class BabelNodeEnumNumberMember extends BabelNode {
+ type: "EnumNumberMember";
+ id: BabelNodeIdentifier;
+ init: BabelNodeNumericLiteral;
+}
+
+declare class BabelNodeEnumStringMember extends BabelNode {
+ type: "EnumStringMember";
+ id: BabelNodeIdentifier;
+ init: BabelNodeStringLiteral;
+}
+
+declare class BabelNodeEnumDefaultedMember extends BabelNode {
+ type: "EnumDefaultedMember";
+ id: BabelNodeIdentifier;
+}
+
+declare class BabelNodeIndexedAccessType extends BabelNode {
+ type: "IndexedAccessType";
+ objectType: BabelNodeFlowType;
+ indexType: BabelNodeFlowType;
+}
+
+declare class BabelNodeOptionalIndexedAccessType extends BabelNode {
+ type: "OptionalIndexedAccessType";
+ objectType: BabelNodeFlowType;
+ indexType: BabelNodeFlowType;
+ optional: boolean;
+}
+
+declare class BabelNodeJSXAttribute extends BabelNode {
+ type: "JSXAttribute";
+ name: BabelNodeJSXIdentifier | BabelNodeJSXNamespacedName;
+ value?: BabelNodeJSXElement | BabelNodeJSXFragment | BabelNodeStringLiteral | BabelNodeJSXExpressionContainer;
+}
+
+declare class BabelNodeJSXClosingElement extends BabelNode {
+ type: "JSXClosingElement";
+ name: BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression | BabelNodeJSXNamespacedName;
+}
+
+declare class BabelNodeJSXElement extends BabelNode {
+ type: "JSXElement";
+ openingElement: BabelNodeJSXOpeningElement;
+ closingElement?: BabelNodeJSXClosingElement;
+ children: Array<BabelNodeJSXText | BabelNodeJSXExpressionContainer | BabelNodeJSXSpreadChild | BabelNodeJSXElement | BabelNodeJSXFragment>;
+ selfClosing?: boolean;
+}
+
+declare class BabelNodeJSXEmptyExpression extends BabelNode {
+ type: "JSXEmptyExpression";
+}
+
+declare class BabelNodeJSXExpressionContainer extends BabelNode {
+ type: "JSXExpressionContainer";
+ expression: BabelNodeExpression | BabelNodeJSXEmptyExpression;
+}
+
+declare class BabelNodeJSXSpreadChild extends BabelNode {
+ type: "JSXSpreadChild";
+ expression: BabelNodeExpression;
+}
+
+declare class BabelNodeJSXIdentifier extends BabelNode {
+ type: "JSXIdentifier";
+ name: string;
+}
+
+declare class BabelNodeJSXMemberExpression extends BabelNode {
+ type: "JSXMemberExpression";
+ object: BabelNodeJSXMemberExpression | BabelNodeJSXIdentifier;
+ property: BabelNodeJSXIdentifier;
+}
+
+declare class BabelNodeJSXNamespacedName extends BabelNode {
+ type: "JSXNamespacedName";
+ namespace: BabelNodeJSXIdentifier;
+ name: BabelNodeJSXIdentifier;
+}
+
+declare class BabelNodeJSXOpeningElement extends BabelNode {
+ type: "JSXOpeningElement";
+ name: BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression | BabelNodeJSXNamespacedName;
+ attributes: Array<BabelNodeJSXAttribute | BabelNodeJSXSpreadAttribute>;
+ selfClosing?: boolean;
+ typeParameters?: BabelNodeTypeParameterInstantiation | BabelNodeTSTypeParameterInstantiation;
+}
+
+declare class BabelNodeJSXSpreadAttribute extends BabelNode {
+ type: "JSXSpreadAttribute";
+ argument: BabelNodeExpression;
+}
+
+declare class BabelNodeJSXText extends BabelNode {
+ type: "JSXText";
+ value: string;
+}
+
+declare class BabelNodeJSXFragment extends BabelNode {
+ type: "JSXFragment";
+ openingFragment: BabelNodeJSXOpeningFragment;
+ closingFragment: BabelNodeJSXClosingFragment;
+ children: Array<BabelNodeJSXText | BabelNodeJSXExpressionContainer | BabelNodeJSXSpreadChild | BabelNodeJSXElement | BabelNodeJSXFragment>;
+}
+
+declare class BabelNodeJSXOpeningFragment extends BabelNode {
+ type: "JSXOpeningFragment";
+}
+
+declare class BabelNodeJSXClosingFragment extends BabelNode {
+ type: "JSXClosingFragment";
+}
+
+declare class BabelNodeNoop extends BabelNode {
+ type: "Noop";
+}
+
+declare class BabelNodePlaceholder extends BabelNode {
+ type: "Placeholder";
+ expectedNode: "Identifier" | "StringLiteral" | "Expression" | "Statement" | "Declaration" | "BlockStatement" | "ClassBody" | "Pattern";
+ name: BabelNodeIdentifier;
+}
+
+declare class BabelNodeV8IntrinsicIdentifier extends BabelNode {
+ type: "V8IntrinsicIdentifier";
+ name: string;
+}
+
+declare class BabelNodeArgumentPlaceholder extends BabelNode {
+ type: "ArgumentPlaceholder";
+}
+
+declare class BabelNodeBindExpression extends BabelNode {
+ type: "BindExpression";
+ object: BabelNodeExpression;
+ callee: BabelNodeExpression;
+}
+
+declare class BabelNodeImportAttribute extends BabelNode {
+ type: "ImportAttribute";
+ key: BabelNodeIdentifier | BabelNodeStringLiteral;
+ value: BabelNodeStringLiteral;
+}
+
+declare class BabelNodeDecorator extends BabelNode {
+ type: "Decorator";
+ expression: BabelNodeExpression;
+}
+
+declare class BabelNodeDoExpression extends BabelNode {
+ type: "DoExpression";
+ body: BabelNodeBlockStatement;
+ async?: boolean;
+}
+
+declare class BabelNodeExportDefaultSpecifier extends BabelNode {
+ type: "ExportDefaultSpecifier";
+ exported: BabelNodeIdentifier;
+}
+
+declare class BabelNodeRecordExpression extends BabelNode {
+ type: "RecordExpression";
+ properties: Array<BabelNodeObjectProperty | BabelNodeSpreadElement>;
+}
+
+declare class BabelNodeTupleExpression extends BabelNode {
+ type: "TupleExpression";
+ elements?: Array<BabelNodeExpression | BabelNodeSpreadElement>;
+}
+
+declare class BabelNodeDecimalLiteral extends BabelNode {
+ type: "DecimalLiteral";
+ value: string;
+}
+
+declare class BabelNodeStaticBlock extends BabelNode {
+ type: "StaticBlock";
+ body: Array<BabelNodeStatement>;
+}
+
+declare class BabelNodeModuleExpression extends BabelNode {
+ type: "ModuleExpression";
+ body: BabelNodeProgram;
+}
+
+declare class BabelNodeTopicReference extends BabelNode {
+ type: "TopicReference";
+}
+
+declare class BabelNodePipelineTopicExpression extends BabelNode {
+ type: "PipelineTopicExpression";
+ expression: BabelNodeExpression;
+}
+
+declare class BabelNodePipelineBareFunction extends BabelNode {
+ type: "PipelineBareFunction";
+ callee: BabelNodeExpression;
+}
+
+declare class BabelNodePipelinePrimaryTopicReference extends BabelNode {
+ type: "PipelinePrimaryTopicReference";
+}
+
+declare class BabelNodeTSParameterProperty extends BabelNode {
+ type: "TSParameterProperty";
+ parameter: BabelNodeIdentifier | BabelNodeAssignmentPattern;
+ accessibility?: "public" | "private" | "protected";
+ decorators?: Array<BabelNodeDecorator>;
+ override?: boolean;
+ readonly?: boolean;
+}
+
+declare class BabelNodeTSDeclareFunction extends BabelNode {
+ type: "TSDeclareFunction";
+ id?: BabelNodeIdentifier;
+ typeParameters?: BabelNodeTSTypeParameterDeclaration | BabelNodeNoop;
+ params: Array<BabelNodeIdentifier | BabelNodePattern | BabelNodeRestElement>;
+ returnType?: BabelNodeTSTypeAnnotation | BabelNodeNoop;
+ async?: boolean;
+ declare?: boolean;
+ generator?: boolean;
+}
+
+declare class BabelNodeTSDeclareMethod extends BabelNode {
+ type: "TSDeclareMethod";
+ decorators?: Array<BabelNodeDecorator>;
+ key: BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeExpression;
+ typeParameters?: BabelNodeTSTypeParameterDeclaration | BabelNodeNoop;
+ params: Array<BabelNodeIdentifier | BabelNodePattern | BabelNodeRestElement | BabelNodeTSParameterProperty>;
+ returnType?: BabelNodeTSTypeAnnotation | BabelNodeNoop;
+ abstract?: boolean;
+ access?: "public" | "private" | "protected";
+ accessibility?: "public" | "private" | "protected";
+ async?: boolean;
+ computed?: boolean;
+ generator?: boolean;
+ kind?: "get" | "set" | "method" | "constructor";
+ optional?: boolean;
+ override?: boolean;
+}
+
+declare class BabelNodeTSQualifiedName extends BabelNode {
+ type: "TSQualifiedName";
+ left: BabelNodeTSEntityName;
+ right: BabelNodeIdentifier;
+}
+
+declare class BabelNodeTSCallSignatureDeclaration extends BabelNode {
+ type: "TSCallSignatureDeclaration";
+ typeParameters?: BabelNodeTSTypeParameterDeclaration;
+ parameters: Array<BabelNodeIdentifier | BabelNodeRestElement>;
+ typeAnnotation?: BabelNodeTSTypeAnnotation;
+}
+
+declare class BabelNodeTSConstructSignatureDeclaration extends BabelNode {
+ type: "TSConstructSignatureDeclaration";
+ typeParameters?: BabelNodeTSTypeParameterDeclaration;
+ parameters: Array<BabelNodeIdentifier | BabelNodeRestElement>;
+ typeAnnotation?: BabelNodeTSTypeAnnotation;
+}
+
+declare class BabelNodeTSPropertySignature extends BabelNode {
+ type: "TSPropertySignature";
+ key: BabelNodeExpression;
+ typeAnnotation?: BabelNodeTSTypeAnnotation;
+ initializer?: BabelNodeExpression;
+ computed?: boolean;
+ kind: "get" | "set";
+ optional?: boolean;
+ readonly?: boolean;
+}
+
+declare class BabelNodeTSMethodSignature extends BabelNode {
+ type: "TSMethodSignature";
+ key: BabelNodeExpression;
+ typeParameters?: BabelNodeTSTypeParameterDeclaration;
+ parameters: Array<BabelNodeIdentifier | BabelNodeRestElement>;
+ typeAnnotation?: BabelNodeTSTypeAnnotation;
+ computed?: boolean;
+ kind: "method" | "get" | "set";
+ optional?: boolean;
+}
+
+declare class BabelNodeTSIndexSignature extends BabelNode {
+ type: "TSIndexSignature";
+ parameters: Array<BabelNodeIdentifier>;
+ typeAnnotation?: BabelNodeTSTypeAnnotation;
+ readonly?: boolean;
+}
+
+declare class BabelNodeTSAnyKeyword extends BabelNode {
+ type: "TSAnyKeyword";
+}
+
+declare class BabelNodeTSBooleanKeyword extends BabelNode {
+ type: "TSBooleanKeyword";
+}
+
+declare class BabelNodeTSBigIntKeyword extends BabelNode {
+ type: "TSBigIntKeyword";
+}
+
+declare class BabelNodeTSIntrinsicKeyword extends BabelNode {
+ type: "TSIntrinsicKeyword";
+}
+
+declare class BabelNodeTSNeverKeyword extends BabelNode {
+ type: "TSNeverKeyword";
+}
+
+declare class BabelNodeTSNullKeyword extends BabelNode {
+ type: "TSNullKeyword";
+}
+
+declare class BabelNodeTSNumberKeyword extends BabelNode {
+ type: "TSNumberKeyword";
+}
+
+declare class BabelNodeTSObjectKeyword extends BabelNode {
+ type: "TSObjectKeyword";
+}
+
+declare class BabelNodeTSStringKeyword extends BabelNode {
+ type: "TSStringKeyword";
+}
+
+declare class BabelNodeTSSymbolKeyword extends BabelNode {
+ type: "TSSymbolKeyword";
+}
+
+declare class BabelNodeTSUndefinedKeyword extends BabelNode {
+ type: "TSUndefinedKeyword";
+}
+
+declare class BabelNodeTSUnknownKeyword extends BabelNode {
+ type: "TSUnknownKeyword";
+}
+
+declare class BabelNodeTSVoidKeyword extends BabelNode {
+ type: "TSVoidKeyword";
+}
+
+declare class BabelNodeTSThisType extends BabelNode {
+ type: "TSThisType";
+}
+
+declare class BabelNodeTSFunctionType extends BabelNode {
+ type: "TSFunctionType";
+ typeParameters?: BabelNodeTSTypeParameterDeclaration;
+ parameters: Array<BabelNodeIdentifier | BabelNodeRestElement>;
+ typeAnnotation?: BabelNodeTSTypeAnnotation;
+}
+
+declare class BabelNodeTSConstructorType extends BabelNode {
+ type: "TSConstructorType";
+ typeParameters?: BabelNodeTSTypeParameterDeclaration;
+ parameters: Array<BabelNodeIdentifier | BabelNodeRestElement>;
+ typeAnnotation?: BabelNodeTSTypeAnnotation;
+ abstract?: boolean;
+}
+
+declare class BabelNodeTSTypeReference extends BabelNode {
+ type: "TSTypeReference";
+ typeName: BabelNodeTSEntityName;
+ typeParameters?: BabelNodeTSTypeParameterInstantiation;
+}
+
+declare class BabelNodeTSTypePredicate extends BabelNode {
+ type: "TSTypePredicate";
+ parameterName: BabelNodeIdentifier | BabelNodeTSThisType;
+ typeAnnotation?: BabelNodeTSTypeAnnotation;
+ asserts?: boolean;
+}
+
+declare class BabelNodeTSTypeQuery extends BabelNode {
+ type: "TSTypeQuery";
+ exprName: BabelNodeTSEntityName | BabelNodeTSImportType;
+}
+
+declare class BabelNodeTSTypeLiteral extends BabelNode {
+ type: "TSTypeLiteral";
+ members: Array<BabelNodeTSTypeElement>;
+}
+
+declare class BabelNodeTSArrayType extends BabelNode {
+ type: "TSArrayType";
+ elementType: BabelNodeTSType;
+}
+
+declare class BabelNodeTSTupleType extends BabelNode {
+ type: "TSTupleType";
+ elementTypes: Array<BabelNodeTSType | BabelNodeTSNamedTupleMember>;
+}
+
+declare class BabelNodeTSOptionalType extends BabelNode {
+ type: "TSOptionalType";
+ typeAnnotation: BabelNodeTSType;
+}
+
+declare class BabelNodeTSRestType extends BabelNode {
+ type: "TSRestType";
+ typeAnnotation: BabelNodeTSType;
+}
+
+declare class BabelNodeTSNamedTupleMember extends BabelNode {
+ type: "TSNamedTupleMember";
+ label: BabelNodeIdentifier;
+ elementType: BabelNodeTSType;
+ optional?: boolean;
+}
+
+declare class BabelNodeTSUnionType extends BabelNode {
+ type: "TSUnionType";
+ types: Array<BabelNodeTSType>;
+}
+
+declare class BabelNodeTSIntersectionType extends BabelNode {
+ type: "TSIntersectionType";
+ types: Array<BabelNodeTSType>;
+}
+
+declare class BabelNodeTSConditionalType extends BabelNode {
+ type: "TSConditionalType";
+ checkType: BabelNodeTSType;
+ extendsType: BabelNodeTSType;
+ trueType: BabelNodeTSType;
+ falseType: BabelNodeTSType;
+}
+
+declare class BabelNodeTSInferType extends BabelNode {
+ type: "TSInferType";
+ typeParameter: BabelNodeTSTypeParameter;
+}
+
+declare class BabelNodeTSParenthesizedType extends BabelNode {
+ type: "TSParenthesizedType";
+ typeAnnotation: BabelNodeTSType;
+}
+
+declare class BabelNodeTSTypeOperator extends BabelNode {
+ type: "TSTypeOperator";
+ typeAnnotation: BabelNodeTSType;
+ operator: string;
+}
+
+declare class BabelNodeTSIndexedAccessType extends BabelNode {
+ type: "TSIndexedAccessType";
+ objectType: BabelNodeTSType;
+ indexType: BabelNodeTSType;
+}
+
+declare class BabelNodeTSMappedType extends BabelNode {
+ type: "TSMappedType";
+ typeParameter: BabelNodeTSTypeParameter;
+ typeAnnotation?: BabelNodeTSType;
+ nameType?: BabelNodeTSType;
+ optional?: boolean;
+ readonly?: boolean;
+}
+
+declare class BabelNodeTSLiteralType extends BabelNode {
+ type: "TSLiteralType";
+ literal: BabelNodeNumericLiteral | BabelNodeStringLiteral | BabelNodeBooleanLiteral | BabelNodeBigIntLiteral | BabelNodeUnaryExpression;
+}
+
+declare class BabelNodeTSExpressionWithTypeArguments extends BabelNode {
+ type: "TSExpressionWithTypeArguments";
+ expression: BabelNodeTSEntityName;
+ typeParameters?: BabelNodeTSTypeParameterInstantiation;
+}
+
+declare class BabelNodeTSInterfaceDeclaration extends BabelNode {
+ type: "TSInterfaceDeclaration";
+ id: BabelNodeIdentifier;
+ typeParameters?: BabelNodeTSTypeParameterDeclaration;
+ body: BabelNodeTSInterfaceBody;
+ declare?: boolean;
+}
+
+declare class BabelNodeTSInterfaceBody extends BabelNode {
+ type: "TSInterfaceBody";
+ body: Array<BabelNodeTSTypeElement>;
+}
+
+declare class BabelNodeTSTypeAliasDeclaration extends BabelNode {
+ type: "TSTypeAliasDeclaration";
+ id: BabelNodeIdentifier;
+ typeParameters?: BabelNodeTSTypeParameterDeclaration;
+ typeAnnotation: BabelNodeTSType;
+ declare?: boolean;
+}
+
+declare class BabelNodeTSAsExpression extends BabelNode {
+ type: "TSAsExpression";
+ expression: BabelNodeExpression;
+ typeAnnotation: BabelNodeTSType;
+}
+
+declare class BabelNodeTSTypeAssertion extends BabelNode {
+ type: "TSTypeAssertion";
+ typeAnnotation: BabelNodeTSType;
+ expression: BabelNodeExpression;
+}
+
+declare class BabelNodeTSEnumDeclaration extends BabelNode {
+ type: "TSEnumDeclaration";
+ id: BabelNodeIdentifier;
+ members: Array<BabelNodeTSEnumMember>;
+ declare?: boolean;
+ initializer?: BabelNodeExpression;
+}
+
+declare class BabelNodeTSEnumMember extends BabelNode {
+ type: "TSEnumMember";
+ id: BabelNodeIdentifier | BabelNodeStringLiteral;
+ initializer?: BabelNodeExpression;
+}
+
+declare class BabelNodeTSModuleDeclaration extends BabelNode {
+ type: "TSModuleDeclaration";
+ id: BabelNodeIdentifier | BabelNodeStringLiteral;
+ body: BabelNodeTSModuleBlock | BabelNodeTSModuleDeclaration;
+ declare?: boolean;
+ global?: boolean;
+}
+
+declare class BabelNodeTSModuleBlock extends BabelNode {
+ type: "TSModuleBlock";
+ body: Array<BabelNodeStatement>;
+}
+
+declare class BabelNodeTSImportType extends BabelNode {
+ type: "TSImportType";
+ argument: BabelNodeStringLiteral;
+ qualifier?: BabelNodeTSEntityName;
+ typeParameters?: BabelNodeTSTypeParameterInstantiation;
+}
+
+declare class BabelNodeTSImportEqualsDeclaration extends BabelNode {
+ type: "TSImportEqualsDeclaration";
+ id: BabelNodeIdentifier;
+ moduleReference: BabelNodeTSEntityName | BabelNodeTSExternalModuleReference;
+ importKind?: "type" | "value";
+ isExport: boolean;
+}
+
+declare class BabelNodeTSExternalModuleReference extends BabelNode {
+ type: "TSExternalModuleReference";
+ expression: BabelNodeStringLiteral;
+}
+
+declare class BabelNodeTSNonNullExpression extends BabelNode {
+ type: "TSNonNullExpression";
+ expression: BabelNodeExpression;
+}
+
+declare class BabelNodeTSExportAssignment extends BabelNode {
+ type: "TSExportAssignment";
+ expression: BabelNodeExpression;
+}
+
+declare class BabelNodeTSNamespaceExportDeclaration extends BabelNode {
+ type: "TSNamespaceExportDeclaration";
+ id: BabelNodeIdentifier;
+}
+
+declare class BabelNodeTSTypeAnnotation extends BabelNode {
+ type: "TSTypeAnnotation";
+ typeAnnotation: BabelNodeTSType;
+}
+
+declare class BabelNodeTSTypeParameterInstantiation extends BabelNode {
+ type: "TSTypeParameterInstantiation";
+ params: Array<BabelNodeTSType>;
+}
+
+declare class BabelNodeTSTypeParameterDeclaration extends BabelNode {
+ type: "TSTypeParameterDeclaration";
+ params: Array<BabelNodeTSTypeParameter>;
+}
+
+declare class BabelNodeTSTypeParameter extends BabelNode {
+ type: "TSTypeParameter";
+ constraint?: BabelNodeTSType;
+ name: string;
+}
+
+type BabelNodeExpression = BabelNodeArrayExpression | BabelNodeAssignmentExpression | BabelNodeBinaryExpression | BabelNodeCallExpression | BabelNodeConditionalExpression | BabelNodeFunctionExpression | BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeNullLiteral | BabelNodeBooleanLiteral | BabelNodeRegExpLiteral | BabelNodeLogicalExpression | BabelNodeMemberExpression | BabelNodeNewExpression | BabelNodeObjectExpression | BabelNodeSequenceExpression | BabelNodeParenthesizedExpression | BabelNodeThisExpression | BabelNodeUnaryExpression | BabelNodeUpdateExpression | BabelNodeArrowFunctionExpression | BabelNodeClassExpression | BabelNodeMetaProperty | BabelNodeSuper | BabelNodeTaggedTemplateExpression | BabelNodeTemplateLiteral | BabelNodeYieldExpression | BabelNodeAwaitExpression | BabelNodeImport | BabelNodeBigIntLiteral | BabelNodeOptionalMemberExpression | BabelNodeOptionalCallExpression | BabelNodeTypeCastExpression | BabelNodeJSXElement | BabelNodeJSXFragment | BabelNodeBindExpression | BabelNodeDoExpression | BabelNodeRecordExpression | BabelNodeTupleExpression | BabelNodeDecimalLiteral | BabelNodeModuleExpression | BabelNodeTopicReference | BabelNodePipelineTopicExpression | BabelNodePipelineBareFunction | BabelNodePipelinePrimaryTopicReference | BabelNodeTSAsExpression | BabelNodeTSTypeAssertion | BabelNodeTSNonNullExpression;
+type BabelNodeBinary = BabelNodeBinaryExpression | BabelNodeLogicalExpression;
+type BabelNodeScopable = BabelNodeBlockStatement | BabelNodeCatchClause | BabelNodeDoWhileStatement | BabelNodeForInStatement | BabelNodeForStatement | BabelNodeFunctionDeclaration | BabelNodeFunctionExpression | BabelNodeProgram | BabelNodeObjectMethod | BabelNodeSwitchStatement | BabelNodeWhileStatement | BabelNodeArrowFunctionExpression | BabelNodeClassExpression | BabelNodeClassDeclaration | BabelNodeForOfStatement | BabelNodeClassMethod | BabelNodeClassPrivateMethod | BabelNodeStaticBlock | BabelNodeTSModuleBlock;
+type BabelNodeBlockParent = BabelNodeBlockStatement | BabelNodeCatchClause | BabelNodeDoWhileStatement | BabelNodeForInStatement | BabelNodeForStatement | BabelNodeFunctionDeclaration | BabelNodeFunctionExpression | BabelNodeProgram | BabelNodeObjectMethod | BabelNodeSwitchStatement | BabelNodeWhileStatement | BabelNodeArrowFunctionExpression | BabelNodeForOfStatement | BabelNodeClassMethod | BabelNodeClassPrivateMethod | BabelNodeStaticBlock | BabelNodeTSModuleBlock;
+type BabelNodeBlock = BabelNodeBlockStatement | BabelNodeProgram | BabelNodeTSModuleBlock;
+type BabelNodeStatement = BabelNodeBlockStatement | BabelNodeBreakStatement | BabelNodeContinueStatement | BabelNodeDebuggerStatement | BabelNodeDoWhileStatement | BabelNodeEmptyStatement | BabelNodeExpressionStatement | BabelNodeForInStatement | BabelNodeForStatement | BabelNodeFunctionDeclaration | BabelNodeIfStatement | BabelNodeLabeledStatement | BabelNodeReturnStatement | BabelNodeSwitchStatement | BabelNodeThrowStatement | BabelNodeTryStatement | BabelNodeVariableDeclaration | BabelNodeWhileStatement | BabelNodeWithStatement | BabelNodeClassDeclaration | BabelNodeExportAllDeclaration | BabelNodeExportDefaultDeclaration | BabelNodeExportNamedDeclaration | BabelNodeForOfStatement | BabelNodeImportDeclaration | BabelNodeDeclareClass | BabelNodeDeclareFunction | BabelNodeDeclareInterface | BabelNodeDeclareModule | BabelNodeDeclareModuleExports | BabelNodeDeclareTypeAlias | BabelNodeDeclareOpaqueType | BabelNodeDeclareVariable | BabelNodeDeclareExportDeclaration | BabelNodeDeclareExportAllDeclaration | BabelNodeInterfaceDeclaration | BabelNodeOpaqueType | BabelNodeTypeAlias | BabelNodeEnumDeclaration | BabelNodeTSDeclareFunction | BabelNodeTSInterfaceDeclaration | BabelNodeTSTypeAliasDeclaration | BabelNodeTSEnumDeclaration | BabelNodeTSModuleDeclaration | BabelNodeTSImportEqualsDeclaration | BabelNodeTSExportAssignment | BabelNodeTSNamespaceExportDeclaration;
+type BabelNodeTerminatorless = BabelNodeBreakStatement | BabelNodeContinueStatement | BabelNodeReturnStatement | BabelNodeThrowStatement | BabelNodeYieldExpression | BabelNodeAwaitExpression;
+type BabelNodeCompletionStatement = BabelNodeBreakStatement | BabelNodeContinueStatement | BabelNodeReturnStatement | BabelNodeThrowStatement;
+type BabelNodeConditional = BabelNodeConditionalExpression | BabelNodeIfStatement;
+type BabelNodeLoop = BabelNodeDoWhileStatement | BabelNodeForInStatement | BabelNodeForStatement | BabelNodeWhileStatement | BabelNodeForOfStatement;
+type BabelNodeWhile = BabelNodeDoWhileStatement | BabelNodeWhileStatement;
+type BabelNodeExpressionWrapper = BabelNodeExpressionStatement | BabelNodeParenthesizedExpression | BabelNodeTypeCastExpression;
+type BabelNodeFor = BabelNodeForInStatement | BabelNodeForStatement | BabelNodeForOfStatement;
+type BabelNodeForXStatement = BabelNodeForInStatement | BabelNodeForOfStatement;
+type BabelNodeFunction = BabelNodeFunctionDeclaration | BabelNodeFunctionExpression | BabelNodeObjectMethod | BabelNodeArrowFunctionExpression | BabelNodeClassMethod | BabelNodeClassPrivateMethod;
+type BabelNodeFunctionParent = BabelNodeFunctionDeclaration | BabelNodeFunctionExpression | BabelNodeObjectMethod | BabelNodeArrowFunctionExpression | BabelNodeClassMethod | BabelNodeClassPrivateMethod;
+type BabelNodePureish = BabelNodeFunctionDeclaration | BabelNodeFunctionExpression | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeNullLiteral | BabelNodeBooleanLiteral | BabelNodeRegExpLiteral | BabelNodeArrowFunctionExpression | BabelNodeBigIntLiteral | BabelNodeDecimalLiteral;
+type BabelNodeDeclaration = BabelNodeFunctionDeclaration | BabelNodeVariableDeclaration | BabelNodeClassDeclaration | BabelNodeExportAllDeclaration | BabelNodeExportDefaultDeclaration | BabelNodeExportNamedDeclaration | BabelNodeImportDeclaration | BabelNodeDeclareClass | BabelNodeDeclareFunction | BabelNodeDeclareInterface | BabelNodeDeclareModule | BabelNodeDeclareModuleExports | BabelNodeDeclareTypeAlias | BabelNodeDeclareOpaqueType | BabelNodeDeclareVariable | BabelNodeDeclareExportDeclaration | BabelNodeDeclareExportAllDeclaration | BabelNodeInterfaceDeclaration | BabelNodeOpaqueType | BabelNodeTypeAlias | BabelNodeEnumDeclaration | BabelNodeTSDeclareFunction | BabelNodeTSInterfaceDeclaration | BabelNodeTSTypeAliasDeclaration | BabelNodeTSEnumDeclaration | BabelNodeTSModuleDeclaration;
+type BabelNodePatternLike = BabelNodeIdentifier | BabelNodeRestElement | BabelNodeAssignmentPattern | BabelNodeArrayPattern | BabelNodeObjectPattern;
+type BabelNodeLVal = BabelNodeIdentifier | BabelNodeMemberExpression | BabelNodeRestElement | BabelNodeAssignmentPattern | BabelNodeArrayPattern | BabelNodeObjectPattern | BabelNodeTSParameterProperty;
+type BabelNodeTSEntityName = BabelNodeIdentifier | BabelNodeTSQualifiedName;
+type BabelNodeLiteral = BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeNullLiteral | BabelNodeBooleanLiteral | BabelNodeRegExpLiteral | BabelNodeTemplateLiteral | BabelNodeBigIntLiteral | BabelNodeDecimalLiteral;
+type BabelNodeImmutable = BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeNullLiteral | BabelNodeBooleanLiteral | BabelNodeBigIntLiteral | BabelNodeJSXAttribute | BabelNodeJSXClosingElement | BabelNodeJSXElement | BabelNodeJSXExpressionContainer | BabelNodeJSXSpreadChild | BabelNodeJSXOpeningElement | BabelNodeJSXText | BabelNodeJSXFragment | BabelNodeJSXOpeningFragment | BabelNodeJSXClosingFragment | BabelNodeDecimalLiteral;
+type BabelNodeUserWhitespacable = BabelNodeObjectMethod | BabelNodeObjectProperty | BabelNodeObjectTypeInternalSlot | BabelNodeObjectTypeCallProperty | BabelNodeObjectTypeIndexer | BabelNodeObjectTypeProperty | BabelNodeObjectTypeSpreadProperty;
+type BabelNodeMethod = BabelNodeObjectMethod | BabelNodeClassMethod | BabelNodeClassPrivateMethod;
+type BabelNodeObjectMember = BabelNodeObjectMethod | BabelNodeObjectProperty;
+type BabelNodeProperty = BabelNodeObjectProperty | BabelNodeClassProperty | BabelNodeClassPrivateProperty;
+type BabelNodeUnaryLike = BabelNodeUnaryExpression | BabelNodeSpreadElement;
+type BabelNodePattern = BabelNodeAssignmentPattern | BabelNodeArrayPattern | BabelNodeObjectPattern;
+type BabelNodeClass = BabelNodeClassExpression | BabelNodeClassDeclaration;
+type BabelNodeModuleDeclaration = BabelNodeExportAllDeclaration | BabelNodeExportDefaultDeclaration | BabelNodeExportNamedDeclaration | BabelNodeImportDeclaration;
+type BabelNodeExportDeclaration = BabelNodeExportAllDeclaration | BabelNodeExportDefaultDeclaration | BabelNodeExportNamedDeclaration;
+type BabelNodeModuleSpecifier = BabelNodeExportSpecifier | BabelNodeImportDefaultSpecifier | BabelNodeImportNamespaceSpecifier | BabelNodeImportSpecifier | BabelNodeExportNamespaceSpecifier | BabelNodeExportDefaultSpecifier;
+type BabelNodePrivate = BabelNodeClassPrivateProperty | BabelNodeClassPrivateMethod | BabelNodePrivateName;
+type BabelNodeFlow = BabelNodeAnyTypeAnnotation | BabelNodeArrayTypeAnnotation | BabelNodeBooleanTypeAnnotation | BabelNodeBooleanLiteralTypeAnnotation | BabelNodeNullLiteralTypeAnnotation | BabelNodeClassImplements | BabelNodeDeclareClass | BabelNodeDeclareFunction | BabelNodeDeclareInterface | BabelNodeDeclareModule | BabelNodeDeclareModuleExports | BabelNodeDeclareTypeAlias | BabelNodeDeclareOpaqueType | BabelNodeDeclareVariable | BabelNodeDeclareExportDeclaration | BabelNodeDeclareExportAllDeclaration | BabelNodeDeclaredPredicate | BabelNodeExistsTypeAnnotation | BabelNodeFunctionTypeAnnotation | BabelNodeFunctionTypeParam | BabelNodeGenericTypeAnnotation | BabelNodeInferredPredicate | BabelNodeInterfaceExtends | BabelNodeInterfaceDeclaration | BabelNodeInterfaceTypeAnnotation | BabelNodeIntersectionTypeAnnotation | BabelNodeMixedTypeAnnotation | BabelNodeEmptyTypeAnnotation | BabelNodeNullableTypeAnnotation | BabelNodeNumberLiteralTypeAnnotation | BabelNodeNumberTypeAnnotation | BabelNodeObjectTypeAnnotation | BabelNodeObjectTypeInternalSlot | BabelNodeObjectTypeCallProperty | BabelNodeObjectTypeIndexer | BabelNodeObjectTypeProperty | BabelNodeObjectTypeSpreadProperty | BabelNodeOpaqueType | BabelNodeQualifiedTypeIdentifier | BabelNodeStringLiteralTypeAnnotation | BabelNodeStringTypeAnnotation | BabelNodeSymbolTypeAnnotation | BabelNodeThisTypeAnnotation | BabelNodeTupleTypeAnnotation | BabelNodeTypeofTypeAnnotation | BabelNodeTypeAlias | BabelNodeTypeAnnotation | BabelNodeTypeCastExpression | BabelNodeTypeParameter | BabelNodeTypeParameterDeclaration | BabelNodeTypeParameterInstantiation | BabelNodeUnionTypeAnnotation | BabelNodeVariance | BabelNodeVoidTypeAnnotation | BabelNodeIndexedAccessType | BabelNodeOptionalIndexedAccessType;
+type BabelNodeFlowType = BabelNodeAnyTypeAnnotation | BabelNodeArrayTypeAnnotation | BabelNodeBooleanTypeAnnotation | BabelNodeBooleanLiteralTypeAnnotation | BabelNodeNullLiteralTypeAnnotation | BabelNodeExistsTypeAnnotation | BabelNodeFunctionTypeAnnotation | BabelNodeGenericTypeAnnotation | BabelNodeInterfaceTypeAnnotation | BabelNodeIntersectionTypeAnnotation | BabelNodeMixedTypeAnnotation | BabelNodeEmptyTypeAnnotation | BabelNodeNullableTypeAnnotation | BabelNodeNumberLiteralTypeAnnotation | BabelNodeNumberTypeAnnotation | BabelNodeObjectTypeAnnotation | BabelNodeStringLiteralTypeAnnotation | BabelNodeStringTypeAnnotation | BabelNodeSymbolTypeAnnotation | BabelNodeThisTypeAnnotation | BabelNodeTupleTypeAnnotation | BabelNodeTypeofTypeAnnotation | BabelNodeUnionTypeAnnotation | BabelNodeVoidTypeAnnotation | BabelNodeIndexedAccessType | BabelNodeOptionalIndexedAccessType;
+type BabelNodeFlowBaseAnnotation = BabelNodeAnyTypeAnnotation | BabelNodeBooleanTypeAnnotation | BabelNodeNullLiteralTypeAnnotation | BabelNodeMixedTypeAnnotation | BabelNodeEmptyTypeAnnotation | BabelNodeNumberTypeAnnotation | BabelNodeStringTypeAnnotation | BabelNodeSymbolTypeAnnotation | BabelNodeThisTypeAnnotation | BabelNodeVoidTypeAnnotation;
+type BabelNodeFlowDeclaration = BabelNodeDeclareClass | BabelNodeDeclareFunction | BabelNodeDeclareInterface | BabelNodeDeclareModule | BabelNodeDeclareModuleExports | BabelNodeDeclareTypeAlias | BabelNodeDeclareOpaqueType | BabelNodeDeclareVariable | BabelNodeDeclareExportDeclaration | BabelNodeDeclareExportAllDeclaration | BabelNodeInterfaceDeclaration | BabelNodeOpaqueType | BabelNodeTypeAlias;
+type BabelNodeFlowPredicate = BabelNodeDeclaredPredicate | BabelNodeInferredPredicate;
+type BabelNodeEnumBody = BabelNodeEnumBooleanBody | BabelNodeEnumNumberBody | BabelNodeEnumStringBody | BabelNodeEnumSymbolBody;
+type BabelNodeEnumMember = BabelNodeEnumBooleanMember | BabelNodeEnumNumberMember | BabelNodeEnumStringMember | BabelNodeEnumDefaultedMember;
+type BabelNodeJSX = BabelNodeJSXAttribute | BabelNodeJSXClosingElement | BabelNodeJSXElement | BabelNodeJSXEmptyExpression | BabelNodeJSXExpressionContainer | BabelNodeJSXSpreadChild | BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression | BabelNodeJSXNamespacedName | BabelNodeJSXOpeningElement | BabelNodeJSXSpreadAttribute | BabelNodeJSXText | BabelNodeJSXFragment | BabelNodeJSXOpeningFragment | BabelNodeJSXClosingFragment;
+type BabelNodeTSTypeElement = BabelNodeTSCallSignatureDeclaration | BabelNodeTSConstructSignatureDeclaration | BabelNodeTSPropertySignature | BabelNodeTSMethodSignature | BabelNodeTSIndexSignature;
+type BabelNodeTSType = BabelNodeTSAnyKeyword | BabelNodeTSBooleanKeyword | BabelNodeTSBigIntKeyword | BabelNodeTSIntrinsicKeyword | BabelNodeTSNeverKeyword | BabelNodeTSNullKeyword | BabelNodeTSNumberKeyword | BabelNodeTSObjectKeyword | BabelNodeTSStringKeyword | BabelNodeTSSymbolKeyword | BabelNodeTSUndefinedKeyword | BabelNodeTSUnknownKeyword | BabelNodeTSVoidKeyword | BabelNodeTSThisType | BabelNodeTSFunctionType | BabelNodeTSConstructorType | BabelNodeTSTypeReference | BabelNodeTSTypePredicate | BabelNodeTSTypeQuery | BabelNodeTSTypeLiteral | BabelNodeTSArrayType | BabelNodeTSTupleType | BabelNodeTSOptionalType | BabelNodeTSRestType | BabelNodeTSUnionType | BabelNodeTSIntersectionType | BabelNodeTSConditionalType | BabelNodeTSInferType | BabelNodeTSParenthesizedType | BabelNodeTSTypeOperator | BabelNodeTSIndexedAccessType | BabelNodeTSMappedType | BabelNodeTSLiteralType | BabelNodeTSExpressionWithTypeArguments | BabelNodeTSImportType;
+type BabelNodeTSBaseType = BabelNodeTSAnyKeyword | BabelNodeTSBooleanKeyword | BabelNodeTSBigIntKeyword | BabelNodeTSIntrinsicKeyword | BabelNodeTSNeverKeyword | BabelNodeTSNullKeyword | BabelNodeTSNumberKeyword | BabelNodeTSObjectKeyword | BabelNodeTSStringKeyword | BabelNodeTSSymbolKeyword | BabelNodeTSUndefinedKeyword | BabelNodeTSUnknownKeyword | BabelNodeTSVoidKeyword | BabelNodeTSThisType | BabelNodeTSLiteralType;
+
+declare module "@babel/types" {
+ declare export function arrayExpression(elements?: Array<null | BabelNodeExpression | BabelNodeSpreadElement>): BabelNodeArrayExpression;
+ declare export function assignmentExpression(operator: string, left: BabelNodeLVal, right: BabelNodeExpression): BabelNodeAssignmentExpression;
+ declare export function binaryExpression(operator: "+" | "-" | "/" | "%" | "*" | "**" | "&" | "|" | ">>" | ">>>" | "<<" | "^" | "==" | "===" | "!=" | "!==" | "in" | "instanceof" | ">" | "<" | ">=" | "<=", left: BabelNodeExpression | BabelNodePrivateName, right: BabelNodeExpression): BabelNodeBinaryExpression;
+ declare export function interpreterDirective(value: string): BabelNodeInterpreterDirective;
+ declare export function directive(value: BabelNodeDirectiveLiteral): BabelNodeDirective;
+ declare export function directiveLiteral(value: string): BabelNodeDirectiveLiteral;
+ declare export function blockStatement(body: Array<BabelNodeStatement>, directives?: Array<BabelNodeDirective>): BabelNodeBlockStatement;
+ declare export function breakStatement(label?: BabelNodeIdentifier): BabelNodeBreakStatement;
+ declare export function callExpression(callee: BabelNodeExpression | BabelNodeV8IntrinsicIdentifier, _arguments: Array<BabelNodeExpression | BabelNodeSpreadElement | BabelNodeJSXNamespacedName | BabelNodeArgumentPlaceholder>): BabelNodeCallExpression;
+ declare export function catchClause(param?: BabelNodeIdentifier | BabelNodeArrayPattern | BabelNodeObjectPattern, body: BabelNodeBlockStatement): BabelNodeCatchClause;
+ declare export function conditionalExpression(test: BabelNodeExpression, consequent: BabelNodeExpression, alternate: BabelNodeExpression): BabelNodeConditionalExpression;
+ declare export function continueStatement(label?: BabelNodeIdentifier): BabelNodeContinueStatement;
+ declare export function debuggerStatement(): BabelNodeDebuggerStatement;
+ declare export function doWhileStatement(test: BabelNodeExpression, body: BabelNodeStatement): BabelNodeDoWhileStatement;
+ declare export function emptyStatement(): BabelNodeEmptyStatement;
+ declare export function expressionStatement(expression: BabelNodeExpression): BabelNodeExpressionStatement;
+ declare export function file(program: BabelNodeProgram, comments?: Array<BabelNodeCommentBlock | BabelNodeCommentLine>, tokens?: Array<any>): BabelNodeFile;
+ declare export function forInStatement(left: BabelNodeVariableDeclaration | BabelNodeLVal, right: BabelNodeExpression, body: BabelNodeStatement): BabelNodeForInStatement;
+ declare export function forStatement(init?: BabelNodeVariableDeclaration | BabelNodeExpression, test?: BabelNodeExpression, update?: BabelNodeExpression, body: BabelNodeStatement): BabelNodeForStatement;
+ declare export function functionDeclaration(id?: BabelNodeIdentifier, params: Array<BabelNodeIdentifier | BabelNodePattern | BabelNodeRestElement>, body: BabelNodeBlockStatement, generator?: boolean, async?: boolean): BabelNodeFunctionDeclaration;
+ declare export function functionExpression(id?: BabelNodeIdentifier, params: Array<BabelNodeIdentifier | BabelNodePattern | BabelNodeRestElement>, body: BabelNodeBlockStatement, generator?: boolean, async?: boolean): BabelNodeFunctionExpression;
+ declare export function identifier(name: string): BabelNodeIdentifier;
+ declare export function ifStatement(test: BabelNodeExpression, consequent: BabelNodeStatement, alternate?: BabelNodeStatement): BabelNodeIfStatement;
+ declare export function labeledStatement(label: BabelNodeIdentifier, body: BabelNodeStatement): BabelNodeLabeledStatement;
+ declare export function stringLiteral(value: string): BabelNodeStringLiteral;
+ declare export function numericLiteral(value: number): BabelNodeNumericLiteral;
+ declare export function nullLiteral(): BabelNodeNullLiteral;
+ declare export function booleanLiteral(value: boolean): BabelNodeBooleanLiteral;
+ declare export function regExpLiteral(pattern: string, flags?: string): BabelNodeRegExpLiteral;
+ declare export function logicalExpression(operator: "||" | "&&" | "??", left: BabelNodeExpression, right: BabelNodeExpression): BabelNodeLogicalExpression;
+ declare export function memberExpression(object: BabelNodeExpression, property: BabelNodeExpression | BabelNodeIdentifier | BabelNodePrivateName, computed?: boolean, optional?: true | false): BabelNodeMemberExpression;
+ declare export function newExpression(callee: BabelNodeExpression | BabelNodeV8IntrinsicIdentifier, _arguments: Array<BabelNodeExpression | BabelNodeSpreadElement | BabelNodeJSXNamespacedName | BabelNodeArgumentPlaceholder>): BabelNodeNewExpression;
+ declare export function program(body: Array<BabelNodeStatement>, directives?: Array<BabelNodeDirective>, sourceType?: "script" | "module", interpreter?: BabelNodeInterpreterDirective): BabelNodeProgram;
+ declare export function objectExpression(properties: Array<BabelNodeObjectMethod | BabelNodeObjectProperty | BabelNodeSpreadElement>): BabelNodeObjectExpression;
+ declare export function objectMethod(kind?: "method" | "get" | "set", key: BabelNodeExpression | BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral, params: Array<BabelNodeIdentifier | BabelNodePattern | BabelNodeRestElement>, body: BabelNodeBlockStatement, computed?: boolean, generator?: boolean, async?: boolean): BabelNodeObjectMethod;
+ declare export function objectProperty(key: BabelNodeExpression | BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral, value: BabelNodeExpression | BabelNodePatternLike, computed?: boolean, shorthand?: boolean, decorators?: Array<BabelNodeDecorator>): BabelNodeObjectProperty;
+ declare export function restElement(argument: BabelNodeLVal): BabelNodeRestElement;
+ declare export function returnStatement(argument?: BabelNodeExpression): BabelNodeReturnStatement;
+ declare export function sequenceExpression(expressions: Array<BabelNodeExpression>): BabelNodeSequenceExpression;
+ declare export function parenthesizedExpression(expression: BabelNodeExpression): BabelNodeParenthesizedExpression;
+ declare export function switchCase(test?: BabelNodeExpression, consequent: Array<BabelNodeStatement>): BabelNodeSwitchCase;
+ declare export function switchStatement(discriminant: BabelNodeExpression, cases: Array<BabelNodeSwitchCase>): BabelNodeSwitchStatement;
+ declare export function thisExpression(): BabelNodeThisExpression;
+ declare export function throwStatement(argument: BabelNodeExpression): BabelNodeThrowStatement;
+ declare export function tryStatement(block: BabelNodeBlockStatement, handler?: BabelNodeCatchClause, finalizer?: BabelNodeBlockStatement): BabelNodeTryStatement;
+ declare export function unaryExpression(operator: "void" | "throw" | "delete" | "!" | "+" | "-" | "~" | "typeof", argument: BabelNodeExpression, prefix?: boolean): BabelNodeUnaryExpression;
+ declare export function updateExpression(operator: "++" | "--", argument: BabelNodeExpression, prefix?: boolean): BabelNodeUpdateExpression;
+ declare export function variableDeclaration(kind: "var" | "let" | "const", declarations: Array<BabelNodeVariableDeclarator>): BabelNodeVariableDeclaration;
+ declare export function variableDeclarator(id: BabelNodeLVal, init?: BabelNodeExpression): BabelNodeVariableDeclarator;
+ declare export function whileStatement(test: BabelNodeExpression, body: BabelNodeStatement): BabelNodeWhileStatement;
+ declare export function withStatement(object: BabelNodeExpression, body: BabelNodeStatement): BabelNodeWithStatement;
+ declare export function assignmentPattern(left: BabelNodeIdentifier | BabelNodeObjectPattern | BabelNodeArrayPattern | BabelNodeMemberExpression, right: BabelNodeExpression): BabelNodeAssignmentPattern;
+ declare export function arrayPattern(elements: Array<null | BabelNodePatternLike>): BabelNodeArrayPattern;
+ declare export function arrowFunctionExpression(params: Array<BabelNodeIdentifier | BabelNodePattern | BabelNodeRestElement>, body: BabelNodeBlockStatement | BabelNodeExpression, async?: boolean): BabelNodeArrowFunctionExpression;
+ declare export function classBody(body: Array<BabelNodeClassMethod | BabelNodeClassPrivateMethod | BabelNodeClassProperty | BabelNodeClassPrivateProperty | BabelNodeTSDeclareMethod | BabelNodeTSIndexSignature>): BabelNodeClassBody;
+ declare export function classExpression(id?: BabelNodeIdentifier, superClass?: BabelNodeExpression, body: BabelNodeClassBody, decorators?: Array<BabelNodeDecorator>): BabelNodeClassExpression;
+ declare export function classDeclaration(id: BabelNodeIdentifier, superClass?: BabelNodeExpression, body: BabelNodeClassBody, decorators?: Array<BabelNodeDecorator>): BabelNodeClassDeclaration;
+ declare export function exportAllDeclaration(source: BabelNodeStringLiteral): BabelNodeExportAllDeclaration;
+ declare export function exportDefaultDeclaration(declaration: BabelNodeFunctionDeclaration | BabelNodeTSDeclareFunction | BabelNodeClassDeclaration | BabelNodeExpression): BabelNodeExportDefaultDeclaration;
+ declare export function exportNamedDeclaration(declaration?: BabelNodeDeclaration, specifiers?: Array<BabelNodeExportSpecifier | BabelNodeExportDefaultSpecifier | BabelNodeExportNamespaceSpecifier>, source?: BabelNodeStringLiteral): BabelNodeExportNamedDeclaration;
+ declare export function exportSpecifier(local: BabelNodeIdentifier, exported: BabelNodeIdentifier | BabelNodeStringLiteral): BabelNodeExportSpecifier;
+ declare export function forOfStatement(left: BabelNodeVariableDeclaration | BabelNodeLVal, right: BabelNodeExpression, body: BabelNodeStatement, _await?: boolean): BabelNodeForOfStatement;
+ declare export function importDeclaration(specifiers: Array<BabelNodeImportSpecifier | BabelNodeImportDefaultSpecifier | BabelNodeImportNamespaceSpecifier>, source: BabelNodeStringLiteral): BabelNodeImportDeclaration;
+ declare export function importDefaultSpecifier(local: BabelNodeIdentifier): BabelNodeImportDefaultSpecifier;
+ declare export function importNamespaceSpecifier(local: BabelNodeIdentifier): BabelNodeImportNamespaceSpecifier;
+ declare export function importSpecifier(local: BabelNodeIdentifier, imported: BabelNodeIdentifier | BabelNodeStringLiteral): BabelNodeImportSpecifier;
+ declare export function metaProperty(meta: BabelNodeIdentifier, property: BabelNodeIdentifier): BabelNodeMetaProperty;
+ declare export function classMethod(kind?: "get" | "set" | "method" | "constructor", key: BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeExpression, params: Array<BabelNodeIdentifier | BabelNodePattern | BabelNodeRestElement | BabelNodeTSParameterProperty>, body: BabelNodeBlockStatement, computed?: boolean, _static?: boolean, generator?: boolean, async?: boolean): BabelNodeClassMethod;
+ declare export function objectPattern(properties: Array<BabelNodeRestElement | BabelNodeObjectProperty>): BabelNodeObjectPattern;
+ declare export function spreadElement(argument: BabelNodeExpression): BabelNodeSpreadElement;
+ declare function _super(): BabelNodeSuper;
+ declare export { _super as super }
+ declare export function taggedTemplateExpression(tag: BabelNodeExpression, quasi: BabelNodeTemplateLiteral): BabelNodeTaggedTemplateExpression;
+ declare export function templateElement(value: { raw: string, cooked?: string }, tail?: boolean): BabelNodeTemplateElement;
+ declare export function templateLiteral(quasis: Array<BabelNodeTemplateElement>, expressions: Array<BabelNodeExpression | BabelNodeTSType>): BabelNodeTemplateLiteral;
+ declare export function yieldExpression(argument?: BabelNodeExpression, delegate?: boolean): BabelNodeYieldExpression;
+ declare export function awaitExpression(argument: BabelNodeExpression): BabelNodeAwaitExpression;
+ declare function _import(): BabelNodeImport;
+ declare export { _import as import }
+ declare export function bigIntLiteral(value: string): BabelNodeBigIntLiteral;
+ declare export function exportNamespaceSpecifier(exported: BabelNodeIdentifier): BabelNodeExportNamespaceSpecifier;
+ declare export function optionalMemberExpression(object: BabelNodeExpression, property: BabelNodeExpression | BabelNodeIdentifier, computed?: boolean, optional: boolean): BabelNodeOptionalMemberExpression;
+ declare export function optionalCallExpression(callee: BabelNodeExpression, _arguments: Array<BabelNodeExpression | BabelNodeSpreadElement | BabelNodeJSXNamespacedName | BabelNodeArgumentPlaceholder>, optional: boolean): BabelNodeOptionalCallExpression;
+ declare export function classProperty(key: BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeExpression, value?: BabelNodeExpression, typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop, decorators?: Array<BabelNodeDecorator>, computed?: boolean, _static?: boolean): BabelNodeClassProperty;
+ declare export function classPrivateProperty(key: BabelNodePrivateName, value?: BabelNodeExpression, decorators?: Array<BabelNodeDecorator>, _static: any): BabelNodeClassPrivateProperty;
+ declare export function classPrivateMethod(kind?: "get" | "set" | "method" | "constructor", key: BabelNodePrivateName, params: Array<BabelNodeIdentifier | BabelNodePattern | BabelNodeRestElement | BabelNodeTSParameterProperty>, body: BabelNodeBlockStatement, _static?: boolean): BabelNodeClassPrivateMethod;
+ declare export function privateName(id: BabelNodeIdentifier): BabelNodePrivateName;
+ declare export function anyTypeAnnotation(): BabelNodeAnyTypeAnnotation;
+ declare export function arrayTypeAnnotation(elementType: BabelNodeFlowType): BabelNodeArrayTypeAnnotation;
+ declare export function booleanTypeAnnotation(): BabelNodeBooleanTypeAnnotation;
+ declare export function booleanLiteralTypeAnnotation(value: boolean): BabelNodeBooleanLiteralTypeAnnotation;
+ declare export function nullLiteralTypeAnnotation(): BabelNodeNullLiteralTypeAnnotation;
+ declare export function classImplements(id: BabelNodeIdentifier, typeParameters?: BabelNodeTypeParameterInstantiation): BabelNodeClassImplements;
+ declare export function declareClass(id: BabelNodeIdentifier, typeParameters?: BabelNodeTypeParameterDeclaration, _extends?: Array<BabelNodeInterfaceExtends>, body: BabelNodeObjectTypeAnnotation): BabelNodeDeclareClass;
+ declare export function declareFunction(id: BabelNodeIdentifier): BabelNodeDeclareFunction;
+ declare export function declareInterface(id: BabelNodeIdentifier, typeParameters?: BabelNodeTypeParameterDeclaration, _extends?: Array<BabelNodeInterfaceExtends>, body: BabelNodeObjectTypeAnnotation): BabelNodeDeclareInterface;
+ declare export function declareModule(id: BabelNodeIdentifier | BabelNodeStringLiteral, body: BabelNodeBlockStatement, kind?: "CommonJS" | "ES"): BabelNodeDeclareModule;
+ declare export function declareModuleExports(typeAnnotation: BabelNodeTypeAnnotation): BabelNodeDeclareModuleExports;
+ declare export function declareTypeAlias(id: BabelNodeIdentifier, typeParameters?: BabelNodeTypeParameterDeclaration, right: BabelNodeFlowType): BabelNodeDeclareTypeAlias;
+ declare export function declareOpaqueType(id: BabelNodeIdentifier, typeParameters?: BabelNodeTypeParameterDeclaration, supertype?: BabelNodeFlowType): BabelNodeDeclareOpaqueType;
+ declare export function declareVariable(id: BabelNodeIdentifier): BabelNodeDeclareVariable;
+ declare export function declareExportDeclaration(declaration?: BabelNodeFlow, specifiers?: Array<BabelNodeExportSpecifier | BabelNodeExportNamespaceSpecifier>, source?: BabelNodeStringLiteral): BabelNodeDeclareExportDeclaration;
+ declare export function declareExportAllDeclaration(source: BabelNodeStringLiteral): BabelNodeDeclareExportAllDeclaration;
+ declare export function declaredPredicate(value: BabelNodeFlow): BabelNodeDeclaredPredicate;
+ declare export function existsTypeAnnotation(): BabelNodeExistsTypeAnnotation;
+ declare export function functionTypeAnnotation(typeParameters?: BabelNodeTypeParameterDeclaration, params: Array<BabelNodeFunctionTypeParam>, rest?: BabelNodeFunctionTypeParam, returnType: BabelNodeFlowType): BabelNodeFunctionTypeAnnotation;
+ declare export function functionTypeParam(name?: BabelNodeIdentifier, typeAnnotation: BabelNodeFlowType): BabelNodeFunctionTypeParam;
+ declare export function genericTypeAnnotation(id: BabelNodeIdentifier | BabelNodeQualifiedTypeIdentifier, typeParameters?: BabelNodeTypeParameterInstantiation): BabelNodeGenericTypeAnnotation;
+ declare export function inferredPredicate(): BabelNodeInferredPredicate;
+ declare export function interfaceExtends(id: BabelNodeIdentifier | BabelNodeQualifiedTypeIdentifier, typeParameters?: BabelNodeTypeParameterInstantiation): BabelNodeInterfaceExtends;
+ declare export function interfaceDeclaration(id: BabelNodeIdentifier, typeParameters?: BabelNodeTypeParameterDeclaration, _extends?: Array<BabelNodeInterfaceExtends>, body: BabelNodeObjectTypeAnnotation): BabelNodeInterfaceDeclaration;
+ declare export function interfaceTypeAnnotation(_extends?: Array<BabelNodeInterfaceExtends>, body: BabelNodeObjectTypeAnnotation): BabelNodeInterfaceTypeAnnotation;
+ declare export function intersectionTypeAnnotation(types: Array<BabelNodeFlowType>): BabelNodeIntersectionTypeAnnotation;
+ declare export function mixedTypeAnnotation(): BabelNodeMixedTypeAnnotation;
+ declare export function emptyTypeAnnotation(): BabelNodeEmptyTypeAnnotation;
+ declare export function nullableTypeAnnotation(typeAnnotation: BabelNodeFlowType): BabelNodeNullableTypeAnnotation;
+ declare export function numberLiteralTypeAnnotation(value: number): BabelNodeNumberLiteralTypeAnnotation;
+ declare export function numberTypeAnnotation(): BabelNodeNumberTypeAnnotation;
+ declare export function objectTypeAnnotation(properties: Array<BabelNodeObjectTypeProperty | BabelNodeObjectTypeSpreadProperty>, indexers?: Array<BabelNodeObjectTypeIndexer>, callProperties?: Array<BabelNodeObjectTypeCallProperty>, internalSlots?: Array<BabelNodeObjectTypeInternalSlot>, exact?: boolean): BabelNodeObjectTypeAnnotation;
+ declare export function objectTypeInternalSlot(id: BabelNodeIdentifier, value: BabelNodeFlowType, optional: boolean, _static: boolean, method: boolean): BabelNodeObjectTypeInternalSlot;
+ declare export function objectTypeCallProperty(value: BabelNodeFlowType): BabelNodeObjectTypeCallProperty;
+ declare export function objectTypeIndexer(id?: BabelNodeIdentifier, key: BabelNodeFlowType, value: BabelNodeFlowType, variance?: BabelNodeVariance): BabelNodeObjectTypeIndexer;
+ declare export function objectTypeProperty(key: BabelNodeIdentifier | BabelNodeStringLiteral, value: BabelNodeFlowType, variance?: BabelNodeVariance): BabelNodeObjectTypeProperty;
+ declare export function objectTypeSpreadProperty(argument: BabelNodeFlowType): BabelNodeObjectTypeSpreadProperty;
+ declare export function opaqueType(id: BabelNodeIdentifier, typeParameters?: BabelNodeTypeParameterDeclaration, supertype?: BabelNodeFlowType, impltype: BabelNodeFlowType): BabelNodeOpaqueType;
+ declare export function qualifiedTypeIdentifier(id: BabelNodeIdentifier, qualification: BabelNodeIdentifier | BabelNodeQualifiedTypeIdentifier): BabelNodeQualifiedTypeIdentifier;
+ declare export function stringLiteralTypeAnnotation(value: string): BabelNodeStringLiteralTypeAnnotation;
+ declare export function stringTypeAnnotation(): BabelNodeStringTypeAnnotation;
+ declare export function symbolTypeAnnotation(): BabelNodeSymbolTypeAnnotation;
+ declare export function thisTypeAnnotation(): BabelNodeThisTypeAnnotation;
+ declare export function tupleTypeAnnotation(types: Array<BabelNodeFlowType>): BabelNodeTupleTypeAnnotation;
+ declare export function typeofTypeAnnotation(argument: BabelNodeFlowType): BabelNodeTypeofTypeAnnotation;
+ declare export function typeAlias(id: BabelNodeIdentifier, typeParameters?: BabelNodeTypeParameterDeclaration, right: BabelNodeFlowType): BabelNodeTypeAlias;
+ declare export function typeAnnotation(typeAnnotation: BabelNodeFlowType): BabelNodeTypeAnnotation;
+ declare export function typeCastExpression(expression: BabelNodeExpression, typeAnnotation: BabelNodeTypeAnnotation): BabelNodeTypeCastExpression;
+ declare export function typeParameter(bound?: BabelNodeTypeAnnotation, _default?: BabelNodeFlowType, variance?: BabelNodeVariance): BabelNodeTypeParameter;
+ declare export function typeParameterDeclaration(params: Array<BabelNodeTypeParameter>): BabelNodeTypeParameterDeclaration;
+ declare export function typeParameterInstantiation(params: Array<BabelNodeFlowType>): BabelNodeTypeParameterInstantiation;
+ declare export function unionTypeAnnotation(types: Array<BabelNodeFlowType>): BabelNodeUnionTypeAnnotation;
+ declare export function variance(kind: "minus" | "plus"): BabelNodeVariance;
+ declare export function voidTypeAnnotation(): BabelNodeVoidTypeAnnotation;
+ declare export function enumDeclaration(id: BabelNodeIdentifier, body: BabelNodeEnumBooleanBody | BabelNodeEnumNumberBody | BabelNodeEnumStringBody | BabelNodeEnumSymbolBody): BabelNodeEnumDeclaration;
+ declare export function enumBooleanBody(members: Array<BabelNodeEnumBooleanMember>): BabelNodeEnumBooleanBody;
+ declare export function enumNumberBody(members: Array<BabelNodeEnumNumberMember>): BabelNodeEnumNumberBody;
+ declare export function enumStringBody(members: Array<BabelNodeEnumStringMember | BabelNodeEnumDefaultedMember>): BabelNodeEnumStringBody;
+ declare export function enumSymbolBody(members: Array<BabelNodeEnumDefaultedMember>): BabelNodeEnumSymbolBody;
+ declare export function enumBooleanMember(id: BabelNodeIdentifier): BabelNodeEnumBooleanMember;
+ declare export function enumNumberMember(id: BabelNodeIdentifier, init: BabelNodeNumericLiteral): BabelNodeEnumNumberMember;
+ declare export function enumStringMember(id: BabelNodeIdentifier, init: BabelNodeStringLiteral): BabelNodeEnumStringMember;
+ declare export function enumDefaultedMember(id: BabelNodeIdentifier): BabelNodeEnumDefaultedMember;
+ declare export function indexedAccessType(objectType: BabelNodeFlowType, indexType: BabelNodeFlowType): BabelNodeIndexedAccessType;
+ declare export function optionalIndexedAccessType(objectType: BabelNodeFlowType, indexType: BabelNodeFlowType): BabelNodeOptionalIndexedAccessType;
+ declare export function jsxAttribute(name: BabelNodeJSXIdentifier | BabelNodeJSXNamespacedName, value?: BabelNodeJSXElement | BabelNodeJSXFragment | BabelNodeStringLiteral | BabelNodeJSXExpressionContainer): BabelNodeJSXAttribute;
+ declare export function jsxClosingElement(name: BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression | BabelNodeJSXNamespacedName): BabelNodeJSXClosingElement;
+ declare export function jsxElement(openingElement: BabelNodeJSXOpeningElement, closingElement?: BabelNodeJSXClosingElement, children: Array<BabelNodeJSXText | BabelNodeJSXExpressionContainer | BabelNodeJSXSpreadChild | BabelNodeJSXElement | BabelNodeJSXFragment>, selfClosing?: boolean): BabelNodeJSXElement;
+ declare export function jsxEmptyExpression(): BabelNodeJSXEmptyExpression;
+ declare export function jsxExpressionContainer(expression: BabelNodeExpression | BabelNodeJSXEmptyExpression): BabelNodeJSXExpressionContainer;
+ declare export function jsxSpreadChild(expression: BabelNodeExpression): BabelNodeJSXSpreadChild;
+ declare export function jsxIdentifier(name: string): BabelNodeJSXIdentifier;
+ declare export function jsxMemberExpression(object: BabelNodeJSXMemberExpression | BabelNodeJSXIdentifier, property: BabelNodeJSXIdentifier): BabelNodeJSXMemberExpression;
+ declare export function jsxNamespacedName(namespace: BabelNodeJSXIdentifier, name: BabelNodeJSXIdentifier): BabelNodeJSXNamespacedName;
+ declare export function jsxOpeningElement(name: BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression | BabelNodeJSXNamespacedName, attributes: Array<BabelNodeJSXAttribute | BabelNodeJSXSpreadAttribute>, selfClosing?: boolean): BabelNodeJSXOpeningElement;
+ declare export function jsxSpreadAttribute(argument: BabelNodeExpression): BabelNodeJSXSpreadAttribute;
+ declare export function jsxText(value: string): BabelNodeJSXText;
+ declare export function jsxFragment(openingFragment: BabelNodeJSXOpeningFragment, closingFragment: BabelNodeJSXClosingFragment, children: Array<BabelNodeJSXText | BabelNodeJSXExpressionContainer | BabelNodeJSXSpreadChild | BabelNodeJSXElement | BabelNodeJSXFragment>): BabelNodeJSXFragment;
+ declare export function jsxOpeningFragment(): BabelNodeJSXOpeningFragment;
+ declare export function jsxClosingFragment(): BabelNodeJSXClosingFragment;
+ declare export function noop(): BabelNodeNoop;
+ declare export function placeholder(expectedNode: "Identifier" | "StringLiteral" | "Expression" | "Statement" | "Declaration" | "BlockStatement" | "ClassBody" | "Pattern", name: BabelNodeIdentifier): BabelNodePlaceholder;
+ declare export function v8IntrinsicIdentifier(name: string): BabelNodeV8IntrinsicIdentifier;
+ declare export function argumentPlaceholder(): BabelNodeArgumentPlaceholder;
+ declare export function bindExpression(object: BabelNodeExpression, callee: BabelNodeExpression): BabelNodeBindExpression;
+ declare export function importAttribute(key: BabelNodeIdentifier | BabelNodeStringLiteral, value: BabelNodeStringLiteral): BabelNodeImportAttribute;
+ declare export function decorator(expression: BabelNodeExpression): BabelNodeDecorator;
+ declare export function doExpression(body: BabelNodeBlockStatement, async?: boolean): BabelNodeDoExpression;
+ declare export function exportDefaultSpecifier(exported: BabelNodeIdentifier): BabelNodeExportDefaultSpecifier;
+ declare export function recordExpression(properties: Array<BabelNodeObjectProperty | BabelNodeSpreadElement>): BabelNodeRecordExpression;
+ declare export function tupleExpression(elements?: Array<BabelNodeExpression | BabelNodeSpreadElement>): BabelNodeTupleExpression;
+ declare export function decimalLiteral(value: string): BabelNodeDecimalLiteral;
+ declare export function staticBlock(body: Array<BabelNodeStatement>): BabelNodeStaticBlock;
+ declare export function moduleExpression(body: BabelNodeProgram): BabelNodeModuleExpression;
+ declare export function topicReference(): BabelNodeTopicReference;
+ declare export function pipelineTopicExpression(expression: BabelNodeExpression): BabelNodePipelineTopicExpression;
+ declare export function pipelineBareFunction(callee: BabelNodeExpression): BabelNodePipelineBareFunction;
+ declare export function pipelinePrimaryTopicReference(): BabelNodePipelinePrimaryTopicReference;
+ declare export function tsParameterProperty(parameter: BabelNodeIdentifier | BabelNodeAssignmentPattern): BabelNodeTSParameterProperty;
+ declare export function tsDeclareFunction(id?: BabelNodeIdentifier, typeParameters?: BabelNodeTSTypeParameterDeclaration | BabelNodeNoop, params: Array<BabelNodeIdentifier | BabelNodePattern | BabelNodeRestElement>, returnType?: BabelNodeTSTypeAnnotation | BabelNodeNoop): BabelNodeTSDeclareFunction;
+ declare export function tsDeclareMethod(decorators?: Array<BabelNodeDecorator>, key: BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeExpression, typeParameters?: BabelNodeTSTypeParameterDeclaration | BabelNodeNoop, params: Array<BabelNodeIdentifier | BabelNodePattern | BabelNodeRestElement | BabelNodeTSParameterProperty>, returnType?: BabelNodeTSTypeAnnotation | BabelNodeNoop): BabelNodeTSDeclareMethod;
+ declare export function tsQualifiedName(left: BabelNodeTSEntityName, right: BabelNodeIdentifier): BabelNodeTSQualifiedName;
+ declare export function tsCallSignatureDeclaration(typeParameters?: BabelNodeTSTypeParameterDeclaration, parameters: Array<BabelNodeIdentifier | BabelNodeRestElement>, typeAnnotation?: BabelNodeTSTypeAnnotation): BabelNodeTSCallSignatureDeclaration;
+ declare export function tsConstructSignatureDeclaration(typeParameters?: BabelNodeTSTypeParameterDeclaration, parameters: Array<BabelNodeIdentifier | BabelNodeRestElement>, typeAnnotation?: BabelNodeTSTypeAnnotation): BabelNodeTSConstructSignatureDeclaration;
+ declare export function tsPropertySignature(key: BabelNodeExpression, typeAnnotation?: BabelNodeTSTypeAnnotation, initializer?: BabelNodeExpression): BabelNodeTSPropertySignature;
+ declare export function tsMethodSignature(key: BabelNodeExpression, typeParameters?: BabelNodeTSTypeParameterDeclaration, parameters: Array<BabelNodeIdentifier | BabelNodeRestElement>, typeAnnotation?: BabelNodeTSTypeAnnotation): BabelNodeTSMethodSignature;
+ declare export function tsIndexSignature(parameters: Array<BabelNodeIdentifier>, typeAnnotation?: BabelNodeTSTypeAnnotation): BabelNodeTSIndexSignature;
+ declare export function tsAnyKeyword(): BabelNodeTSAnyKeyword;
+ declare export function tsBooleanKeyword(): BabelNodeTSBooleanKeyword;
+ declare export function tsBigIntKeyword(): BabelNodeTSBigIntKeyword;
+ declare export function tsIntrinsicKeyword(): BabelNodeTSIntrinsicKeyword;
+ declare export function tsNeverKeyword(): BabelNodeTSNeverKeyword;
+ declare export function tsNullKeyword(): BabelNodeTSNullKeyword;
+ declare export function tsNumberKeyword(): BabelNodeTSNumberKeyword;
+ declare export function tsObjectKeyword(): BabelNodeTSObjectKeyword;
+ declare export function tsStringKeyword(): BabelNodeTSStringKeyword;
+ declare export function tsSymbolKeyword(): BabelNodeTSSymbolKeyword;
+ declare export function tsUndefinedKeyword(): BabelNodeTSUndefinedKeyword;
+ declare export function tsUnknownKeyword(): BabelNodeTSUnknownKeyword;
+ declare export function tsVoidKeyword(): BabelNodeTSVoidKeyword;
+ declare export function tsThisType(): BabelNodeTSThisType;
+ declare export function tsFunctionType(typeParameters?: BabelNodeTSTypeParameterDeclaration, parameters: Array<BabelNodeIdentifier | BabelNodeRestElement>, typeAnnotation?: BabelNodeTSTypeAnnotation): BabelNodeTSFunctionType;
+ declare export function tsConstructorType(typeParameters?: BabelNodeTSTypeParameterDeclaration, parameters: Array<BabelNodeIdentifier | BabelNodeRestElement>, typeAnnotation?: BabelNodeTSTypeAnnotation): BabelNodeTSConstructorType;
+ declare export function tsTypeReference(typeName: BabelNodeTSEntityName, typeParameters?: BabelNodeTSTypeParameterInstantiation): BabelNodeTSTypeReference;
+ declare export function tsTypePredicate(parameterName: BabelNodeIdentifier | BabelNodeTSThisType, typeAnnotation?: BabelNodeTSTypeAnnotation, asserts?: boolean): BabelNodeTSTypePredicate;
+ declare export function tsTypeQuery(exprName: BabelNodeTSEntityName | BabelNodeTSImportType): BabelNodeTSTypeQuery;
+ declare export function tsTypeLiteral(members: Array<BabelNodeTSTypeElement>): BabelNodeTSTypeLiteral;
+ declare export function tsArrayType(elementType: BabelNodeTSType): BabelNodeTSArrayType;
+ declare export function tsTupleType(elementTypes: Array<BabelNodeTSType | BabelNodeTSNamedTupleMember>): BabelNodeTSTupleType;
+ declare export function tsOptionalType(typeAnnotation: BabelNodeTSType): BabelNodeTSOptionalType;
+ declare export function tsRestType(typeAnnotation: BabelNodeTSType): BabelNodeTSRestType;
+ declare export function tsNamedTupleMember(label: BabelNodeIdentifier, elementType: BabelNodeTSType, optional?: boolean): BabelNodeTSNamedTupleMember;
+ declare export function tsUnionType(types: Array<BabelNodeTSType>): BabelNodeTSUnionType;
+ declare export function tsIntersectionType(types: Array<BabelNodeTSType>): BabelNodeTSIntersectionType;
+ declare export function tsConditionalType(checkType: BabelNodeTSType, extendsType: BabelNodeTSType, trueType: BabelNodeTSType, falseType: BabelNodeTSType): BabelNodeTSConditionalType;
+ declare export function tsInferType(typeParameter: BabelNodeTSTypeParameter): BabelNodeTSInferType;
+ declare export function tsParenthesizedType(typeAnnotation: BabelNodeTSType): BabelNodeTSParenthesizedType;
+ declare export function tsTypeOperator(typeAnnotation: BabelNodeTSType): BabelNodeTSTypeOperator;
+ declare export function tsIndexedAccessType(objectType: BabelNodeTSType, indexType: BabelNodeTSType): BabelNodeTSIndexedAccessType;
+ declare export function tsMappedType(typeParameter: BabelNodeTSTypeParameter, typeAnnotation?: BabelNodeTSType, nameType?: BabelNodeTSType): BabelNodeTSMappedType;
+ declare export function tsLiteralType(literal: BabelNodeNumericLiteral | BabelNodeStringLiteral | BabelNodeBooleanLiteral | BabelNodeBigIntLiteral | BabelNodeUnaryExpression): BabelNodeTSLiteralType;
+ declare export function tsExpressionWithTypeArguments(expression: BabelNodeTSEntityName, typeParameters?: BabelNodeTSTypeParameterInstantiation): BabelNodeTSExpressionWithTypeArguments;
+ declare export function tsInterfaceDeclaration(id: BabelNodeIdentifier, typeParameters?: BabelNodeTSTypeParameterDeclaration, _extends?: Array<BabelNodeTSExpressionWithTypeArguments>, body: BabelNodeTSInterfaceBody): BabelNodeTSInterfaceDeclaration;
+ declare export function tsInterfaceBody(body: Array<BabelNodeTSTypeElement>): BabelNodeTSInterfaceBody;
+ declare export function tsTypeAliasDeclaration(id: BabelNodeIdentifier, typeParameters?: BabelNodeTSTypeParameterDeclaration, typeAnnotation: BabelNodeTSType): BabelNodeTSTypeAliasDeclaration;
+ declare export function tsAsExpression(expression: BabelNodeExpression, typeAnnotation: BabelNodeTSType): BabelNodeTSAsExpression;
+ declare export function tsTypeAssertion(typeAnnotation: BabelNodeTSType, expression: BabelNodeExpression): BabelNodeTSTypeAssertion;
+ declare export function tsEnumDeclaration(id: BabelNodeIdentifier, members: Array<BabelNodeTSEnumMember>): BabelNodeTSEnumDeclaration;
+ declare export function tsEnumMember(id: BabelNodeIdentifier | BabelNodeStringLiteral, initializer?: BabelNodeExpression): BabelNodeTSEnumMember;
+ declare export function tsModuleDeclaration(id: BabelNodeIdentifier | BabelNodeStringLiteral, body: BabelNodeTSModuleBlock | BabelNodeTSModuleDeclaration): BabelNodeTSModuleDeclaration;
+ declare export function tsModuleBlock(body: Array<BabelNodeStatement>): BabelNodeTSModuleBlock;
+ declare export function tsImportType(argument: BabelNodeStringLiteral, qualifier?: BabelNodeTSEntityName, typeParameters?: BabelNodeTSTypeParameterInstantiation): BabelNodeTSImportType;
+ declare export function tsImportEqualsDeclaration(id: BabelNodeIdentifier, moduleReference: BabelNodeTSEntityName | BabelNodeTSExternalModuleReference): BabelNodeTSImportEqualsDeclaration;
+ declare export function tsExternalModuleReference(expression: BabelNodeStringLiteral): BabelNodeTSExternalModuleReference;
+ declare export function tsNonNullExpression(expression: BabelNodeExpression): BabelNodeTSNonNullExpression;
+ declare export function tsExportAssignment(expression: BabelNodeExpression): BabelNodeTSExportAssignment;
+ declare export function tsNamespaceExportDeclaration(id: BabelNodeIdentifier): BabelNodeTSNamespaceExportDeclaration;
+ declare export function tsTypeAnnotation(typeAnnotation: BabelNodeTSType): BabelNodeTSTypeAnnotation;
+ declare export function tsTypeParameterInstantiation(params: Array<BabelNodeTSType>): BabelNodeTSTypeParameterInstantiation;
+ declare export function tsTypeParameterDeclaration(params: Array<BabelNodeTSTypeParameter>): BabelNodeTSTypeParameterDeclaration;
+ declare export function tsTypeParameter(constraint?: BabelNodeTSType, _default?: BabelNodeTSType, name: string): BabelNodeTSTypeParameter;
+ declare export function isArrayExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeArrayExpression)
+ declare export function assertArrayExpression(node: ?Object, opts?: ?Object): void
+ declare export function isAssignmentExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeAssignmentExpression)
+ declare export function assertAssignmentExpression(node: ?Object, opts?: ?Object): void
+ declare export function isBinaryExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeBinaryExpression)
+ declare export function assertBinaryExpression(node: ?Object, opts?: ?Object): void
+ declare export function isInterpreterDirective(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeInterpreterDirective)
+ declare export function assertInterpreterDirective(node: ?Object, opts?: ?Object): void
+ declare export function isDirective(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDirective)
+ declare export function assertDirective(node: ?Object, opts?: ?Object): void
+ declare export function isDirectiveLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDirectiveLiteral)
+ declare export function assertDirectiveLiteral(node: ?Object, opts?: ?Object): void
+ declare export function isBlockStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeBlockStatement)
+ declare export function assertBlockStatement(node: ?Object, opts?: ?Object): void
+ declare export function isBreakStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeBreakStatement)
+ declare export function assertBreakStatement(node: ?Object, opts?: ?Object): void
+ declare export function isCallExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeCallExpression)
+ declare export function assertCallExpression(node: ?Object, opts?: ?Object): void
+ declare export function isCatchClause(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeCatchClause)
+ declare export function assertCatchClause(node: ?Object, opts?: ?Object): void
+ declare export function isConditionalExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeConditionalExpression)
+ declare export function assertConditionalExpression(node: ?Object, opts?: ?Object): void
+ declare export function isContinueStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeContinueStatement)
+ declare export function assertContinueStatement(node: ?Object, opts?: ?Object): void
+ declare export function isDebuggerStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDebuggerStatement)
+ declare export function assertDebuggerStatement(node: ?Object, opts?: ?Object): void
+ declare export function isDoWhileStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDoWhileStatement)
+ declare export function assertDoWhileStatement(node: ?Object, opts?: ?Object): void
+ declare export function isEmptyStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeEmptyStatement)
+ declare export function assertEmptyStatement(node: ?Object, opts?: ?Object): void
+ declare export function isExpressionStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeExpressionStatement)
+ declare export function assertExpressionStatement(node: ?Object, opts?: ?Object): void
+ declare export function isFile(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeFile)
+ declare export function assertFile(node: ?Object, opts?: ?Object): void
+ declare export function isForInStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeForInStatement)
+ declare export function assertForInStatement(node: ?Object, opts?: ?Object): void
+ declare export function isForStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeForStatement)
+ declare export function assertForStatement(node: ?Object, opts?: ?Object): void
+ declare export function isFunctionDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeFunctionDeclaration)
+ declare export function assertFunctionDeclaration(node: ?Object, opts?: ?Object): void
+ declare export function isFunctionExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeFunctionExpression)
+ declare export function assertFunctionExpression(node: ?Object, opts?: ?Object): void
+ declare export function isIdentifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeIdentifier)
+ declare export function assertIdentifier(node: ?Object, opts?: ?Object): void
+ declare export function isIfStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeIfStatement)
+ declare export function assertIfStatement(node: ?Object, opts?: ?Object): void
+ declare export function isLabeledStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeLabeledStatement)
+ declare export function assertLabeledStatement(node: ?Object, opts?: ?Object): void
+ declare export function isStringLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeStringLiteral)
+ declare export function assertStringLiteral(node: ?Object, opts?: ?Object): void
+ declare export function isNumericLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeNumericLiteral)
+ declare export function assertNumericLiteral(node: ?Object, opts?: ?Object): void
+ declare export function isNullLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeNullLiteral)
+ declare export function assertNullLiteral(node: ?Object, opts?: ?Object): void
+ declare export function isBooleanLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeBooleanLiteral)
+ declare export function assertBooleanLiteral(node: ?Object, opts?: ?Object): void
+ declare export function isRegExpLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeRegExpLiteral)
+ declare export function assertRegExpLiteral(node: ?Object, opts?: ?Object): void
+ declare export function isLogicalExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeLogicalExpression)
+ declare export function assertLogicalExpression(node: ?Object, opts?: ?Object): void
+ declare export function isMemberExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeMemberExpression)
+ declare export function assertMemberExpression(node: ?Object, opts?: ?Object): void
+ declare export function isNewExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeNewExpression)
+ declare export function assertNewExpression(node: ?Object, opts?: ?Object): void
+ declare export function isProgram(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeProgram)
+ declare export function assertProgram(node: ?Object, opts?: ?Object): void
+ declare export function isObjectExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectExpression)
+ declare export function assertObjectExpression(node: ?Object, opts?: ?Object): void
+ declare export function isObjectMethod(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectMethod)
+ declare export function assertObjectMethod(node: ?Object, opts?: ?Object): void
+ declare export function isObjectProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectProperty)
+ declare export function assertObjectProperty(node: ?Object, opts?: ?Object): void
+ declare export function isRestElement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeRestElement)
+ declare export function assertRestElement(node: ?Object, opts?: ?Object): void
+ declare export function isReturnStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeReturnStatement)
+ declare export function assertReturnStatement(node: ?Object, opts?: ?Object): void
+ declare export function isSequenceExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeSequenceExpression)
+ declare export function assertSequenceExpression(node: ?Object, opts?: ?Object): void
+ declare export function isParenthesizedExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeParenthesizedExpression)
+ declare export function assertParenthesizedExpression(node: ?Object, opts?: ?Object): void
+ declare export function isSwitchCase(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeSwitchCase)
+ declare export function assertSwitchCase(node: ?Object, opts?: ?Object): void
+ declare export function isSwitchStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeSwitchStatement)
+ declare export function assertSwitchStatement(node: ?Object, opts?: ?Object): void
+ declare export function isThisExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeThisExpression)
+ declare export function assertThisExpression(node: ?Object, opts?: ?Object): void
+ declare export function isThrowStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeThrowStatement)
+ declare export function assertThrowStatement(node: ?Object, opts?: ?Object): void
+ declare export function isTryStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTryStatement)
+ declare export function assertTryStatement(node: ?Object, opts?: ?Object): void
+ declare export function isUnaryExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeUnaryExpression)
+ declare export function assertUnaryExpression(node: ?Object, opts?: ?Object): void
+ declare export function isUpdateExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeUpdateExpression)
+ declare export function assertUpdateExpression(node: ?Object, opts?: ?Object): void
+ declare export function isVariableDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeVariableDeclaration)
+ declare export function assertVariableDeclaration(node: ?Object, opts?: ?Object): void
+ declare export function isVariableDeclarator(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeVariableDeclarator)
+ declare export function assertVariableDeclarator(node: ?Object, opts?: ?Object): void
+ declare export function isWhileStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeWhileStatement)
+ declare export function assertWhileStatement(node: ?Object, opts?: ?Object): void
+ declare export function isWithStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeWithStatement)
+ declare export function assertWithStatement(node: ?Object, opts?: ?Object): void
+ declare export function isAssignmentPattern(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeAssignmentPattern)
+ declare export function assertAssignmentPattern(node: ?Object, opts?: ?Object): void
+ declare export function isArrayPattern(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeArrayPattern)
+ declare export function assertArrayPattern(node: ?Object, opts?: ?Object): void
+ declare export function isArrowFunctionExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeArrowFunctionExpression)
+ declare export function assertArrowFunctionExpression(node: ?Object, opts?: ?Object): void
+ declare export function isClassBody(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeClassBody)
+ declare export function assertClassBody(node: ?Object, opts?: ?Object): void
+ declare export function isClassExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeClassExpression)
+ declare export function assertClassExpression(node: ?Object, opts?: ?Object): void
+ declare export function isClassDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeClassDeclaration)
+ declare export function assertClassDeclaration(node: ?Object, opts?: ?Object): void
+ declare export function isExportAllDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeExportAllDeclaration)
+ declare export function assertExportAllDeclaration(node: ?Object, opts?: ?Object): void
+ declare export function isExportDefaultDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeExportDefaultDeclaration)
+ declare export function assertExportDefaultDeclaration(node: ?Object, opts?: ?Object): void
+ declare export function isExportNamedDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeExportNamedDeclaration)
+ declare export function assertExportNamedDeclaration(node: ?Object, opts?: ?Object): void
+ declare export function isExportSpecifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeExportSpecifier)
+ declare export function assertExportSpecifier(node: ?Object, opts?: ?Object): void
+ declare export function isForOfStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeForOfStatement)
+ declare export function assertForOfStatement(node: ?Object, opts?: ?Object): void
+ declare export function isImportDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeImportDeclaration)
+ declare export function assertImportDeclaration(node: ?Object, opts?: ?Object): void
+ declare export function isImportDefaultSpecifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeImportDefaultSpecifier)
+ declare export function assertImportDefaultSpecifier(node: ?Object, opts?: ?Object): void
+ declare export function isImportNamespaceSpecifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeImportNamespaceSpecifier)
+ declare export function assertImportNamespaceSpecifier(node: ?Object, opts?: ?Object): void
+ declare export function isImportSpecifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeImportSpecifier)
+ declare export function assertImportSpecifier(node: ?Object, opts?: ?Object): void
+ declare export function isMetaProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeMetaProperty)
+ declare export function assertMetaProperty(node: ?Object, opts?: ?Object): void
+ declare export function isClassMethod(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeClassMethod)
+ declare export function assertClassMethod(node: ?Object, opts?: ?Object): void
+ declare export function isObjectPattern(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectPattern)
+ declare export function assertObjectPattern(node: ?Object, opts?: ?Object): void
+ declare export function isSpreadElement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeSpreadElement)
+ declare export function assertSpreadElement(node: ?Object, opts?: ?Object): void
+ declare export function isSuper(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeSuper)
+ declare export function assertSuper(node: ?Object, opts?: ?Object): void
+ declare export function isTaggedTemplateExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTaggedTemplateExpression)
+ declare export function assertTaggedTemplateExpression(node: ?Object, opts?: ?Object): void
+ declare export function isTemplateElement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTemplateElement)
+ declare export function assertTemplateElement(node: ?Object, opts?: ?Object): void
+ declare export function isTemplateLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTemplateLiteral)
+ declare export function assertTemplateLiteral(node: ?Object, opts?: ?Object): void
+ declare export function isYieldExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeYieldExpression)
+ declare export function assertYieldExpression(node: ?Object, opts?: ?Object): void
+ declare export function isAwaitExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeAwaitExpression)
+ declare export function assertAwaitExpression(node: ?Object, opts?: ?Object): void
+ declare export function isImport(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeImport)
+ declare export function assertImport(node: ?Object, opts?: ?Object): void
+ declare export function isBigIntLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeBigIntLiteral)
+ declare export function assertBigIntLiteral(node: ?Object, opts?: ?Object): void
+ declare export function isExportNamespaceSpecifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeExportNamespaceSpecifier)
+ declare export function assertExportNamespaceSpecifier(node: ?Object, opts?: ?Object): void
+ declare export function isOptionalMemberExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeOptionalMemberExpression)
+ declare export function assertOptionalMemberExpression(node: ?Object, opts?: ?Object): void
+ declare export function isOptionalCallExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeOptionalCallExpression)
+ declare export function assertOptionalCallExpression(node: ?Object, opts?: ?Object): void
+ declare export function isClassProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeClassProperty)
+ declare export function assertClassProperty(node: ?Object, opts?: ?Object): void
+ declare export function isClassPrivateProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeClassPrivateProperty)
+ declare export function assertClassPrivateProperty(node: ?Object, opts?: ?Object): void
+ declare export function isClassPrivateMethod(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeClassPrivateMethod)
+ declare export function assertClassPrivateMethod(node: ?Object, opts?: ?Object): void
+ declare export function isPrivateName(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodePrivateName)
+ declare export function assertPrivateName(node: ?Object, opts?: ?Object): void
+ declare export function isAnyTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeAnyTypeAnnotation)
+ declare export function assertAnyTypeAnnotation(node: ?Object, opts?: ?Object): void
+ declare export function isArrayTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeArrayTypeAnnotation)
+ declare export function assertArrayTypeAnnotation(node: ?Object, opts?: ?Object): void
+ declare export function isBooleanTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeBooleanTypeAnnotation)
+ declare export function assertBooleanTypeAnnotation(node: ?Object, opts?: ?Object): void
+ declare export function isBooleanLiteralTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeBooleanLiteralTypeAnnotation)
+ declare export function assertBooleanLiteralTypeAnnotation(node: ?Object, opts?: ?Object): void
+ declare export function isNullLiteralTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeNullLiteralTypeAnnotation)
+ declare export function assertNullLiteralTypeAnnotation(node: ?Object, opts?: ?Object): void
+ declare export function isClassImplements(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeClassImplements)
+ declare export function assertClassImplements(node: ?Object, opts?: ?Object): void
+ declare export function isDeclareClass(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareClass)
+ declare export function assertDeclareClass(node: ?Object, opts?: ?Object): void
+ declare export function isDeclareFunction(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareFunction)
+ declare export function assertDeclareFunction(node: ?Object, opts?: ?Object): void
+ declare export function isDeclareInterface(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareInterface)
+ declare export function assertDeclareInterface(node: ?Object, opts?: ?Object): void
+ declare export function isDeclareModule(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareModule)
+ declare export function assertDeclareModule(node: ?Object, opts?: ?Object): void
+ declare export function isDeclareModuleExports(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareModuleExports)
+ declare export function assertDeclareModuleExports(node: ?Object, opts?: ?Object): void
+ declare export function isDeclareTypeAlias(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareTypeAlias)
+ declare export function assertDeclareTypeAlias(node: ?Object, opts?: ?Object): void
+ declare export function isDeclareOpaqueType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareOpaqueType)
+ declare export function assertDeclareOpaqueType(node: ?Object, opts?: ?Object): void
+ declare export function isDeclareVariable(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareVariable)
+ declare export function assertDeclareVariable(node: ?Object, opts?: ?Object): void
+ declare export function isDeclareExportDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareExportDeclaration)
+ declare export function assertDeclareExportDeclaration(node: ?Object, opts?: ?Object): void
+ declare export function isDeclareExportAllDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareExportAllDeclaration)
+ declare export function assertDeclareExportAllDeclaration(node: ?Object, opts?: ?Object): void
+ declare export function isDeclaredPredicate(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclaredPredicate)
+ declare export function assertDeclaredPredicate(node: ?Object, opts?: ?Object): void
+ declare export function isExistsTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeExistsTypeAnnotation)
+ declare export function assertExistsTypeAnnotation(node: ?Object, opts?: ?Object): void
+ declare export function isFunctionTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeFunctionTypeAnnotation)
+ declare export function assertFunctionTypeAnnotation(node: ?Object, opts?: ?Object): void
+ declare export function isFunctionTypeParam(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeFunctionTypeParam)
+ declare export function assertFunctionTypeParam(node: ?Object, opts?: ?Object): void
+ declare export function isGenericTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeGenericTypeAnnotation)
+ declare export function assertGenericTypeAnnotation(node: ?Object, opts?: ?Object): void
+ declare export function isInferredPredicate(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeInferredPredicate)
+ declare export function assertInferredPredicate(node: ?Object, opts?: ?Object): void
+ declare export function isInterfaceExtends(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeInterfaceExtends)
+ declare export function assertInterfaceExtends(node: ?Object, opts?: ?Object): void
+ declare export function isInterfaceDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeInterfaceDeclaration)
+ declare export function assertInterfaceDeclaration(node: ?Object, opts?: ?Object): void
+ declare export function isInterfaceTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeInterfaceTypeAnnotation)
+ declare export function assertInterfaceTypeAnnotation(node: ?Object, opts?: ?Object): void
+ declare export function isIntersectionTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeIntersectionTypeAnnotation)
+ declare export function assertIntersectionTypeAnnotation(node: ?Object, opts?: ?Object): void
+ declare export function isMixedTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeMixedTypeAnnotation)
+ declare export function assertMixedTypeAnnotation(node: ?Object, opts?: ?Object): void
+ declare export function isEmptyTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeEmptyTypeAnnotation)
+ declare export function assertEmptyTypeAnnotation(node: ?Object, opts?: ?Object): void
+ declare export function isNullableTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeNullableTypeAnnotation)
+ declare export function assertNullableTypeAnnotation(node: ?Object, opts?: ?Object): void
+ declare export function isNumberLiteralTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeNumberLiteralTypeAnnotation)
+ declare export function assertNumberLiteralTypeAnnotation(node: ?Object, opts?: ?Object): void
+ declare export function isNumberTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeNumberTypeAnnotation)
+ declare export function assertNumberTypeAnnotation(node: ?Object, opts?: ?Object): void
+ declare export function isObjectTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectTypeAnnotation)
+ declare export function assertObjectTypeAnnotation(node: ?Object, opts?: ?Object): void
+ declare export function isObjectTypeInternalSlot(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectTypeInternalSlot)
+ declare export function assertObjectTypeInternalSlot(node: ?Object, opts?: ?Object): void
+ declare export function isObjectTypeCallProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectTypeCallProperty)
+ declare export function assertObjectTypeCallProperty(node: ?Object, opts?: ?Object): void
+ declare export function isObjectTypeIndexer(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectTypeIndexer)
+ declare export function assertObjectTypeIndexer(node: ?Object, opts?: ?Object): void
+ declare export function isObjectTypeProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectTypeProperty)
+ declare export function assertObjectTypeProperty(node: ?Object, opts?: ?Object): void
+ declare export function isObjectTypeSpreadProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectTypeSpreadProperty)
+ declare export function assertObjectTypeSpreadProperty(node: ?Object, opts?: ?Object): void
+ declare export function isOpaqueType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeOpaqueType)
+ declare export function assertOpaqueType(node: ?Object, opts?: ?Object): void
+ declare export function isQualifiedTypeIdentifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeQualifiedTypeIdentifier)
+ declare export function assertQualifiedTypeIdentifier(node: ?Object, opts?: ?Object): void
+ declare export function isStringLiteralTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeStringLiteralTypeAnnotation)
+ declare export function assertStringLiteralTypeAnnotation(node: ?Object, opts?: ?Object): void
+ declare export function isStringTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeStringTypeAnnotation)
+ declare export function assertStringTypeAnnotation(node: ?Object, opts?: ?Object): void
+ declare export function isSymbolTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeSymbolTypeAnnotation)
+ declare export function assertSymbolTypeAnnotation(node: ?Object, opts?: ?Object): void
+ declare export function isThisTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeThisTypeAnnotation)
+ declare export function assertThisTypeAnnotation(node: ?Object, opts?: ?Object): void
+ declare export function isTupleTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTupleTypeAnnotation)
+ declare export function assertTupleTypeAnnotation(node: ?Object, opts?: ?Object): void
+ declare export function isTypeofTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTypeofTypeAnnotation)
+ declare export function assertTypeofTypeAnnotation(node: ?Object, opts?: ?Object): void
+ declare export function isTypeAlias(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTypeAlias)
+ declare export function assertTypeAlias(node: ?Object, opts?: ?Object): void
+ declare export function isTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTypeAnnotation)
+ declare export function assertTypeAnnotation(node: ?Object, opts?: ?Object): void
+ declare export function isTypeCastExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTypeCastExpression)
+ declare export function assertTypeCastExpression(node: ?Object, opts?: ?Object): void
+ declare export function isTypeParameter(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTypeParameter)
+ declare export function assertTypeParameter(node: ?Object, opts?: ?Object): void
+ declare export function isTypeParameterDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTypeParameterDeclaration)
+ declare export function assertTypeParameterDeclaration(node: ?Object, opts?: ?Object): void
+ declare export function isTypeParameterInstantiation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTypeParameterInstantiation)
+ declare export function assertTypeParameterInstantiation(node: ?Object, opts?: ?Object): void
+ declare export function isUnionTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeUnionTypeAnnotation)
+ declare export function assertUnionTypeAnnotation(node: ?Object, opts?: ?Object): void
+ declare export function isVariance(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeVariance)
+ declare export function assertVariance(node: ?Object, opts?: ?Object): void
+ declare export function isVoidTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeVoidTypeAnnotation)
+ declare export function assertVoidTypeAnnotation(node: ?Object, opts?: ?Object): void
+ declare export function isEnumDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeEnumDeclaration)
+ declare export function assertEnumDeclaration(node: ?Object, opts?: ?Object): void
+ declare export function isEnumBooleanBody(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeEnumBooleanBody)
+ declare export function assertEnumBooleanBody(node: ?Object, opts?: ?Object): void
+ declare export function isEnumNumberBody(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeEnumNumberBody)
+ declare export function assertEnumNumberBody(node: ?Object, opts?: ?Object): void
+ declare export function isEnumStringBody(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeEnumStringBody)
+ declare export function assertEnumStringBody(node: ?Object, opts?: ?Object): void
+ declare export function isEnumSymbolBody(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeEnumSymbolBody)
+ declare export function assertEnumSymbolBody(node: ?Object, opts?: ?Object): void
+ declare export function isEnumBooleanMember(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeEnumBooleanMember)
+ declare export function assertEnumBooleanMember(node: ?Object, opts?: ?Object): void
+ declare export function isEnumNumberMember(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeEnumNumberMember)
+ declare export function assertEnumNumberMember(node: ?Object, opts?: ?Object): void
+ declare export function isEnumStringMember(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeEnumStringMember)
+ declare export function assertEnumStringMember(node: ?Object, opts?: ?Object): void
+ declare export function isEnumDefaultedMember(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeEnumDefaultedMember)
+ declare export function assertEnumDefaultedMember(node: ?Object, opts?: ?Object): void
+ declare export function isIndexedAccessType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeIndexedAccessType)
+ declare export function assertIndexedAccessType(node: ?Object, opts?: ?Object): void
+ declare export function isOptionalIndexedAccessType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeOptionalIndexedAccessType)
+ declare export function assertOptionalIndexedAccessType(node: ?Object, opts?: ?Object): void
+ declare export function isJSXAttribute(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXAttribute)
+ declare export function assertJSXAttribute(node: ?Object, opts?: ?Object): void
+ declare export function isJSXClosingElement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXClosingElement)
+ declare export function assertJSXClosingElement(node: ?Object, opts?: ?Object): void
+ declare export function isJSXElement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXElement)
+ declare export function assertJSXElement(node: ?Object, opts?: ?Object): void
+ declare export function isJSXEmptyExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXEmptyExpression)
+ declare export function assertJSXEmptyExpression(node: ?Object, opts?: ?Object): void
+ declare export function isJSXExpressionContainer(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXExpressionContainer)
+ declare export function assertJSXExpressionContainer(node: ?Object, opts?: ?Object): void
+ declare export function isJSXSpreadChild(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXSpreadChild)
+ declare export function assertJSXSpreadChild(node: ?Object, opts?: ?Object): void
+ declare export function isJSXIdentifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXIdentifier)
+ declare export function assertJSXIdentifier(node: ?Object, opts?: ?Object): void
+ declare export function isJSXMemberExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXMemberExpression)
+ declare export function assertJSXMemberExpression(node: ?Object, opts?: ?Object): void
+ declare export function isJSXNamespacedName(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXNamespacedName)
+ declare export function assertJSXNamespacedName(node: ?Object, opts?: ?Object): void
+ declare export function isJSXOpeningElement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXOpeningElement)
+ declare export function assertJSXOpeningElement(node: ?Object, opts?: ?Object): void
+ declare export function isJSXSpreadAttribute(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXSpreadAttribute)
+ declare export function assertJSXSpreadAttribute(node: ?Object, opts?: ?Object): void
+ declare export function isJSXText(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXText)
+ declare export function assertJSXText(node: ?Object, opts?: ?Object): void
+ declare export function isJSXFragment(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXFragment)
+ declare export function assertJSXFragment(node: ?Object, opts?: ?Object): void
+ declare export function isJSXOpeningFragment(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXOpeningFragment)
+ declare export function assertJSXOpeningFragment(node: ?Object, opts?: ?Object): void
+ declare export function isJSXClosingFragment(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXClosingFragment)
+ declare export function assertJSXClosingFragment(node: ?Object, opts?: ?Object): void
+ declare export function isNoop(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeNoop)
+ declare export function assertNoop(node: ?Object, opts?: ?Object): void
+ declare export function isPlaceholder(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodePlaceholder)
+ declare export function assertPlaceholder(node: ?Object, opts?: ?Object): void
+ declare export function isV8IntrinsicIdentifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeV8IntrinsicIdentifier)
+ declare export function assertV8IntrinsicIdentifier(node: ?Object, opts?: ?Object): void
+ declare export function isArgumentPlaceholder(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeArgumentPlaceholder)
+ declare export function assertArgumentPlaceholder(node: ?Object, opts?: ?Object): void
+ declare export function isBindExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeBindExpression)
+ declare export function assertBindExpression(node: ?Object, opts?: ?Object): void
+ declare export function isImportAttribute(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeImportAttribute)
+ declare export function assertImportAttribute(node: ?Object, opts?: ?Object): void
+ declare export function isDecorator(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDecorator)
+ declare export function assertDecorator(node: ?Object, opts?: ?Object): void
+ declare export function isDoExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDoExpression)
+ declare export function assertDoExpression(node: ?Object, opts?: ?Object): void
+ declare export function isExportDefaultSpecifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeExportDefaultSpecifier)
+ declare export function assertExportDefaultSpecifier(node: ?Object, opts?: ?Object): void
+ declare export function isRecordExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeRecordExpression)
+ declare export function assertRecordExpression(node: ?Object, opts?: ?Object): void
+ declare export function isTupleExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTupleExpression)
+ declare export function assertTupleExpression(node: ?Object, opts?: ?Object): void
+ declare export function isDecimalLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDecimalLiteral)
+ declare export function assertDecimalLiteral(node: ?Object, opts?: ?Object): void
+ declare export function isStaticBlock(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeStaticBlock)
+ declare export function assertStaticBlock(node: ?Object, opts?: ?Object): void
+ declare export function isModuleExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeModuleExpression)
+ declare export function assertModuleExpression(node: ?Object, opts?: ?Object): void
+ declare export function isTopicReference(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTopicReference)
+ declare export function assertTopicReference(node: ?Object, opts?: ?Object): void
+ declare export function isPipelineTopicExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodePipelineTopicExpression)
+ declare export function assertPipelineTopicExpression(node: ?Object, opts?: ?Object): void
+ declare export function isPipelineBareFunction(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodePipelineBareFunction)
+ declare export function assertPipelineBareFunction(node: ?Object, opts?: ?Object): void
+ declare export function isPipelinePrimaryTopicReference(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodePipelinePrimaryTopicReference)
+ declare export function assertPipelinePrimaryTopicReference(node: ?Object, opts?: ?Object): void
+ declare export function isTSParameterProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSParameterProperty)
+ declare export function assertTSParameterProperty(node: ?Object, opts?: ?Object): void
+ declare export function isTSDeclareFunction(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSDeclareFunction)
+ declare export function assertTSDeclareFunction(node: ?Object, opts?: ?Object): void
+ declare export function isTSDeclareMethod(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSDeclareMethod)
+ declare export function assertTSDeclareMethod(node: ?Object, opts?: ?Object): void
+ declare export function isTSQualifiedName(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSQualifiedName)
+ declare export function assertTSQualifiedName(node: ?Object, opts?: ?Object): void
+ declare export function isTSCallSignatureDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSCallSignatureDeclaration)
+ declare export function assertTSCallSignatureDeclaration(node: ?Object, opts?: ?Object): void
+ declare export function isTSConstructSignatureDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSConstructSignatureDeclaration)
+ declare export function assertTSConstructSignatureDeclaration(node: ?Object, opts?: ?Object): void
+ declare export function isTSPropertySignature(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSPropertySignature)
+ declare export function assertTSPropertySignature(node: ?Object, opts?: ?Object): void
+ declare export function isTSMethodSignature(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSMethodSignature)
+ declare export function assertTSMethodSignature(node: ?Object, opts?: ?Object): void
+ declare export function isTSIndexSignature(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSIndexSignature)
+ declare export function assertTSIndexSignature(node: ?Object, opts?: ?Object): void
+ declare export function isTSAnyKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSAnyKeyword)
+ declare export function assertTSAnyKeyword(node: ?Object, opts?: ?Object): void
+ declare export function isTSBooleanKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSBooleanKeyword)
+ declare export function assertTSBooleanKeyword(node: ?Object, opts?: ?Object): void
+ declare export function isTSBigIntKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSBigIntKeyword)
+ declare export function assertTSBigIntKeyword(node: ?Object, opts?: ?Object): void
+ declare export function isTSIntrinsicKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSIntrinsicKeyword)
+ declare export function assertTSIntrinsicKeyword(node: ?Object, opts?: ?Object): void
+ declare export function isTSNeverKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSNeverKeyword)
+ declare export function assertTSNeverKeyword(node: ?Object, opts?: ?Object): void
+ declare export function isTSNullKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSNullKeyword)
+ declare export function assertTSNullKeyword(node: ?Object, opts?: ?Object): void
+ declare export function isTSNumberKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSNumberKeyword)
+ declare export function assertTSNumberKeyword(node: ?Object, opts?: ?Object): void
+ declare export function isTSObjectKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSObjectKeyword)
+ declare export function assertTSObjectKeyword(node: ?Object, opts?: ?Object): void
+ declare export function isTSStringKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSStringKeyword)
+ declare export function assertTSStringKeyword(node: ?Object, opts?: ?Object): void
+ declare export function isTSSymbolKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSSymbolKeyword)
+ declare export function assertTSSymbolKeyword(node: ?Object, opts?: ?Object): void
+ declare export function isTSUndefinedKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSUndefinedKeyword)
+ declare export function assertTSUndefinedKeyword(node: ?Object, opts?: ?Object): void
+ declare export function isTSUnknownKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSUnknownKeyword)
+ declare export function assertTSUnknownKeyword(node: ?Object, opts?: ?Object): void
+ declare export function isTSVoidKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSVoidKeyword)
+ declare export function assertTSVoidKeyword(node: ?Object, opts?: ?Object): void
+ declare export function isTSThisType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSThisType)
+ declare export function assertTSThisType(node: ?Object, opts?: ?Object): void
+ declare export function isTSFunctionType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSFunctionType)
+ declare export function assertTSFunctionType(node: ?Object, opts?: ?Object): void
+ declare export function isTSConstructorType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSConstructorType)
+ declare export function assertTSConstructorType(node: ?Object, opts?: ?Object): void
+ declare export function isTSTypeReference(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeReference)
+ declare export function assertTSTypeReference(node: ?Object, opts?: ?Object): void
+ declare export function isTSTypePredicate(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypePredicate)
+ declare export function assertTSTypePredicate(node: ?Object, opts?: ?Object): void
+ declare export function isTSTypeQuery(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeQuery)
+ declare export function assertTSTypeQuery(node: ?Object, opts?: ?Object): void
+ declare export function isTSTypeLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeLiteral)
+ declare export function assertTSTypeLiteral(node: ?Object, opts?: ?Object): void
+ declare export function isTSArrayType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSArrayType)
+ declare export function assertTSArrayType(node: ?Object, opts?: ?Object): void
+ declare export function isTSTupleType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTupleType)
+ declare export function assertTSTupleType(node: ?Object, opts?: ?Object): void
+ declare export function isTSOptionalType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSOptionalType)
+ declare export function assertTSOptionalType(node: ?Object, opts?: ?Object): void
+ declare export function isTSRestType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSRestType)
+ declare export function assertTSRestType(node: ?Object, opts?: ?Object): void
+ declare export function isTSNamedTupleMember(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSNamedTupleMember)
+ declare export function assertTSNamedTupleMember(node: ?Object, opts?: ?Object): void
+ declare export function isTSUnionType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSUnionType)
+ declare export function assertTSUnionType(node: ?Object, opts?: ?Object): void
+ declare export function isTSIntersectionType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSIntersectionType)
+ declare export function assertTSIntersectionType(node: ?Object, opts?: ?Object): void
+ declare export function isTSConditionalType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSConditionalType)
+ declare export function assertTSConditionalType(node: ?Object, opts?: ?Object): void
+ declare export function isTSInferType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSInferType)
+ declare export function assertTSInferType(node: ?Object, opts?: ?Object): void
+ declare export function isTSParenthesizedType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSParenthesizedType)
+ declare export function assertTSParenthesizedType(node: ?Object, opts?: ?Object): void
+ declare export function isTSTypeOperator(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeOperator)
+ declare export function assertTSTypeOperator(node: ?Object, opts?: ?Object): void
+ declare export function isTSIndexedAccessType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSIndexedAccessType)
+ declare export function assertTSIndexedAccessType(node: ?Object, opts?: ?Object): void
+ declare export function isTSMappedType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSMappedType)
+ declare export function assertTSMappedType(node: ?Object, opts?: ?Object): void
+ declare export function isTSLiteralType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSLiteralType)
+ declare export function assertTSLiteralType(node: ?Object, opts?: ?Object): void
+ declare export function isTSExpressionWithTypeArguments(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSExpressionWithTypeArguments)
+ declare export function assertTSExpressionWithTypeArguments(node: ?Object, opts?: ?Object): void
+ declare export function isTSInterfaceDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSInterfaceDeclaration)
+ declare export function assertTSInterfaceDeclaration(node: ?Object, opts?: ?Object): void
+ declare export function isTSInterfaceBody(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSInterfaceBody)
+ declare export function assertTSInterfaceBody(node: ?Object, opts?: ?Object): void
+ declare export function isTSTypeAliasDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeAliasDeclaration)
+ declare export function assertTSTypeAliasDeclaration(node: ?Object, opts?: ?Object): void
+ declare export function isTSAsExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSAsExpression)
+ declare export function assertTSAsExpression(node: ?Object, opts?: ?Object): void
+ declare export function isTSTypeAssertion(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeAssertion)
+ declare export function assertTSTypeAssertion(node: ?Object, opts?: ?Object): void
+ declare export function isTSEnumDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSEnumDeclaration)
+ declare export function assertTSEnumDeclaration(node: ?Object, opts?: ?Object): void
+ declare export function isTSEnumMember(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSEnumMember)
+ declare export function assertTSEnumMember(node: ?Object, opts?: ?Object): void
+ declare export function isTSModuleDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSModuleDeclaration)
+ declare export function assertTSModuleDeclaration(node: ?Object, opts?: ?Object): void
+ declare export function isTSModuleBlock(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSModuleBlock)
+ declare export function assertTSModuleBlock(node: ?Object, opts?: ?Object): void
+ declare export function isTSImportType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSImportType)
+ declare export function assertTSImportType(node: ?Object, opts?: ?Object): void
+ declare export function isTSImportEqualsDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSImportEqualsDeclaration)
+ declare export function assertTSImportEqualsDeclaration(node: ?Object, opts?: ?Object): void
+ declare export function isTSExternalModuleReference(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSExternalModuleReference)
+ declare export function assertTSExternalModuleReference(node: ?Object, opts?: ?Object): void
+ declare export function isTSNonNullExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSNonNullExpression)
+ declare export function assertTSNonNullExpression(node: ?Object, opts?: ?Object): void
+ declare export function isTSExportAssignment(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSExportAssignment)
+ declare export function assertTSExportAssignment(node: ?Object, opts?: ?Object): void
+ declare export function isTSNamespaceExportDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSNamespaceExportDeclaration)
+ declare export function assertTSNamespaceExportDeclaration(node: ?Object, opts?: ?Object): void
+ declare export function isTSTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeAnnotation)
+ declare export function assertTSTypeAnnotation(node: ?Object, opts?: ?Object): void
+ declare export function isTSTypeParameterInstantiation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeParameterInstantiation)
+ declare export function assertTSTypeParameterInstantiation(node: ?Object, opts?: ?Object): void
+ declare export function isTSTypeParameterDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeParameterDeclaration)
+ declare export function assertTSTypeParameterDeclaration(node: ?Object, opts?: ?Object): void
+ declare export function isTSTypeParameter(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeParameter)
+ declare export function assertTSTypeParameter(node: ?Object, opts?: ?Object): void
+ declare export function isExpression(node: ?Object, opts?: ?Object): boolean
+ declare export function assertExpression(node: ?Object, opts?: ?Object): void
+ declare export function isBinary(node: ?Object, opts?: ?Object): boolean
+ declare export function assertBinary(node: ?Object, opts?: ?Object): void
+ declare export function isScopable(node: ?Object, opts?: ?Object): boolean
+ declare export function assertScopable(node: ?Object, opts?: ?Object): void
+ declare export function isBlockParent(node: ?Object, opts?: ?Object): boolean
+ declare export function assertBlockParent(node: ?Object, opts?: ?Object): void
+ declare export function isBlock(node: ?Object, opts?: ?Object): boolean
+ declare export function assertBlock(node: ?Object, opts?: ?Object): void
+ declare export function isStatement(node: ?Object, opts?: ?Object): boolean
+ declare export function assertStatement(node: ?Object, opts?: ?Object): void
+ declare export function isTerminatorless(node: ?Object, opts?: ?Object): boolean
+ declare export function assertTerminatorless(node: ?Object, opts?: ?Object): void
+ declare export function isCompletionStatement(node: ?Object, opts?: ?Object): boolean
+ declare export function assertCompletionStatement(node: ?Object, opts?: ?Object): void
+ declare export function isConditional(node: ?Object, opts?: ?Object): boolean
+ declare export function assertConditional(node: ?Object, opts?: ?Object): void
+ declare export function isLoop(node: ?Object, opts?: ?Object): boolean
+ declare export function assertLoop(node: ?Object, opts?: ?Object): void
+ declare export function isWhile(node: ?Object, opts?: ?Object): boolean
+ declare export function assertWhile(node: ?Object, opts?: ?Object): void
+ declare export function isExpressionWrapper(node: ?Object, opts?: ?Object): boolean
+ declare export function assertExpressionWrapper(node: ?Object, opts?: ?Object): void
+ declare export function isFor(node: ?Object, opts?: ?Object): boolean
+ declare export function assertFor(node: ?Object, opts?: ?Object): void
+ declare export function isForXStatement(node: ?Object, opts?: ?Object): boolean
+ declare export function assertForXStatement(node: ?Object, opts?: ?Object): void
+ declare export function isFunction(node: ?Object, opts?: ?Object): boolean
+ declare export function assertFunction(node: ?Object, opts?: ?Object): void
+ declare export function isFunctionParent(node: ?Object, opts?: ?Object): boolean
+ declare export function assertFunctionParent(node: ?Object, opts?: ?Object): void
+ declare export function isPureish(node: ?Object, opts?: ?Object): boolean
+ declare export function assertPureish(node: ?Object, opts?: ?Object): void
+ declare export function isDeclaration(node: ?Object, opts?: ?Object): boolean
+ declare export function assertDeclaration(node: ?Object, opts?: ?Object): void
+ declare export function isPatternLike(node: ?Object, opts?: ?Object): boolean
+ declare export function assertPatternLike(node: ?Object, opts?: ?Object): void
+ declare export function isLVal(node: ?Object, opts?: ?Object): boolean
+ declare export function assertLVal(node: ?Object, opts?: ?Object): void
+ declare export function isTSEntityName(node: ?Object, opts?: ?Object): boolean
+ declare export function assertTSEntityName(node: ?Object, opts?: ?Object): void
+ declare export function isLiteral(node: ?Object, opts?: ?Object): boolean
+ declare export function assertLiteral(node: ?Object, opts?: ?Object): void
+ declare export function isImmutable(node: ?Object, opts?: ?Object): boolean
+ declare export function assertImmutable(node: ?Object, opts?: ?Object): void
+ declare export function isUserWhitespacable(node: ?Object, opts?: ?Object): boolean
+ declare export function assertUserWhitespacable(node: ?Object, opts?: ?Object): void
+ declare export function isMethod(node: ?Object, opts?: ?Object): boolean
+ declare export function assertMethod(node: ?Object, opts?: ?Object): void
+ declare export function isObjectMember(node: ?Object, opts?: ?Object): boolean
+ declare export function assertObjectMember(node: ?Object, opts?: ?Object): void
+ declare export function isProperty(node: ?Object, opts?: ?Object): boolean
+ declare export function assertProperty(node: ?Object, opts?: ?Object): void
+ declare export function isUnaryLike(node: ?Object, opts?: ?Object): boolean
+ declare export function assertUnaryLike(node: ?Object, opts?: ?Object): void
+ declare export function isPattern(node: ?Object, opts?: ?Object): boolean
+ declare export function assertPattern(node: ?Object, opts?: ?Object): void
+ declare export function isClass(node: ?Object, opts?: ?Object): boolean
+ declare export function assertClass(node: ?Object, opts?: ?Object): void
+ declare export function isModuleDeclaration(node: ?Object, opts?: ?Object): boolean
+ declare export function assertModuleDeclaration(node: ?Object, opts?: ?Object): void
+ declare export function isExportDeclaration(node: ?Object, opts?: ?Object): boolean
+ declare export function assertExportDeclaration(node: ?Object, opts?: ?Object): void
+ declare export function isModuleSpecifier(node: ?Object, opts?: ?Object): boolean
+ declare export function assertModuleSpecifier(node: ?Object, opts?: ?Object): void
+ declare export function isPrivate(node: ?Object, opts?: ?Object): boolean
+ declare export function assertPrivate(node: ?Object, opts?: ?Object): void
+ declare export function isFlow(node: ?Object, opts?: ?Object): boolean
+ declare export function assertFlow(node: ?Object, opts?: ?Object): void
+ declare export function isFlowType(node: ?Object, opts?: ?Object): boolean
+ declare export function assertFlowType(node: ?Object, opts?: ?Object): void
+ declare export function isFlowBaseAnnotation(node: ?Object, opts?: ?Object): boolean
+ declare export function assertFlowBaseAnnotation(node: ?Object, opts?: ?Object): void
+ declare export function isFlowDeclaration(node: ?Object, opts?: ?Object): boolean
+ declare export function assertFlowDeclaration(node: ?Object, opts?: ?Object): void
+ declare export function isFlowPredicate(node: ?Object, opts?: ?Object): boolean
+ declare export function assertFlowPredicate(node: ?Object, opts?: ?Object): void
+ declare export function isEnumBody(node: ?Object, opts?: ?Object): boolean
+ declare export function assertEnumBody(node: ?Object, opts?: ?Object): void
+ declare export function isEnumMember(node: ?Object, opts?: ?Object): boolean
+ declare export function assertEnumMember(node: ?Object, opts?: ?Object): void
+ declare export function isJSX(node: ?Object, opts?: ?Object): boolean
+ declare export function assertJSX(node: ?Object, opts?: ?Object): void
+ declare export function isTSTypeElement(node: ?Object, opts?: ?Object): boolean
+ declare export function assertTSTypeElement(node: ?Object, opts?: ?Object): void
+ declare export function isTSType(node: ?Object, opts?: ?Object): boolean
+ declare export function assertTSType(node: ?Object, opts?: ?Object): void
+ declare export function isTSBaseType(node: ?Object, opts?: ?Object): boolean
+ declare export function assertTSBaseType(node: ?Object, opts?: ?Object): void
+ declare export function isNumberLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeNumericLiteral)
+ declare export function assertNumberLiteral(node: ?Object, opts?: ?Object): void
+ declare export function isRegexLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeRegExpLiteral)
+ declare export function assertRegexLiteral(node: ?Object, opts?: ?Object): void
+ declare export function isRestProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeRestElement)
+ declare export function assertRestProperty(node: ?Object, opts?: ?Object): void
+ declare export function isSpreadProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeSpreadElement)
+ declare export function assertSpreadProperty(node: ?Object, opts?: ?Object): void
+ declare export var VISITOR_KEYS: { [type: string]: string[] }
+ declare export function assertNode(obj: any): void
+ declare export function createTypeAnnotationBasedOnTypeof(type: 'string' | 'number' | 'undefined' | 'boolean' | 'function' | 'object' | 'symbol'): BabelNodeTypeAnnotation
+ declare export function createUnionTypeAnnotation(types: Array<BabelNodeFlowType>): BabelNodeUnionTypeAnnotation
+ declare export function createFlowUnionType(types: Array<BabelNodeFlowType>): BabelNodeUnionTypeAnnotation
+ declare export function buildChildren(node: { children: Array<BabelNodeJSXText | BabelNodeJSXExpressionContainer | BabelNodeJSXSpreadChild | BabelNodeJSXElement | BabelNodeJSXFragment | BabelNodeJSXEmptyExpression> }): Array<BabelNodeJSXText | BabelNodeJSXExpressionContainer | BabelNodeJSXSpreadChild | BabelNodeJSXElement | BabelNodeJSXFragment>
+ declare export function clone<T>(n: T): T;
+ declare export function cloneDeep<T>(n: T): T;
+ declare export function cloneDeepWithoutLoc<T>(n: T): T;
+ declare export function cloneNode<T>(n: T, deep?: boolean, withoutLoc?: boolean): T;
+ declare export function cloneWithoutLoc<T>(n: T): T;
+ declare type CommentTypeShorthand = 'leading' | 'inner' | 'trailing'
+ declare export function addComment<T: BabelNode>(node: T, type: CommentTypeShorthand, content: string, line?: boolean): T
+ declare export function addComments<T: BabelNode>(node: T, type: CommentTypeShorthand, comments: Array<Comment>): T
+ declare export function inheritInnerComments(node: BabelNode, parent: BabelNode): void
+ declare export function inheritLeadingComments(node: BabelNode, parent: BabelNode): void
+ declare export function inheritsComments<T: BabelNode>(node: T, parent: BabelNode): void
+ declare export function inheritTrailingComments(node: BabelNode, parent: BabelNode): void
+ declare export function removeComments<T: BabelNode>(node: T): T
+ declare export function ensureBlock(node: BabelNode, key: string): BabelNodeBlockStatement
+ declare export function toBindingIdentifierName(name?: ?string): string
+ declare export function toBlock(node: BabelNodeStatement | BabelNodeExpression, parent?: BabelNodeFunction | null): BabelNodeBlockStatement
+ declare export function toComputedKey(node: BabelNodeMethod | BabelNodeProperty, key?: BabelNodeExpression | BabelNodeIdentifier): BabelNodeExpression
+ declare export function toExpression(node: BabelNodeExpressionStatement | BabelNodeExpression | BabelNodeClass | BabelNodeFunction): BabelNodeExpression
+ declare export function toIdentifier(name?: ?string): string
+ declare export function toKeyAlias(node: BabelNodeMethod | BabelNodeProperty, key?: BabelNode): string
+ declare export function toStatement(node: BabelNodeStatement | BabelNodeClass | BabelNodeFunction | BabelNodeAssignmentExpression, ignore?: boolean): BabelNodeStatement | void
+ declare export function valueToNode(value: any): BabelNodeExpression
+ declare export function removeTypeDuplicates(types: Array<BabelNodeFlowType>): Array<BabelNodeFlowType>
+ declare export function appendToMemberExpression(member: BabelNodeMemberExpression, append: BabelNode, computed?: boolean): BabelNodeMemberExpression
+ declare export function inherits<T: BabelNode>(child: T, parent: BabelNode | null | void): T
+ declare export function prependToMemberExpression(member: BabelNodeMemberExpression, prepend: BabelNodeExpression): BabelNodeMemberExpression
+ declare export function removeProperties<T>(n: T, opts: ?{}): void;
+ declare export function removePropertiesDeep<T>(n: T, opts: ?{}): T;
+ declare export var getBindingIdentifiers: {
+ (node: BabelNode, duplicates?: boolean, outerOnly?: boolean): { [key: string]: BabelNodeIdentifier | Array<BabelNodeIdentifier> },
+ keys: { [type: string]: string[] }
+ }
+ declare export function getOuterBindingIdentifiers(node: BabelNode, duplicates?: boolean): { [key: string]: BabelNodeIdentifier | Array<BabelNodeIdentifier> }
+ declare type TraversalAncestors = Array<{
+ node: BabelNode,
+ key: string,
+ index?: number,
+ }>;
+ declare type TraversalHandler<T> = (BabelNode, TraversalAncestors, T) => void;
+ declare type TraversalHandlers<T> = {
+ enter?: TraversalHandler<T>,
+ exit?: TraversalHandler<T>,
+ };
+ declare export function traverse<T>(n: BabelNode, TraversalHandler<T> | TraversalHandlers<T>, state?: T): void;
+ declare export function traverseFast<T>(n: BabelNode, h: TraversalHandler<T>, state?: T): void;
+ declare export function shallowEqual(actual: Object, expected: Object): boolean
+ declare export function buildMatchMemberExpression(match: string, allowPartial?: boolean): (?BabelNode) => boolean
+ declare export function is(type: string, n: BabelNode, opts: Object): boolean;
+ declare export function isBinding(node: BabelNode, parent: BabelNode, grandparent?: BabelNode): boolean
+ declare export function isBlockScoped(node: BabelNode): boolean
+ declare export function isImmutable(node: BabelNode): boolean
+ declare export function isLet(node: BabelNode): boolean
+ declare export function isNode(node: ?Object): boolean
+ declare export function isNodesEquivalent(a: any, b: any): boolean
+ declare export function isPlaceholderType(placeholderType: string, targetType: string): boolean
+ declare export function isReferenced(node: BabelNode, parent: BabelNode, grandparent?: BabelNode): boolean
+ declare export function isScope(node: BabelNode, parent: BabelNode): boolean
+ declare export function isSpecifierDefault(specifier: BabelNodeModuleSpecifier): boolean
+ declare export function isType(nodetype: ?string, targetType: string): boolean
+ declare export function isValidES3Identifier(name: string): boolean
+ declare export function isValidES3Identifier(name: string): boolean
+ declare export function isValidIdentifier(name: string): boolean
+ declare export function isVar(node: BabelNode): boolean
+ declare export function matchesPattern(node: ?BabelNode, match: string | Array<string>, allowPartial?: boolean): boolean
+ declare export function validate(n: BabelNode, key: string, value: mixed): void;
+}
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/modifications/appendToMemberExpression.js b/chromium/third_party/node/node_modules/@babel/types/lib/modifications/appendToMemberExpression.js
new file mode 100644
index 00000000000..6a0ac93c5cf
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/modifications/appendToMemberExpression.js
@@ -0,0 +1,15 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = appendToMemberExpression;
+
+var _generated = require("../builders/generated");
+
+function appendToMemberExpression(member, append, computed = false) {
+ member.object = (0, _generated.memberExpression)(member.object, member.property, member.computed);
+ member.property = append;
+ member.computed = !!computed;
+ return member;
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js b/chromium/third_party/node/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js
new file mode 100644
index 00000000000..de9464d1672
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js
@@ -0,0 +1,78 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = removeTypeDuplicates;
+
+var _generated = require("../../validators/generated");
+
+function getQualifiedName(node) {
+ return (0, _generated.isIdentifier)(node) ? node.name : `${node.id.name}.${getQualifiedName(node.qualification)}`;
+}
+
+function removeTypeDuplicates(nodes) {
+ const generics = {};
+ const bases = {};
+ const typeGroups = new Set();
+ const types = [];
+
+ for (let i = 0; i < nodes.length; i++) {
+ const node = nodes[i];
+ if (!node) continue;
+
+ if (types.indexOf(node) >= 0) {
+ continue;
+ }
+
+ if ((0, _generated.isAnyTypeAnnotation)(node)) {
+ return [node];
+ }
+
+ if ((0, _generated.isFlowBaseAnnotation)(node)) {
+ bases[node.type] = node;
+ continue;
+ }
+
+ if ((0, _generated.isUnionTypeAnnotation)(node)) {
+ if (!typeGroups.has(node.types)) {
+ nodes = nodes.concat(node.types);
+ typeGroups.add(node.types);
+ }
+
+ continue;
+ }
+
+ if ((0, _generated.isGenericTypeAnnotation)(node)) {
+ const name = getQualifiedName(node.id);
+
+ if (generics[name]) {
+ let existing = generics[name];
+
+ if (existing.typeParameters) {
+ if (node.typeParameters) {
+ existing.typeParameters.params = removeTypeDuplicates(existing.typeParameters.params.concat(node.typeParameters.params));
+ }
+ } else {
+ existing = node.typeParameters;
+ }
+ } else {
+ generics[name] = node;
+ }
+
+ continue;
+ }
+
+ types.push(node);
+ }
+
+ for (const type of Object.keys(bases)) {
+ types.push(bases[type]);
+ }
+
+ for (const name of Object.keys(generics)) {
+ types.push(generics[name]);
+ }
+
+ return types;
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/modifications/inherits.js b/chromium/third_party/node/node_modules/@babel/types/lib/modifications/inherits.js
new file mode 100644
index 00000000000..8701897d0e2
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/modifications/inherits.js
@@ -0,0 +1,31 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = inherits;
+
+var _constants = require("../constants");
+
+var _inheritsComments = require("../comments/inheritsComments");
+
+function inherits(child, parent) {
+ if (!child || !parent) return child;
+
+ for (const key of _constants.INHERIT_KEYS.optional) {
+ if (child[key] == null) {
+ child[key] = parent[key];
+ }
+ }
+
+ for (const key of Object.keys(parent)) {
+ if (key[0] === "_" && key !== "__clone") child[key] = parent[key];
+ }
+
+ for (const key of _constants.INHERIT_KEYS.force) {
+ child[key] = parent[key];
+ }
+
+ (0, _inheritsComments.default)(child, parent);
+ return child;
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/modifications/prependToMemberExpression.js b/chromium/third_party/node/node_modules/@babel/types/lib/modifications/prependToMemberExpression.js
new file mode 100644
index 00000000000..ee6de0ec332
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/modifications/prependToMemberExpression.js
@@ -0,0 +1,13 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = prependToMemberExpression;
+
+var _generated = require("../builders/generated");
+
+function prependToMemberExpression(member, prepend) {
+ member.object = (0, _generated.memberExpression)(prepend, member.object);
+ return member;
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/modifications/removeProperties.js b/chromium/third_party/node/node_modules/@babel/types/lib/modifications/removeProperties.js
new file mode 100644
index 00000000000..f9cf8e6065d
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/modifications/removeProperties.js
@@ -0,0 +1,30 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = removeProperties;
+
+var _constants = require("../constants");
+
+const CLEAR_KEYS = ["tokens", "start", "end", "loc", "raw", "rawValue"];
+
+const CLEAR_KEYS_PLUS_COMMENTS = _constants.COMMENT_KEYS.concat(["comments"]).concat(CLEAR_KEYS);
+
+function removeProperties(node, opts = {}) {
+ const map = opts.preserveComments ? CLEAR_KEYS : CLEAR_KEYS_PLUS_COMMENTS;
+
+ for (const key of map) {
+ if (node[key] != null) node[key] = undefined;
+ }
+
+ for (const key of Object.keys(node)) {
+ if (key[0] === "_" && node[key] != null) node[key] = undefined;
+ }
+
+ const symbols = Object.getOwnPropertySymbols(node);
+
+ for (const sym of symbols) {
+ node[sym] = null;
+ }
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/modifications/removePropertiesDeep.js b/chromium/third_party/node/node_modules/@babel/types/lib/modifications/removePropertiesDeep.js
new file mode 100644
index 00000000000..e36f7558934
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/modifications/removePropertiesDeep.js
@@ -0,0 +1,15 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = removePropertiesDeep;
+
+var _traverseFast = require("../traverse/traverseFast");
+
+var _removeProperties = require("./removeProperties");
+
+function removePropertiesDeep(tree, opts) {
+ (0, _traverseFast.default)(tree, _removeProperties.default, opts);
+ return tree;
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js b/chromium/third_party/node/node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js
new file mode 100644
index 00000000000..25defea7ec5
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js
@@ -0,0 +1,54 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = removeTypeDuplicates;
+
+var _generated = require("../../validators/generated");
+
+function removeTypeDuplicates(nodes) {
+ const generics = {};
+ const bases = {};
+ const typeGroups = new Set();
+ const types = [];
+
+ for (let i = 0; i < nodes.length; i++) {
+ const node = nodes[i];
+ if (!node) continue;
+
+ if (types.indexOf(node) >= 0) {
+ continue;
+ }
+
+ if ((0, _generated.isTSAnyKeyword)(node)) {
+ return [node];
+ }
+
+ if ((0, _generated.isTSBaseType)(node)) {
+ bases[node.type] = node;
+ continue;
+ }
+
+ if ((0, _generated.isTSUnionType)(node)) {
+ if (!typeGroups.has(node.types)) {
+ nodes.push(...node.types);
+ typeGroups.add(node.types);
+ }
+
+ continue;
+ }
+
+ types.push(node);
+ }
+
+ for (const type of Object.keys(bases)) {
+ types.push(bases[type]);
+ }
+
+ for (const name of Object.keys(generics)) {
+ types.push(generics[name]);
+ }
+
+ return types;
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js b/chromium/third_party/node/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js
new file mode 100644
index 00000000000..4daaf8bf0fe
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js
@@ -0,0 +1,104 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = getBindingIdentifiers;
+
+var _generated = require("../validators/generated");
+
+function getBindingIdentifiers(node, duplicates, outerOnly) {
+ let search = [].concat(node);
+ const ids = Object.create(null);
+
+ while (search.length) {
+ const id = search.shift();
+ if (!id) continue;
+ const keys = getBindingIdentifiers.keys[id.type];
+
+ if ((0, _generated.isIdentifier)(id)) {
+ if (duplicates) {
+ const _ids = ids[id.name] = ids[id.name] || [];
+
+ _ids.push(id);
+ } else {
+ ids[id.name] = id;
+ }
+
+ continue;
+ }
+
+ if ((0, _generated.isExportDeclaration)(id) && !(0, _generated.isExportAllDeclaration)(id)) {
+ if ((0, _generated.isDeclaration)(id.declaration)) {
+ search.push(id.declaration);
+ }
+
+ continue;
+ }
+
+ if (outerOnly) {
+ if ((0, _generated.isFunctionDeclaration)(id)) {
+ search.push(id.id);
+ continue;
+ }
+
+ if ((0, _generated.isFunctionExpression)(id)) {
+ continue;
+ }
+ }
+
+ if (keys) {
+ for (let i = 0; i < keys.length; i++) {
+ const key = keys[i];
+
+ if (id[key]) {
+ search = search.concat(id[key]);
+ }
+ }
+ }
+ }
+
+ return ids;
+}
+
+getBindingIdentifiers.keys = {
+ DeclareClass: ["id"],
+ DeclareFunction: ["id"],
+ DeclareModule: ["id"],
+ DeclareVariable: ["id"],
+ DeclareInterface: ["id"],
+ DeclareTypeAlias: ["id"],
+ DeclareOpaqueType: ["id"],
+ InterfaceDeclaration: ["id"],
+ TypeAlias: ["id"],
+ OpaqueType: ["id"],
+ CatchClause: ["param"],
+ LabeledStatement: ["label"],
+ UnaryExpression: ["argument"],
+ AssignmentExpression: ["left"],
+ ImportSpecifier: ["local"],
+ ImportNamespaceSpecifier: ["local"],
+ ImportDefaultSpecifier: ["local"],
+ ImportDeclaration: ["specifiers"],
+ ExportSpecifier: ["exported"],
+ ExportNamespaceSpecifier: ["exported"],
+ ExportDefaultSpecifier: ["exported"],
+ FunctionDeclaration: ["id", "params"],
+ FunctionExpression: ["id", "params"],
+ ArrowFunctionExpression: ["params"],
+ ObjectMethod: ["params"],
+ ClassMethod: ["params"],
+ ClassPrivateMethod: ["params"],
+ ForInStatement: ["left"],
+ ForOfStatement: ["left"],
+ ClassDeclaration: ["id"],
+ ClassExpression: ["id"],
+ RestElement: ["argument"],
+ UpdateExpression: ["argument"],
+ ObjectProperty: ["value"],
+ AssignmentPattern: ["left"],
+ ArrayPattern: ["elements"],
+ ObjectPattern: ["properties"],
+ VariableDeclaration: ["declarations"],
+ VariableDeclarator: ["id"]
+}; \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js b/chromium/third_party/node/node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js
new file mode 100644
index 00000000000..c27cffe544d
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js
@@ -0,0 +1,15 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = void 0;
+
+var _getBindingIdentifiers = require("./getBindingIdentifiers");
+
+var _default = getOuterBindingIdentifiers;
+exports.default = _default;
+
+function getOuterBindingIdentifiers(node, duplicates) {
+ return (0, _getBindingIdentifiers.default)(node, duplicates, true);
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/traverse/traverse.js b/chromium/third_party/node/node_modules/@babel/types/lib/traverse/traverse.js
new file mode 100644
index 00000000000..775aed1eede
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/traverse/traverse.js
@@ -0,0 +1,55 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = traverse;
+
+var _definitions = require("../definitions");
+
+function traverse(node, handlers, state) {
+ if (typeof handlers === "function") {
+ handlers = {
+ enter: handlers
+ };
+ }
+
+ const {
+ enter,
+ exit
+ } = handlers;
+ traverseSimpleImpl(node, enter, exit, state, []);
+}
+
+function traverseSimpleImpl(node, enter, exit, state, ancestors) {
+ const keys = _definitions.VISITOR_KEYS[node.type];
+ if (!keys) return;
+ if (enter) enter(node, ancestors, state);
+
+ for (const key of keys) {
+ const subNode = node[key];
+
+ if (Array.isArray(subNode)) {
+ for (let i = 0; i < subNode.length; i++) {
+ const child = subNode[i];
+ if (!child) continue;
+ ancestors.push({
+ node,
+ key,
+ index: i
+ });
+ traverseSimpleImpl(child, enter, exit, state, ancestors);
+ ancestors.pop();
+ }
+ } else if (subNode) {
+ ancestors.push({
+ node,
+ key
+ });
+ traverseSimpleImpl(subNode, enter, exit, state, ancestors);
+ ancestors.pop();
+ }
+ }
+
+ if (exit) exit(node, ancestors, state);
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/traverse/traverseFast.js b/chromium/third_party/node/node_modules/@babel/types/lib/traverse/traverseFast.js
new file mode 100644
index 00000000000..f038dd835ed
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/traverse/traverseFast.js
@@ -0,0 +1,28 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = traverseFast;
+
+var _definitions = require("../definitions");
+
+function traverseFast(node, enter, opts) {
+ if (!node) return;
+ const keys = _definitions.VISITOR_KEYS[node.type];
+ if (!keys) return;
+ opts = opts || {};
+ enter(node, opts);
+
+ for (const key of keys) {
+ const subNode = node[key];
+
+ if (Array.isArray(subNode)) {
+ for (const node of subNode) {
+ traverseFast(node, enter, opts);
+ }
+ } else {
+ traverseFast(subNode, enter, opts);
+ }
+ }
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/utils/inherit.js b/chromium/third_party/node/node_modules/@babel/types/lib/utils/inherit.js
new file mode 100644
index 00000000000..35f33812439
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/utils/inherit.js
@@ -0,0 +1,12 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = inherit;
+
+function inherit(key, child, parent) {
+ if (child && parent) {
+ child[key] = Array.from(new Set([].concat(child[key], parent[key]).filter(Boolean)));
+ }
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js b/chromium/third_party/node/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js
new file mode 100644
index 00000000000..f0ca13369be
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js
@@ -0,0 +1,47 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = cleanJSXElementLiteralChild;
+
+var _generated = require("../../builders/generated");
+
+function cleanJSXElementLiteralChild(child, args) {
+ const lines = child.value.split(/\r\n|\n|\r/);
+ let lastNonEmptyLine = 0;
+
+ for (let i = 0; i < lines.length; i++) {
+ if (lines[i].match(/[^ \t]/)) {
+ lastNonEmptyLine = i;
+ }
+ }
+
+ let str = "";
+
+ for (let i = 0; i < lines.length; i++) {
+ const line = lines[i];
+ const isFirstLine = i === 0;
+ const isLastLine = i === lines.length - 1;
+ const isLastNonEmptyLine = i === lastNonEmptyLine;
+ let trimmedLine = line.replace(/\t/g, " ");
+
+ if (!isFirstLine) {
+ trimmedLine = trimmedLine.replace(/^[ ]+/, "");
+ }
+
+ if (!isLastLine) {
+ trimmedLine = trimmedLine.replace(/[ ]+$/, "");
+ }
+
+ if (trimmedLine) {
+ if (!isLastNonEmptyLine) {
+ trimmedLine += " ";
+ }
+
+ str += trimmedLine;
+ }
+ }
+
+ if (str) args.push((0, _generated.stringLiteral)(str));
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/utils/shallowEqual.js b/chromium/third_party/node/node_modules/@babel/types/lib/utils/shallowEqual.js
new file mode 100644
index 00000000000..fae259e4fc5
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/utils/shallowEqual.js
@@ -0,0 +1,18 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = shallowEqual;
+
+function shallowEqual(actual, expected) {
+ const keys = Object.keys(expected);
+
+ for (const key of keys) {
+ if (actual[key] !== expected[key]) {
+ return false;
+ }
+ }
+
+ return true;
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js b/chromium/third_party/node/node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js
new file mode 100644
index 00000000000..c0064968ecd
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js
@@ -0,0 +1,13 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = buildMatchMemberExpression;
+
+var _matchesPattern = require("./matchesPattern");
+
+function buildMatchMemberExpression(match, allowPartial) {
+ const parts = match.split(".");
+ return member => (0, _matchesPattern.default)(member, parts, allowPartial);
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/validators/generated/index.js b/chromium/third_party/node/node_modules/@babel/types/lib/validators/generated/index.js
new file mode 100644
index 00000000000..0d54c9bd95c
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/validators/generated/index.js
@@ -0,0 +1,4731 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.isArrayExpression = isArrayExpression;
+exports.isAssignmentExpression = isAssignmentExpression;
+exports.isBinaryExpression = isBinaryExpression;
+exports.isInterpreterDirective = isInterpreterDirective;
+exports.isDirective = isDirective;
+exports.isDirectiveLiteral = isDirectiveLiteral;
+exports.isBlockStatement = isBlockStatement;
+exports.isBreakStatement = isBreakStatement;
+exports.isCallExpression = isCallExpression;
+exports.isCatchClause = isCatchClause;
+exports.isConditionalExpression = isConditionalExpression;
+exports.isContinueStatement = isContinueStatement;
+exports.isDebuggerStatement = isDebuggerStatement;
+exports.isDoWhileStatement = isDoWhileStatement;
+exports.isEmptyStatement = isEmptyStatement;
+exports.isExpressionStatement = isExpressionStatement;
+exports.isFile = isFile;
+exports.isForInStatement = isForInStatement;
+exports.isForStatement = isForStatement;
+exports.isFunctionDeclaration = isFunctionDeclaration;
+exports.isFunctionExpression = isFunctionExpression;
+exports.isIdentifier = isIdentifier;
+exports.isIfStatement = isIfStatement;
+exports.isLabeledStatement = isLabeledStatement;
+exports.isStringLiteral = isStringLiteral;
+exports.isNumericLiteral = isNumericLiteral;
+exports.isNullLiteral = isNullLiteral;
+exports.isBooleanLiteral = isBooleanLiteral;
+exports.isRegExpLiteral = isRegExpLiteral;
+exports.isLogicalExpression = isLogicalExpression;
+exports.isMemberExpression = isMemberExpression;
+exports.isNewExpression = isNewExpression;
+exports.isProgram = isProgram;
+exports.isObjectExpression = isObjectExpression;
+exports.isObjectMethod = isObjectMethod;
+exports.isObjectProperty = isObjectProperty;
+exports.isRestElement = isRestElement;
+exports.isReturnStatement = isReturnStatement;
+exports.isSequenceExpression = isSequenceExpression;
+exports.isParenthesizedExpression = isParenthesizedExpression;
+exports.isSwitchCase = isSwitchCase;
+exports.isSwitchStatement = isSwitchStatement;
+exports.isThisExpression = isThisExpression;
+exports.isThrowStatement = isThrowStatement;
+exports.isTryStatement = isTryStatement;
+exports.isUnaryExpression = isUnaryExpression;
+exports.isUpdateExpression = isUpdateExpression;
+exports.isVariableDeclaration = isVariableDeclaration;
+exports.isVariableDeclarator = isVariableDeclarator;
+exports.isWhileStatement = isWhileStatement;
+exports.isWithStatement = isWithStatement;
+exports.isAssignmentPattern = isAssignmentPattern;
+exports.isArrayPattern = isArrayPattern;
+exports.isArrowFunctionExpression = isArrowFunctionExpression;
+exports.isClassBody = isClassBody;
+exports.isClassExpression = isClassExpression;
+exports.isClassDeclaration = isClassDeclaration;
+exports.isExportAllDeclaration = isExportAllDeclaration;
+exports.isExportDefaultDeclaration = isExportDefaultDeclaration;
+exports.isExportNamedDeclaration = isExportNamedDeclaration;
+exports.isExportSpecifier = isExportSpecifier;
+exports.isForOfStatement = isForOfStatement;
+exports.isImportDeclaration = isImportDeclaration;
+exports.isImportDefaultSpecifier = isImportDefaultSpecifier;
+exports.isImportNamespaceSpecifier = isImportNamespaceSpecifier;
+exports.isImportSpecifier = isImportSpecifier;
+exports.isMetaProperty = isMetaProperty;
+exports.isClassMethod = isClassMethod;
+exports.isObjectPattern = isObjectPattern;
+exports.isSpreadElement = isSpreadElement;
+exports.isSuper = isSuper;
+exports.isTaggedTemplateExpression = isTaggedTemplateExpression;
+exports.isTemplateElement = isTemplateElement;
+exports.isTemplateLiteral = isTemplateLiteral;
+exports.isYieldExpression = isYieldExpression;
+exports.isAwaitExpression = isAwaitExpression;
+exports.isImport = isImport;
+exports.isBigIntLiteral = isBigIntLiteral;
+exports.isExportNamespaceSpecifier = isExportNamespaceSpecifier;
+exports.isOptionalMemberExpression = isOptionalMemberExpression;
+exports.isOptionalCallExpression = isOptionalCallExpression;
+exports.isClassProperty = isClassProperty;
+exports.isClassPrivateProperty = isClassPrivateProperty;
+exports.isClassPrivateMethod = isClassPrivateMethod;
+exports.isPrivateName = isPrivateName;
+exports.isAnyTypeAnnotation = isAnyTypeAnnotation;
+exports.isArrayTypeAnnotation = isArrayTypeAnnotation;
+exports.isBooleanTypeAnnotation = isBooleanTypeAnnotation;
+exports.isBooleanLiteralTypeAnnotation = isBooleanLiteralTypeAnnotation;
+exports.isNullLiteralTypeAnnotation = isNullLiteralTypeAnnotation;
+exports.isClassImplements = isClassImplements;
+exports.isDeclareClass = isDeclareClass;
+exports.isDeclareFunction = isDeclareFunction;
+exports.isDeclareInterface = isDeclareInterface;
+exports.isDeclareModule = isDeclareModule;
+exports.isDeclareModuleExports = isDeclareModuleExports;
+exports.isDeclareTypeAlias = isDeclareTypeAlias;
+exports.isDeclareOpaqueType = isDeclareOpaqueType;
+exports.isDeclareVariable = isDeclareVariable;
+exports.isDeclareExportDeclaration = isDeclareExportDeclaration;
+exports.isDeclareExportAllDeclaration = isDeclareExportAllDeclaration;
+exports.isDeclaredPredicate = isDeclaredPredicate;
+exports.isExistsTypeAnnotation = isExistsTypeAnnotation;
+exports.isFunctionTypeAnnotation = isFunctionTypeAnnotation;
+exports.isFunctionTypeParam = isFunctionTypeParam;
+exports.isGenericTypeAnnotation = isGenericTypeAnnotation;
+exports.isInferredPredicate = isInferredPredicate;
+exports.isInterfaceExtends = isInterfaceExtends;
+exports.isInterfaceDeclaration = isInterfaceDeclaration;
+exports.isInterfaceTypeAnnotation = isInterfaceTypeAnnotation;
+exports.isIntersectionTypeAnnotation = isIntersectionTypeAnnotation;
+exports.isMixedTypeAnnotation = isMixedTypeAnnotation;
+exports.isEmptyTypeAnnotation = isEmptyTypeAnnotation;
+exports.isNullableTypeAnnotation = isNullableTypeAnnotation;
+exports.isNumberLiteralTypeAnnotation = isNumberLiteralTypeAnnotation;
+exports.isNumberTypeAnnotation = isNumberTypeAnnotation;
+exports.isObjectTypeAnnotation = isObjectTypeAnnotation;
+exports.isObjectTypeInternalSlot = isObjectTypeInternalSlot;
+exports.isObjectTypeCallProperty = isObjectTypeCallProperty;
+exports.isObjectTypeIndexer = isObjectTypeIndexer;
+exports.isObjectTypeProperty = isObjectTypeProperty;
+exports.isObjectTypeSpreadProperty = isObjectTypeSpreadProperty;
+exports.isOpaqueType = isOpaqueType;
+exports.isQualifiedTypeIdentifier = isQualifiedTypeIdentifier;
+exports.isStringLiteralTypeAnnotation = isStringLiteralTypeAnnotation;
+exports.isStringTypeAnnotation = isStringTypeAnnotation;
+exports.isSymbolTypeAnnotation = isSymbolTypeAnnotation;
+exports.isThisTypeAnnotation = isThisTypeAnnotation;
+exports.isTupleTypeAnnotation = isTupleTypeAnnotation;
+exports.isTypeofTypeAnnotation = isTypeofTypeAnnotation;
+exports.isTypeAlias = isTypeAlias;
+exports.isTypeAnnotation = isTypeAnnotation;
+exports.isTypeCastExpression = isTypeCastExpression;
+exports.isTypeParameter = isTypeParameter;
+exports.isTypeParameterDeclaration = isTypeParameterDeclaration;
+exports.isTypeParameterInstantiation = isTypeParameterInstantiation;
+exports.isUnionTypeAnnotation = isUnionTypeAnnotation;
+exports.isVariance = isVariance;
+exports.isVoidTypeAnnotation = isVoidTypeAnnotation;
+exports.isEnumDeclaration = isEnumDeclaration;
+exports.isEnumBooleanBody = isEnumBooleanBody;
+exports.isEnumNumberBody = isEnumNumberBody;
+exports.isEnumStringBody = isEnumStringBody;
+exports.isEnumSymbolBody = isEnumSymbolBody;
+exports.isEnumBooleanMember = isEnumBooleanMember;
+exports.isEnumNumberMember = isEnumNumberMember;
+exports.isEnumStringMember = isEnumStringMember;
+exports.isEnumDefaultedMember = isEnumDefaultedMember;
+exports.isIndexedAccessType = isIndexedAccessType;
+exports.isOptionalIndexedAccessType = isOptionalIndexedAccessType;
+exports.isJSXAttribute = isJSXAttribute;
+exports.isJSXClosingElement = isJSXClosingElement;
+exports.isJSXElement = isJSXElement;
+exports.isJSXEmptyExpression = isJSXEmptyExpression;
+exports.isJSXExpressionContainer = isJSXExpressionContainer;
+exports.isJSXSpreadChild = isJSXSpreadChild;
+exports.isJSXIdentifier = isJSXIdentifier;
+exports.isJSXMemberExpression = isJSXMemberExpression;
+exports.isJSXNamespacedName = isJSXNamespacedName;
+exports.isJSXOpeningElement = isJSXOpeningElement;
+exports.isJSXSpreadAttribute = isJSXSpreadAttribute;
+exports.isJSXText = isJSXText;
+exports.isJSXFragment = isJSXFragment;
+exports.isJSXOpeningFragment = isJSXOpeningFragment;
+exports.isJSXClosingFragment = isJSXClosingFragment;
+exports.isNoop = isNoop;
+exports.isPlaceholder = isPlaceholder;
+exports.isV8IntrinsicIdentifier = isV8IntrinsicIdentifier;
+exports.isArgumentPlaceholder = isArgumentPlaceholder;
+exports.isBindExpression = isBindExpression;
+exports.isImportAttribute = isImportAttribute;
+exports.isDecorator = isDecorator;
+exports.isDoExpression = isDoExpression;
+exports.isExportDefaultSpecifier = isExportDefaultSpecifier;
+exports.isRecordExpression = isRecordExpression;
+exports.isTupleExpression = isTupleExpression;
+exports.isDecimalLiteral = isDecimalLiteral;
+exports.isStaticBlock = isStaticBlock;
+exports.isModuleExpression = isModuleExpression;
+exports.isTopicReference = isTopicReference;
+exports.isPipelineTopicExpression = isPipelineTopicExpression;
+exports.isPipelineBareFunction = isPipelineBareFunction;
+exports.isPipelinePrimaryTopicReference = isPipelinePrimaryTopicReference;
+exports.isTSParameterProperty = isTSParameterProperty;
+exports.isTSDeclareFunction = isTSDeclareFunction;
+exports.isTSDeclareMethod = isTSDeclareMethod;
+exports.isTSQualifiedName = isTSQualifiedName;
+exports.isTSCallSignatureDeclaration = isTSCallSignatureDeclaration;
+exports.isTSConstructSignatureDeclaration = isTSConstructSignatureDeclaration;
+exports.isTSPropertySignature = isTSPropertySignature;
+exports.isTSMethodSignature = isTSMethodSignature;
+exports.isTSIndexSignature = isTSIndexSignature;
+exports.isTSAnyKeyword = isTSAnyKeyword;
+exports.isTSBooleanKeyword = isTSBooleanKeyword;
+exports.isTSBigIntKeyword = isTSBigIntKeyword;
+exports.isTSIntrinsicKeyword = isTSIntrinsicKeyword;
+exports.isTSNeverKeyword = isTSNeverKeyword;
+exports.isTSNullKeyword = isTSNullKeyword;
+exports.isTSNumberKeyword = isTSNumberKeyword;
+exports.isTSObjectKeyword = isTSObjectKeyword;
+exports.isTSStringKeyword = isTSStringKeyword;
+exports.isTSSymbolKeyword = isTSSymbolKeyword;
+exports.isTSUndefinedKeyword = isTSUndefinedKeyword;
+exports.isTSUnknownKeyword = isTSUnknownKeyword;
+exports.isTSVoidKeyword = isTSVoidKeyword;
+exports.isTSThisType = isTSThisType;
+exports.isTSFunctionType = isTSFunctionType;
+exports.isTSConstructorType = isTSConstructorType;
+exports.isTSTypeReference = isTSTypeReference;
+exports.isTSTypePredicate = isTSTypePredicate;
+exports.isTSTypeQuery = isTSTypeQuery;
+exports.isTSTypeLiteral = isTSTypeLiteral;
+exports.isTSArrayType = isTSArrayType;
+exports.isTSTupleType = isTSTupleType;
+exports.isTSOptionalType = isTSOptionalType;
+exports.isTSRestType = isTSRestType;
+exports.isTSNamedTupleMember = isTSNamedTupleMember;
+exports.isTSUnionType = isTSUnionType;
+exports.isTSIntersectionType = isTSIntersectionType;
+exports.isTSConditionalType = isTSConditionalType;
+exports.isTSInferType = isTSInferType;
+exports.isTSParenthesizedType = isTSParenthesizedType;
+exports.isTSTypeOperator = isTSTypeOperator;
+exports.isTSIndexedAccessType = isTSIndexedAccessType;
+exports.isTSMappedType = isTSMappedType;
+exports.isTSLiteralType = isTSLiteralType;
+exports.isTSExpressionWithTypeArguments = isTSExpressionWithTypeArguments;
+exports.isTSInterfaceDeclaration = isTSInterfaceDeclaration;
+exports.isTSInterfaceBody = isTSInterfaceBody;
+exports.isTSTypeAliasDeclaration = isTSTypeAliasDeclaration;
+exports.isTSAsExpression = isTSAsExpression;
+exports.isTSTypeAssertion = isTSTypeAssertion;
+exports.isTSEnumDeclaration = isTSEnumDeclaration;
+exports.isTSEnumMember = isTSEnumMember;
+exports.isTSModuleDeclaration = isTSModuleDeclaration;
+exports.isTSModuleBlock = isTSModuleBlock;
+exports.isTSImportType = isTSImportType;
+exports.isTSImportEqualsDeclaration = isTSImportEqualsDeclaration;
+exports.isTSExternalModuleReference = isTSExternalModuleReference;
+exports.isTSNonNullExpression = isTSNonNullExpression;
+exports.isTSExportAssignment = isTSExportAssignment;
+exports.isTSNamespaceExportDeclaration = isTSNamespaceExportDeclaration;
+exports.isTSTypeAnnotation = isTSTypeAnnotation;
+exports.isTSTypeParameterInstantiation = isTSTypeParameterInstantiation;
+exports.isTSTypeParameterDeclaration = isTSTypeParameterDeclaration;
+exports.isTSTypeParameter = isTSTypeParameter;
+exports.isExpression = isExpression;
+exports.isBinary = isBinary;
+exports.isScopable = isScopable;
+exports.isBlockParent = isBlockParent;
+exports.isBlock = isBlock;
+exports.isStatement = isStatement;
+exports.isTerminatorless = isTerminatorless;
+exports.isCompletionStatement = isCompletionStatement;
+exports.isConditional = isConditional;
+exports.isLoop = isLoop;
+exports.isWhile = isWhile;
+exports.isExpressionWrapper = isExpressionWrapper;
+exports.isFor = isFor;
+exports.isForXStatement = isForXStatement;
+exports.isFunction = isFunction;
+exports.isFunctionParent = isFunctionParent;
+exports.isPureish = isPureish;
+exports.isDeclaration = isDeclaration;
+exports.isPatternLike = isPatternLike;
+exports.isLVal = isLVal;
+exports.isTSEntityName = isTSEntityName;
+exports.isLiteral = isLiteral;
+exports.isImmutable = isImmutable;
+exports.isUserWhitespacable = isUserWhitespacable;
+exports.isMethod = isMethod;
+exports.isObjectMember = isObjectMember;
+exports.isProperty = isProperty;
+exports.isUnaryLike = isUnaryLike;
+exports.isPattern = isPattern;
+exports.isClass = isClass;
+exports.isModuleDeclaration = isModuleDeclaration;
+exports.isExportDeclaration = isExportDeclaration;
+exports.isModuleSpecifier = isModuleSpecifier;
+exports.isPrivate = isPrivate;
+exports.isFlow = isFlow;
+exports.isFlowType = isFlowType;
+exports.isFlowBaseAnnotation = isFlowBaseAnnotation;
+exports.isFlowDeclaration = isFlowDeclaration;
+exports.isFlowPredicate = isFlowPredicate;
+exports.isEnumBody = isEnumBody;
+exports.isEnumMember = isEnumMember;
+exports.isJSX = isJSX;
+exports.isTSTypeElement = isTSTypeElement;
+exports.isTSType = isTSType;
+exports.isTSBaseType = isTSBaseType;
+exports.isNumberLiteral = isNumberLiteral;
+exports.isRegexLiteral = isRegexLiteral;
+exports.isRestProperty = isRestProperty;
+exports.isSpreadProperty = isSpreadProperty;
+
+var _shallowEqual = require("../../utils/shallowEqual");
+
+function isArrayExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ArrayExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isAssignmentExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "AssignmentExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isBinaryExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "BinaryExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isInterpreterDirective(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "InterpreterDirective") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isDirective(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Directive") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isDirectiveLiteral(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DirectiveLiteral") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isBlockStatement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "BlockStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isBreakStatement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "BreakStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isCallExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "CallExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isCatchClause(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "CatchClause") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isConditionalExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ConditionalExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isContinueStatement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ContinueStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isDebuggerStatement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DebuggerStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isDoWhileStatement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DoWhileStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isEmptyStatement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EmptyStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isExpressionStatement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ExpressionStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isFile(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "File") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isForInStatement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ForInStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isForStatement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ForStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isFunctionDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "FunctionDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isFunctionExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "FunctionExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isIdentifier(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Identifier") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isIfStatement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "IfStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isLabeledStatement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "LabeledStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isStringLiteral(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "StringLiteral") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isNumericLiteral(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "NumericLiteral") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isNullLiteral(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "NullLiteral") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isBooleanLiteral(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "BooleanLiteral") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isRegExpLiteral(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "RegExpLiteral") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isLogicalExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "LogicalExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isMemberExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "MemberExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isNewExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "NewExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isProgram(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Program") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isObjectExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ObjectExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isObjectMethod(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ObjectMethod") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isObjectProperty(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ObjectProperty") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isRestElement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "RestElement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isReturnStatement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ReturnStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isSequenceExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "SequenceExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isParenthesizedExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ParenthesizedExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isSwitchCase(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "SwitchCase") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isSwitchStatement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "SwitchStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isThisExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ThisExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isThrowStatement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ThrowStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTryStatement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TryStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isUnaryExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "UnaryExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isUpdateExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "UpdateExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isVariableDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "VariableDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isVariableDeclarator(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "VariableDeclarator") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isWhileStatement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "WhileStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isWithStatement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "WithStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isAssignmentPattern(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "AssignmentPattern") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isArrayPattern(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ArrayPattern") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isArrowFunctionExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ArrowFunctionExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isClassBody(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ClassBody") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isClassExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ClassExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isClassDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ClassDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isExportAllDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ExportAllDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isExportDefaultDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ExportDefaultDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isExportNamedDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ExportNamedDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isExportSpecifier(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ExportSpecifier") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isForOfStatement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ForOfStatement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isImportDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ImportDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isImportDefaultSpecifier(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ImportDefaultSpecifier") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isImportNamespaceSpecifier(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ImportNamespaceSpecifier") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isImportSpecifier(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ImportSpecifier") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isMetaProperty(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "MetaProperty") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isClassMethod(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ClassMethod") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isObjectPattern(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ObjectPattern") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isSpreadElement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "SpreadElement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isSuper(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Super") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTaggedTemplateExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TaggedTemplateExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTemplateElement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TemplateElement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTemplateLiteral(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TemplateLiteral") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isYieldExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "YieldExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isAwaitExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "AwaitExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isImport(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Import") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isBigIntLiteral(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "BigIntLiteral") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isExportNamespaceSpecifier(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ExportNamespaceSpecifier") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isOptionalMemberExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "OptionalMemberExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isOptionalCallExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "OptionalCallExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isClassProperty(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ClassProperty") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isClassPrivateProperty(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ClassPrivateProperty") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isClassPrivateMethod(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ClassPrivateMethod") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isPrivateName(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "PrivateName") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isAnyTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "AnyTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isArrayTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ArrayTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isBooleanTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "BooleanTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isBooleanLiteralTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "BooleanLiteralTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isNullLiteralTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "NullLiteralTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isClassImplements(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ClassImplements") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isDeclareClass(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DeclareClass") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isDeclareFunction(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DeclareFunction") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isDeclareInterface(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DeclareInterface") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isDeclareModule(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DeclareModule") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isDeclareModuleExports(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DeclareModuleExports") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isDeclareTypeAlias(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DeclareTypeAlias") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isDeclareOpaqueType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DeclareOpaqueType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isDeclareVariable(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DeclareVariable") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isDeclareExportDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DeclareExportDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isDeclareExportAllDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DeclareExportAllDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isDeclaredPredicate(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DeclaredPredicate") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isExistsTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ExistsTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isFunctionTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "FunctionTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isFunctionTypeParam(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "FunctionTypeParam") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isGenericTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "GenericTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isInferredPredicate(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "InferredPredicate") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isInterfaceExtends(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "InterfaceExtends") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isInterfaceDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "InterfaceDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isInterfaceTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "InterfaceTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isIntersectionTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "IntersectionTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isMixedTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "MixedTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isEmptyTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EmptyTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isNullableTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "NullableTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isNumberLiteralTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "NumberLiteralTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isNumberTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "NumberTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isObjectTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ObjectTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isObjectTypeInternalSlot(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ObjectTypeInternalSlot") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isObjectTypeCallProperty(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ObjectTypeCallProperty") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isObjectTypeIndexer(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ObjectTypeIndexer") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isObjectTypeProperty(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ObjectTypeProperty") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isObjectTypeSpreadProperty(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ObjectTypeSpreadProperty") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isOpaqueType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "OpaqueType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isQualifiedTypeIdentifier(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "QualifiedTypeIdentifier") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isStringLiteralTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "StringLiteralTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isStringTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "StringTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isSymbolTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "SymbolTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isThisTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ThisTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTupleTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TupleTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTypeofTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TypeofTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTypeAlias(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TypeAlias") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTypeCastExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TypeCastExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTypeParameter(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TypeParameter") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTypeParameterDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TypeParameterDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTypeParameterInstantiation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TypeParameterInstantiation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isUnionTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "UnionTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isVariance(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Variance") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isVoidTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "VoidTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isEnumDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isEnumBooleanBody(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumBooleanBody") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isEnumNumberBody(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumNumberBody") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isEnumStringBody(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumStringBody") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isEnumSymbolBody(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumSymbolBody") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isEnumBooleanMember(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumBooleanMember") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isEnumNumberMember(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumNumberMember") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isEnumStringMember(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumStringMember") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isEnumDefaultedMember(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumDefaultedMember") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isIndexedAccessType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "IndexedAccessType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isOptionalIndexedAccessType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "OptionalIndexedAccessType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isJSXAttribute(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXAttribute") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isJSXClosingElement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXClosingElement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isJSXElement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXElement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isJSXEmptyExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXEmptyExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isJSXExpressionContainer(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXExpressionContainer") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isJSXSpreadChild(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXSpreadChild") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isJSXIdentifier(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXIdentifier") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isJSXMemberExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXMemberExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isJSXNamespacedName(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXNamespacedName") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isJSXOpeningElement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXOpeningElement") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isJSXSpreadAttribute(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXSpreadAttribute") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isJSXText(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXText") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isJSXFragment(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXFragment") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isJSXOpeningFragment(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXOpeningFragment") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isJSXClosingFragment(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "JSXClosingFragment") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isNoop(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Noop") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isPlaceholder(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Placeholder") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isV8IntrinsicIdentifier(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "V8IntrinsicIdentifier") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isArgumentPlaceholder(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ArgumentPlaceholder") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isBindExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "BindExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isImportAttribute(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ImportAttribute") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isDecorator(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "Decorator") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isDoExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DoExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isExportDefaultSpecifier(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ExportDefaultSpecifier") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isRecordExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "RecordExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTupleExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TupleExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isDecimalLiteral(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "DecimalLiteral") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isStaticBlock(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "StaticBlock") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isModuleExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ModuleExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTopicReference(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TopicReference") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isPipelineTopicExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "PipelineTopicExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isPipelineBareFunction(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "PipelineBareFunction") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isPipelinePrimaryTopicReference(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "PipelinePrimaryTopicReference") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSParameterProperty(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSParameterProperty") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSDeclareFunction(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSDeclareFunction") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSDeclareMethod(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSDeclareMethod") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSQualifiedName(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSQualifiedName") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSCallSignatureDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSCallSignatureDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSConstructSignatureDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSConstructSignatureDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSPropertySignature(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSPropertySignature") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSMethodSignature(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSMethodSignature") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSIndexSignature(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSIndexSignature") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSAnyKeyword(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSAnyKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSBooleanKeyword(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSBooleanKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSBigIntKeyword(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSBigIntKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSIntrinsicKeyword(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSIntrinsicKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSNeverKeyword(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSNeverKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSNullKeyword(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSNullKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSNumberKeyword(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSNumberKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSObjectKeyword(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSObjectKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSStringKeyword(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSStringKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSSymbolKeyword(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSSymbolKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSUndefinedKeyword(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSUndefinedKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSUnknownKeyword(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSUnknownKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSVoidKeyword(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSVoidKeyword") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSThisType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSThisType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSFunctionType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSFunctionType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSConstructorType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSConstructorType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSTypeReference(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTypeReference") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSTypePredicate(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTypePredicate") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSTypeQuery(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTypeQuery") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSTypeLiteral(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTypeLiteral") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSArrayType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSArrayType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSTupleType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTupleType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSOptionalType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSOptionalType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSRestType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSRestType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSNamedTupleMember(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSNamedTupleMember") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSUnionType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSUnionType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSIntersectionType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSIntersectionType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSConditionalType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSConditionalType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSInferType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSInferType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSParenthesizedType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSParenthesizedType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSTypeOperator(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTypeOperator") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSIndexedAccessType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSIndexedAccessType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSMappedType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSMappedType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSLiteralType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSLiteralType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSExpressionWithTypeArguments(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSExpressionWithTypeArguments") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSInterfaceDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSInterfaceDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSInterfaceBody(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSInterfaceBody") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSTypeAliasDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTypeAliasDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSAsExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSAsExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSTypeAssertion(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTypeAssertion") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSEnumDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSEnumDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSEnumMember(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSEnumMember") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSModuleDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSModuleDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSModuleBlock(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSModuleBlock") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSImportType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSImportType") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSImportEqualsDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSImportEqualsDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSExternalModuleReference(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSExternalModuleReference") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSNonNullExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSNonNullExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSExportAssignment(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSExportAssignment") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSNamespaceExportDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSNamespaceExportDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTypeAnnotation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSTypeParameterInstantiation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTypeParameterInstantiation") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSTypeParameterDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTypeParameterDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSTypeParameter(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSTypeParameter") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("ArrayExpression" === nodeType || "AssignmentExpression" === nodeType || "BinaryExpression" === nodeType || "CallExpression" === nodeType || "ConditionalExpression" === nodeType || "FunctionExpression" === nodeType || "Identifier" === nodeType || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "LogicalExpression" === nodeType || "MemberExpression" === nodeType || "NewExpression" === nodeType || "ObjectExpression" === nodeType || "SequenceExpression" === nodeType || "ParenthesizedExpression" === nodeType || "ThisExpression" === nodeType || "UnaryExpression" === nodeType || "UpdateExpression" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassExpression" === nodeType || "MetaProperty" === nodeType || "Super" === nodeType || "TaggedTemplateExpression" === nodeType || "TemplateLiteral" === nodeType || "YieldExpression" === nodeType || "AwaitExpression" === nodeType || "Import" === nodeType || "BigIntLiteral" === nodeType || "OptionalMemberExpression" === nodeType || "OptionalCallExpression" === nodeType || "TypeCastExpression" === nodeType || "JSXElement" === nodeType || "JSXFragment" === nodeType || "BindExpression" === nodeType || "DoExpression" === nodeType || "RecordExpression" === nodeType || "TupleExpression" === nodeType || "DecimalLiteral" === nodeType || "ModuleExpression" === nodeType || "TopicReference" === nodeType || "PipelineTopicExpression" === nodeType || "PipelineBareFunction" === nodeType || "PipelinePrimaryTopicReference" === nodeType || "TSAsExpression" === nodeType || "TSTypeAssertion" === nodeType || "TSNonNullExpression" === nodeType || nodeType === "Placeholder" && ("Expression" === node.expectedNode || "Identifier" === node.expectedNode || "StringLiteral" === node.expectedNode)) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isBinary(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("BinaryExpression" === nodeType || "LogicalExpression" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isScopable(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("BlockStatement" === nodeType || "CatchClause" === nodeType || "DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "Program" === nodeType || "ObjectMethod" === nodeType || "SwitchStatement" === nodeType || "WhileStatement" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassExpression" === nodeType || "ClassDeclaration" === nodeType || "ForOfStatement" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType || "StaticBlock" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isBlockParent(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("BlockStatement" === nodeType || "CatchClause" === nodeType || "DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "Program" === nodeType || "ObjectMethod" === nodeType || "SwitchStatement" === nodeType || "WhileStatement" === nodeType || "ArrowFunctionExpression" === nodeType || "ForOfStatement" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType || "StaticBlock" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isBlock(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("BlockStatement" === nodeType || "Program" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isStatement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("BlockStatement" === nodeType || "BreakStatement" === nodeType || "ContinueStatement" === nodeType || "DebuggerStatement" === nodeType || "DoWhileStatement" === nodeType || "EmptyStatement" === nodeType || "ExpressionStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "IfStatement" === nodeType || "LabeledStatement" === nodeType || "ReturnStatement" === nodeType || "SwitchStatement" === nodeType || "ThrowStatement" === nodeType || "TryStatement" === nodeType || "VariableDeclaration" === nodeType || "WhileStatement" === nodeType || "WithStatement" === nodeType || "ClassDeclaration" === nodeType || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ForOfStatement" === nodeType || "ImportDeclaration" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType || "EnumDeclaration" === nodeType || "TSDeclareFunction" === nodeType || "TSInterfaceDeclaration" === nodeType || "TSTypeAliasDeclaration" === nodeType || "TSEnumDeclaration" === nodeType || "TSModuleDeclaration" === nodeType || "TSImportEqualsDeclaration" === nodeType || "TSExportAssignment" === nodeType || "TSNamespaceExportDeclaration" === nodeType || nodeType === "Placeholder" && ("Statement" === node.expectedNode || "Declaration" === node.expectedNode || "BlockStatement" === node.expectedNode)) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTerminatorless(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("BreakStatement" === nodeType || "ContinueStatement" === nodeType || "ReturnStatement" === nodeType || "ThrowStatement" === nodeType || "YieldExpression" === nodeType || "AwaitExpression" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isCompletionStatement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("BreakStatement" === nodeType || "ContinueStatement" === nodeType || "ReturnStatement" === nodeType || "ThrowStatement" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isConditional(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("ConditionalExpression" === nodeType || "IfStatement" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isLoop(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "WhileStatement" === nodeType || "ForOfStatement" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isWhile(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("DoWhileStatement" === nodeType || "WhileStatement" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isExpressionWrapper(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("ExpressionStatement" === nodeType || "ParenthesizedExpression" === nodeType || "TypeCastExpression" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isFor(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("ForInStatement" === nodeType || "ForStatement" === nodeType || "ForOfStatement" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isForXStatement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("ForInStatement" === nodeType || "ForOfStatement" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isFunction(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "ObjectMethod" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isFunctionParent(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "ObjectMethod" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isPureish(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "ArrowFunctionExpression" === nodeType || "BigIntLiteral" === nodeType || "DecimalLiteral" === nodeType || nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("FunctionDeclaration" === nodeType || "VariableDeclaration" === nodeType || "ClassDeclaration" === nodeType || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ImportDeclaration" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType || "EnumDeclaration" === nodeType || "TSDeclareFunction" === nodeType || "TSInterfaceDeclaration" === nodeType || "TSTypeAliasDeclaration" === nodeType || "TSEnumDeclaration" === nodeType || "TSModuleDeclaration" === nodeType || nodeType === "Placeholder" && "Declaration" === node.expectedNode) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isPatternLike(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("Identifier" === nodeType || "RestElement" === nodeType || "AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || nodeType === "Placeholder" && ("Pattern" === node.expectedNode || "Identifier" === node.expectedNode)) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isLVal(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("Identifier" === nodeType || "MemberExpression" === nodeType || "RestElement" === nodeType || "AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || "TSParameterProperty" === nodeType || nodeType === "Placeholder" && ("Pattern" === node.expectedNode || "Identifier" === node.expectedNode)) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSEntityName(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("Identifier" === nodeType || "TSQualifiedName" === nodeType || nodeType === "Placeholder" && "Identifier" === node.expectedNode) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isLiteral(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "TemplateLiteral" === nodeType || "BigIntLiteral" === nodeType || "DecimalLiteral" === nodeType || nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isImmutable(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "BigIntLiteral" === nodeType || "JSXAttribute" === nodeType || "JSXClosingElement" === nodeType || "JSXElement" === nodeType || "JSXExpressionContainer" === nodeType || "JSXSpreadChild" === nodeType || "JSXOpeningElement" === nodeType || "JSXText" === nodeType || "JSXFragment" === nodeType || "JSXOpeningFragment" === nodeType || "JSXClosingFragment" === nodeType || "DecimalLiteral" === nodeType || nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isUserWhitespacable(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("ObjectMethod" === nodeType || "ObjectProperty" === nodeType || "ObjectTypeInternalSlot" === nodeType || "ObjectTypeCallProperty" === nodeType || "ObjectTypeIndexer" === nodeType || "ObjectTypeProperty" === nodeType || "ObjectTypeSpreadProperty" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isMethod(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("ObjectMethod" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isObjectMember(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("ObjectMethod" === nodeType || "ObjectProperty" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isProperty(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("ObjectProperty" === nodeType || "ClassProperty" === nodeType || "ClassPrivateProperty" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isUnaryLike(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("UnaryExpression" === nodeType || "SpreadElement" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isPattern(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || nodeType === "Placeholder" && "Pattern" === node.expectedNode) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isClass(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("ClassExpression" === nodeType || "ClassDeclaration" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isModuleDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ImportDeclaration" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isExportDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isModuleSpecifier(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("ExportSpecifier" === nodeType || "ImportDefaultSpecifier" === nodeType || "ImportNamespaceSpecifier" === nodeType || "ImportSpecifier" === nodeType || "ExportNamespaceSpecifier" === nodeType || "ExportDefaultSpecifier" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isPrivate(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("ClassPrivateProperty" === nodeType || "ClassPrivateMethod" === nodeType || "PrivateName" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isFlow(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("AnyTypeAnnotation" === nodeType || "ArrayTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "BooleanLiteralTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "ClassImplements" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "DeclaredPredicate" === nodeType || "ExistsTypeAnnotation" === nodeType || "FunctionTypeAnnotation" === nodeType || "FunctionTypeParam" === nodeType || "GenericTypeAnnotation" === nodeType || "InferredPredicate" === nodeType || "InterfaceExtends" === nodeType || "InterfaceDeclaration" === nodeType || "InterfaceTypeAnnotation" === nodeType || "IntersectionTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NullableTypeAnnotation" === nodeType || "NumberLiteralTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "ObjectTypeAnnotation" === nodeType || "ObjectTypeInternalSlot" === nodeType || "ObjectTypeCallProperty" === nodeType || "ObjectTypeIndexer" === nodeType || "ObjectTypeProperty" === nodeType || "ObjectTypeSpreadProperty" === nodeType || "OpaqueType" === nodeType || "QualifiedTypeIdentifier" === nodeType || "StringLiteralTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "SymbolTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "TupleTypeAnnotation" === nodeType || "TypeofTypeAnnotation" === nodeType || "TypeAlias" === nodeType || "TypeAnnotation" === nodeType || "TypeCastExpression" === nodeType || "TypeParameter" === nodeType || "TypeParameterDeclaration" === nodeType || "TypeParameterInstantiation" === nodeType || "UnionTypeAnnotation" === nodeType || "Variance" === nodeType || "VoidTypeAnnotation" === nodeType || "IndexedAccessType" === nodeType || "OptionalIndexedAccessType" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isFlowType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("AnyTypeAnnotation" === nodeType || "ArrayTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "BooleanLiteralTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "ExistsTypeAnnotation" === nodeType || "FunctionTypeAnnotation" === nodeType || "GenericTypeAnnotation" === nodeType || "InterfaceTypeAnnotation" === nodeType || "IntersectionTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NullableTypeAnnotation" === nodeType || "NumberLiteralTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "ObjectTypeAnnotation" === nodeType || "StringLiteralTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "SymbolTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "TupleTypeAnnotation" === nodeType || "TypeofTypeAnnotation" === nodeType || "UnionTypeAnnotation" === nodeType || "VoidTypeAnnotation" === nodeType || "IndexedAccessType" === nodeType || "OptionalIndexedAccessType" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isFlowBaseAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("AnyTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "SymbolTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "VoidTypeAnnotation" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isFlowDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isFlowPredicate(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("DeclaredPredicate" === nodeType || "InferredPredicate" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isEnumBody(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("EnumBooleanBody" === nodeType || "EnumNumberBody" === nodeType || "EnumStringBody" === nodeType || "EnumSymbolBody" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isEnumMember(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("EnumBooleanMember" === nodeType || "EnumNumberMember" === nodeType || "EnumStringMember" === nodeType || "EnumDefaultedMember" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isJSX(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("JSXAttribute" === nodeType || "JSXClosingElement" === nodeType || "JSXElement" === nodeType || "JSXEmptyExpression" === nodeType || "JSXExpressionContainer" === nodeType || "JSXSpreadChild" === nodeType || "JSXIdentifier" === nodeType || "JSXMemberExpression" === nodeType || "JSXNamespacedName" === nodeType || "JSXOpeningElement" === nodeType || "JSXSpreadAttribute" === nodeType || "JSXText" === nodeType || "JSXFragment" === nodeType || "JSXOpeningFragment" === nodeType || "JSXClosingFragment" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSTypeElement(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("TSCallSignatureDeclaration" === nodeType || "TSConstructSignatureDeclaration" === nodeType || "TSPropertySignature" === nodeType || "TSMethodSignature" === nodeType || "TSIndexSignature" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("TSAnyKeyword" === nodeType || "TSBooleanKeyword" === nodeType || "TSBigIntKeyword" === nodeType || "TSIntrinsicKeyword" === nodeType || "TSNeverKeyword" === nodeType || "TSNullKeyword" === nodeType || "TSNumberKeyword" === nodeType || "TSObjectKeyword" === nodeType || "TSStringKeyword" === nodeType || "TSSymbolKeyword" === nodeType || "TSUndefinedKeyword" === nodeType || "TSUnknownKeyword" === nodeType || "TSVoidKeyword" === nodeType || "TSThisType" === nodeType || "TSFunctionType" === nodeType || "TSConstructorType" === nodeType || "TSTypeReference" === nodeType || "TSTypePredicate" === nodeType || "TSTypeQuery" === nodeType || "TSTypeLiteral" === nodeType || "TSArrayType" === nodeType || "TSTupleType" === nodeType || "TSOptionalType" === nodeType || "TSRestType" === nodeType || "TSUnionType" === nodeType || "TSIntersectionType" === nodeType || "TSConditionalType" === nodeType || "TSInferType" === nodeType || "TSParenthesizedType" === nodeType || "TSTypeOperator" === nodeType || "TSIndexedAccessType" === nodeType || "TSMappedType" === nodeType || "TSLiteralType" === nodeType || "TSExpressionWithTypeArguments" === nodeType || "TSImportType" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTSBaseType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if ("TSAnyKeyword" === nodeType || "TSBooleanKeyword" === nodeType || "TSBigIntKeyword" === nodeType || "TSIntrinsicKeyword" === nodeType || "TSNeverKeyword" === nodeType || "TSNullKeyword" === nodeType || "TSNumberKeyword" === nodeType || "TSObjectKeyword" === nodeType || "TSStringKeyword" === nodeType || "TSSymbolKeyword" === nodeType || "TSUndefinedKeyword" === nodeType || "TSUnknownKeyword" === nodeType || "TSVoidKeyword" === nodeType || "TSThisType" === nodeType || "TSLiteralType" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isNumberLiteral(node, opts) {
+ console.trace("The node type NumberLiteral has been renamed to NumericLiteral");
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "NumberLiteral") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isRegexLiteral(node, opts) {
+ console.trace("The node type RegexLiteral has been renamed to RegExpLiteral");
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "RegexLiteral") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isRestProperty(node, opts) {
+ console.trace("The node type RestProperty has been renamed to RestElement");
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "RestProperty") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isSpreadProperty(node, opts) {
+ console.trace("The node type SpreadProperty has been renamed to SpreadElement");
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "SpreadProperty") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/validators/is.js b/chromium/third_party/node/node_modules/@babel/types/lib/validators/is.js
new file mode 100644
index 00000000000..581979fa701
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/validators/is.js
@@ -0,0 +1,33 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = is;
+
+var _shallowEqual = require("../utils/shallowEqual");
+
+var _isType = require("./isType");
+
+var _isPlaceholderType = require("./isPlaceholderType");
+
+var _definitions = require("../definitions");
+
+function is(type, node, opts) {
+ if (!node) return false;
+ const matches = (0, _isType.default)(node.type, type);
+
+ if (!matches) {
+ if (!opts && node.type === "Placeholder" && type in _definitions.FLIPPED_ALIAS_KEYS) {
+ return (0, _isPlaceholderType.default)(node.expectedNode, type);
+ }
+
+ return false;
+ }
+
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/validators/isBinding.js b/chromium/third_party/node/node_modules/@babel/types/lib/validators/isBinding.js
new file mode 100644
index 00000000000..74c86dd0e98
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/validators/isBinding.js
@@ -0,0 +1,31 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = isBinding;
+
+var _getBindingIdentifiers = require("../retrievers/getBindingIdentifiers");
+
+function isBinding(node, parent, grandparent) {
+ if (grandparent && node.type === "Identifier" && parent.type === "ObjectProperty" && grandparent.type === "ObjectExpression") {
+ return false;
+ }
+
+ const keys = _getBindingIdentifiers.default.keys[parent.type];
+
+ if (keys) {
+ for (let i = 0; i < keys.length; i++) {
+ const key = keys[i];
+ const val = parent[key];
+
+ if (Array.isArray(val)) {
+ if (val.indexOf(node) >= 0) return true;
+ } else {
+ if (val === node) return true;
+ }
+ }
+ }
+
+ return false;
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/validators/isBlockScoped.js b/chromium/third_party/node/node_modules/@babel/types/lib/validators/isBlockScoped.js
new file mode 100644
index 00000000000..77ec1663004
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/validators/isBlockScoped.js
@@ -0,0 +1,14 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = isBlockScoped;
+
+var _generated = require("./generated");
+
+var _isLet = require("./isLet");
+
+function isBlockScoped(node) {
+ return (0, _generated.isFunctionDeclaration)(node) || (0, _generated.isClassDeclaration)(node) || (0, _isLet.default)(node);
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/validators/isImmutable.js b/chromium/third_party/node/node_modules/@babel/types/lib/validators/isImmutable.js
new file mode 100644
index 00000000000..27754f6599e
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/validators/isImmutable.js
@@ -0,0 +1,24 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = isImmutable;
+
+var _isType = require("./isType");
+
+var _generated = require("./generated");
+
+function isImmutable(node) {
+ if ((0, _isType.default)(node.type, "Immutable")) return true;
+
+ if ((0, _generated.isIdentifier)(node)) {
+ if (node.name === "undefined") {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ return false;
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/validators/isLet.js b/chromium/third_party/node/node_modules/@babel/types/lib/validators/isLet.js
new file mode 100644
index 00000000000..93d75628082
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/validators/isLet.js
@@ -0,0 +1,14 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = isLet;
+
+var _generated = require("./generated");
+
+var _constants = require("../constants");
+
+function isLet(node) {
+ return (0, _generated.isVariableDeclaration)(node) && (node.kind !== "var" || node[_constants.BLOCK_SCOPED_SYMBOL]);
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/validators/isNode.js b/chromium/third_party/node/node_modules/@babel/types/lib/validators/isNode.js
new file mode 100644
index 00000000000..e88a47aac45
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/validators/isNode.js
@@ -0,0 +1,12 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = isNode;
+
+var _definitions = require("../definitions");
+
+function isNode(node) {
+ return !!(node && _definitions.VISITOR_KEYS[node.type]);
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/validators/isNodesEquivalent.js b/chromium/third_party/node/node_modules/@babel/types/lib/validators/isNodesEquivalent.js
new file mode 100644
index 00000000000..f829834e910
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/validators/isNodesEquivalent.js
@@ -0,0 +1,67 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = isNodesEquivalent;
+
+var _definitions = require("../definitions");
+
+function isNodesEquivalent(a, b) {
+ if (typeof a !== "object" || typeof b !== "object" || a == null || b == null) {
+ return a === b;
+ }
+
+ if (a.type !== b.type) {
+ return false;
+ }
+
+ const fields = Object.keys(_definitions.NODE_FIELDS[a.type] || a.type);
+ const visitorKeys = _definitions.VISITOR_KEYS[a.type];
+
+ for (const field of fields) {
+ if (typeof a[field] !== typeof b[field]) {
+ return false;
+ }
+
+ if (a[field] == null && b[field] == null) {
+ continue;
+ } else if (a[field] == null || b[field] == null) {
+ return false;
+ }
+
+ if (Array.isArray(a[field])) {
+ if (!Array.isArray(b[field])) {
+ return false;
+ }
+
+ if (a[field].length !== b[field].length) {
+ return false;
+ }
+
+ for (let i = 0; i < a[field].length; i++) {
+ if (!isNodesEquivalent(a[field][i], b[field][i])) {
+ return false;
+ }
+ }
+
+ continue;
+ }
+
+ if (typeof a[field] === "object" && !(visitorKeys != null && visitorKeys.includes(field))) {
+ for (const key of Object.keys(a[field])) {
+ if (a[field][key] !== b[field][key]) {
+ return false;
+ }
+ }
+
+ continue;
+ }
+
+ if (!isNodesEquivalent(a[field], b[field])) {
+ return false;
+ }
+ }
+
+ return true;
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/validators/isPlaceholderType.js b/chromium/third_party/node/node_modules/@babel/types/lib/validators/isPlaceholderType.js
new file mode 100644
index 00000000000..e8271de0b1c
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/validators/isPlaceholderType.js
@@ -0,0 +1,21 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = isPlaceholderType;
+
+var _definitions = require("../definitions");
+
+function isPlaceholderType(placeholderType, targetType) {
+ if (placeholderType === targetType) return true;
+ const aliases = _definitions.PLACEHOLDERS_ALIAS[placeholderType];
+
+ if (aliases) {
+ for (const alias of aliases) {
+ if (targetType === alias) return true;
+ }
+ }
+
+ return false;
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/validators/isReferenced.js b/chromium/third_party/node/node_modules/@babel/types/lib/validators/isReferenced.js
new file mode 100644
index 00000000000..dc94a693383
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/validators/isReferenced.js
@@ -0,0 +1,127 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = isReferenced;
+
+function isReferenced(node, parent, grandparent) {
+ switch (parent.type) {
+ case "MemberExpression":
+ case "OptionalMemberExpression":
+ if (parent.property === node) {
+ return !!parent.computed;
+ }
+
+ return parent.object === node;
+
+ case "JSXMemberExpression":
+ return parent.object === node;
+
+ case "VariableDeclarator":
+ return parent.init === node;
+
+ case "ArrowFunctionExpression":
+ return parent.body === node;
+
+ case "PrivateName":
+ return false;
+
+ case "ClassMethod":
+ case "ClassPrivateMethod":
+ case "ObjectMethod":
+ if (parent.key === node) {
+ return !!parent.computed;
+ }
+
+ return false;
+
+ case "ObjectProperty":
+ if (parent.key === node) {
+ return !!parent.computed;
+ }
+
+ return !grandparent || grandparent.type !== "ObjectPattern";
+
+ case "ClassProperty":
+ if (parent.key === node) {
+ return !!parent.computed;
+ }
+
+ return true;
+
+ case "ClassPrivateProperty":
+ return parent.key !== node;
+
+ case "ClassDeclaration":
+ case "ClassExpression":
+ return parent.superClass === node;
+
+ case "AssignmentExpression":
+ return parent.right === node;
+
+ case "AssignmentPattern":
+ return parent.right === node;
+
+ case "LabeledStatement":
+ return false;
+
+ case "CatchClause":
+ return false;
+
+ case "RestElement":
+ return false;
+
+ case "BreakStatement":
+ case "ContinueStatement":
+ return false;
+
+ case "FunctionDeclaration":
+ case "FunctionExpression":
+ return false;
+
+ case "ExportNamespaceSpecifier":
+ case "ExportDefaultSpecifier":
+ return false;
+
+ case "ExportSpecifier":
+ if (grandparent != null && grandparent.source) {
+ return false;
+ }
+
+ return parent.local === node;
+
+ case "ImportDefaultSpecifier":
+ case "ImportNamespaceSpecifier":
+ case "ImportSpecifier":
+ return false;
+
+ case "ImportAttribute":
+ return false;
+
+ case "JSXAttribute":
+ return false;
+
+ case "ObjectPattern":
+ case "ArrayPattern":
+ return false;
+
+ case "MetaProperty":
+ return false;
+
+ case "ObjectTypeProperty":
+ return parent.key !== node;
+
+ case "TSEnumMember":
+ return parent.id !== node;
+
+ case "TSPropertySignature":
+ if (parent.key === node) {
+ return !!parent.computed;
+ }
+
+ return true;
+ }
+
+ return true;
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/validators/isScope.js b/chromium/third_party/node/node_modules/@babel/types/lib/validators/isScope.js
new file mode 100644
index 00000000000..0f82449cce7
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/validators/isScope.js
@@ -0,0 +1,20 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = isScope;
+
+var _generated = require("./generated");
+
+function isScope(node, parent) {
+ if ((0, _generated.isBlockStatement)(node) && ((0, _generated.isFunction)(parent) || (0, _generated.isCatchClause)(parent))) {
+ return false;
+ }
+
+ if ((0, _generated.isPattern)(node) && ((0, _generated.isFunction)(parent) || (0, _generated.isCatchClause)(parent))) {
+ return true;
+ }
+
+ return (0, _generated.isScopable)(node);
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/validators/isSpecifierDefault.js b/chromium/third_party/node/node_modules/@babel/types/lib/validators/isSpecifierDefault.js
new file mode 100644
index 00000000000..25431cc2732
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/validators/isSpecifierDefault.js
@@ -0,0 +1,14 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = isSpecifierDefault;
+
+var _generated = require("./generated");
+
+function isSpecifierDefault(specifier) {
+ return (0, _generated.isImportDefaultSpecifier)(specifier) || (0, _generated.isIdentifier)(specifier.imported || specifier.exported, {
+ name: "default"
+ });
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/validators/isType.js b/chromium/third_party/node/node_modules/@babel/types/lib/validators/isType.js
new file mode 100644
index 00000000000..59d31dfbbfc
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/validators/isType.js
@@ -0,0 +1,24 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = isType;
+
+var _definitions = require("../definitions");
+
+function isType(nodeType, targetType) {
+ if (nodeType === targetType) return true;
+ if (_definitions.ALIAS_KEYS[targetType]) return false;
+ const aliases = _definitions.FLIPPED_ALIAS_KEYS[targetType];
+
+ if (aliases) {
+ if (aliases[0] === nodeType) return true;
+
+ for (const alias of aliases) {
+ if (nodeType === alias) return true;
+ }
+ }
+
+ return false;
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/validators/isValidES3Identifier.js b/chromium/third_party/node/node_modules/@babel/types/lib/validators/isValidES3Identifier.js
new file mode 100644
index 00000000000..5cef5664df0
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/validators/isValidES3Identifier.js
@@ -0,0 +1,14 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = isValidES3Identifier;
+
+var _isValidIdentifier = require("./isValidIdentifier");
+
+const RESERVED_WORDS_ES3_ONLY = new Set(["abstract", "boolean", "byte", "char", "double", "enum", "final", "float", "goto", "implements", "int", "interface", "long", "native", "package", "private", "protected", "public", "short", "static", "synchronized", "throws", "transient", "volatile"]);
+
+function isValidES3Identifier(name) {
+ return (0, _isValidIdentifier.default)(name) && !RESERVED_WORDS_ES3_ONLY.has(name);
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/validators/isValidIdentifier.js b/chromium/third_party/node/node_modules/@babel/types/lib/validators/isValidIdentifier.js
new file mode 100644
index 00000000000..3fa6f98000b
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/validators/isValidIdentifier.js
@@ -0,0 +1,20 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = isValidIdentifier;
+
+var _helperValidatorIdentifier = require("@babel/helper-validator-identifier");
+
+function isValidIdentifier(name, reserved = true) {
+ if (typeof name !== "string") return false;
+
+ if (reserved) {
+ if ((0, _helperValidatorIdentifier.isKeyword)(name) || (0, _helperValidatorIdentifier.isStrictReservedWord)(name, true)) {
+ return false;
+ }
+ }
+
+ return (0, _helperValidatorIdentifier.isIdentifierName)(name);
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/validators/isVar.js b/chromium/third_party/node/node_modules/@babel/types/lib/validators/isVar.js
new file mode 100644
index 00000000000..a34801d18fe
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/validators/isVar.js
@@ -0,0 +1,16 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = isVar;
+
+var _generated = require("./generated");
+
+var _constants = require("../constants");
+
+function isVar(node) {
+ return (0, _generated.isVariableDeclaration)(node, {
+ kind: "var"
+ }) && !node[_constants.BLOCK_SCOPED_SYMBOL];
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/validators/matchesPattern.js b/chromium/third_party/node/node_modules/@babel/types/lib/validators/matchesPattern.js
new file mode 100644
index 00000000000..d961f5a6ef2
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/validators/matchesPattern.js
@@ -0,0 +1,42 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = matchesPattern;
+
+var _generated = require("./generated");
+
+function matchesPattern(member, match, allowPartial) {
+ if (!(0, _generated.isMemberExpression)(member)) return false;
+ const parts = Array.isArray(match) ? match : match.split(".");
+ const nodes = [];
+ let node;
+
+ for (node = member; (0, _generated.isMemberExpression)(node); node = node.object) {
+ nodes.push(node.property);
+ }
+
+ nodes.push(node);
+ if (nodes.length < parts.length) return false;
+ if (!allowPartial && nodes.length > parts.length) return false;
+
+ for (let i = 0, j = nodes.length - 1; i < parts.length; i++, j--) {
+ const node = nodes[j];
+ let value;
+
+ if ((0, _generated.isIdentifier)(node)) {
+ value = node.name;
+ } else if ((0, _generated.isStringLiteral)(node)) {
+ value = node.value;
+ } else if ((0, _generated.isThisExpression)(node)) {
+ value = "this";
+ } else {
+ return false;
+ }
+
+ if (parts[i] !== value) return false;
+ }
+
+ return true;
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/validators/react/isCompatTag.js b/chromium/third_party/node/node_modules/@babel/types/lib/validators/react/isCompatTag.js
new file mode 100644
index 00000000000..57761c2b1b1
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/validators/react/isCompatTag.js
@@ -0,0 +1,10 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = isCompatTag;
+
+function isCompatTag(tagName) {
+ return !!tagName && /^[a-z]/.test(tagName);
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/validators/react/isReactComponent.js b/chromium/third_party/node/node_modules/@babel/types/lib/validators/react/isReactComponent.js
new file mode 100644
index 00000000000..0dd2102589a
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/validators/react/isReactComponent.js
@@ -0,0 +1,12 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = void 0;
+
+var _buildMatchMemberExpression = require("../buildMatchMemberExpression");
+
+const isReactComponent = (0, _buildMatchMemberExpression.default)("React.Component");
+var _default = isReactComponent;
+exports.default = _default; \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/validators/validate.js b/chromium/third_party/node/node_modules/@babel/types/lib/validators/validate.js
new file mode 100644
index 00000000000..f5a2bef5fb1
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/validators/validate.js
@@ -0,0 +1,32 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = validate;
+exports.validateField = validateField;
+exports.validateChild = validateChild;
+
+var _definitions = require("../definitions");
+
+function validate(node, key, val) {
+ if (!node) return;
+ const fields = _definitions.NODE_FIELDS[node.type];
+ if (!fields) return;
+ const field = fields[key];
+ validateField(node, key, val, field);
+ validateChild(node, key, val);
+}
+
+function validateField(node, key, val, field) {
+ if (!(field != null && field.validate)) return;
+ if (field.optional && val == null) return;
+ field.validate(node, key, val);
+}
+
+function validateChild(node, key, val) {
+ if (val == null) return;
+ const validate = _definitions.NODE_PARENT_VALIDATIONS[val.type];
+ if (!validate) return;
+ validate(node, key, val);
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/package.json b/chromium/third_party/node/node_modules/@babel/types/package.json
new file mode 100644
index 00000000000..202d4baa466
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/package.json
@@ -0,0 +1,39 @@
+{
+ "name": "@babel/types",
+ "version": "7.15.6",
+ "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",
+ "bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20types%22+is%3Aopen",
+ "license": "MIT",
+ "publishConfig": {
+ "access": "public"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/babel/babel.git",
+ "directory": "packages/babel-types"
+ },
+ "main": "./lib/index.js",
+ "types": "./lib/index-legacy.d.ts",
+ "typesVersions": {
+ ">=3.7": {
+ "lib/index-legacy.d.ts": [
+ "lib/index.d.ts"
+ ]
+ }
+ },
+ "dependencies": {
+ "@babel/helper-validator-identifier": "^7.14.9",
+ "to-fast-properties": "^2.0.0"
+ },
+ "devDependencies": {
+ "@babel/generator": "7.15.4",
+ "@babel/parser": "7.15.6",
+ "chalk": "^4.1.0",
+ "glob": "^7.1.7"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+} \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/@babel/types/scripts/generators/asserts.js b/chromium/third_party/node/node_modules/@babel/types/scripts/generators/asserts.js
new file mode 100644
index 00000000000..bdfd94857fc
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/scripts/generators/asserts.js
@@ -0,0 +1,50 @@
+import definitions from "../../lib/definitions/index.js";
+
+function addAssertHelper(type) {
+ const result =
+ definitions.NODE_FIELDS[type] || definitions.FLIPPED_ALIAS_KEYS[type]
+ ? `node is t.${type}`
+ : "boolean";
+
+ return `export function assert${type}(node: object | null | undefined, opts?: object | null): asserts ${
+ result === "boolean" ? "node" : result
+ } {
+ assert("${type}", node, opts) }
+ `;
+}
+
+export default function generateAsserts() {
+ let output = `/*
+ * This file is auto-generated! Do not modify it directly.
+ * To re-generate run 'make build'
+ */
+import is from "../../validators/is";
+import type * as t from "../..";
+
+function assert(type: string, node: any, opts?: any): void {
+ if (!is(type, node, opts)) {
+ throw new Error(
+ \`Expected type "\${type}" with option \${JSON.stringify(opts)}, \` +
+ \`but instead got "\${node.type}".\`,
+ );
+ }
+}\n\n`;
+
+ Object.keys(definitions.VISITOR_KEYS).forEach(type => {
+ output += addAssertHelper(type);
+ });
+
+ Object.keys(definitions.FLIPPED_ALIAS_KEYS).forEach(type => {
+ output += addAssertHelper(type);
+ });
+
+ Object.keys(definitions.DEPRECATED_KEYS).forEach(type => {
+ const newType = definitions.DEPRECATED_KEYS[type];
+ output += `export function assert${type}(node: any, opts: any): void {
+ console.trace("The node type ${type} has been renamed to ${newType}");
+ assert("${type}", node, opts);
+}\n`;
+ });
+
+ return output;
+}
diff --git a/chromium/third_party/node/node_modules/@babel/types/scripts/generators/ast-types.js b/chromium/third_party/node/node_modules/@babel/types/scripts/generators/ast-types.js
new file mode 100644
index 00000000000..cd31918a561
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/scripts/generators/ast-types.js
@@ -0,0 +1,139 @@
+import t from "../../lib/index.js";
+import stringifyValidator from "../utils/stringifyValidator.js";
+
+export default function generateAstTypes() {
+ let code = `// NOTE: This file is autogenerated. Do not modify.
+// See packages/babel-types/scripts/generators/ast-types.js for script used.
+
+interface BaseComment {
+ value: string;
+ start: number;
+ end: number;
+ loc: SourceLocation;
+ type: "CommentBlock" | "CommentLine";
+}
+
+export interface CommentBlock extends BaseComment {
+ type: "CommentBlock";
+}
+
+export interface CommentLine extends BaseComment {
+ type: "CommentLine";
+}
+
+export type Comment = CommentBlock | CommentLine;
+
+export interface SourceLocation {
+ start: {
+ line: number;
+ column: number;
+ };
+
+ end: {
+ line: number;
+ column: number;
+ };
+}
+
+interface BaseNode {
+ leadingComments: ReadonlyArray<Comment> | null;
+ innerComments: ReadonlyArray<Comment> | null;
+ trailingComments: ReadonlyArray<Comment> | null;
+ start: number | null;
+ end: number | null;
+ loc: SourceLocation | null;
+ type: Node["type"];
+ range?: [number, number];
+ extra?: Record<string, unknown>;
+}
+
+export type CommentTypeShorthand = "leading" | "inner" | "trailing";
+
+export type Node = ${t.TYPES.sort().join(" | ")};\n\n`;
+
+ const deprecatedAlias = {};
+ for (const type in t.DEPRECATED_KEYS) {
+ deprecatedAlias[t.DEPRECATED_KEYS[type]] = type;
+ }
+ for (const type in t.NODE_FIELDS) {
+ const fields = t.NODE_FIELDS[type];
+ const fieldNames = sortFieldNames(Object.keys(t.NODE_FIELDS[type]), type);
+ const struct = [];
+
+ fieldNames.forEach(fieldName => {
+ const field = fields[fieldName];
+ // Future / annoying TODO:
+ // MemberExpression.property, ObjectProperty.key and ObjectMethod.key need special cases; either:
+ // - convert the declaration to chain() like ClassProperty.key and ClassMethod.key,
+ // - declare an alias type for valid keys, detect the case and reuse it here,
+ // - declare a disjoint union with, for example, ObjectPropertyBase,
+ // ObjectPropertyLiteralKey and ObjectPropertyComputedKey, and declare ObjectProperty
+ // as "ObjectPropertyBase & (ObjectPropertyLiteralKey | ObjectPropertyComputedKey)"
+ let typeAnnotation = stringifyValidator(field.validate, "");
+
+ if (isNullable(field) && !hasDefault(field)) {
+ typeAnnotation += " | null";
+ }
+
+ const alphaNumeric = /^\w+$/;
+ const optional = field.optional ? "?" : "";
+
+ if (t.isValidIdentifier(fieldName) || alphaNumeric.test(fieldName)) {
+ struct.push(`${fieldName}${optional}: ${typeAnnotation};`);
+ } else {
+ struct.push(`"${fieldName}"${optional}: ${typeAnnotation};`);
+ }
+ });
+
+ code += `export interface ${type} extends BaseNode {
+ type: "${type}";
+ ${struct.join("\n ").trim()}
+}\n\n`;
+
+ if (deprecatedAlias[type]) {
+ code += `/**
+ * @deprecated Use \`${type}\`
+ */
+export interface ${deprecatedAlias[type]} extends BaseNode {
+ type: "${deprecatedAlias[type]}";
+ ${struct.join("\n ").trim()}
+}\n\n
+`;
+ }
+ }
+
+ for (const type in t.FLIPPED_ALIAS_KEYS) {
+ const types = t.FLIPPED_ALIAS_KEYS[type];
+ code += `export type ${type} = ${types
+ .map(type => `${type}`)
+ .join(" | ")};\n`;
+ }
+ code += "\n";
+
+ code += "export interface Aliases {\n";
+ for (const type in t.FLIPPED_ALIAS_KEYS) {
+ code += ` ${type}: ${type};\n`;
+ }
+ code += "}\n\n";
+
+ return code;
+}
+
+function hasDefault(field) {
+ return field.default != null;
+}
+
+function isNullable(field) {
+ return field.optional || hasDefault(field);
+}
+
+function sortFieldNames(fields, type) {
+ return fields.sort((fieldA, fieldB) => {
+ const indexA = t.BUILDER_KEYS[type].indexOf(fieldA);
+ const indexB = t.BUILDER_KEYS[type].indexOf(fieldB);
+ if (indexA === indexB) return fieldA < fieldB ? -1 : 1;
+ if (indexA === -1) return 1;
+ if (indexB === -1) return -1;
+ return indexA - indexB;
+ });
+}
diff --git a/chromium/third_party/node/node_modules/@babel/types/scripts/generators/builders.js b/chromium/third_party/node/node_modules/@babel/types/scripts/generators/builders.js
new file mode 100644
index 00000000000..3a30e6053c1
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/scripts/generators/builders.js
@@ -0,0 +1,163 @@
+import t from "../../lib/index.js";
+import definitions from "../../lib/definitions/index.js";
+import formatBuilderName from "../utils/formatBuilderName.js";
+import lowerFirst from "../utils/lowerFirst.js";
+import stringifyValidator from "../utils/stringifyValidator.js";
+
+function areAllRemainingFieldsNullable(fieldName, fieldNames, fields) {
+ const index = fieldNames.indexOf(fieldName);
+ return fieldNames.slice(index).every(_ => isNullable(fields[_]));
+}
+
+function hasDefault(field) {
+ return field.default != null;
+}
+
+function isNullable(field) {
+ return field.optional || hasDefault(field);
+}
+
+function sortFieldNames(fields, type) {
+ return fields.sort((fieldA, fieldB) => {
+ const indexA = t.BUILDER_KEYS[type].indexOf(fieldA);
+ const indexB = t.BUILDER_KEYS[type].indexOf(fieldB);
+ if (indexA === indexB) return fieldA < fieldB ? -1 : 1;
+ if (indexA === -1) return 1;
+ if (indexB === -1) return -1;
+ return indexA - indexB;
+ });
+}
+
+function generateBuilderArgs(type) {
+ const fields = t.NODE_FIELDS[type];
+ const fieldNames = sortFieldNames(Object.keys(t.NODE_FIELDS[type]), type);
+ const builderNames = t.BUILDER_KEYS[type];
+
+ const args = [];
+
+ fieldNames.forEach(fieldName => {
+ const field = fields[fieldName];
+ // Future / annoying TODO:
+ // MemberExpression.property, ObjectProperty.key and ObjectMethod.key need special cases; either:
+ // - convert the declaration to chain() like ClassProperty.key and ClassMethod.key,
+ // - declare an alias type for valid keys, detect the case and reuse it here,
+ // - declare a disjoint union with, for example, ObjectPropertyBase,
+ // ObjectPropertyLiteralKey and ObjectPropertyComputedKey, and declare ObjectProperty
+ // as "ObjectPropertyBase & (ObjectPropertyLiteralKey | ObjectPropertyComputedKey)"
+ let typeAnnotation = stringifyValidator(field.validate, "t.");
+
+ if (isNullable(field) && !hasDefault(field)) {
+ typeAnnotation += " | null";
+ }
+
+ if (builderNames.includes(fieldName)) {
+ const bindingIdentifierName = t.toBindingIdentifierName(fieldName);
+ if (areAllRemainingFieldsNullable(fieldName, builderNames, fields)) {
+ args.push(
+ `${bindingIdentifierName}${
+ isNullable(field) ? "?:" : ":"
+ } ${typeAnnotation}`
+ );
+ } else {
+ args.push(
+ `${bindingIdentifierName}: ${typeAnnotation}${
+ isNullable(field) ? " | undefined" : ""
+ }`
+ );
+ }
+ }
+ });
+
+ return args;
+}
+
+export default function generateBuilders(kind) {
+ return kind === "uppercase.js"
+ ? generateUppercaseBuilders()
+ : generateLowercaseBuilders();
+}
+
+function generateLowercaseBuilders() {
+ let output = `/*
+ * This file is auto-generated! Do not modify it directly.
+ * To re-generate run 'make build'
+ */
+import builder from "../builder";
+import type * as t from "../..";
+
+/* eslint-disable @typescript-eslint/no-unused-vars */
+
+`;
+
+ const reservedNames = new Set(["super", "import"]);
+ Object.keys(definitions.BUILDER_KEYS).forEach(type => {
+ const defArgs = generateBuilderArgs(type);
+ const formatedBuilderName = formatBuilderName(type);
+ const formatedBuilderNameLocal = reservedNames.has(formatedBuilderName)
+ ? `_${formatedBuilderName}`
+ : formatedBuilderName;
+ output += `${
+ formatedBuilderNameLocal === formatedBuilderName ? "export " : ""
+ }function ${formatedBuilderNameLocal}(${defArgs.join(
+ ", "
+ )}): t.${type} { return builder("${type}", ...arguments); }\n`;
+ if (formatedBuilderNameLocal !== formatedBuilderName) {
+ output += `export { ${formatedBuilderNameLocal} as ${formatedBuilderName} };\n`;
+ }
+
+ // This is needed for backwards compatibility.
+ // It should be removed in the next major version.
+ // JSXIdentifier -> jSXIdentifier
+ if (/^[A-Z]{2}/.test(type)) {
+ output += `export { ${formatedBuilderNameLocal} as ${lowerFirst(
+ type
+ )} }\n`;
+ }
+ });
+
+ Object.keys(definitions.DEPRECATED_KEYS).forEach(type => {
+ const newType = definitions.DEPRECATED_KEYS[type];
+ const formatedBuilderName = formatBuilderName(type);
+ output += `/** @deprecated */
+function ${type}(...args: Array<any>): any {
+ console.trace("The node type ${type} has been renamed to ${newType}");
+ return builder("${type}", ...args);
+}
+export { ${type} as ${formatedBuilderName} };\n`;
+ // This is needed for backwards compatibility.
+ // It should be removed in the next major version.
+ // JSXIdentifier -> jSXIdentifier
+ if (/^[A-Z]{2}/.test(type)) {
+ output += `export { ${type} as ${lowerFirst(type)} }\n`;
+ }
+ });
+
+ return output;
+}
+
+function generateUppercaseBuilders() {
+ let output = `/*
+ * This file is auto-generated! Do not modify it directly.
+ * To re-generate run 'make build'
+ */
+
+/**
+ * This file is written in JavaScript and not TypeScript because uppercase builders
+ * conflict with AST types. TypeScript reads the uppercase.d.ts file instead.
+ */
+
+ export {\n`;
+
+ Object.keys(definitions.BUILDER_KEYS).forEach(type => {
+ const formatedBuilderName = formatBuilderName(type);
+ output += ` ${formatedBuilderName} as ${type},\n`;
+ });
+
+ Object.keys(definitions.DEPRECATED_KEYS).forEach(type => {
+ const formatedBuilderName = formatBuilderName(type);
+ output += ` ${formatedBuilderName} as ${type},\n`;
+ });
+
+ output += ` } from './index';\n`;
+ return output;
+}
diff --git a/chromium/third_party/node/node_modules/@babel/types/scripts/generators/constants.js b/chromium/third_party/node/node_modules/@babel/types/scripts/generators/constants.js
new file mode 100644
index 00000000000..68abdbd837f
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/scripts/generators/constants.js
@@ -0,0 +1,15 @@
+import definitions from "../../lib/definitions/index.js";
+
+export default function generateConstants() {
+ let output = `/*
+ * This file is auto-generated! Do not modify it directly.
+ * To re-generate run 'make build'
+ */
+import { FLIPPED_ALIAS_KEYS } from "../../definitions";\n\n`;
+
+ Object.keys(definitions.FLIPPED_ALIAS_KEYS).forEach(type => {
+ output += `export const ${type.toUpperCase()}_TYPES = FLIPPED_ALIAS_KEYS["${type}"];\n`;
+ });
+
+ return output;
+}
diff --git a/chromium/third_party/node/node_modules/@babel/types/scripts/generators/docs.js b/chromium/third_party/node/node_modules/@babel/types/scripts/generators/docs.js
new file mode 100644
index 00000000000..f7b82e56d39
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/scripts/generators/docs.js
@@ -0,0 +1,277 @@
+import util from "util";
+import stringifyValidator from "../utils/stringifyValidator.js";
+import toFunctionName from "../utils/toFunctionName.js";
+
+import t from "../../lib/index.js";
+
+const readme = [
+ `---
+id: babel-types
+title: @babel/types
+---
+<!-- Do not modify! This file is automatically generated by
+ github.com/babel/babel/babel-types/scripts/generators/docs.js !-->
+
+> This module contains methods for building ASTs manually and for checking the types of AST nodes.
+
+## Install
+
+\`\`\`sh
+npm install --save-dev @babel/types
+\`\`\`
+
+## API`,
+];
+
+const customTypes = {
+ ClassMethod: {
+ key: "if computed then `Expression` else `Identifier | Literal`",
+ },
+ Identifier: {
+ name: "`string`",
+ },
+ MemberExpression: {
+ property: "if computed then `Expression` else `Identifier`",
+ },
+ ObjectMethod: {
+ key: "if computed then `Expression` else `Identifier | Literal`",
+ },
+ ObjectProperty: {
+ key: "if computed then `Expression` else `Identifier | Literal`",
+ },
+ ClassPrivateMethod: {
+ computed: "'false'",
+ },
+ ClassPrivateProperty: {
+ computed: "'false'",
+ },
+};
+const APIHistory = {
+ ClassProperty: [["v7.6.0", "Supports `static`"]],
+};
+function formatHistory(historyItems) {
+ const lines = historyItems.map(
+ item => "| `" + item[0] + "` | " + item[1] + " |"
+ );
+ return [
+ "<details>",
+ " <summary>History</summary>",
+ "| Version | Changes |",
+ "| --- | --- |",
+ ...lines,
+ "</details>",
+ ];
+}
+function printAPIHistory(key, readme) {
+ if (APIHistory[key]) {
+ readme.push("");
+ readme.push(...formatHistory(APIHistory[key]));
+ }
+}
+function printNodeFields(key, readme) {
+ if (Object.keys(t.NODE_FIELDS[key]).length > 0) {
+ readme.push("");
+ readme.push("AST Node `" + key + "` shape:");
+ Object.keys(t.NODE_FIELDS[key])
+ .sort(function (fieldA, fieldB) {
+ const indexA = t.BUILDER_KEYS[key].indexOf(fieldA);
+ const indexB = t.BUILDER_KEYS[key].indexOf(fieldB);
+ if (indexA === indexB) return fieldA < fieldB ? -1 : 1;
+ if (indexA === -1) return 1;
+ if (indexB === -1) return -1;
+ return indexA - indexB;
+ })
+ .forEach(function (field) {
+ const defaultValue = t.NODE_FIELDS[key][field].default;
+ const fieldDescription = ["`" + field + "`"];
+ const validator = t.NODE_FIELDS[key][field].validate;
+ if (customTypes[key] && customTypes[key][field]) {
+ fieldDescription.push(`: ${customTypes[key][field]}`);
+ } else if (validator) {
+ try {
+ fieldDescription.push(
+ ": `" + stringifyValidator(validator, "") + "`"
+ );
+ } catch (ex) {
+ if (ex.code === "UNEXPECTED_VALIDATOR_TYPE") {
+ console.log(
+ "Unrecognised validator type for " + key + "." + field
+ );
+ console.dir(ex.validator, { depth: 10, colors: true });
+ }
+ }
+ }
+ if (defaultValue !== null || t.NODE_FIELDS[key][field].optional) {
+ fieldDescription.push(
+ " (default: `" + util.inspect(defaultValue) + "`"
+ );
+ if (t.BUILDER_KEYS[key].indexOf(field) < 0) {
+ fieldDescription.push(", excluded from builder function");
+ }
+ fieldDescription.push(")");
+ } else {
+ fieldDescription.push(" (required)");
+ }
+ readme.push("- " + fieldDescription.join(""));
+ });
+ }
+}
+
+function printAliasKeys(key, readme) {
+ if (t.ALIAS_KEYS[key] && t.ALIAS_KEYS[key].length) {
+ readme.push("");
+ readme.push(
+ "Aliases: " +
+ t.ALIAS_KEYS[key]
+ .map(function (key) {
+ return "[`" + key + "`](#" + key.toLowerCase() + ")";
+ })
+ .join(", ")
+ );
+ }
+}
+readme.push("### Node Builders");
+readme.push("");
+Object.keys(t.BUILDER_KEYS)
+ .sort()
+ .forEach(function (key) {
+ readme.push("#### " + toFunctionName(key));
+ readme.push("");
+ readme.push("```javascript");
+ readme.push(
+ "t." + toFunctionName(key) + "(" + t.BUILDER_KEYS[key].join(", ") + ");"
+ );
+ readme.push("```");
+ printAPIHistory(key, readme);
+ readme.push("");
+ readme.push(
+ "See also `t.is" +
+ key +
+ "(node, opts)` and `t.assert" +
+ key +
+ "(node, opts)`."
+ );
+
+ printNodeFields(key, readme);
+ printAliasKeys(key, readme);
+
+ readme.push("");
+ readme.push("---");
+ readme.push("");
+ });
+
+function generateMapAliasToNodeTypes() {
+ const result = new Map();
+ for (const nodeType of Object.keys(t.ALIAS_KEYS)) {
+ const aliases = t.ALIAS_KEYS[nodeType];
+ if (!aliases) continue;
+ for (const alias of aliases) {
+ if (!result.has(alias)) {
+ result.set(alias, []);
+ }
+ const nodeTypes = result.get(alias);
+ nodeTypes.push(nodeType);
+ }
+ }
+ return result;
+}
+const aliasDescriptions = {
+ Binary:
+ "A cover of BinaryExpression and LogicalExpression, which share the same AST shape.",
+ Block: "Deprecated. Will be removed in Babel 8.",
+ BlockParent:
+ "A cover of AST nodes that start an execution context with new [LexicalEnvironment](https://tc39.es/ecma262/#table-additional-state-components-for-ecmascript-code-execution-contexts). In other words, they define the scope of `let` and `const` declarations.",
+ Class:
+ "A cover of ClassExpression and ClassDeclaration, which share the same AST shape.",
+ CompletionStatement:
+ "A statement that indicates the [completion records](https://tc39.es/ecma262/#sec-completion-record-specification-type). In other words, they define the control flow of the program, such as when should a loop break or an action throws critical errors.",
+ Conditional:
+ "A cover of ConditionalExpression and IfStatement, which share the same AST shape.",
+ Declaration:
+ "A cover of any [Declaration](https://tc39.es/ecma262/#prod-Declaration)s.",
+ EnumBody: "A cover of Flow enum bodies.",
+ EnumMember: "A cover of Flow enum membors.",
+ ExportDeclaration:
+ "A cover of any [ExportDeclaration](https://tc39.es/ecma262/#prod-ExportDeclaration)s.",
+ Expression:
+ "A cover of any [Expression](https://tc39.es/ecma262/#sec-ecmascript-language-expressions)s.",
+ ExpressionWrapper:
+ "A wrapper of expression that does not have runtime semantics.",
+ Flow: "A cover of AST nodes defined for Flow.",
+ FlowBaseAnnotation: "A cover of primary Flow type annotations.",
+ FlowDeclaration: "A cover of Flow declarations.",
+ FlowPredicate: "A cover of Flow predicates.",
+ FlowType: "A cover of Flow type annotations.",
+ For: "A cover of [ForStatement](https://tc39.es/ecma262/#sec-for-statement)s and [ForXStatement](#forxstatement)s.",
+ ForXStatement:
+ "A cover of [ForInStatements and ForOfStatements](https://tc39.es/ecma262/#sec-for-in-and-for-of-statements).",
+ Function:
+ "A cover of functions and [method](#method)s, the must have `body` and `params`. Note: `Function` is different to `FunctionParent`.",
+ FunctionParent:
+ "A cover of AST nodes that start an execution context with new [VariableEnvironment](https://tc39.es/ecma262/#table-additional-state-components-for-ecmascript-code-execution-contexts). In other words, they define the scope of `var` declarations. FunctionParent did not include `Program` since Babel 7.",
+ Immutable:
+ "A cover of immutable objects and JSX elements. An object is [immutable](https://tc39.es/ecma262/#immutable-prototype-exotic-object) if no other properties can be defined once created.",
+ JSX: "A cover of AST nodes defined for [JSX](https://facebook.github.io/jsx/).",
+ LVal: "A cover of left hand side expressions used in the `left` of assignment expressions and [ForXStatement](#forxstatement)s. ",
+ Literal:
+ "A cover of [Literal](https://tc39.es/ecma262/#sec-primary-expression-literals)s, [Regular Expression Literal](https://tc39.es/ecma262/#sec-primary-expression-regular-expression-literals)s and [Template Literal](https://tc39.es/ecma262/#sec-template-literals)s.",
+ Loop: "A cover of loop statements.",
+ Method: "A cover of object methods and class methods.",
+ ModuleDeclaration:
+ "A cover of ImportDeclaration and [ExportDeclaration](#exportdeclaration)",
+ ModuleSpecifier:
+ "A cover of import and export specifiers. Note: It is _not_ the [ModuleSpecifier](https://tc39.es/ecma262/#prod-ModuleSpecifier) defined in the spec.",
+ ObjectMember:
+ "A cover of [members](https://tc39.es/ecma262/#prod-PropertyDefinitionList) in an object literal.",
+ Pattern:
+ "A cover of [BindingPattern](https://tc39.es/ecma262/#prod-BindingPattern) except Identifiers.",
+ PatternLike:
+ "A cover of [BindingPattern](https://tc39.es/ecma262/#prod-BindingPattern)s. ",
+ Private: "A cover of private class elements and private identifiers.",
+ Property: "A cover of object properties and class properties.",
+ Pureish:
+ "A cover of AST nodes which do not have side-effects. In other words, there is no observable behaviour changes if they are evaluated more than once.",
+ Scopable:
+ "A cover of [FunctionParent](#functionparent) and [BlockParent](#blockparent).",
+ Statement:
+ "A cover of any [Statement](https://tc39.es/ecma262/#prod-Statement)s.",
+ TSBaseType: "A cover of primary TypeScript type annotations.",
+ TSEntityName: "A cover of ts entities.",
+ TSType: "A cover of TypeScript type annotations.",
+ TSTypeElement: "A cover of TypeScript type declarations.",
+ Terminatorless:
+ "A cover of AST nodes whose semantic will change when a line terminator is inserted between the operator and the operand.",
+ UnaryLike: "A cover of UnaryExpression and SpreadElement.",
+ UserWhitespacable: "Deprecated. Will be removed in Babel 8.",
+ While:
+ "A cover of DoWhileStatement and WhileStatement, which share the same AST shape.",
+};
+const mapAliasToNodeTypes = generateMapAliasToNodeTypes();
+readme.push("### Aliases");
+readme.push("");
+for (const alias of [...mapAliasToNodeTypes.keys()].sort()) {
+ const nodeTypes = mapAliasToNodeTypes.get(alias);
+ nodeTypes.sort();
+ if (!(alias in aliasDescriptions)) {
+ throw new Error(
+ 'Missing alias descriptions of "' +
+ alias +
+ ", which covers " +
+ nodeTypes.join(",")
+ );
+ }
+ readme.push("#### " + alias);
+ readme.push("");
+ readme.push(aliasDescriptions[alias]);
+ readme.push("```javascript");
+ readme.push("t.is" + alias + "(node);");
+ readme.push("```");
+ readme.push("");
+ readme.push("Covered nodes: ");
+ for (const nodeType of nodeTypes) {
+ readme.push("- [`" + nodeType + "`](#" + nodeType.toLowerCase() + ")");
+ }
+ readme.push("");
+}
+
+process.stdout.write(readme.join("\n"));
diff --git a/chromium/third_party/node/node_modules/@babel/types/scripts/generators/flow.js b/chromium/third_party/node/node_modules/@babel/types/scripts/generators/flow.js
new file mode 100644
index 00000000000..7fabcc67c52
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/scripts/generators/flow.js
@@ -0,0 +1,260 @@
+import t from "../../lib/index.js";
+import stringifyValidator from "../utils/stringifyValidator.js";
+import toFunctionName from "../utils/toFunctionName.js";
+
+const NODE_PREFIX = "BabelNode";
+
+let code = `// NOTE: This file is autogenerated. Do not modify.
+// See packages/babel-types/scripts/generators/flow.js for script used.
+
+declare class ${NODE_PREFIX}Comment {
+ value: string;
+ start: number;
+ end: number;
+ loc: ${NODE_PREFIX}SourceLocation;
+}
+
+declare class ${NODE_PREFIX}CommentBlock extends ${NODE_PREFIX}Comment {
+ type: "CommentBlock";
+}
+
+declare class ${NODE_PREFIX}CommentLine extends ${NODE_PREFIX}Comment {
+ type: "CommentLine";
+}
+
+declare class ${NODE_PREFIX}SourceLocation {
+ start: {
+ line: number;
+ column: number;
+ };
+
+ end: {
+ line: number;
+ column: number;
+ };
+}
+
+declare class ${NODE_PREFIX} {
+ leadingComments?: Array<${NODE_PREFIX}Comment>;
+ innerComments?: Array<${NODE_PREFIX}Comment>;
+ trailingComments?: Array<${NODE_PREFIX}Comment>;
+ start: ?number;
+ end: ?number;
+ loc: ?${NODE_PREFIX}SourceLocation;
+ extra?: { [string]: mixed };
+}\n\n`;
+
+//
+
+const lines = [];
+
+for (const type in t.NODE_FIELDS) {
+ const fields = t.NODE_FIELDS[type];
+
+ const struct = ['type: "' + type + '";'];
+ const args = [];
+ const builderNames = t.BUILDER_KEYS[type];
+
+ Object.keys(t.NODE_FIELDS[type])
+ .sort((fieldA, fieldB) => {
+ const indexA = t.BUILDER_KEYS[type].indexOf(fieldA);
+ const indexB = t.BUILDER_KEYS[type].indexOf(fieldB);
+ if (indexA === indexB) return fieldA < fieldB ? -1 : 1;
+ if (indexA === -1) return 1;
+ if (indexB === -1) return -1;
+ return indexA - indexB;
+ })
+ .forEach(fieldName => {
+ const field = fields[fieldName];
+
+ let suffix = "";
+ if (field.optional || field.default != null) suffix += "?";
+
+ let typeAnnotation = "any";
+
+ const validate = field.validate;
+ if (validate) {
+ typeAnnotation = stringifyValidator(validate, NODE_PREFIX);
+ }
+
+ if (typeAnnotation) {
+ suffix += ": " + typeAnnotation;
+ }
+ if (builderNames.includes(fieldName)) {
+ args.push(t.toBindingIdentifierName(fieldName) + suffix);
+ }
+
+ if (t.isValidIdentifier(fieldName)) {
+ struct.push(fieldName + suffix + ";");
+ }
+ });
+
+ code += `declare class ${NODE_PREFIX}${type} extends ${NODE_PREFIX} {
+ ${struct.join("\n ").trim()}
+}\n\n`;
+
+ // Flow chokes on super() and import() :/
+ if (type !== "Super" && type !== "Import") {
+ lines.push(
+ `declare export function ${toFunctionName(type)}(${args.join(
+ ", "
+ )}): ${NODE_PREFIX}${type};`
+ );
+ } else {
+ const functionName = toFunctionName(type);
+ lines.push(
+ `declare function _${functionName}(${args.join(
+ ", "
+ )}): ${NODE_PREFIX}${type};`,
+ `declare export { _${functionName} as ${functionName} }`
+ );
+ }
+}
+
+for (const typeName of t.TYPES) {
+ const isDeprecated = !!t.DEPRECATED_KEYS[typeName];
+ const realName = isDeprecated ? t.DEPRECATED_KEYS[typeName] : typeName;
+
+ let decl = `declare export function is${typeName}(node: ?Object, opts?: ?Object): boolean`;
+ if (t.NODE_FIELDS[realName]) {
+ decl += ` %checks (node instanceof ${NODE_PREFIX}${realName})`;
+ }
+ lines.push(decl);
+
+ lines.push(
+ `declare export function assert${typeName}(node: ?Object, opts?: ?Object): void`
+ );
+}
+
+lines.push(
+ `declare export var VISITOR_KEYS: { [type: string]: string[] }`,
+
+ // assert/
+ `declare export function assertNode(obj: any): void`,
+
+ // builders/
+ // eslint-disable-next-line max-len
+ `declare export function createTypeAnnotationBasedOnTypeof(type: 'string' | 'number' | 'undefined' | 'boolean' | 'function' | 'object' | 'symbol'): ${NODE_PREFIX}TypeAnnotation`,
+ // eslint-disable-next-line max-len
+ `declare export function createUnionTypeAnnotation(types: Array<${NODE_PREFIX}FlowType>): ${NODE_PREFIX}UnionTypeAnnotation`,
+ // eslint-disable-next-line max-len
+ `declare export function createFlowUnionType(types: Array<${NODE_PREFIX}FlowType>): ${NODE_PREFIX}UnionTypeAnnotation`,
+ // this smells like "internal API"
+ // eslint-disable-next-line max-len
+ `declare export function buildChildren(node: { children: Array<${NODE_PREFIX}JSXText | ${NODE_PREFIX}JSXExpressionContainer | ${NODE_PREFIX}JSXSpreadChild | ${NODE_PREFIX}JSXElement | ${NODE_PREFIX}JSXFragment | ${NODE_PREFIX}JSXEmptyExpression> }): Array<${NODE_PREFIX}JSXText | ${NODE_PREFIX}JSXExpressionContainer | ${NODE_PREFIX}JSXSpreadChild | ${NODE_PREFIX}JSXElement | ${NODE_PREFIX}JSXFragment>`,
+
+ // clone/
+ `declare export function clone<T>(n: T): T;`,
+ `declare export function cloneDeep<T>(n: T): T;`,
+ `declare export function cloneDeepWithoutLoc<T>(n: T): T;`,
+ `declare export function cloneNode<T>(n: T, deep?: boolean, withoutLoc?: boolean): T;`,
+ `declare export function cloneWithoutLoc<T>(n: T): T;`,
+
+ // comments/
+ `declare type CommentTypeShorthand = 'leading' | 'inner' | 'trailing'`,
+ // eslint-disable-next-line max-len
+ `declare export function addComment<T: BabelNode>(node: T, type: CommentTypeShorthand, content: string, line?: boolean): T`,
+ // eslint-disable-next-line max-len
+ `declare export function addComments<T: BabelNode>(node: T, type: CommentTypeShorthand, comments: Array<Comment>): T`,
+ `declare export function inheritInnerComments(node: BabelNode, parent: BabelNode): void`,
+ `declare export function inheritLeadingComments(node: BabelNode, parent: BabelNode): void`,
+ `declare export function inheritsComments<T: BabelNode>(node: T, parent: BabelNode): void`,
+ `declare export function inheritTrailingComments(node: BabelNode, parent: BabelNode): void`,
+ `declare export function removeComments<T: BabelNode>(node: T): T`,
+
+ // converters/
+ `declare export function ensureBlock(node: ${NODE_PREFIX}, key: string): ${NODE_PREFIX}BlockStatement`,
+ `declare export function toBindingIdentifierName(name?: ?string): string`,
+ // eslint-disable-next-line max-len
+ `declare export function toBlock(node: ${NODE_PREFIX}Statement | ${NODE_PREFIX}Expression, parent?: ${NODE_PREFIX}Function | null): ${NODE_PREFIX}BlockStatement`,
+ // eslint-disable-next-line max-len
+ `declare export function toComputedKey(node: ${NODE_PREFIX}Method | ${NODE_PREFIX}Property, key?: ${NODE_PREFIX}Expression | ${NODE_PREFIX}Identifier): ${NODE_PREFIX}Expression`,
+ // eslint-disable-next-line max-len
+ `declare export function toExpression(node: ${NODE_PREFIX}ExpressionStatement | ${NODE_PREFIX}Expression | ${NODE_PREFIX}Class | ${NODE_PREFIX}Function): ${NODE_PREFIX}Expression`,
+ `declare export function toIdentifier(name?: ?string): string`,
+ // eslint-disable-next-line max-len
+ `declare export function toKeyAlias(node: ${NODE_PREFIX}Method | ${NODE_PREFIX}Property, key?: ${NODE_PREFIX}): string`,
+ // toSequenceExpression relies on types that aren't declared in flow
+ // eslint-disable-next-line max-len
+ `declare export function toStatement(node: ${NODE_PREFIX}Statement | ${NODE_PREFIX}Class | ${NODE_PREFIX}Function | ${NODE_PREFIX}AssignmentExpression, ignore?: boolean): ${NODE_PREFIX}Statement | void`,
+ `declare export function valueToNode(value: any): ${NODE_PREFIX}Expression`,
+
+ // modifications/
+ // eslint-disable-next-line max-len
+ `declare export function removeTypeDuplicates(types: Array<${NODE_PREFIX}FlowType>): Array<${NODE_PREFIX}FlowType>`,
+ // eslint-disable-next-line max-len
+ `declare export function appendToMemberExpression(member: ${NODE_PREFIX}MemberExpression, append: ${NODE_PREFIX}, computed?: boolean): ${NODE_PREFIX}MemberExpression`,
+ // eslint-disable-next-line max-len
+ `declare export function inherits<T: BabelNode>(child: T, parent: ${NODE_PREFIX} | null | void): T`,
+ // eslint-disable-next-line max-len
+ `declare export function prependToMemberExpression(member: ${NODE_PREFIX}MemberExpression, prepend: ${NODE_PREFIX}Expression): ${NODE_PREFIX}MemberExpression`,
+ `declare export function removeProperties<T>(n: T, opts: ?{}): void;`,
+ `declare export function removePropertiesDeep<T>(n: T, opts: ?{}): T;`,
+
+ // retrievers/
+ // eslint-disable-next-line max-len
+ `declare export var getBindingIdentifiers: {
+ (node: ${NODE_PREFIX}, duplicates?: boolean, outerOnly?: boolean): { [key: string]: ${NODE_PREFIX}Identifier | Array<${NODE_PREFIX}Identifier> },
+ keys: { [type: string]: string[] }
+ }`,
+ // eslint-disable-next-line max-len
+ `declare export function getOuterBindingIdentifiers(node: BabelNode, duplicates?: boolean): { [key: string]: ${NODE_PREFIX}Identifier | Array<${NODE_PREFIX}Identifier> }`,
+
+ // traverse/
+ `declare type TraversalAncestors = Array<{
+ node: BabelNode,
+ key: string,
+ index?: number,
+ }>;
+ declare type TraversalHandler<T> = (BabelNode, TraversalAncestors, T) => void;
+ declare type TraversalHandlers<T> = {
+ enter?: TraversalHandler<T>,
+ exit?: TraversalHandler<T>,
+ };`.replace(/(^|\n) {2}/g, "$1"),
+ // eslint-disable-next-line
+ `declare export function traverse<T>(n: BabelNode, TraversalHandler<T> | TraversalHandlers<T>, state?: T): void;`,
+ `declare export function traverseFast<T>(n: BabelNode, h: TraversalHandler<T>, state?: T): void;`,
+
+ // utils/
+ // cleanJSXElementLiteralChild is not exported
+ // inherit is not exported
+ `declare export function shallowEqual(actual: Object, expected: Object): boolean`,
+
+ // validators/
+ // eslint-disable-next-line max-len
+ `declare export function buildMatchMemberExpression(match: string, allowPartial?: boolean): (?BabelNode) => boolean`,
+ `declare export function is(type: string, n: BabelNode, opts: Object): boolean;`,
+ `declare export function isBinding(node: BabelNode, parent: BabelNode, grandparent?: BabelNode): boolean`,
+ `declare export function isBlockScoped(node: BabelNode): boolean`,
+ `declare export function isImmutable(node: BabelNode): boolean`,
+ `declare export function isLet(node: BabelNode): boolean`,
+ `declare export function isNode(node: ?Object): boolean`,
+ `declare export function isNodesEquivalent(a: any, b: any): boolean`,
+ `declare export function isPlaceholderType(placeholderType: string, targetType: string): boolean`,
+ `declare export function isReferenced(node: BabelNode, parent: BabelNode, grandparent?: BabelNode): boolean`,
+ `declare export function isScope(node: BabelNode, parent: BabelNode): boolean`,
+ `declare export function isSpecifierDefault(specifier: BabelNodeModuleSpecifier): boolean`,
+ `declare export function isType(nodetype: ?string, targetType: string): boolean`,
+ `declare export function isValidES3Identifier(name: string): boolean`,
+ `declare export function isValidES3Identifier(name: string): boolean`,
+ `declare export function isValidIdentifier(name: string): boolean`,
+ `declare export function isVar(node: BabelNode): boolean`,
+ // eslint-disable-next-line max-len
+ `declare export function matchesPattern(node: ?BabelNode, match: string | Array<string>, allowPartial?: boolean): boolean`,
+ `declare export function validate(n: BabelNode, key: string, value: mixed): void;`
+);
+
+for (const type in t.FLIPPED_ALIAS_KEYS) {
+ const types = t.FLIPPED_ALIAS_KEYS[type];
+ code += `type ${NODE_PREFIX}${type} = ${types
+ .map(type => `${NODE_PREFIX}${type}`)
+ .join(" | ")};\n`;
+}
+
+code += `\ndeclare module "@babel/types" {
+ ${lines.join("\n").replace(/\n/g, "\n ").trim()}
+}\n`;
+
+//
+
+process.stdout.write(code);
diff --git a/chromium/third_party/node/node_modules/@babel/types/scripts/generators/typescript-legacy.js b/chromium/third_party/node/node_modules/@babel/types/scripts/generators/typescript-legacy.js
new file mode 100644
index 00000000000..40da48f4e7d
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/scripts/generators/typescript-legacy.js
@@ -0,0 +1,369 @@
+import t from "../../lib/index.js";
+import stringifyValidator from "../utils/stringifyValidator.js";
+import toFunctionName from "../utils/toFunctionName.js";
+
+let code = `// NOTE: This file is autogenerated. Do not modify.
+// See packages/babel-types/scripts/generators/typescript-legacy.js for script used.
+
+interface BaseComment {
+ value: string;
+ start: number;
+ end: number;
+ loc: SourceLocation;
+ type: "CommentBlock" | "CommentLine";
+}
+
+export interface CommentBlock extends BaseComment {
+ type: "CommentBlock";
+}
+
+export interface CommentLine extends BaseComment {
+ type: "CommentLine";
+}
+
+export type Comment = CommentBlock | CommentLine;
+
+export interface SourceLocation {
+ start: {
+ line: number;
+ column: number;
+ };
+
+ end: {
+ line: number;
+ column: number;
+ };
+}
+
+interface BaseNode {
+ leadingComments: ReadonlyArray<Comment> | null;
+ innerComments: ReadonlyArray<Comment> | null;
+ trailingComments: ReadonlyArray<Comment> | null;
+ start: number | null;
+ end: number | null;
+ loc: SourceLocation | null;
+ type: Node["type"];
+ extra?: Record<string, unknown>;
+}
+
+export type Node = ${t.TYPES.sort().join(" | ")};\n\n`;
+
+//
+
+const lines = [];
+
+for (const type in t.NODE_FIELDS) {
+ const fields = t.NODE_FIELDS[type];
+ const fieldNames = sortFieldNames(Object.keys(t.NODE_FIELDS[type]), type);
+ const builderNames = t.BUILDER_KEYS[type];
+
+ const struct = ['type: "' + type + '";'];
+ const args = [];
+
+ fieldNames.forEach(fieldName => {
+ const field = fields[fieldName];
+ // Future / annoying TODO:
+ // MemberExpression.property, ObjectProperty.key and ObjectMethod.key need special cases; either:
+ // - convert the declaration to chain() like ClassProperty.key and ClassMethod.key,
+ // - declare an alias type for valid keys, detect the case and reuse it here,
+ // - declare a disjoint union with, for example, ObjectPropertyBase,
+ // ObjectPropertyLiteralKey and ObjectPropertyComputedKey, and declare ObjectProperty
+ // as "ObjectPropertyBase & (ObjectPropertyLiteralKey | ObjectPropertyComputedKey)"
+ let typeAnnotation = stringifyValidator(field.validate, "");
+
+ if (isNullable(field) && !hasDefault(field)) {
+ typeAnnotation += " | null";
+ }
+
+ if (builderNames.includes(fieldName)) {
+ if (areAllRemainingFieldsNullable(fieldName, builderNames, fields)) {
+ args.push(
+ `${t.toBindingIdentifierName(fieldName)}${
+ isNullable(field) ? "?:" : ":"
+ } ${typeAnnotation}`
+ );
+ } else {
+ args.push(
+ `${t.toBindingIdentifierName(fieldName)}: ${typeAnnotation}${
+ isNullable(field) ? " | undefined" : ""
+ }`
+ );
+ }
+ }
+
+ const alphaNumeric = /^\w+$/;
+
+ if (t.isValidIdentifier(fieldName) || alphaNumeric.test(fieldName)) {
+ struct.push(`${fieldName}: ${typeAnnotation};`);
+ } else {
+ struct.push(`"${fieldName}": ${typeAnnotation};`);
+ }
+ });
+
+ code += `export interface ${type} extends BaseNode {
+ ${struct.join("\n ").trim()}
+}\n\n`;
+
+ // super and import are reserved words in JavaScript
+ if (type !== "Super" && type !== "Import") {
+ lines.push(
+ `export function ${toFunctionName(type)}(${args.join(", ")}): ${type};`
+ );
+ } else {
+ const functionName = toFunctionName(type);
+ lines.push(
+ `declare function _${functionName}(${args.join(", ")}): ${type};`,
+ `export { _${functionName} as ${functionName}}`
+ );
+ }
+}
+
+for (const typeName of t.TYPES) {
+ const isDeprecated = !!t.DEPRECATED_KEYS[typeName];
+ const realName = isDeprecated ? t.DEPRECATED_KEYS[typeName] : typeName;
+
+ const result =
+ t.NODE_FIELDS[realName] || t.FLIPPED_ALIAS_KEYS[realName]
+ ? `node is ${realName}`
+ : "boolean";
+
+ if (isDeprecated) {
+ lines.push(`/** @deprecated Use \`is${realName}\` */`);
+ }
+ lines.push(
+ `export function is${typeName}(node: object | null | undefined, opts?: object | null): ${result};`
+ );
+
+ if (isDeprecated) {
+ lines.push(`/** @deprecated Use \`assert${realName}\` */`);
+ }
+ lines.push(
+ `export function assert${typeName}(node: object | null | undefined, opts?: object | null): void;`
+ );
+}
+
+lines.push(
+ // assert/
+ `export function assertNode(obj: any): void`,
+
+ // builders/
+ // eslint-disable-next-line max-len
+ `export function createTypeAnnotationBasedOnTypeof(type: 'string' | 'number' | 'undefined' | 'boolean' | 'function' | 'object' | 'symbol'): StringTypeAnnotation | VoidTypeAnnotation | NumberTypeAnnotation | BooleanTypeAnnotation | GenericTypeAnnotation`,
+ `export function createUnionTypeAnnotation<T extends FlowType>(types: [T]): T`,
+ `export function createFlowUnionType<T extends FlowType>(types: [T]): T`,
+ // this probably misbehaves if there are 0 elements, and it's not a UnionTypeAnnotation if there's only 1
+ // it is possible to require "2 or more" for this overload ([T, T, ...T[]]) but it requires typescript 3.0
+ `export function createUnionTypeAnnotation(types: ReadonlyArray<FlowType>): UnionTypeAnnotation`,
+ `export function createFlowUnionType(types: ReadonlyArray<FlowType>): UnionTypeAnnotation`,
+ // this smells like "internal API"
+ // eslint-disable-next-line max-len
+ `export function buildChildren(node: { children: ReadonlyArray<JSXText | JSXExpressionContainer | JSXSpreadChild | JSXElement | JSXFragment | JSXEmptyExpression> }): JSXElement['children']`,
+
+ // clone/
+ `export function clone<T extends Node>(n: T): T;`,
+ `export function cloneDeep<T extends Node>(n: T): T;`,
+ `export function cloneDeepWithoutLoc<T extends Node>(n: T): T;`,
+ `export function cloneNode<T extends Node>(n: T, deep?: boolean, withoutLoc?: boolean): T;`,
+ `export function cloneWithoutLoc<T extends Node>(n: T): T;`,
+
+ // comments/
+ `export type CommentTypeShorthand = 'leading' | 'inner' | 'trailing'`,
+ // eslint-disable-next-line max-len
+ `export function addComment<T extends Node>(node: T, type: CommentTypeShorthand, content: string, line?: boolean): T`,
+ // eslint-disable-next-line max-len
+ `export function addComments<T extends Node>(node: T, type: CommentTypeShorthand, comments: ReadonlyArray<Comment>): T`,
+ `export function inheritInnerComments(node: Node, parent: Node): void`,
+ `export function inheritLeadingComments(node: Node, parent: Node): void`,
+ `export function inheritsComments<T extends Node>(node: T, parent: Node): void`,
+ `export function inheritTrailingComments(node: Node, parent: Node): void`,
+ `export function removeComments<T extends Node>(node: T): T`,
+
+ // converters/
+ // eslint-disable-next-line max-len
+ `export function ensureBlock(node: Extract<Node, { body: BlockStatement | Statement | Expression }>): BlockStatement`,
+ // too complex?
+ // eslint-disable-next-line max-len
+ `export function ensureBlock<K extends keyof Extract<Node, { body: BlockStatement | Statement | Expression }> = 'body'>(node: Extract<Node, Record<K, BlockStatement | Statement | Expression>>, key: K): BlockStatement`,
+ // gatherSequenceExpressions is not exported
+ `export function toBindingIdentifierName(name: { toString(): string } | null | undefined): string`,
+ `export function toBlock(node: Statement | Expression, parent?: Function | null): BlockStatement`,
+ // it is possible for `node` to be an arbitrary object if `key` is always provided,
+ // but that doesn't look like intended API
+ // eslint-disable-next-line max-len
+ `export function toComputedKey<T extends Extract<Node, { computed: boolean | null }>>(node: T, key?: Expression | Identifier): Expression`,
+ `export function toExpression(node: Function): FunctionExpression`,
+ `export function toExpression(node: Class): ClassExpression`,
+ `export function toExpression(node: ExpressionStatement | Expression | Class | Function): Expression`,
+ `export function toIdentifier(name: { toString(): string } | null | undefined): string`,
+ `export function toKeyAlias(node: Method | Property, key?: Node): string`,
+ // NOTE: this actually uses Scope from @babel/traverse, but we can't add a dependency on its types,
+ // as they live in @types. Declare the structural subset that is required.
+ // eslint-disable-next-line max-len
+ `export function toSequenceExpression(nodes: ReadonlyArray<Node>, scope: { push(value: { id: LVal; kind: 'var'; init?: Expression}): void; buildUndefinedNode(): Node }): SequenceExpression | undefined`,
+ `export function toStatement(node: AssignmentExpression, ignore?: boolean): ExpressionStatement`,
+ `export function toStatement(node: Statement | AssignmentExpression, ignore?: boolean): Statement`,
+ `export function toStatement(node: Class, ignore: true): ClassDeclaration | undefined`,
+ `export function toStatement(node: Class, ignore?: boolean): ClassDeclaration`,
+ `export function toStatement(node: Function, ignore: true): FunctionDeclaration | undefined`,
+ `export function toStatement(node: Function, ignore?: boolean): FunctionDeclaration`,
+ // eslint-disable-next-line max-len
+ `export function toStatement(node: Statement | Class | Function | AssignmentExpression, ignore: true): Statement | undefined`,
+ // eslint-disable-next-line max-len
+ `export function toStatement(node: Statement | Class | Function | AssignmentExpression, ignore?: boolean): Statement`,
+ // eslint-disable-next-line max-len
+ `export function valueToNode(value: undefined): Identifier`, // (should this not be a UnaryExpression to avoid shadowing?)
+ `export function valueToNode(value: boolean): BooleanLiteral`,
+ `export function valueToNode(value: null): NullLiteral`,
+ `export function valueToNode(value: string): StringLiteral`,
+ // Infinities and NaN need to use a BinaryExpression; negative values must be wrapped in UnaryExpression
+ `export function valueToNode(value: number): NumericLiteral | BinaryExpression | UnaryExpression`,
+ `export function valueToNode(value: RegExp): RegExpLiteral`,
+ // eslint-disable-next-line max-len
+ `export function valueToNode(value: ReadonlyArray<undefined | boolean | null | string | number | RegExp | object>): ArrayExpression`,
+ // this throws with objects that are not PlainObject according to lodash,
+ // or if there are non-valueToNode-able values
+ `export function valueToNode(value: object): ObjectExpression`,
+ // eslint-disable-next-line max-len
+ `export function valueToNode(value: undefined | boolean | null | string | number | RegExp | object): Expression`,
+
+ // modifications/
+ // eslint-disable-next-line max-len
+ `export function removeTypeDuplicates(types: ReadonlyArray<FlowType | false | null | undefined>): FlowType[]`,
+ // eslint-disable-next-line max-len
+ `export function appendToMemberExpression<T extends Pick<MemberExpression, 'object' | 'property'>>(member: T, append: MemberExpression['property'], computed?: boolean): T`,
+ // eslint-disable-next-line max-len
+ `export function inherits<T extends Node | null | undefined>(child: T, parent: Node | null | undefined): T`,
+ // eslint-disable-next-line max-len
+ `export function prependToMemberExpression<T extends Pick<MemberExpression, 'object' | 'property'>>(member: T, prepend: MemberExpression['object']): T`,
+ `export function removeProperties(
+ n: Node,
+ opts?: { preserveComments: boolean } | null
+): void;`,
+ `export function removePropertiesDeep<T extends Node>(
+ n: T,
+ opts?: { preserveComments: boolean } | null
+): T;`,
+
+ // retrievers/
+ // eslint-disable-next-line max-len
+ `export function getBindingIdentifiers(node: Node, duplicates: true, outerOnly?: boolean): Record<string, Array<Identifier>>`,
+ // eslint-disable-next-line max-len
+ `export function getBindingIdentifiers(node: Node, duplicates?: false, outerOnly?: boolean): Record<string, Identifier>`,
+ // eslint-disable-next-line max-len
+ `export function getBindingIdentifiers(node: Node, duplicates: boolean, outerOnly?: boolean): Record<string, Identifier | Array<Identifier>>`,
+ // eslint-disable-next-line max-len
+ `export function getOuterBindingIdentifiers(node: Node, duplicates: true): Record<string, Array<Identifier>>`,
+ `export function getOuterBindingIdentifiers(node: Node, duplicates?: false): Record<string, Identifier>`,
+ // eslint-disable-next-line max-len
+ `export function getOuterBindingIdentifiers(node: Node, duplicates: boolean): Record<string, Identifier | Array<Identifier>>`,
+
+ // traverse/
+ `export type TraversalAncestors = ReadonlyArray<{
+ node: Node,
+ key: string,
+ index?: number,
+ }>;
+ export type TraversalHandler<T> = (
+ this: undefined, node: Node, parent: TraversalAncestors, type: T
+ ) => void;
+ export type TraversalHandlers<T> = {
+ enter?: TraversalHandler<T>,
+ exit?: TraversalHandler<T>,
+ };`.replace(/(^|\n) {2}/g, "$1"),
+ // eslint-disable-next-line
+ `export function traverse<T>(n: Node, h: TraversalHandler<T> | TraversalHandlers<T>, state?: T): void;`,
+ `export function traverseFast<T>(n: Node, h: TraversalHandler<T>, state?: T): void;`,
+
+ // utils/
+ // cleanJSXElementLiteralChild is not exported
+ // inherit is not exported
+ `export function shallowEqual<T extends object>(actual: object, expected: T): actual is T`,
+
+ // validators/
+ // eslint-disable-next-line max-len
+ `export function buildMatchMemberExpression(match: string, allowPartial?: boolean): (node: Node | null | undefined) => node is MemberExpression`,
+ // eslint-disable-next-line max-len
+ `export function is<T extends Node['type']>(type: T, n: Node | null | undefined, required?: undefined): n is Extract<Node, { type: T }>`,
+ // eslint-disable-next-line max-len
+ `export function is<T extends Node['type'], P extends Extract<Node, { type: T }>>(type: T, n: Node | null | undefined, required: Partial<P>): n is P`,
+ // eslint-disable-next-line max-len
+ `export function is<P extends Node>(type: string, n: Node | null | undefined, required: Partial<P>): n is P`,
+ `export function is(type: string, n: Node | null | undefined, required?: Partial<Node>): n is Node`,
+ `export function isBinding(node: Node, parent: Node, grandparent?: Node): boolean`,
+ // eslint-disable-next-line max-len
+ `export function isBlockScoped(node: Node): node is FunctionDeclaration | ClassDeclaration | VariableDeclaration`,
+ `export function isImmutable(node: Node): node is Immutable`,
+ `export function isLet(node: Node): node is VariableDeclaration`,
+ `export function isNode(node: object | null | undefined): node is Node`,
+ `export function isNodesEquivalent<T extends Partial<Node>>(a: T, b: any): b is T`,
+ `export function isNodesEquivalent(a: any, b: any): boolean`,
+ `export function isPlaceholderType(placeholderType: Node['type'], targetType: Node['type']): boolean`,
+ `export function isReferenced(node: Node, parent: Node, grandparent?: Node): boolean`,
+ `export function isScope(node: Node, parent: Node): node is Scopable`,
+ `export function isSpecifierDefault(specifier: ModuleSpecifier): boolean`,
+ `export function isType<T extends Node['type']>(nodetype: string, targetType: T): nodetype is T`,
+ `export function isType(nodetype: string | null | undefined, targetType: string): boolean`,
+ `export function isValidES3Identifier(name: string): boolean`,
+ `export function isValidIdentifier(name: string): boolean`,
+ `export function isVar(node: Node): node is VariableDeclaration`,
+ // the MemberExpression implication is incidental, but it follows from the implementation
+ // eslint-disable-next-line max-len
+ `export function matchesPattern(node: Node | null | undefined, match: string | ReadonlyArray<string>, allowPartial?: boolean): node is MemberExpression`,
+ // eslint-disable-next-line max-len
+ `export function validate<T extends Node, K extends keyof T>(n: Node | null | undefined, key: K, value: T[K]): void;`,
+ `export function validate(n: Node, key: string, value: any): void;`
+);
+
+for (const type in t.DEPRECATED_KEYS) {
+ code += `/**
+ * @deprecated Use \`${t.DEPRECATED_KEYS[type]}\`
+ */
+export type ${type} = ${t.DEPRECATED_KEYS[type]};\n
+`;
+}
+
+for (const type in t.FLIPPED_ALIAS_KEYS) {
+ const types = t.FLIPPED_ALIAS_KEYS[type];
+ code += `export type ${type} = ${types
+ .map(type => `${type}`)
+ .join(" | ")};\n`;
+}
+code += "\n";
+
+code += "export interface Aliases {\n";
+for (const type in t.FLIPPED_ALIAS_KEYS) {
+ code += ` ${type}: ${type};\n`;
+}
+code += "}\n\n";
+
+code += lines.join("\n") + "\n";
+
+//
+
+process.stdout.write(code);
+
+//
+
+function areAllRemainingFieldsNullable(fieldName, fieldNames, fields) {
+ const index = fieldNames.indexOf(fieldName);
+ return fieldNames.slice(index).every(_ => isNullable(fields[_]));
+}
+
+function hasDefault(field) {
+ return field.default != null;
+}
+
+function isNullable(field) {
+ return field.optional || hasDefault(field);
+}
+
+function sortFieldNames(fields, type) {
+ return fields.sort((fieldA, fieldB) => {
+ const indexA = t.BUILDER_KEYS[type].indexOf(fieldA);
+ const indexB = t.BUILDER_KEYS[type].indexOf(fieldB);
+ if (indexA === indexB) return fieldA < fieldB ? -1 : 1;
+ if (indexA === -1) return 1;
+ if (indexB === -1) return -1;
+ return indexA - indexB;
+ });
+}
diff --git a/chromium/third_party/node/node_modules/@babel/types/scripts/generators/validators.js b/chromium/third_party/node/node_modules/@babel/types/scripts/generators/validators.js
new file mode 100644
index 00000000000..acd6da65750
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/scripts/generators/validators.js
@@ -0,0 +1,87 @@
+import definitions from "../../lib/definitions/index.js";
+
+const has = Function.call.bind(Object.prototype.hasOwnProperty);
+
+function joinComparisons(leftArr, right) {
+ return (
+ leftArr.map(JSON.stringify).join(` === ${right} || `) + ` === ${right}`
+ );
+}
+
+function addIsHelper(type, aliasKeys, deprecated) {
+ const targetType = JSON.stringify(type);
+ let aliasSource = "";
+ if (aliasKeys) {
+ aliasSource = joinComparisons(aliasKeys, "nodeType");
+ }
+
+ let placeholderSource = "";
+ const placeholderTypes = [];
+ if (
+ definitions.PLACEHOLDERS.includes(type) &&
+ has(definitions.FLIPPED_ALIAS_KEYS, type)
+ ) {
+ placeholderTypes.push(type);
+ }
+ if (has(definitions.PLACEHOLDERS_FLIPPED_ALIAS, type)) {
+ placeholderTypes.push(...definitions.PLACEHOLDERS_FLIPPED_ALIAS[type]);
+ }
+ if (placeholderTypes.length > 0) {
+ placeholderSource =
+ ' || nodeType === "Placeholder" && (' +
+ joinComparisons(
+ placeholderTypes,
+ "(node as t.Placeholder).expectedNode"
+ ) +
+ ")";
+ }
+
+ const result =
+ definitions.NODE_FIELDS[type] || definitions.FLIPPED_ALIAS_KEYS[type]
+ ? `node is t.${type}`
+ : "boolean";
+
+ return `export function is${type}(node: object | null | undefined, opts?: object | null): ${result} {
+ ${deprecated || ""}
+ if (!node) return false;
+
+ const nodeType = (node as t.Node).type;
+ if (${
+ aliasSource ? aliasSource : `nodeType === ${targetType}`
+ }${placeholderSource}) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return shallowEqual(node, opts);
+ }
+ }
+
+ return false;
+ }
+ `;
+}
+
+export default function generateValidators() {
+ let output = `/*
+ * This file is auto-generated! Do not modify it directly.
+ * To re-generate run 'make build'
+ */
+import shallowEqual from "../../utils/shallowEqual";
+import type * as t from "../..";\n\n`;
+
+ Object.keys(definitions.VISITOR_KEYS).forEach(type => {
+ output += addIsHelper(type);
+ });
+
+ Object.keys(definitions.FLIPPED_ALIAS_KEYS).forEach(type => {
+ output += addIsHelper(type, definitions.FLIPPED_ALIAS_KEYS[type]);
+ });
+
+ Object.keys(definitions.DEPRECATED_KEYS).forEach(type => {
+ const newType = definitions.DEPRECATED_KEYS[type];
+ const deprecated = `console.trace("The node type ${type} has been renamed to ${newType}");`;
+ output += addIsHelper(type, null, deprecated);
+ });
+
+ return output;
+}
diff --git a/chromium/third_party/node/node_modules/@babel/types/scripts/package.json b/chromium/third_party/node/node_modules/@babel/types/scripts/package.json
new file mode 100644
index 00000000000..5ffd9800b97
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/scripts/package.json
@@ -0,0 +1 @@
+{ "type": "module" }
diff --git a/chromium/third_party/node/node_modules/@babel/types/scripts/utils/formatBuilderName.js b/chromium/third_party/node/node_modules/@babel/types/scripts/utils/formatBuilderName.js
new file mode 100644
index 00000000000..f00a3c4a610
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/scripts/utils/formatBuilderName.js
@@ -0,0 +1,8 @@
+const toLowerCase = Function.call.bind("".toLowerCase);
+
+export default function formatBuilderName(type) {
+ // FunctionExpression -> functionExpression
+ // JSXIdentifier -> jsxIdentifier
+ // V8IntrinsicIdentifier -> v8IntrinsicIdentifier
+ return type.replace(/^([A-Z](?=[a-z0-9])|[A-Z]+(?=[A-Z]))/, toLowerCase);
+}
diff --git a/chromium/third_party/node/node_modules/@babel/types/scripts/utils/lowerFirst.js b/chromium/third_party/node/node_modules/@babel/types/scripts/utils/lowerFirst.js
new file mode 100644
index 00000000000..012f252a7f6
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/scripts/utils/lowerFirst.js
@@ -0,0 +1,3 @@
+export default function lowerFirst(string) {
+ return string[0].toLowerCase() + string.slice(1);
+}
diff --git a/chromium/third_party/node/node_modules/@babel/types/scripts/utils/stringifyValidator.js b/chromium/third_party/node/node_modules/@babel/types/scripts/utils/stringifyValidator.js
new file mode 100644
index 00000000000..4b8d29c12c3
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/scripts/utils/stringifyValidator.js
@@ -0,0 +1,66 @@
+export default function stringifyValidator(validator, nodePrefix) {
+ if (validator === undefined) {
+ return "any";
+ }
+
+ if (validator.each) {
+ return `Array<${stringifyValidator(validator.each, nodePrefix)}>`;
+ }
+
+ if (validator.chainOf) {
+ return stringifyValidator(validator.chainOf[1], nodePrefix);
+ }
+
+ if (validator.oneOf) {
+ return validator.oneOf.map(JSON.stringify).join(" | ");
+ }
+
+ if (validator.oneOfNodeTypes) {
+ return validator.oneOfNodeTypes.map(_ => nodePrefix + _).join(" | ");
+ }
+
+ if (validator.oneOfNodeOrValueTypes) {
+ return validator.oneOfNodeOrValueTypes
+ .map(_ => {
+ return isValueType(_) ? _ : nodePrefix + _;
+ })
+ .join(" | ");
+ }
+
+ if (validator.type) {
+ return validator.type;
+ }
+
+ if (validator.shapeOf) {
+ return (
+ "{ " +
+ Object.keys(validator.shapeOf)
+ .map(shapeKey => {
+ const propertyDefinition = validator.shapeOf[shapeKey];
+ if (propertyDefinition.validate) {
+ const isOptional =
+ propertyDefinition.optional || propertyDefinition.default != null;
+ return (
+ shapeKey +
+ (isOptional ? "?: " : ": ") +
+ stringifyValidator(propertyDefinition.validate)
+ );
+ }
+ return null;
+ })
+ .filter(Boolean)
+ .join(", ") +
+ " }"
+ );
+ }
+
+ return ["any"];
+}
+
+/**
+ * Heuristic to decide whether or not the given type is a value type (eg. "null")
+ * or a Node type (eg. "Expression").
+ */
+function isValueType(type) {
+ return type.charAt(0).toLowerCase() === type.charAt(0);
+}
diff --git a/chromium/third_party/node/node_modules/@babel/types/scripts/utils/toFunctionName.js b/chromium/third_party/node/node_modules/@babel/types/scripts/utils/toFunctionName.js
new file mode 100644
index 00000000000..2b645780ec6
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/scripts/utils/toFunctionName.js
@@ -0,0 +1,4 @@
+export default function toFunctionName(typeName) {
+ const _ = typeName.replace(/^TS/, "ts").replace(/^JSX/, "jsx");
+ return _.slice(0, 1).toLowerCase() + _.slice(1);
+}
diff --git a/chromium/third_party/node/node_modules/ansi-styles/index.js b/chromium/third_party/node/node_modules/ansi-styles/index.js
new file mode 100644
index 00000000000..90a871c4d78
--- /dev/null
+++ b/chromium/third_party/node/node_modules/ansi-styles/index.js
@@ -0,0 +1,165 @@
+'use strict';
+const colorConvert = require('color-convert');
+
+const wrapAnsi16 = (fn, offset) => function () {
+ const code = fn.apply(colorConvert, arguments);
+ return `\u001B[${code + offset}m`;
+};
+
+const wrapAnsi256 = (fn, offset) => function () {
+ const code = fn.apply(colorConvert, arguments);
+ return `\u001B[${38 + offset};5;${code}m`;
+};
+
+const wrapAnsi16m = (fn, offset) => function () {
+ const rgb = fn.apply(colorConvert, arguments);
+ return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
+};
+
+function assembleStyles() {
+ const codes = new Map();
+ const styles = {
+ modifier: {
+ reset: [0, 0],
+ // 21 isn't widely supported and 22 does the same thing
+ bold: [1, 22],
+ dim: [2, 22],
+ italic: [3, 23],
+ underline: [4, 24],
+ inverse: [7, 27],
+ hidden: [8, 28],
+ strikethrough: [9, 29]
+ },
+ color: {
+ black: [30, 39],
+ red: [31, 39],
+ green: [32, 39],
+ yellow: [33, 39],
+ blue: [34, 39],
+ magenta: [35, 39],
+ cyan: [36, 39],
+ white: [37, 39],
+ gray: [90, 39],
+
+ // Bright color
+ redBright: [91, 39],
+ greenBright: [92, 39],
+ yellowBright: [93, 39],
+ blueBright: [94, 39],
+ magentaBright: [95, 39],
+ cyanBright: [96, 39],
+ whiteBright: [97, 39]
+ },
+ bgColor: {
+ bgBlack: [40, 49],
+ bgRed: [41, 49],
+ bgGreen: [42, 49],
+ bgYellow: [43, 49],
+ bgBlue: [44, 49],
+ bgMagenta: [45, 49],
+ bgCyan: [46, 49],
+ bgWhite: [47, 49],
+
+ // Bright color
+ bgBlackBright: [100, 49],
+ bgRedBright: [101, 49],
+ bgGreenBright: [102, 49],
+ bgYellowBright: [103, 49],
+ bgBlueBright: [104, 49],
+ bgMagentaBright: [105, 49],
+ bgCyanBright: [106, 49],
+ bgWhiteBright: [107, 49]
+ }
+ };
+
+ // Fix humans
+ styles.color.grey = styles.color.gray;
+
+ for (const groupName of Object.keys(styles)) {
+ const group = styles[groupName];
+
+ for (const styleName of Object.keys(group)) {
+ const style = group[styleName];
+
+ styles[styleName] = {
+ open: `\u001B[${style[0]}m`,
+ close: `\u001B[${style[1]}m`
+ };
+
+ group[styleName] = styles[styleName];
+
+ codes.set(style[0], style[1]);
+ }
+
+ Object.defineProperty(styles, groupName, {
+ value: group,
+ enumerable: false
+ });
+
+ Object.defineProperty(styles, 'codes', {
+ value: codes,
+ enumerable: false
+ });
+ }
+
+ const ansi2ansi = n => n;
+ const rgb2rgb = (r, g, b) => [r, g, b];
+
+ styles.color.close = '\u001B[39m';
+ styles.bgColor.close = '\u001B[49m';
+
+ styles.color.ansi = {
+ ansi: wrapAnsi16(ansi2ansi, 0)
+ };
+ styles.color.ansi256 = {
+ ansi256: wrapAnsi256(ansi2ansi, 0)
+ };
+ styles.color.ansi16m = {
+ rgb: wrapAnsi16m(rgb2rgb, 0)
+ };
+
+ styles.bgColor.ansi = {
+ ansi: wrapAnsi16(ansi2ansi, 10)
+ };
+ styles.bgColor.ansi256 = {
+ ansi256: wrapAnsi256(ansi2ansi, 10)
+ };
+ styles.bgColor.ansi16m = {
+ rgb: wrapAnsi16m(rgb2rgb, 10)
+ };
+
+ for (let key of Object.keys(colorConvert)) {
+ if (typeof colorConvert[key] !== 'object') {
+ continue;
+ }
+
+ const suite = colorConvert[key];
+
+ if (key === 'ansi16') {
+ key = 'ansi';
+ }
+
+ if ('ansi16' in suite) {
+ styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0);
+ styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10);
+ }
+
+ if ('ansi256' in suite) {
+ styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0);
+ styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10);
+ }
+
+ if ('rgb' in suite) {
+ styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0);
+ styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10);
+ }
+ }
+
+ return styles;
+}
+
+// Make the export immutable
+Object.defineProperty(module, 'exports', {
+ enumerable: true,
+ get: assembleStyles
+});
diff --git a/chromium/third_party/node/node_modules/ansi-styles/license b/chromium/third_party/node/node_modules/ansi-styles/license
new file mode 100644
index 00000000000..e7af2f77107
--- /dev/null
+++ b/chromium/third_party/node/node_modules/ansi-styles/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/chromium/third_party/node/node_modules/ansi-styles/package.json b/chromium/third_party/node/node_modules/ansi-styles/package.json
new file mode 100644
index 00000000000..65edb48c399
--- /dev/null
+++ b/chromium/third_party/node/node_modules/ansi-styles/package.json
@@ -0,0 +1,56 @@
+{
+ "name": "ansi-styles",
+ "version": "3.2.1",
+ "description": "ANSI escape codes for styling strings in the terminal",
+ "license": "MIT",
+ "repository": "chalk/ansi-styles",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=4"
+ },
+ "scripts": {
+ "test": "xo && ava",
+ "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "ansi",
+ "styles",
+ "color",
+ "colour",
+ "colors",
+ "terminal",
+ "console",
+ "cli",
+ "string",
+ "tty",
+ "escape",
+ "formatting",
+ "rgb",
+ "256",
+ "shell",
+ "xterm",
+ "log",
+ "logging",
+ "command-line",
+ "text"
+ ],
+ "dependencies": {
+ "color-convert": "^1.9.0"
+ },
+ "devDependencies": {
+ "ava": "*",
+ "babel-polyfill": "^6.23.0",
+ "svg-term-cli": "^2.1.1",
+ "xo": "*"
+ },
+ "ava": {
+ "require": "babel-polyfill"
+ }
+}
diff --git a/chromium/third_party/node/node_modules/balanced-match/index.js b/chromium/third_party/node/node_modules/balanced-match/index.js
new file mode 100644
index 00000000000..c67a64608df
--- /dev/null
+++ b/chromium/third_party/node/node_modules/balanced-match/index.js
@@ -0,0 +1,62 @@
+'use strict';
+module.exports = balanced;
+function balanced(a, b, str) {
+ if (a instanceof RegExp) a = maybeMatch(a, str);
+ if (b instanceof RegExp) b = maybeMatch(b, str);
+
+ var r = range(a, b, str);
+
+ return r && {
+ start: r[0],
+ end: r[1],
+ pre: str.slice(0, r[0]),
+ body: str.slice(r[0] + a.length, r[1]),
+ post: str.slice(r[1] + b.length)
+ };
+}
+
+function maybeMatch(reg, str) {
+ var m = str.match(reg);
+ return m ? m[0] : null;
+}
+
+balanced.range = range;
+function range(a, b, str) {
+ var begs, beg, left, right, result;
+ var ai = str.indexOf(a);
+ var bi = str.indexOf(b, ai + 1);
+ var i = ai;
+
+ if (ai >= 0 && bi > 0) {
+ if(a===b) {
+ return [ai, bi];
+ }
+ begs = [];
+ left = str.length;
+
+ while (i >= 0 && !result) {
+ if (i == ai) {
+ begs.push(i);
+ ai = str.indexOf(a, i + 1);
+ } else if (begs.length == 1) {
+ result = [ begs.pop(), bi ];
+ } else {
+ beg = begs.pop();
+ if (beg < left) {
+ left = beg;
+ right = bi;
+ }
+
+ bi = str.indexOf(b, i + 1);
+ }
+
+ i = ai < bi && ai >= 0 ? ai : bi;
+ }
+
+ if (begs.length) {
+ result = [ left, right ];
+ }
+ }
+
+ return result;
+}
diff --git a/chromium/third_party/node/node_modules/balanced-match/package.json b/chromium/third_party/node/node_modules/balanced-match/package.json
new file mode 100644
index 00000000000..ce6073e0403
--- /dev/null
+++ b/chromium/third_party/node/node_modules/balanced-match/package.json
@@ -0,0 +1,48 @@
+{
+ "name": "balanced-match",
+ "description": "Match balanced character pairs, like \"{\" and \"}\"",
+ "version": "1.0.2",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/juliangruber/balanced-match.git"
+ },
+ "homepage": "https://github.com/juliangruber/balanced-match",
+ "main": "index.js",
+ "scripts": {
+ "test": "tape test/test.js",
+ "bench": "matcha test/bench.js"
+ },
+ "devDependencies": {
+ "matcha": "^0.7.0",
+ "tape": "^4.6.0"
+ },
+ "keywords": [
+ "match",
+ "regexp",
+ "test",
+ "balanced",
+ "parse"
+ ],
+ "author": {
+ "name": "Julian Gruber",
+ "email": "mail@juliangruber.com",
+ "url": "http://juliangruber.com"
+ },
+ "license": "MIT",
+ "testling": {
+ "files": "test/*.js",
+ "browsers": [
+ "ie/8..latest",
+ "firefox/20..latest",
+ "firefox/nightly",
+ "chrome/25..latest",
+ "chrome/canary",
+ "opera/12..latest",
+ "opera/next",
+ "safari/5.1..latest",
+ "ipad/6.0..latest",
+ "iphone/6.0..latest",
+ "android-browser/4.2..latest"
+ ]
+ }
+}
diff --git a/chromium/third_party/node/node_modules/brace-expansion/LICENSE b/chromium/third_party/node/node_modules/brace-expansion/LICENSE
new file mode 100644
index 00000000000..de3226673c3
--- /dev/null
+++ b/chromium/third_party/node/node_modules/brace-expansion/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/chromium/third_party/node/node_modules/brace-expansion/index.js b/chromium/third_party/node/node_modules/brace-expansion/index.js
new file mode 100644
index 00000000000..0478be81eab
--- /dev/null
+++ b/chromium/third_party/node/node_modules/brace-expansion/index.js
@@ -0,0 +1,201 @@
+var concatMap = require('concat-map');
+var balanced = require('balanced-match');
+
+module.exports = expandTop;
+
+var escSlash = '\0SLASH'+Math.random()+'\0';
+var escOpen = '\0OPEN'+Math.random()+'\0';
+var escClose = '\0CLOSE'+Math.random()+'\0';
+var escComma = '\0COMMA'+Math.random()+'\0';
+var escPeriod = '\0PERIOD'+Math.random()+'\0';
+
+function numeric(str) {
+ return parseInt(str, 10) == str
+ ? parseInt(str, 10)
+ : str.charCodeAt(0);
+}
+
+function escapeBraces(str) {
+ return str.split('\\\\').join(escSlash)
+ .split('\\{').join(escOpen)
+ .split('\\}').join(escClose)
+ .split('\\,').join(escComma)
+ .split('\\.').join(escPeriod);
+}
+
+function unescapeBraces(str) {
+ return str.split(escSlash).join('\\')
+ .split(escOpen).join('{')
+ .split(escClose).join('}')
+ .split(escComma).join(',')
+ .split(escPeriod).join('.');
+}
+
+
+// Basically just str.split(","), but handling cases
+// where we have nested braced sections, which should be
+// treated as individual members, like {a,{b,c},d}
+function parseCommaParts(str) {
+ if (!str)
+ return [''];
+
+ var parts = [];
+ var m = balanced('{', '}', str);
+
+ if (!m)
+ return str.split(',');
+
+ var pre = m.pre;
+ var body = m.body;
+ var post = m.post;
+ var p = pre.split(',');
+
+ p[p.length-1] += '{' + body + '}';
+ var postParts = parseCommaParts(post);
+ if (post.length) {
+ p[p.length-1] += postParts.shift();
+ p.push.apply(p, postParts);
+ }
+
+ parts.push.apply(parts, p);
+
+ return parts;
+}
+
+function expandTop(str) {
+ if (!str)
+ return [];
+
+ // I don't know why Bash 4.3 does this, but it does.
+ // Anything starting with {} will have the first two bytes preserved
+ // but *only* at the top level, so {},a}b will not expand to anything,
+ // but a{},b}c will be expanded to [a}c,abc].
+ // One could argue that this is a bug in Bash, but since the goal of
+ // this module is to match Bash's rules, we escape a leading {}
+ if (str.substr(0, 2) === '{}') {
+ str = '\\{\\}' + str.substr(2);
+ }
+
+ return expand(escapeBraces(str), true).map(unescapeBraces);
+}
+
+function identity(e) {
+ return e;
+}
+
+function embrace(str) {
+ return '{' + str + '}';
+}
+function isPadded(el) {
+ return /^-?0\d/.test(el);
+}
+
+function lte(i, y) {
+ return i <= y;
+}
+function gte(i, y) {
+ return i >= y;
+}
+
+function expand(str, isTop) {
+ var expansions = [];
+
+ var m = balanced('{', '}', str);
+ if (!m || /\$$/.test(m.pre)) return [str];
+
+ var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
+ var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
+ var isSequence = isNumericSequence || isAlphaSequence;
+ var isOptions = m.body.indexOf(',') >= 0;
+ if (!isSequence && !isOptions) {
+ // {a},b}
+ if (m.post.match(/,.*\}/)) {
+ str = m.pre + '{' + m.body + escClose + m.post;
+ return expand(str);
+ }
+ return [str];
+ }
+
+ var n;
+ if (isSequence) {
+ n = m.body.split(/\.\./);
+ } else {
+ n = parseCommaParts(m.body);
+ if (n.length === 1) {
+ // x{{a,b}}y ==> x{a}y x{b}y
+ n = expand(n[0], false).map(embrace);
+ if (n.length === 1) {
+ var post = m.post.length
+ ? expand(m.post, false)
+ : [''];
+ return post.map(function(p) {
+ return m.pre + n[0] + p;
+ });
+ }
+ }
+ }
+
+ // at this point, n is the parts, and we know it's not a comma set
+ // with a single entry.
+
+ // no need to expand pre, since it is guaranteed to be free of brace-sets
+ var pre = m.pre;
+ var post = m.post.length
+ ? expand(m.post, false)
+ : [''];
+
+ var N;
+
+ if (isSequence) {
+ var x = numeric(n[0]);
+ var y = numeric(n[1]);
+ var width = Math.max(n[0].length, n[1].length)
+ var incr = n.length == 3
+ ? Math.abs(numeric(n[2]))
+ : 1;
+ var test = lte;
+ var reverse = y < x;
+ if (reverse) {
+ incr *= -1;
+ test = gte;
+ }
+ var pad = n.some(isPadded);
+
+ N = [];
+
+ for (var i = x; test(i, y); i += incr) {
+ var c;
+ if (isAlphaSequence) {
+ c = String.fromCharCode(i);
+ if (c === '\\')
+ c = '';
+ } else {
+ c = String(i);
+ if (pad) {
+ var need = width - c.length;
+ if (need > 0) {
+ var z = new Array(need + 1).join('0');
+ if (i < 0)
+ c = '-' + z + c.slice(1);
+ else
+ c = z + c;
+ }
+ }
+ }
+ N.push(c);
+ }
+ } else {
+ N = concatMap(n, function(el) { return expand(el, false) });
+ }
+
+ for (var j = 0; j < N.length; j++) {
+ for (var k = 0; k < post.length; k++) {
+ var expansion = pre + N[j] + post[k];
+ if (!isTop || isSequence || expansion)
+ expansions.push(expansion);
+ }
+ }
+
+ return expansions;
+}
+
diff --git a/chromium/third_party/node/node_modules/brace-expansion/package.json b/chromium/third_party/node/node_modules/brace-expansion/package.json
new file mode 100644
index 00000000000..a18faa8fd67
--- /dev/null
+++ b/chromium/third_party/node/node_modules/brace-expansion/package.json
@@ -0,0 +1,47 @@
+{
+ "name": "brace-expansion",
+ "description": "Brace expansion as known from sh/bash",
+ "version": "1.1.11",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/juliangruber/brace-expansion.git"
+ },
+ "homepage": "https://github.com/juliangruber/brace-expansion",
+ "main": "index.js",
+ "scripts": {
+ "test": "tape test/*.js",
+ "gentest": "bash test/generate.sh",
+ "bench": "matcha test/perf/bench.js"
+ },
+ "dependencies": {
+ "balanced-match": "^1.0.0",
+ "concat-map": "0.0.1"
+ },
+ "devDependencies": {
+ "matcha": "^0.7.0",
+ "tape": "^4.6.0"
+ },
+ "keywords": [],
+ "author": {
+ "name": "Julian Gruber",
+ "email": "mail@juliangruber.com",
+ "url": "http://juliangruber.com"
+ },
+ "license": "MIT",
+ "testling": {
+ "files": "test/*.js",
+ "browsers": [
+ "ie/8..latest",
+ "firefox/20..latest",
+ "firefox/nightly",
+ "chrome/25..latest",
+ "chrome/canary",
+ "opera/12..latest",
+ "opera/next",
+ "safari/5.1..latest",
+ "ipad/6.0..latest",
+ "iphone/6.0..latest",
+ "android-browser/4.2..latest"
+ ]
+ }
+}
diff --git a/chromium/third_party/node/node_modules/chalk/index.js b/chromium/third_party/node/node_modules/chalk/index.js
new file mode 100644
index 00000000000..1cc5fa89a95
--- /dev/null
+++ b/chromium/third_party/node/node_modules/chalk/index.js
@@ -0,0 +1,228 @@
+'use strict';
+const escapeStringRegexp = require('escape-string-regexp');
+const ansiStyles = require('ansi-styles');
+const stdoutColor = require('supports-color').stdout;
+
+const template = require('./templates.js');
+
+const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm');
+
+// `supportsColor.level` → `ansiStyles.color[name]` mapping
+const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m'];
+
+// `color-convert` models to exclude from the Chalk API due to conflicts and such
+const skipModels = new Set(['gray']);
+
+const styles = Object.create(null);
+
+function applyOptions(obj, options) {
+ options = options || {};
+
+ // Detect level if not set manually
+ const scLevel = stdoutColor ? stdoutColor.level : 0;
+ obj.level = options.level === undefined ? scLevel : options.level;
+ obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0;
+}
+
+function Chalk(options) {
+ // We check for this.template here since calling `chalk.constructor()`
+ // by itself will have a `this` of a previously constructed chalk object
+ if (!this || !(this instanceof Chalk) || this.template) {
+ const chalk = {};
+ applyOptions(chalk, options);
+
+ chalk.template = function () {
+ const args = [].slice.call(arguments);
+ return chalkTag.apply(null, [chalk.template].concat(args));
+ };
+
+ Object.setPrototypeOf(chalk, Chalk.prototype);
+ Object.setPrototypeOf(chalk.template, chalk);
+
+ chalk.template.constructor = Chalk;
+
+ return chalk.template;
+ }
+
+ applyOptions(this, options);
+}
+
+// Use bright blue on Windows as the normal blue color is illegible
+if (isSimpleWindowsTerm) {
+ ansiStyles.blue.open = '\u001B[94m';
+}
+
+for (const key of Object.keys(ansiStyles)) {
+ ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
+
+ styles[key] = {
+ get() {
+ const codes = ansiStyles[key];
+ return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key);
+ }
+ };
+}
+
+styles.visible = {
+ get() {
+ return build.call(this, this._styles || [], true, 'visible');
+ }
+};
+
+ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g');
+for (const model of Object.keys(ansiStyles.color.ansi)) {
+ if (skipModels.has(model)) {
+ continue;
+ }
+
+ styles[model] = {
+ get() {
+ const level = this.level;
+ return function () {
+ const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments);
+ const codes = {
+ open,
+ close: ansiStyles.color.close,
+ closeRe: ansiStyles.color.closeRe
+ };
+ return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);
+ };
+ }
+ };
+}
+
+ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), 'g');
+for (const model of Object.keys(ansiStyles.bgColor.ansi)) {
+ if (skipModels.has(model)) {
+ continue;
+ }
+
+ const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);
+ styles[bgModel] = {
+ get() {
+ const level = this.level;
+ return function () {
+ const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments);
+ const codes = {
+ open,
+ close: ansiStyles.bgColor.close,
+ closeRe: ansiStyles.bgColor.closeRe
+ };
+ return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);
+ };
+ }
+ };
+}
+
+const proto = Object.defineProperties(() => {}, styles);
+
+function build(_styles, _empty, key) {
+ const builder = function () {
+ return applyStyle.apply(builder, arguments);
+ };
+
+ builder._styles = _styles;
+ builder._empty = _empty;
+
+ const self = this;
+
+ Object.defineProperty(builder, 'level', {
+ enumerable: true,
+ get() {
+ return self.level;
+ },
+ set(level) {
+ self.level = level;
+ }
+ });
+
+ Object.defineProperty(builder, 'enabled', {
+ enumerable: true,
+ get() {
+ return self.enabled;
+ },
+ set(enabled) {
+ self.enabled = enabled;
+ }
+ });
+
+ // See below for fix regarding invisible grey/dim combination on Windows
+ builder.hasGrey = this.hasGrey || key === 'gray' || key === 'grey';
+
+ // `__proto__` is used because we must return a function, but there is
+ // no way to create a function with a different prototype
+ builder.__proto__ = proto; // eslint-disable-line no-proto
+
+ return builder;
+}
+
+function applyStyle() {
+ // Support varags, but simply cast to string in case there's only one arg
+ const args = arguments;
+ const argsLen = args.length;
+ let str = String(arguments[0]);
+
+ if (argsLen === 0) {
+ return '';
+ }
+
+ if (argsLen > 1) {
+ // Don't slice `arguments`, it prevents V8 optimizations
+ for (let a = 1; a < argsLen; a++) {
+ str += ' ' + args[a];
+ }
+ }
+
+ if (!this.enabled || this.level <= 0 || !str) {
+ return this._empty ? '' : str;
+ }
+
+ // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe,
+ // see https://github.com/chalk/chalk/issues/58
+ // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop.
+ const originalDim = ansiStyles.dim.open;
+ if (isSimpleWindowsTerm && this.hasGrey) {
+ ansiStyles.dim.open = '';
+ }
+
+ for (const code of this._styles.slice().reverse()) {
+ // Replace any instances already present with a re-opening code
+ // otherwise only the part of the string until said closing code
+ // will be colored, and the rest will simply be 'plain'.
+ str = code.open + str.replace(code.closeRe, code.open) + code.close;
+
+ // Close the styling before a linebreak and reopen
+ // after next line to fix a bleed issue on macOS
+ // https://github.com/chalk/chalk/pull/92
+ str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`);
+ }
+
+ // Reset the original `dim` if we changed it to work around the Windows dimmed gray issue
+ ansiStyles.dim.open = originalDim;
+
+ return str;
+}
+
+function chalkTag(chalk, strings) {
+ if (!Array.isArray(strings)) {
+ // If chalk() was called by itself or with a string,
+ // return the string itself as a string.
+ return [].slice.call(arguments, 1).join(' ');
+ }
+
+ const args = [].slice.call(arguments, 2);
+ const parts = [strings.raw[0]];
+
+ for (let i = 1; i < strings.length; i++) {
+ parts.push(String(args[i - 1]).replace(/[{}\\]/g, '\\$&'));
+ parts.push(String(strings.raw[i]));
+ }
+
+ return template(chalk, parts.join(''));
+}
+
+Object.defineProperties(Chalk.prototype, styles);
+
+module.exports = Chalk(); // eslint-disable-line new-cap
+module.exports.supportsColor = stdoutColor;
+module.exports.default = module.exports; // For TypeScript
diff --git a/chromium/third_party/node/node_modules/chalk/index.js.flow b/chromium/third_party/node/node_modules/chalk/index.js.flow
new file mode 100644
index 00000000000..622caaa2e80
--- /dev/null
+++ b/chromium/third_party/node/node_modules/chalk/index.js.flow
@@ -0,0 +1,93 @@
+// @flow strict
+
+type TemplateStringsArray = $ReadOnlyArray<string>;
+
+export type Level = $Values<{
+ None: 0,
+ Basic: 1,
+ Ansi256: 2,
+ TrueColor: 3
+}>;
+
+export type ChalkOptions = {|
+ enabled?: boolean,
+ level?: Level
+|};
+
+export type ColorSupport = {|
+ level: Level,
+ hasBasic: boolean,
+ has256: boolean,
+ has16m: boolean
+|};
+
+export interface Chalk {
+ (...text: string[]): string,
+ (text: TemplateStringsArray, ...placeholders: string[]): string,
+ constructor(options?: ChalkOptions): Chalk,
+ enabled: boolean,
+ level: Level,
+ rgb(r: number, g: number, b: number): Chalk,
+ hsl(h: number, s: number, l: number): Chalk,
+ hsv(h: number, s: number, v: number): Chalk,
+ hwb(h: number, w: number, b: number): Chalk,
+ bgHex(color: string): Chalk,
+ bgKeyword(color: string): Chalk,
+ bgRgb(r: number, g: number, b: number): Chalk,
+ bgHsl(h: number, s: number, l: number): Chalk,
+ bgHsv(h: number, s: number, v: number): Chalk,
+ bgHwb(h: number, w: number, b: number): Chalk,
+ hex(color: string): Chalk,
+ keyword(color: string): Chalk,
+
+ +reset: Chalk,
+ +bold: Chalk,
+ +dim: Chalk,
+ +italic: Chalk,
+ +underline: Chalk,
+ +inverse: Chalk,
+ +hidden: Chalk,
+ +strikethrough: Chalk,
+
+ +visible: Chalk,
+
+ +black: Chalk,
+ +red: Chalk,
+ +green: Chalk,
+ +yellow: Chalk,
+ +blue: Chalk,
+ +magenta: Chalk,
+ +cyan: Chalk,
+ +white: Chalk,
+ +gray: Chalk,
+ +grey: Chalk,
+ +blackBright: Chalk,
+ +redBright: Chalk,
+ +greenBright: Chalk,
+ +yellowBright: Chalk,
+ +blueBright: Chalk,
+ +magentaBright: Chalk,
+ +cyanBright: Chalk,
+ +whiteBright: Chalk,
+
+ +bgBlack: Chalk,
+ +bgRed: Chalk,
+ +bgGreen: Chalk,
+ +bgYellow: Chalk,
+ +bgBlue: Chalk,
+ +bgMagenta: Chalk,
+ +bgCyan: Chalk,
+ +bgWhite: Chalk,
+ +bgBlackBright: Chalk,
+ +bgRedBright: Chalk,
+ +bgGreenBright: Chalk,
+ +bgYellowBright: Chalk,
+ +bgBlueBright: Chalk,
+ +bgMagentaBright: Chalk,
+ +bgCyanBright: Chalk,
+ +bgWhiteBrigh: Chalk,
+
+ supportsColor: ColorSupport
+};
+
+declare module.exports: Chalk;
diff --git a/chromium/third_party/node/node_modules/chalk/license b/chromium/third_party/node/node_modules/chalk/license
new file mode 100644
index 00000000000..e7af2f77107
--- /dev/null
+++ b/chromium/third_party/node/node_modules/chalk/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/chromium/third_party/node/node_modules/chalk/package.json b/chromium/third_party/node/node_modules/chalk/package.json
new file mode 100644
index 00000000000..bc324685a76
--- /dev/null
+++ b/chromium/third_party/node/node_modules/chalk/package.json
@@ -0,0 +1,71 @@
+{
+ "name": "chalk",
+ "version": "2.4.2",
+ "description": "Terminal string styling done right",
+ "license": "MIT",
+ "repository": "chalk/chalk",
+ "engines": {
+ "node": ">=4"
+ },
+ "scripts": {
+ "test": "xo && tsc --project types && flow --max-warnings=0 && nyc ava",
+ "bench": "matcha benchmark.js",
+ "coveralls": "nyc report --reporter=text-lcov | coveralls"
+ },
+ "files": [
+ "index.js",
+ "templates.js",
+ "types/index.d.ts",
+ "index.js.flow"
+ ],
+ "keywords": [
+ "color",
+ "colour",
+ "colors",
+ "terminal",
+ "console",
+ "cli",
+ "string",
+ "str",
+ "ansi",
+ "style",
+ "styles",
+ "tty",
+ "formatting",
+ "rgb",
+ "256",
+ "shell",
+ "xterm",
+ "log",
+ "logging",
+ "command-line",
+ "text"
+ ],
+ "dependencies": {
+ "ansi-styles": "^3.2.1",
+ "escape-string-regexp": "^1.0.5",
+ "supports-color": "^5.3.0"
+ },
+ "devDependencies": {
+ "ava": "*",
+ "coveralls": "^3.0.0",
+ "execa": "^0.9.0",
+ "flow-bin": "^0.68.0",
+ "import-fresh": "^2.0.0",
+ "matcha": "^0.7.0",
+ "nyc": "^11.0.2",
+ "resolve-from": "^4.0.0",
+ "typescript": "^2.5.3",
+ "xo": "*"
+ },
+ "types": "types/index.d.ts",
+ "xo": {
+ "envs": [
+ "node",
+ "mocha"
+ ],
+ "ignores": [
+ "test/_flow.js"
+ ]
+ }
+}
diff --git a/chromium/third_party/node/node_modules/chalk/templates.js b/chromium/third_party/node/node_modules/chalk/templates.js
new file mode 100644
index 00000000000..dbdf9b22112
--- /dev/null
+++ b/chromium/third_party/node/node_modules/chalk/templates.js
@@ -0,0 +1,128 @@
+'use strict';
+const TEMPLATE_REGEX = /(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
+const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
+const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
+const ESCAPE_REGEX = /\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi;
+
+const ESCAPES = new Map([
+ ['n', '\n'],
+ ['r', '\r'],
+ ['t', '\t'],
+ ['b', '\b'],
+ ['f', '\f'],
+ ['v', '\v'],
+ ['0', '\0'],
+ ['\\', '\\'],
+ ['e', '\u001B'],
+ ['a', '\u0007']
+]);
+
+function unescape(c) {
+ if ((c[0] === 'u' && c.length === 5) || (c[0] === 'x' && c.length === 3)) {
+ return String.fromCharCode(parseInt(c.slice(1), 16));
+ }
+
+ return ESCAPES.get(c) || c;
+}
+
+function parseArguments(name, args) {
+ const results = [];
+ const chunks = args.trim().split(/\s*,\s*/g);
+ let matches;
+
+ for (const chunk of chunks) {
+ if (!isNaN(chunk)) {
+ results.push(Number(chunk));
+ } else if ((matches = chunk.match(STRING_REGEX))) {
+ results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, chr) => escape ? unescape(escape) : chr));
+ } else {
+ throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
+ }
+ }
+
+ return results;
+}
+
+function parseStyle(style) {
+ STYLE_REGEX.lastIndex = 0;
+
+ const results = [];
+ let matches;
+
+ while ((matches = STYLE_REGEX.exec(style)) !== null) {
+ const name = matches[1];
+
+ if (matches[2]) {
+ const args = parseArguments(name, matches[2]);
+ results.push([name].concat(args));
+ } else {
+ results.push([name]);
+ }
+ }
+
+ return results;
+}
+
+function buildStyle(chalk, styles) {
+ const enabled = {};
+
+ for (const layer of styles) {
+ for (const style of layer.styles) {
+ enabled[style[0]] = layer.inverse ? null : style.slice(1);
+ }
+ }
+
+ let current = chalk;
+ for (const styleName of Object.keys(enabled)) {
+ if (Array.isArray(enabled[styleName])) {
+ if (!(styleName in current)) {
+ throw new Error(`Unknown Chalk style: ${styleName}`);
+ }
+
+ if (enabled[styleName].length > 0) {
+ current = current[styleName].apply(current, enabled[styleName]);
+ } else {
+ current = current[styleName];
+ }
+ }
+ }
+
+ return current;
+}
+
+module.exports = (chalk, tmp) => {
+ const styles = [];
+ const chunks = [];
+ let chunk = [];
+
+ // eslint-disable-next-line max-params
+ tmp.replace(TEMPLATE_REGEX, (m, escapeChar, inverse, style, close, chr) => {
+ if (escapeChar) {
+ chunk.push(unescape(escapeChar));
+ } else if (style) {
+ const str = chunk.join('');
+ chunk = [];
+ chunks.push(styles.length === 0 ? str : buildStyle(chalk, styles)(str));
+ styles.push({inverse, styles: parseStyle(style)});
+ } else if (close) {
+ if (styles.length === 0) {
+ throw new Error('Found extraneous } in Chalk template literal');
+ }
+
+ chunks.push(buildStyle(chalk, styles)(chunk.join('')));
+ chunk = [];
+ styles.pop();
+ } else {
+ chunk.push(chr);
+ }
+ });
+
+ chunks.push(chunk.join(''));
+
+ if (styles.length > 0) {
+ const errMsg = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`;
+ throw new Error(errMsg);
+ }
+
+ return chunks.join('');
+};
diff --git a/chromium/third_party/node/node_modules/color-convert/LICENSE b/chromium/third_party/node/node_modules/color-convert/LICENSE
new file mode 100644
index 00000000000..5b4c386f926
--- /dev/null
+++ b/chromium/third_party/node/node_modules/color-convert/LICENSE
@@ -0,0 +1,21 @@
+Copyright (c) 2011-2016 Heather Arthur <fayearthur@gmail.com>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/chromium/third_party/node/node_modules/color-convert/conversions.js b/chromium/third_party/node/node_modules/color-convert/conversions.js
new file mode 100644
index 00000000000..32172007ec0
--- /dev/null
+++ b/chromium/third_party/node/node_modules/color-convert/conversions.js
@@ -0,0 +1,868 @@
+/* MIT license */
+var cssKeywords = require('color-name');
+
+// NOTE: conversions should only return primitive values (i.e. arrays, or
+// values that give correct `typeof` results).
+// do not use box values types (i.e. Number(), String(), etc.)
+
+var reverseKeywords = {};
+for (var key in cssKeywords) {
+ if (cssKeywords.hasOwnProperty(key)) {
+ reverseKeywords[cssKeywords[key]] = key;
+ }
+}
+
+var convert = module.exports = {
+ rgb: {channels: 3, labels: 'rgb'},
+ hsl: {channels: 3, labels: 'hsl'},
+ hsv: {channels: 3, labels: 'hsv'},
+ hwb: {channels: 3, labels: 'hwb'},
+ cmyk: {channels: 4, labels: 'cmyk'},
+ xyz: {channels: 3, labels: 'xyz'},
+ lab: {channels: 3, labels: 'lab'},
+ lch: {channels: 3, labels: 'lch'},
+ hex: {channels: 1, labels: ['hex']},
+ keyword: {channels: 1, labels: ['keyword']},
+ ansi16: {channels: 1, labels: ['ansi16']},
+ ansi256: {channels: 1, labels: ['ansi256']},
+ hcg: {channels: 3, labels: ['h', 'c', 'g']},
+ apple: {channels: 3, labels: ['r16', 'g16', 'b16']},
+ gray: {channels: 1, labels: ['gray']}
+};
+
+// hide .channels and .labels properties
+for (var model in convert) {
+ if (convert.hasOwnProperty(model)) {
+ if (!('channels' in convert[model])) {
+ throw new Error('missing channels property: ' + model);
+ }
+
+ if (!('labels' in convert[model])) {
+ throw new Error('missing channel labels property: ' + model);
+ }
+
+ if (convert[model].labels.length !== convert[model].channels) {
+ throw new Error('channel and label counts mismatch: ' + model);
+ }
+
+ var channels = convert[model].channels;
+ var labels = convert[model].labels;
+ delete convert[model].channels;
+ delete convert[model].labels;
+ Object.defineProperty(convert[model], 'channels', {value: channels});
+ Object.defineProperty(convert[model], 'labels', {value: labels});
+ }
+}
+
+convert.rgb.hsl = function (rgb) {
+ var r = rgb[0] / 255;
+ var g = rgb[1] / 255;
+ var b = rgb[2] / 255;
+ var min = Math.min(r, g, b);
+ var max = Math.max(r, g, b);
+ var delta = max - min;
+ var h;
+ var s;
+ var l;
+
+ if (max === min) {
+ h = 0;
+ } else if (r === max) {
+ h = (g - b) / delta;
+ } else if (g === max) {
+ h = 2 + (b - r) / delta;
+ } else if (b === max) {
+ h = 4 + (r - g) / delta;
+ }
+
+ h = Math.min(h * 60, 360);
+
+ if (h < 0) {
+ h += 360;
+ }
+
+ l = (min + max) / 2;
+
+ if (max === min) {
+ s = 0;
+ } else if (l <= 0.5) {
+ s = delta / (max + min);
+ } else {
+ s = delta / (2 - max - min);
+ }
+
+ return [h, s * 100, l * 100];
+};
+
+convert.rgb.hsv = function (rgb) {
+ var rdif;
+ var gdif;
+ var bdif;
+ var h;
+ var s;
+
+ var r = rgb[0] / 255;
+ var g = rgb[1] / 255;
+ var b = rgb[2] / 255;
+ var v = Math.max(r, g, b);
+ var diff = v - Math.min(r, g, b);
+ var diffc = function (c) {
+ return (v - c) / 6 / diff + 1 / 2;
+ };
+
+ if (diff === 0) {
+ h = s = 0;
+ } else {
+ s = diff / v;
+ rdif = diffc(r);
+ gdif = diffc(g);
+ bdif = diffc(b);
+
+ if (r === v) {
+ h = bdif - gdif;
+ } else if (g === v) {
+ h = (1 / 3) + rdif - bdif;
+ } else if (b === v) {
+ h = (2 / 3) + gdif - rdif;
+ }
+ if (h < 0) {
+ h += 1;
+ } else if (h > 1) {
+ h -= 1;
+ }
+ }
+
+ return [
+ h * 360,
+ s * 100,
+ v * 100
+ ];
+};
+
+convert.rgb.hwb = function (rgb) {
+ var r = rgb[0];
+ var g = rgb[1];
+ var b = rgb[2];
+ var h = convert.rgb.hsl(rgb)[0];
+ var w = 1 / 255 * Math.min(r, Math.min(g, b));
+
+ b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
+
+ return [h, w * 100, b * 100];
+};
+
+convert.rgb.cmyk = function (rgb) {
+ var r = rgb[0] / 255;
+ var g = rgb[1] / 255;
+ var b = rgb[2] / 255;
+ var c;
+ var m;
+ var y;
+ var k;
+
+ k = Math.min(1 - r, 1 - g, 1 - b);
+ c = (1 - r - k) / (1 - k) || 0;
+ m = (1 - g - k) / (1 - k) || 0;
+ y = (1 - b - k) / (1 - k) || 0;
+
+ return [c * 100, m * 100, y * 100, k * 100];
+};
+
+/**
+ * See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance
+ * */
+function comparativeDistance(x, y) {
+ return (
+ Math.pow(x[0] - y[0], 2) +
+ Math.pow(x[1] - y[1], 2) +
+ Math.pow(x[2] - y[2], 2)
+ );
+}
+
+convert.rgb.keyword = function (rgb) {
+ var reversed = reverseKeywords[rgb];
+ if (reversed) {
+ return reversed;
+ }
+
+ var currentClosestDistance = Infinity;
+ var currentClosestKeyword;
+
+ for (var keyword in cssKeywords) {
+ if (cssKeywords.hasOwnProperty(keyword)) {
+ var value = cssKeywords[keyword];
+
+ // Compute comparative distance
+ var distance = comparativeDistance(rgb, value);
+
+ // Check if its less, if so set as closest
+ if (distance < currentClosestDistance) {
+ currentClosestDistance = distance;
+ currentClosestKeyword = keyword;
+ }
+ }
+ }
+
+ return currentClosestKeyword;
+};
+
+convert.keyword.rgb = function (keyword) {
+ return cssKeywords[keyword];
+};
+
+convert.rgb.xyz = function (rgb) {
+ var r = rgb[0] / 255;
+ var g = rgb[1] / 255;
+ var b = rgb[2] / 255;
+
+ // assume sRGB
+ r = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92);
+ g = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92);
+ b = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92);
+
+ var x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);
+ var y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);
+ var z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);
+
+ return [x * 100, y * 100, z * 100];
+};
+
+convert.rgb.lab = function (rgb) {
+ var xyz = convert.rgb.xyz(rgb);
+ var x = xyz[0];
+ var y = xyz[1];
+ var z = xyz[2];
+ var l;
+ var a;
+ var b;
+
+ x /= 95.047;
+ y /= 100;
+ z /= 108.883;
+
+ x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);
+ y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);
+ z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);
+
+ l = (116 * y) - 16;
+ a = 500 * (x - y);
+ b = 200 * (y - z);
+
+ return [l, a, b];
+};
+
+convert.hsl.rgb = function (hsl) {
+ var h = hsl[0] / 360;
+ var s = hsl[1] / 100;
+ var l = hsl[2] / 100;
+ var t1;
+ var t2;
+ var t3;
+ var rgb;
+ var val;
+
+ if (s === 0) {
+ val = l * 255;
+ return [val, val, val];
+ }
+
+ if (l < 0.5) {
+ t2 = l * (1 + s);
+ } else {
+ t2 = l + s - l * s;
+ }
+
+ t1 = 2 * l - t2;
+
+ rgb = [0, 0, 0];
+ for (var i = 0; i < 3; i++) {
+ t3 = h + 1 / 3 * -(i - 1);
+ if (t3 < 0) {
+ t3++;
+ }
+ if (t3 > 1) {
+ t3--;
+ }
+
+ if (6 * t3 < 1) {
+ val = t1 + (t2 - t1) * 6 * t3;
+ } else if (2 * t3 < 1) {
+ val = t2;
+ } else if (3 * t3 < 2) {
+ val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
+ } else {
+ val = t1;
+ }
+
+ rgb[i] = val * 255;
+ }
+
+ return rgb;
+};
+
+convert.hsl.hsv = function (hsl) {
+ var h = hsl[0];
+ var s = hsl[1] / 100;
+ var l = hsl[2] / 100;
+ var smin = s;
+ var lmin = Math.max(l, 0.01);
+ var sv;
+ var v;
+
+ l *= 2;
+ s *= (l <= 1) ? l : 2 - l;
+ smin *= lmin <= 1 ? lmin : 2 - lmin;
+ v = (l + s) / 2;
+ sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);
+
+ return [h, sv * 100, v * 100];
+};
+
+convert.hsv.rgb = function (hsv) {
+ var h = hsv[0] / 60;
+ var s = hsv[1] / 100;
+ var v = hsv[2] / 100;
+ var hi = Math.floor(h) % 6;
+
+ var f = h - Math.floor(h);
+ var p = 255 * v * (1 - s);
+ var q = 255 * v * (1 - (s * f));
+ var t = 255 * v * (1 - (s * (1 - f)));
+ v *= 255;
+
+ switch (hi) {
+ case 0:
+ return [v, t, p];
+ case 1:
+ return [q, v, p];
+ case 2:
+ return [p, v, t];
+ case 3:
+ return [p, q, v];
+ case 4:
+ return [t, p, v];
+ case 5:
+ return [v, p, q];
+ }
+};
+
+convert.hsv.hsl = function (hsv) {
+ var h = hsv[0];
+ var s = hsv[1] / 100;
+ var v = hsv[2] / 100;
+ var vmin = Math.max(v, 0.01);
+ var lmin;
+ var sl;
+ var l;
+
+ l = (2 - s) * v;
+ lmin = (2 - s) * vmin;
+ sl = s * vmin;
+ sl /= (lmin <= 1) ? lmin : 2 - lmin;
+ sl = sl || 0;
+ l /= 2;
+
+ return [h, sl * 100, l * 100];
+};
+
+// http://dev.w3.org/csswg/css-color/#hwb-to-rgb
+convert.hwb.rgb = function (hwb) {
+ var h = hwb[0] / 360;
+ var wh = hwb[1] / 100;
+ var bl = hwb[2] / 100;
+ var ratio = wh + bl;
+ var i;
+ var v;
+ var f;
+ var n;
+
+ // wh + bl cant be > 1
+ if (ratio > 1) {
+ wh /= ratio;
+ bl /= ratio;
+ }
+
+ i = Math.floor(6 * h);
+ v = 1 - bl;
+ f = 6 * h - i;
+
+ if ((i & 0x01) !== 0) {
+ f = 1 - f;
+ }
+
+ n = wh + f * (v - wh); // linear interpolation
+
+ var r;
+ var g;
+ var b;
+ switch (i) {
+ default:
+ case 6:
+ case 0: r = v; g = n; b = wh; break;
+ case 1: r = n; g = v; b = wh; break;
+ case 2: r = wh; g = v; b = n; break;
+ case 3: r = wh; g = n; b = v; break;
+ case 4: r = n; g = wh; b = v; break;
+ case 5: r = v; g = wh; b = n; break;
+ }
+
+ return [r * 255, g * 255, b * 255];
+};
+
+convert.cmyk.rgb = function (cmyk) {
+ var c = cmyk[0] / 100;
+ var m = cmyk[1] / 100;
+ var y = cmyk[2] / 100;
+ var k = cmyk[3] / 100;
+ var r;
+ var g;
+ var b;
+
+ r = 1 - Math.min(1, c * (1 - k) + k);
+ g = 1 - Math.min(1, m * (1 - k) + k);
+ b = 1 - Math.min(1, y * (1 - k) + k);
+
+ return [r * 255, g * 255, b * 255];
+};
+
+convert.xyz.rgb = function (xyz) {
+ var x = xyz[0] / 100;
+ var y = xyz[1] / 100;
+ var z = xyz[2] / 100;
+ var r;
+ var g;
+ var b;
+
+ r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);
+ g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);
+ b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);
+
+ // assume sRGB
+ r = r > 0.0031308
+ ? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055)
+ : r * 12.92;
+
+ g = g > 0.0031308
+ ? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055)
+ : g * 12.92;
+
+ b = b > 0.0031308
+ ? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055)
+ : b * 12.92;
+
+ r = Math.min(Math.max(0, r), 1);
+ g = Math.min(Math.max(0, g), 1);
+ b = Math.min(Math.max(0, b), 1);
+
+ return [r * 255, g * 255, b * 255];
+};
+
+convert.xyz.lab = function (xyz) {
+ var x = xyz[0];
+ var y = xyz[1];
+ var z = xyz[2];
+ var l;
+ var a;
+ var b;
+
+ x /= 95.047;
+ y /= 100;
+ z /= 108.883;
+
+ x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);
+ y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);
+ z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);
+
+ l = (116 * y) - 16;
+ a = 500 * (x - y);
+ b = 200 * (y - z);
+
+ return [l, a, b];
+};
+
+convert.lab.xyz = function (lab) {
+ var l = lab[0];
+ var a = lab[1];
+ var b = lab[2];
+ var x;
+ var y;
+ var z;
+
+ y = (l + 16) / 116;
+ x = a / 500 + y;
+ z = y - b / 200;
+
+ var y2 = Math.pow(y, 3);
+ var x2 = Math.pow(x, 3);
+ var z2 = Math.pow(z, 3);
+ y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
+ x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
+ z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
+
+ x *= 95.047;
+ y *= 100;
+ z *= 108.883;
+
+ return [x, y, z];
+};
+
+convert.lab.lch = function (lab) {
+ var l = lab[0];
+ var a = lab[1];
+ var b = lab[2];
+ var hr;
+ var h;
+ var c;
+
+ hr = Math.atan2(b, a);
+ h = hr * 360 / 2 / Math.PI;
+
+ if (h < 0) {
+ h += 360;
+ }
+
+ c = Math.sqrt(a * a + b * b);
+
+ return [l, c, h];
+};
+
+convert.lch.lab = function (lch) {
+ var l = lch[0];
+ var c = lch[1];
+ var h = lch[2];
+ var a;
+ var b;
+ var hr;
+
+ hr = h / 360 * 2 * Math.PI;
+ a = c * Math.cos(hr);
+ b = c * Math.sin(hr);
+
+ return [l, a, b];
+};
+
+convert.rgb.ansi16 = function (args) {
+ var r = args[0];
+ var g = args[1];
+ var b = args[2];
+ var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2]; // hsv -> ansi16 optimization
+
+ value = Math.round(value / 50);
+
+ if (value === 0) {
+ return 30;
+ }
+
+ var ansi = 30
+ + ((Math.round(b / 255) << 2)
+ | (Math.round(g / 255) << 1)
+ | Math.round(r / 255));
+
+ if (value === 2) {
+ ansi += 60;
+ }
+
+ return ansi;
+};
+
+convert.hsv.ansi16 = function (args) {
+ // optimization here; we already know the value and don't need to get
+ // it converted for us.
+ return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
+};
+
+convert.rgb.ansi256 = function (args) {
+ var r = args[0];
+ var g = args[1];
+ var b = args[2];
+
+ // we use the extended greyscale palette here, with the exception of
+ // black and white. normal palette only has 4 greyscale shades.
+ if (r === g && g === b) {
+ if (r < 8) {
+ return 16;
+ }
+
+ if (r > 248) {
+ return 231;
+ }
+
+ return Math.round(((r - 8) / 247) * 24) + 232;
+ }
+
+ var ansi = 16
+ + (36 * Math.round(r / 255 * 5))
+ + (6 * Math.round(g / 255 * 5))
+ + Math.round(b / 255 * 5);
+
+ return ansi;
+};
+
+convert.ansi16.rgb = function (args) {
+ var color = args % 10;
+
+ // handle greyscale
+ if (color === 0 || color === 7) {
+ if (args > 50) {
+ color += 3.5;
+ }
+
+ color = color / 10.5 * 255;
+
+ return [color, color, color];
+ }
+
+ var mult = (~~(args > 50) + 1) * 0.5;
+ var r = ((color & 1) * mult) * 255;
+ var g = (((color >> 1) & 1) * mult) * 255;
+ var b = (((color >> 2) & 1) * mult) * 255;
+
+ return [r, g, b];
+};
+
+convert.ansi256.rgb = function (args) {
+ // handle greyscale
+ if (args >= 232) {
+ var c = (args - 232) * 10 + 8;
+ return [c, c, c];
+ }
+
+ args -= 16;
+
+ var rem;
+ var r = Math.floor(args / 36) / 5 * 255;
+ var g = Math.floor((rem = args % 36) / 6) / 5 * 255;
+ var b = (rem % 6) / 5 * 255;
+
+ return [r, g, b];
+};
+
+convert.rgb.hex = function (args) {
+ var integer = ((Math.round(args[0]) & 0xFF) << 16)
+ + ((Math.round(args[1]) & 0xFF) << 8)
+ + (Math.round(args[2]) & 0xFF);
+
+ var string = integer.toString(16).toUpperCase();
+ return '000000'.substring(string.length) + string;
+};
+
+convert.hex.rgb = function (args) {
+ var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
+ if (!match) {
+ return [0, 0, 0];
+ }
+
+ var colorString = match[0];
+
+ if (match[0].length === 3) {
+ colorString = colorString.split('').map(function (char) {
+ return char + char;
+ }).join('');
+ }
+
+ var integer = parseInt(colorString, 16);
+ var r = (integer >> 16) & 0xFF;
+ var g = (integer >> 8) & 0xFF;
+ var b = integer & 0xFF;
+
+ return [r, g, b];
+};
+
+convert.rgb.hcg = function (rgb) {
+ var r = rgb[0] / 255;
+ var g = rgb[1] / 255;
+ var b = rgb[2] / 255;
+ var max = Math.max(Math.max(r, g), b);
+ var min = Math.min(Math.min(r, g), b);
+ var chroma = (max - min);
+ var grayscale;
+ var hue;
+
+ if (chroma < 1) {
+ grayscale = min / (1 - chroma);
+ } else {
+ grayscale = 0;
+ }
+
+ if (chroma <= 0) {
+ hue = 0;
+ } else
+ if (max === r) {
+ hue = ((g - b) / chroma) % 6;
+ } else
+ if (max === g) {
+ hue = 2 + (b - r) / chroma;
+ } else {
+ hue = 4 + (r - g) / chroma + 4;
+ }
+
+ hue /= 6;
+ hue %= 1;
+
+ return [hue * 360, chroma * 100, grayscale * 100];
+};
+
+convert.hsl.hcg = function (hsl) {
+ var s = hsl[1] / 100;
+ var l = hsl[2] / 100;
+ var c = 1;
+ var f = 0;
+
+ if (l < 0.5) {
+ c = 2.0 * s * l;
+ } else {
+ c = 2.0 * s * (1.0 - l);
+ }
+
+ if (c < 1.0) {
+ f = (l - 0.5 * c) / (1.0 - c);
+ }
+
+ return [hsl[0], c * 100, f * 100];
+};
+
+convert.hsv.hcg = function (hsv) {
+ var s = hsv[1] / 100;
+ var v = hsv[2] / 100;
+
+ var c = s * v;
+ var f = 0;
+
+ if (c < 1.0) {
+ f = (v - c) / (1 - c);
+ }
+
+ return [hsv[0], c * 100, f * 100];
+};
+
+convert.hcg.rgb = function (hcg) {
+ var h = hcg[0] / 360;
+ var c = hcg[1] / 100;
+ var g = hcg[2] / 100;
+
+ if (c === 0.0) {
+ return [g * 255, g * 255, g * 255];
+ }
+
+ var pure = [0, 0, 0];
+ var hi = (h % 1) * 6;
+ var v = hi % 1;
+ var w = 1 - v;
+ var mg = 0;
+
+ switch (Math.floor(hi)) {
+ case 0:
+ pure[0] = 1; pure[1] = v; pure[2] = 0; break;
+ case 1:
+ pure[0] = w; pure[1] = 1; pure[2] = 0; break;
+ case 2:
+ pure[0] = 0; pure[1] = 1; pure[2] = v; break;
+ case 3:
+ pure[0] = 0; pure[1] = w; pure[2] = 1; break;
+ case 4:
+ pure[0] = v; pure[1] = 0; pure[2] = 1; break;
+ default:
+ pure[0] = 1; pure[1] = 0; pure[2] = w;
+ }
+
+ mg = (1.0 - c) * g;
+
+ return [
+ (c * pure[0] + mg) * 255,
+ (c * pure[1] + mg) * 255,
+ (c * pure[2] + mg) * 255
+ ];
+};
+
+convert.hcg.hsv = function (hcg) {
+ var c = hcg[1] / 100;
+ var g = hcg[2] / 100;
+
+ var v = c + g * (1.0 - c);
+ var f = 0;
+
+ if (v > 0.0) {
+ f = c / v;
+ }
+
+ return [hcg[0], f * 100, v * 100];
+};
+
+convert.hcg.hsl = function (hcg) {
+ var c = hcg[1] / 100;
+ var g = hcg[2] / 100;
+
+ var l = g * (1.0 - c) + 0.5 * c;
+ var s = 0;
+
+ if (l > 0.0 && l < 0.5) {
+ s = c / (2 * l);
+ } else
+ if (l >= 0.5 && l < 1.0) {
+ s = c / (2 * (1 - l));
+ }
+
+ return [hcg[0], s * 100, l * 100];
+};
+
+convert.hcg.hwb = function (hcg) {
+ var c = hcg[1] / 100;
+ var g = hcg[2] / 100;
+ var v = c + g * (1.0 - c);
+ return [hcg[0], (v - c) * 100, (1 - v) * 100];
+};
+
+convert.hwb.hcg = function (hwb) {
+ var w = hwb[1] / 100;
+ var b = hwb[2] / 100;
+ var v = 1 - b;
+ var c = v - w;
+ var g = 0;
+
+ if (c < 1) {
+ g = (v - c) / (1 - c);
+ }
+
+ return [hwb[0], c * 100, g * 100];
+};
+
+convert.apple.rgb = function (apple) {
+ return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255];
+};
+
+convert.rgb.apple = function (rgb) {
+ return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535];
+};
+
+convert.gray.rgb = function (args) {
+ return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
+};
+
+convert.gray.hsl = convert.gray.hsv = function (args) {
+ return [0, 0, args[0]];
+};
+
+convert.gray.hwb = function (gray) {
+ return [0, 100, gray[0]];
+};
+
+convert.gray.cmyk = function (gray) {
+ return [0, 0, 0, gray[0]];
+};
+
+convert.gray.lab = function (gray) {
+ return [gray[0], 0, 0];
+};
+
+convert.gray.hex = function (gray) {
+ var val = Math.round(gray[0] / 100 * 255) & 0xFF;
+ var integer = (val << 16) + (val << 8) + val;
+
+ var string = integer.toString(16).toUpperCase();
+ return '000000'.substring(string.length) + string;
+};
+
+convert.rgb.gray = function (rgb) {
+ var val = (rgb[0] + rgb[1] + rgb[2]) / 3;
+ return [val / 255 * 100];
+};
diff --git a/chromium/third_party/node/node_modules/color-convert/index.js b/chromium/third_party/node/node_modules/color-convert/index.js
new file mode 100644
index 00000000000..e65b5d775da
--- /dev/null
+++ b/chromium/third_party/node/node_modules/color-convert/index.js
@@ -0,0 +1,78 @@
+var conversions = require('./conversions');
+var route = require('./route');
+
+var convert = {};
+
+var models = Object.keys(conversions);
+
+function wrapRaw(fn) {
+ var wrappedFn = function (args) {
+ if (args === undefined || args === null) {
+ return args;
+ }
+
+ if (arguments.length > 1) {
+ args = Array.prototype.slice.call(arguments);
+ }
+
+ return fn(args);
+ };
+
+ // preserve .conversion property if there is one
+ if ('conversion' in fn) {
+ wrappedFn.conversion = fn.conversion;
+ }
+
+ return wrappedFn;
+}
+
+function wrapRounded(fn) {
+ var wrappedFn = function (args) {
+ if (args === undefined || args === null) {
+ return args;
+ }
+
+ if (arguments.length > 1) {
+ args = Array.prototype.slice.call(arguments);
+ }
+
+ var result = fn(args);
+
+ // we're assuming the result is an array here.
+ // see notice in conversions.js; don't use box types
+ // in conversion functions.
+ if (typeof result === 'object') {
+ for (var len = result.length, i = 0; i < len; i++) {
+ result[i] = Math.round(result[i]);
+ }
+ }
+
+ return result;
+ };
+
+ // preserve .conversion property if there is one
+ if ('conversion' in fn) {
+ wrappedFn.conversion = fn.conversion;
+ }
+
+ return wrappedFn;
+}
+
+models.forEach(function (fromModel) {
+ convert[fromModel] = {};
+
+ Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});
+ Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});
+
+ var routes = route(fromModel);
+ var routeModels = Object.keys(routes);
+
+ routeModels.forEach(function (toModel) {
+ var fn = routes[toModel];
+
+ convert[fromModel][toModel] = wrapRounded(fn);
+ convert[fromModel][toModel].raw = wrapRaw(fn);
+ });
+});
+
+module.exports = convert;
diff --git a/chromium/third_party/node/node_modules/color-convert/package.json b/chromium/third_party/node/node_modules/color-convert/package.json
new file mode 100644
index 00000000000..dfbc471407f
--- /dev/null
+++ b/chromium/third_party/node/node_modules/color-convert/package.json
@@ -0,0 +1,46 @@
+{
+ "name": "color-convert",
+ "description": "Plain color conversion functions",
+ "version": "1.9.3",
+ "author": "Heather Arthur <fayearthur@gmail.com>",
+ "license": "MIT",
+ "repository": "Qix-/color-convert",
+ "scripts": {
+ "pretest": "xo",
+ "test": "node test/basic.js"
+ },
+ "keywords": [
+ "color",
+ "colour",
+ "convert",
+ "converter",
+ "conversion",
+ "rgb",
+ "hsl",
+ "hsv",
+ "hwb",
+ "cmyk",
+ "ansi",
+ "ansi16"
+ ],
+ "files": [
+ "index.js",
+ "conversions.js",
+ "css-keywords.js",
+ "route.js"
+ ],
+ "xo": {
+ "rules": {
+ "default-case": 0,
+ "no-inline-comments": 0,
+ "operator-linebreak": 0
+ }
+ },
+ "devDependencies": {
+ "chalk": "1.1.1",
+ "xo": "0.11.2"
+ },
+ "dependencies": {
+ "color-name": "1.1.3"
+ }
+}
diff --git a/chromium/third_party/node/node_modules/color-convert/route.js b/chromium/third_party/node/node_modules/color-convert/route.js
new file mode 100644
index 00000000000..0a1fdea689e
--- /dev/null
+++ b/chromium/third_party/node/node_modules/color-convert/route.js
@@ -0,0 +1,97 @@
+var conversions = require('./conversions');
+
+/*
+ this function routes a model to all other models.
+
+ all functions that are routed have a property `.conversion` attached
+ to the returned synthetic function. This property is an array
+ of strings, each with the steps in between the 'from' and 'to'
+ color models (inclusive).
+
+ conversions that are not possible simply are not included.
+*/
+
+function buildGraph() {
+ var graph = {};
+ // https://jsperf.com/object-keys-vs-for-in-with-closure/3
+ var models = Object.keys(conversions);
+
+ for (var len = models.length, i = 0; i < len; i++) {
+ graph[models[i]] = {
+ // http://jsperf.com/1-vs-infinity
+ // micro-opt, but this is simple.
+ distance: -1,
+ parent: null
+ };
+ }
+
+ return graph;
+}
+
+// https://en.wikipedia.org/wiki/Breadth-first_search
+function deriveBFS(fromModel) {
+ var graph = buildGraph();
+ var queue = [fromModel]; // unshift -> queue -> pop
+
+ graph[fromModel].distance = 0;
+
+ while (queue.length) {
+ var current = queue.pop();
+ var adjacents = Object.keys(conversions[current]);
+
+ for (var len = adjacents.length, i = 0; i < len; i++) {
+ var adjacent = adjacents[i];
+ var node = graph[adjacent];
+
+ if (node.distance === -1) {
+ node.distance = graph[current].distance + 1;
+ node.parent = current;
+ queue.unshift(adjacent);
+ }
+ }
+ }
+
+ return graph;
+}
+
+function link(from, to) {
+ return function (args) {
+ return to(from(args));
+ };
+}
+
+function wrapConversion(toModel, graph) {
+ var path = [graph[toModel].parent, toModel];
+ var fn = conversions[graph[toModel].parent][toModel];
+
+ var cur = graph[toModel].parent;
+ while (graph[cur].parent) {
+ path.unshift(graph[cur].parent);
+ fn = link(conversions[graph[cur].parent][cur], fn);
+ cur = graph[cur].parent;
+ }
+
+ fn.conversion = path;
+ return fn;
+}
+
+module.exports = function (fromModel) {
+ var graph = deriveBFS(fromModel);
+ var conversion = {};
+
+ var models = Object.keys(graph);
+ for (var len = models.length, i = 0; i < len; i++) {
+ var toModel = models[i];
+ var node = graph[toModel];
+
+ if (node.parent === null) {
+ // no possible conversion, or this node is the source model.
+ continue;
+ }
+
+ conversion[toModel] = wrapConversion(toModel, graph);
+ }
+
+ return conversion;
+};
+
diff --git a/chromium/third_party/node/node_modules/color-name/LICENSE b/chromium/third_party/node/node_modules/color-name/LICENSE
new file mode 100644
index 00000000000..4d9802a89e2
--- /dev/null
+++ b/chromium/third_party/node/node_modules/color-name/LICENSE
@@ -0,0 +1,8 @@
+The MIT License (MIT)
+Copyright (c) 2015 Dmitry Ivanov
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/color-name/index.js b/chromium/third_party/node/node_modules/color-name/index.js
new file mode 100644
index 00000000000..e42aa68a542
--- /dev/null
+++ b/chromium/third_party/node/node_modules/color-name/index.js
@@ -0,0 +1,152 @@
+'use strict'
+
+module.exports = {
+ "aliceblue": [240, 248, 255],
+ "antiquewhite": [250, 235, 215],
+ "aqua": [0, 255, 255],
+ "aquamarine": [127, 255, 212],
+ "azure": [240, 255, 255],
+ "beige": [245, 245, 220],
+ "bisque": [255, 228, 196],
+ "black": [0, 0, 0],
+ "blanchedalmond": [255, 235, 205],
+ "blue": [0, 0, 255],
+ "blueviolet": [138, 43, 226],
+ "brown": [165, 42, 42],
+ "burlywood": [222, 184, 135],
+ "cadetblue": [95, 158, 160],
+ "chartreuse": [127, 255, 0],
+ "chocolate": [210, 105, 30],
+ "coral": [255, 127, 80],
+ "cornflowerblue": [100, 149, 237],
+ "cornsilk": [255, 248, 220],
+ "crimson": [220, 20, 60],
+ "cyan": [0, 255, 255],
+ "darkblue": [0, 0, 139],
+ "darkcyan": [0, 139, 139],
+ "darkgoldenrod": [184, 134, 11],
+ "darkgray": [169, 169, 169],
+ "darkgreen": [0, 100, 0],
+ "darkgrey": [169, 169, 169],
+ "darkkhaki": [189, 183, 107],
+ "darkmagenta": [139, 0, 139],
+ "darkolivegreen": [85, 107, 47],
+ "darkorange": [255, 140, 0],
+ "darkorchid": [153, 50, 204],
+ "darkred": [139, 0, 0],
+ "darksalmon": [233, 150, 122],
+ "darkseagreen": [143, 188, 143],
+ "darkslateblue": [72, 61, 139],
+ "darkslategray": [47, 79, 79],
+ "darkslategrey": [47, 79, 79],
+ "darkturquoise": [0, 206, 209],
+ "darkviolet": [148, 0, 211],
+ "deeppink": [255, 20, 147],
+ "deepskyblue": [0, 191, 255],
+ "dimgray": [105, 105, 105],
+ "dimgrey": [105, 105, 105],
+ "dodgerblue": [30, 144, 255],
+ "firebrick": [178, 34, 34],
+ "floralwhite": [255, 250, 240],
+ "forestgreen": [34, 139, 34],
+ "fuchsia": [255, 0, 255],
+ "gainsboro": [220, 220, 220],
+ "ghostwhite": [248, 248, 255],
+ "gold": [255, 215, 0],
+ "goldenrod": [218, 165, 32],
+ "gray": [128, 128, 128],
+ "green": [0, 128, 0],
+ "greenyellow": [173, 255, 47],
+ "grey": [128, 128, 128],
+ "honeydew": [240, 255, 240],
+ "hotpink": [255, 105, 180],
+ "indianred": [205, 92, 92],
+ "indigo": [75, 0, 130],
+ "ivory": [255, 255, 240],
+ "khaki": [240, 230, 140],
+ "lavender": [230, 230, 250],
+ "lavenderblush": [255, 240, 245],
+ "lawngreen": [124, 252, 0],
+ "lemonchiffon": [255, 250, 205],
+ "lightblue": [173, 216, 230],
+ "lightcoral": [240, 128, 128],
+ "lightcyan": [224, 255, 255],
+ "lightgoldenrodyellow": [250, 250, 210],
+ "lightgray": [211, 211, 211],
+ "lightgreen": [144, 238, 144],
+ "lightgrey": [211, 211, 211],
+ "lightpink": [255, 182, 193],
+ "lightsalmon": [255, 160, 122],
+ "lightseagreen": [32, 178, 170],
+ "lightskyblue": [135, 206, 250],
+ "lightslategray": [119, 136, 153],
+ "lightslategrey": [119, 136, 153],
+ "lightsteelblue": [176, 196, 222],
+ "lightyellow": [255, 255, 224],
+ "lime": [0, 255, 0],
+ "limegreen": [50, 205, 50],
+ "linen": [250, 240, 230],
+ "magenta": [255, 0, 255],
+ "maroon": [128, 0, 0],
+ "mediumaquamarine": [102, 205, 170],
+ "mediumblue": [0, 0, 205],
+ "mediumorchid": [186, 85, 211],
+ "mediumpurple": [147, 112, 219],
+ "mediumseagreen": [60, 179, 113],
+ "mediumslateblue": [123, 104, 238],
+ "mediumspringgreen": [0, 250, 154],
+ "mediumturquoise": [72, 209, 204],
+ "mediumvioletred": [199, 21, 133],
+ "midnightblue": [25, 25, 112],
+ "mintcream": [245, 255, 250],
+ "mistyrose": [255, 228, 225],
+ "moccasin": [255, 228, 181],
+ "navajowhite": [255, 222, 173],
+ "navy": [0, 0, 128],
+ "oldlace": [253, 245, 230],
+ "olive": [128, 128, 0],
+ "olivedrab": [107, 142, 35],
+ "orange": [255, 165, 0],
+ "orangered": [255, 69, 0],
+ "orchid": [218, 112, 214],
+ "palegoldenrod": [238, 232, 170],
+ "palegreen": [152, 251, 152],
+ "paleturquoise": [175, 238, 238],
+ "palevioletred": [219, 112, 147],
+ "papayawhip": [255, 239, 213],
+ "peachpuff": [255, 218, 185],
+ "peru": [205, 133, 63],
+ "pink": [255, 192, 203],
+ "plum": [221, 160, 221],
+ "powderblue": [176, 224, 230],
+ "purple": [128, 0, 128],
+ "rebeccapurple": [102, 51, 153],
+ "red": [255, 0, 0],
+ "rosybrown": [188, 143, 143],
+ "royalblue": [65, 105, 225],
+ "saddlebrown": [139, 69, 19],
+ "salmon": [250, 128, 114],
+ "sandybrown": [244, 164, 96],
+ "seagreen": [46, 139, 87],
+ "seashell": [255, 245, 238],
+ "sienna": [160, 82, 45],
+ "silver": [192, 192, 192],
+ "skyblue": [135, 206, 235],
+ "slateblue": [106, 90, 205],
+ "slategray": [112, 128, 144],
+ "slategrey": [112, 128, 144],
+ "snow": [255, 250, 250],
+ "springgreen": [0, 255, 127],
+ "steelblue": [70, 130, 180],
+ "tan": [210, 180, 140],
+ "teal": [0, 128, 128],
+ "thistle": [216, 191, 216],
+ "tomato": [255, 99, 71],
+ "turquoise": [64, 224, 208],
+ "violet": [238, 130, 238],
+ "wheat": [245, 222, 179],
+ "white": [255, 255, 255],
+ "whitesmoke": [245, 245, 245],
+ "yellow": [255, 255, 0],
+ "yellowgreen": [154, 205, 50]
+};
diff --git a/chromium/third_party/node/node_modules/color-name/package.json b/chromium/third_party/node/node_modules/color-name/package.json
new file mode 100644
index 00000000000..d061123ef02
--- /dev/null
+++ b/chromium/third_party/node/node_modules/color-name/package.json
@@ -0,0 +1,25 @@
+{
+ "name": "color-name",
+ "version": "1.1.3",
+ "description": "A list of color names and its values",
+ "main": "index.js",
+ "scripts": {
+ "test": "node test.js"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git@github.com:dfcreative/color-name.git"
+ },
+ "keywords": [
+ "color-name",
+ "color",
+ "color-keyword",
+ "keyword"
+ ],
+ "author": "DY <dfcreative@gmail.com>",
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/dfcreative/color-name/issues"
+ },
+ "homepage": "https://github.com/dfcreative/color-name"
+}
diff --git a/chromium/third_party/node/node_modules/color-name/test.js b/chromium/third_party/node/node_modules/color-name/test.js
new file mode 100644
index 00000000000..7a08746215e
--- /dev/null
+++ b/chromium/third_party/node/node_modules/color-name/test.js
@@ -0,0 +1,7 @@
+'use strict'
+
+var names = require('./');
+var assert = require('assert');
+
+assert.deepEqual(names.red, [255,0,0]);
+assert.deepEqual(names.aliceblue, [240,248,255]);
diff --git a/chromium/third_party/node/node_modules/commander/LICENSE b/chromium/third_party/node/node_modules/commander/LICENSE
new file mode 100644
index 00000000000..10f997ab104
--- /dev/null
+++ b/chromium/third_party/node/node_modules/commander/LICENSE
@@ -0,0 +1,22 @@
+(The MIT License)
+
+Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/chromium/third_party/node/node_modules/commander/index.js b/chromium/third_party/node/node_modules/commander/index.js
new file mode 100644
index 00000000000..ec1d61d5872
--- /dev/null
+++ b/chromium/third_party/node/node_modules/commander/index.js
@@ -0,0 +1,1224 @@
+/**
+ * Module dependencies.
+ */
+
+var EventEmitter = require('events').EventEmitter;
+var spawn = require('child_process').spawn;
+var path = require('path');
+var dirname = path.dirname;
+var basename = path.basename;
+var fs = require('fs');
+
+/**
+ * Inherit `Command` from `EventEmitter.prototype`.
+ */
+
+require('util').inherits(Command, EventEmitter);
+
+/**
+ * Expose the root command.
+ */
+
+exports = module.exports = new Command();
+
+/**
+ * Expose `Command`.
+ */
+
+exports.Command = Command;
+
+/**
+ * Expose `Option`.
+ */
+
+exports.Option = Option;
+
+/**
+ * Initialize a new `Option` with the given `flags` and `description`.
+ *
+ * @param {String} flags
+ * @param {String} description
+ * @api public
+ */
+
+function Option(flags, description) {
+ this.flags = flags;
+ this.required = flags.indexOf('<') >= 0;
+ this.optional = flags.indexOf('[') >= 0;
+ this.bool = flags.indexOf('-no-') === -1;
+ flags = flags.split(/[ ,|]+/);
+ if (flags.length > 1 && !/^[[<]/.test(flags[1])) this.short = flags.shift();
+ this.long = flags.shift();
+ this.description = description || '';
+}
+
+/**
+ * Return option name.
+ *
+ * @return {String}
+ * @api private
+ */
+
+Option.prototype.name = function() {
+ return this.long
+ .replace('--', '')
+ .replace('no-', '');
+};
+
+/**
+ * Return option name, in a camelcase format that can be used
+ * as a object attribute key.
+ *
+ * @return {String}
+ * @api private
+ */
+
+Option.prototype.attributeName = function() {
+ return camelcase(this.name());
+};
+
+/**
+ * Check if `arg` matches the short or long flag.
+ *
+ * @param {String} arg
+ * @return {Boolean}
+ * @api private
+ */
+
+Option.prototype.is = function(arg) {
+ return this.short === arg || this.long === arg;
+};
+
+/**
+ * Initialize a new `Command`.
+ *
+ * @param {String} name
+ * @api public
+ */
+
+function Command(name) {
+ this.commands = [];
+ this.options = [];
+ this._execs = {};
+ this._allowUnknownOption = false;
+ this._args = [];
+ this._name = name || '';
+}
+
+/**
+ * Add command `name`.
+ *
+ * The `.action()` callback is invoked when the
+ * command `name` is specified via __ARGV__,
+ * and the remaining arguments are applied to the
+ * function for access.
+ *
+ * When the `name` is "*" an un-matched command
+ * will be passed as the first arg, followed by
+ * the rest of __ARGV__ remaining.
+ *
+ * Examples:
+ *
+ * program
+ * .version('0.0.1')
+ * .option('-C, --chdir <path>', 'change the working directory')
+ * .option('-c, --config <path>', 'set config path. defaults to ./deploy.conf')
+ * .option('-T, --no-tests', 'ignore test hook')
+ *
+ * program
+ * .command('setup')
+ * .description('run remote setup commands')
+ * .action(function() {
+ * console.log('setup');
+ * });
+ *
+ * program
+ * .command('exec <cmd>')
+ * .description('run the given remote command')
+ * .action(function(cmd) {
+ * console.log('exec "%s"', cmd);
+ * });
+ *
+ * program
+ * .command('teardown <dir> [otherDirs...]')
+ * .description('run teardown commands')
+ * .action(function(dir, otherDirs) {
+ * console.log('dir "%s"', dir);
+ * if (otherDirs) {
+ * otherDirs.forEach(function (oDir) {
+ * console.log('dir "%s"', oDir);
+ * });
+ * }
+ * });
+ *
+ * program
+ * .command('*')
+ * .description('deploy the given env')
+ * .action(function(env) {
+ * console.log('deploying "%s"', env);
+ * });
+ *
+ * program.parse(process.argv);
+ *
+ * @param {String} name
+ * @param {String} [desc] for git-style sub-commands
+ * @return {Command} the new command
+ * @api public
+ */
+
+Command.prototype.command = function(name, desc, opts) {
+ if (typeof desc === 'object' && desc !== null) {
+ opts = desc;
+ desc = null;
+ }
+ opts = opts || {};
+ var args = name.split(/ +/);
+ var cmd = new Command(args.shift());
+
+ if (desc) {
+ cmd.description(desc);
+ this.executables = true;
+ this._execs[cmd._name] = true;
+ if (opts.isDefault) this.defaultExecutable = cmd._name;
+ }
+ cmd._noHelp = !!opts.noHelp;
+ this.commands.push(cmd);
+ cmd.parseExpectedArgs(args);
+ cmd.parent = this;
+
+ if (desc) return this;
+ return cmd;
+};
+
+/**
+ * Define argument syntax for the top-level command.
+ *
+ * @api public
+ */
+
+Command.prototype.arguments = function(desc) {
+ return this.parseExpectedArgs(desc.split(/ +/));
+};
+
+/**
+ * Add an implicit `help [cmd]` subcommand
+ * which invokes `--help` for the given command.
+ *
+ * @api private
+ */
+
+Command.prototype.addImplicitHelpCommand = function() {
+ this.command('help [cmd]', 'display help for [cmd]');
+};
+
+/**
+ * Parse expected `args`.
+ *
+ * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`.
+ *
+ * @param {Array} args
+ * @return {Command} for chaining
+ * @api public
+ */
+
+Command.prototype.parseExpectedArgs = function(args) {
+ if (!args.length) return;
+ var self = this;
+ args.forEach(function(arg) {
+ var argDetails = {
+ required: false,
+ name: '',
+ variadic: false
+ };
+
+ switch (arg[0]) {
+ case '<':
+ argDetails.required = true;
+ argDetails.name = arg.slice(1, -1);
+ break;
+ case '[':
+ argDetails.name = arg.slice(1, -1);
+ break;
+ }
+
+ if (argDetails.name.length > 3 && argDetails.name.slice(-3) === '...') {
+ argDetails.variadic = true;
+ argDetails.name = argDetails.name.slice(0, -3);
+ }
+ if (argDetails.name) {
+ self._args.push(argDetails);
+ }
+ });
+ return this;
+};
+
+/**
+ * Register callback `fn` for the command.
+ *
+ * Examples:
+ *
+ * program
+ * .command('help')
+ * .description('display verbose help')
+ * .action(function() {
+ * // output help here
+ * });
+ *
+ * @param {Function} fn
+ * @return {Command} for chaining
+ * @api public
+ */
+
+Command.prototype.action = function(fn) {
+ var self = this;
+ var listener = function(args, unknown) {
+ // Parse any so-far unknown options
+ args = args || [];
+ unknown = unknown || [];
+
+ var parsed = self.parseOptions(unknown);
+
+ // Output help if necessary
+ outputHelpIfNecessary(self, parsed.unknown);
+
+ // If there are still any unknown options, then we simply
+ // die, unless someone asked for help, in which case we give it
+ // to them, and then we die.
+ if (parsed.unknown.length > 0) {
+ self.unknownOption(parsed.unknown[0]);
+ }
+
+ // Leftover arguments need to be pushed back. Fixes issue #56
+ if (parsed.args.length) args = parsed.args.concat(args);
+
+ self._args.forEach(function(arg, i) {
+ if (arg.required && args[i] == null) {
+ self.missingArgument(arg.name);
+ } else if (arg.variadic) {
+ if (i !== self._args.length - 1) {
+ self.variadicArgNotLast(arg.name);
+ }
+
+ args[i] = args.splice(i);
+ }
+ });
+
+ // Always append ourselves to the end of the arguments,
+ // to make sure we match the number of arguments the user
+ // expects
+ if (self._args.length) {
+ args[self._args.length] = self;
+ } else {
+ args.push(self);
+ }
+
+ fn.apply(self, args);
+ };
+ var parent = this.parent || this;
+ var name = parent === this ? '*' : this._name;
+ parent.on('command:' + name, listener);
+ if (this._alias) parent.on('command:' + this._alias, listener);
+ return this;
+};
+
+/**
+ * Define option with `flags`, `description` and optional
+ * coercion `fn`.
+ *
+ * The `flags` string should contain both the short and long flags,
+ * separated by comma, a pipe or space. The following are all valid
+ * all will output this way when `--help` is used.
+ *
+ * "-p, --pepper"
+ * "-p|--pepper"
+ * "-p --pepper"
+ *
+ * Examples:
+ *
+ * // simple boolean defaulting to false
+ * program.option('-p, --pepper', 'add pepper');
+ *
+ * --pepper
+ * program.pepper
+ * // => Boolean
+ *
+ * // simple boolean defaulting to true
+ * program.option('-C, --no-cheese', 'remove cheese');
+ *
+ * program.cheese
+ * // => true
+ *
+ * --no-cheese
+ * program.cheese
+ * // => false
+ *
+ * // required argument
+ * program.option('-C, --chdir <path>', 'change the working directory');
+ *
+ * --chdir /tmp
+ * program.chdir
+ * // => "/tmp"
+ *
+ * // optional argument
+ * program.option('-c, --cheese [type]', 'add cheese [marble]');
+ *
+ * @param {String} flags
+ * @param {String} description
+ * @param {Function|*} [fn] or default
+ * @param {*} [defaultValue]
+ * @return {Command} for chaining
+ * @api public
+ */
+
+Command.prototype.option = function(flags, description, fn, defaultValue) {
+ var self = this,
+ option = new Option(flags, description),
+ oname = option.name(),
+ name = option.attributeName();
+
+ // default as 3rd arg
+ if (typeof fn !== 'function') {
+ if (fn instanceof RegExp) {
+ var regex = fn;
+ fn = function(val, def) {
+ var m = regex.exec(val);
+ return m ? m[0] : def;
+ };
+ } else {
+ defaultValue = fn;
+ fn = null;
+ }
+ }
+
+ // preassign default value only for --no-*, [optional], or <required>
+ if (!option.bool || option.optional || option.required) {
+ // when --no-* we make sure default is true
+ if (!option.bool) defaultValue = true;
+ // preassign only if we have a default
+ if (defaultValue !== undefined) {
+ self[name] = defaultValue;
+ option.defaultValue = defaultValue;
+ }
+ }
+
+ // register the option
+ this.options.push(option);
+
+ // when it's passed assign the value
+ // and conditionally invoke the callback
+ this.on('option:' + oname, function(val) {
+ // coercion
+ if (val !== null && fn) {
+ val = fn(val, self[name] === undefined ? defaultValue : self[name]);
+ }
+
+ // unassigned or bool
+ if (typeof self[name] === 'boolean' || typeof self[name] === 'undefined') {
+ // if no value, bool true, and we have a default, then use it!
+ if (val == null) {
+ self[name] = option.bool
+ ? defaultValue || true
+ : false;
+ } else {
+ self[name] = val;
+ }
+ } else if (val !== null) {
+ // reassign
+ self[name] = val;
+ }
+ });
+
+ return this;
+};
+
+/**
+ * Allow unknown options on the command line.
+ *
+ * @param {Boolean} arg if `true` or omitted, no error will be thrown
+ * for unknown options.
+ * @api public
+ */
+Command.prototype.allowUnknownOption = function(arg) {
+ this._allowUnknownOption = arguments.length === 0 || arg;
+ return this;
+};
+
+/**
+ * Parse `argv`, settings options and invoking commands when defined.
+ *
+ * @param {Array} argv
+ * @return {Command} for chaining
+ * @api public
+ */
+
+Command.prototype.parse = function(argv) {
+ // implicit help
+ if (this.executables) this.addImplicitHelpCommand();
+
+ // store raw args
+ this.rawArgs = argv;
+
+ // guess name
+ this._name = this._name || basename(argv[1], '.js');
+
+ // github-style sub-commands with no sub-command
+ if (this.executables && argv.length < 3 && !this.defaultExecutable) {
+ // this user needs help
+ argv.push('--help');
+ }
+
+ // process argv
+ var parsed = this.parseOptions(this.normalize(argv.slice(2)));
+ var args = this.args = parsed.args;
+
+ var result = this.parseArgs(this.args, parsed.unknown);
+
+ // executable sub-commands
+ var name = result.args[0];
+
+ var aliasCommand = null;
+ // check alias of sub commands
+ if (name) {
+ aliasCommand = this.commands.filter(function(command) {
+ return command.alias() === name;
+ })[0];
+ }
+
+ if (this._execs[name] === true) {
+ return this.executeSubCommand(argv, args, parsed.unknown);
+ } else if (aliasCommand) {
+ // is alias of a subCommand
+ args[0] = aliasCommand._name;
+ return this.executeSubCommand(argv, args, parsed.unknown);
+ } else if (this.defaultExecutable) {
+ // use the default subcommand
+ args.unshift(this.defaultExecutable);
+ return this.executeSubCommand(argv, args, parsed.unknown);
+ }
+
+ return result;
+};
+
+/**
+ * Execute a sub-command executable.
+ *
+ * @param {Array} argv
+ * @param {Array} args
+ * @param {Array} unknown
+ * @api private
+ */
+
+Command.prototype.executeSubCommand = function(argv, args, unknown) {
+ args = args.concat(unknown);
+
+ if (!args.length) this.help();
+ if (args[0] === 'help' && args.length === 1) this.help();
+
+ // <cmd> --help
+ if (args[0] === 'help') {
+ args[0] = args[1];
+ args[1] = '--help';
+ }
+
+ // executable
+ var f = argv[1];
+ // name of the subcommand, link `pm-install`
+ var bin = basename(f, path.extname(f)) + '-' + args[0];
+
+ // In case of globally installed, get the base dir where executable
+ // subcommand file should be located at
+ var baseDir;
+
+ var resolvedLink = fs.realpathSync(f);
+
+ baseDir = dirname(resolvedLink);
+
+ // prefer local `./<bin>` to bin in the $PATH
+ var localBin = path.join(baseDir, bin);
+
+ // whether bin file is a js script with explicit `.js` or `.ts` extension
+ var isExplicitJS = false;
+ if (exists(localBin + '.js')) {
+ bin = localBin + '.js';
+ isExplicitJS = true;
+ } else if (exists(localBin + '.ts')) {
+ bin = localBin + '.ts';
+ isExplicitJS = true;
+ } else if (exists(localBin)) {
+ bin = localBin;
+ }
+
+ args = args.slice(1);
+
+ var proc;
+ if (process.platform !== 'win32') {
+ if (isExplicitJS) {
+ args.unshift(bin);
+ // add executable arguments to spawn
+ args = (process.execArgv || []).concat(args);
+
+ proc = spawn(process.argv[0], args, { stdio: 'inherit', customFds: [0, 1, 2] });
+ } else {
+ proc = spawn(bin, args, { stdio: 'inherit', customFds: [0, 1, 2] });
+ }
+ } else {
+ args.unshift(bin);
+ proc = spawn(process.execPath, args, { stdio: 'inherit' });
+ }
+
+ var signals = ['SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGINT', 'SIGHUP'];
+ signals.forEach(function(signal) {
+ process.on(signal, function() {
+ if (proc.killed === false && proc.exitCode === null) {
+ proc.kill(signal);
+ }
+ });
+ });
+ proc.on('close', process.exit.bind(process));
+ proc.on('error', function(err) {
+ if (err.code === 'ENOENT') {
+ console.error('error: %s(1) does not exist, try --help', bin);
+ } else if (err.code === 'EACCES') {
+ console.error('error: %s(1) not executable. try chmod or run with root', bin);
+ }
+ process.exit(1);
+ });
+
+ // Store the reference to the child process
+ this.runningCommand = proc;
+};
+
+/**
+ * Normalize `args`, splitting joined short flags. For example
+ * the arg "-abc" is equivalent to "-a -b -c".
+ * This also normalizes equal sign and splits "--abc=def" into "--abc def".
+ *
+ * @param {Array} args
+ * @return {Array}
+ * @api private
+ */
+
+Command.prototype.normalize = function(args) {
+ var ret = [],
+ arg,
+ lastOpt,
+ index;
+
+ for (var i = 0, len = args.length; i < len; ++i) {
+ arg = args[i];
+ if (i > 0) {
+ lastOpt = this.optionFor(args[i - 1]);
+ }
+
+ if (arg === '--') {
+ // Honor option terminator
+ ret = ret.concat(args.slice(i));
+ break;
+ } else if (lastOpt && lastOpt.required) {
+ ret.push(arg);
+ } else if (arg.length > 1 && arg[0] === '-' && arg[1] !== '-') {
+ arg.slice(1).split('').forEach(function(c) {
+ ret.push('-' + c);
+ });
+ } else if (/^--/.test(arg) && ~(index = arg.indexOf('='))) {
+ ret.push(arg.slice(0, index), arg.slice(index + 1));
+ } else {
+ ret.push(arg);
+ }
+ }
+
+ return ret;
+};
+
+/**
+ * Parse command `args`.
+ *
+ * When listener(s) are available those
+ * callbacks are invoked, otherwise the "*"
+ * event is emitted and those actions are invoked.
+ *
+ * @param {Array} args
+ * @return {Command} for chaining
+ * @api private
+ */
+
+Command.prototype.parseArgs = function(args, unknown) {
+ var name;
+
+ if (args.length) {
+ name = args[0];
+ if (this.listeners('command:' + name).length) {
+ this.emit('command:' + args.shift(), args, unknown);
+ } else {
+ this.emit('command:*', args);
+ }
+ } else {
+ outputHelpIfNecessary(this, unknown);
+
+ // If there were no args and we have unknown options,
+ // then they are extraneous and we need to error.
+ if (unknown.length > 0) {
+ this.unknownOption(unknown[0]);
+ }
+ if (this.commands.length === 0 &&
+ this._args.filter(function(a) { return a.required; }).length === 0) {
+ this.emit('command:*');
+ }
+ }
+
+ return this;
+};
+
+/**
+ * Return an option matching `arg` if any.
+ *
+ * @param {String} arg
+ * @return {Option}
+ * @api private
+ */
+
+Command.prototype.optionFor = function(arg) {
+ for (var i = 0, len = this.options.length; i < len; ++i) {
+ if (this.options[i].is(arg)) {
+ return this.options[i];
+ }
+ }
+};
+
+/**
+ * Parse options from `argv` returning `argv`
+ * void of these options.
+ *
+ * @param {Array} argv
+ * @return {Array}
+ * @api public
+ */
+
+Command.prototype.parseOptions = function(argv) {
+ var args = [],
+ len = argv.length,
+ literal,
+ option,
+ arg;
+
+ var unknownOptions = [];
+
+ // parse options
+ for (var i = 0; i < len; ++i) {
+ arg = argv[i];
+
+ // literal args after --
+ if (literal) {
+ args.push(arg);
+ continue;
+ }
+
+ if (arg === '--') {
+ literal = true;
+ continue;
+ }
+
+ // find matching Option
+ option = this.optionFor(arg);
+
+ // option is defined
+ if (option) {
+ // requires arg
+ if (option.required) {
+ arg = argv[++i];
+ if (arg == null) return this.optionMissingArgument(option);
+ this.emit('option:' + option.name(), arg);
+ // optional arg
+ } else if (option.optional) {
+ arg = argv[i + 1];
+ if (arg == null || (arg[0] === '-' && arg !== '-')) {
+ arg = null;
+ } else {
+ ++i;
+ }
+ this.emit('option:' + option.name(), arg);
+ // bool
+ } else {
+ this.emit('option:' + option.name());
+ }
+ continue;
+ }
+
+ // looks like an option
+ if (arg.length > 1 && arg[0] === '-') {
+ unknownOptions.push(arg);
+
+ // If the next argument looks like it might be
+ // an argument for this option, we pass it on.
+ // If it isn't, then it'll simply be ignored
+ if ((i + 1) < argv.length && argv[i + 1][0] !== '-') {
+ unknownOptions.push(argv[++i]);
+ }
+ continue;
+ }
+
+ // arg
+ args.push(arg);
+ }
+
+ return { args: args, unknown: unknownOptions };
+};
+
+/**
+ * Return an object containing options as key-value pairs
+ *
+ * @return {Object}
+ * @api public
+ */
+Command.prototype.opts = function() {
+ var result = {},
+ len = this.options.length;
+
+ for (var i = 0; i < len; i++) {
+ var key = this.options[i].attributeName();
+ result[key] = key === this._versionOptionName ? this._version : this[key];
+ }
+ return result;
+};
+
+/**
+ * Argument `name` is missing.
+ *
+ * @param {String} name
+ * @api private
+ */
+
+Command.prototype.missingArgument = function(name) {
+ console.error("error: missing required argument `%s'", name);
+ process.exit(1);
+};
+
+/**
+ * `Option` is missing an argument, but received `flag` or nothing.
+ *
+ * @param {String} option
+ * @param {String} flag
+ * @api private
+ */
+
+Command.prototype.optionMissingArgument = function(option, flag) {
+ if (flag) {
+ console.error("error: option `%s' argument missing, got `%s'", option.flags, flag);
+ } else {
+ console.error("error: option `%s' argument missing", option.flags);
+ }
+ process.exit(1);
+};
+
+/**
+ * Unknown option `flag`.
+ *
+ * @param {String} flag
+ * @api private
+ */
+
+Command.prototype.unknownOption = function(flag) {
+ if (this._allowUnknownOption) return;
+ console.error("error: unknown option `%s'", flag);
+ process.exit(1);
+};
+
+/**
+ * Variadic argument with `name` is not the last argument as required.
+ *
+ * @param {String} name
+ * @api private
+ */
+
+Command.prototype.variadicArgNotLast = function(name) {
+ console.error("error: variadic arguments must be last `%s'", name);
+ process.exit(1);
+};
+
+/**
+ * Set the program version to `str`.
+ *
+ * This method auto-registers the "-V, --version" flag
+ * which will print the version number when passed.
+ *
+ * @param {String} str
+ * @param {String} [flags]
+ * @return {Command} for chaining
+ * @api public
+ */
+
+Command.prototype.version = function(str, flags) {
+ if (arguments.length === 0) return this._version;
+ this._version = str;
+ flags = flags || '-V, --version';
+ var versionOption = new Option(flags, 'output the version number');
+ this._versionOptionName = versionOption.long.substr(2) || 'version';
+ this.options.push(versionOption);
+ this.on('option:' + this._versionOptionName, function() {
+ process.stdout.write(str + '\n');
+ process.exit(0);
+ });
+ return this;
+};
+
+/**
+ * Set the description to `str`.
+ *
+ * @param {String} str
+ * @param {Object} argsDescription
+ * @return {String|Command}
+ * @api public
+ */
+
+Command.prototype.description = function(str, argsDescription) {
+ if (arguments.length === 0) return this._description;
+ this._description = str;
+ this._argsDescription = argsDescription;
+ return this;
+};
+
+/**
+ * Set an alias for the command
+ *
+ * @param {String} alias
+ * @return {String|Command}
+ * @api public
+ */
+
+Command.prototype.alias = function(alias) {
+ var command = this;
+ if (this.commands.length !== 0) {
+ command = this.commands[this.commands.length - 1];
+ }
+
+ if (arguments.length === 0) return command._alias;
+
+ if (alias === command._name) throw new Error('Command alias can\'t be the same as its name');
+
+ command._alias = alias;
+ return this;
+};
+
+/**
+ * Set / get the command usage `str`.
+ *
+ * @param {String} str
+ * @return {String|Command}
+ * @api public
+ */
+
+Command.prototype.usage = function(str) {
+ var args = this._args.map(function(arg) {
+ return humanReadableArgName(arg);
+ });
+
+ var usage = '[options]' +
+ (this.commands.length ? ' [command]' : '') +
+ (this._args.length ? ' ' + args.join(' ') : '');
+
+ if (arguments.length === 0) return this._usage || usage;
+ this._usage = str;
+
+ return this;
+};
+
+/**
+ * Get or set the name of the command
+ *
+ * @param {String} str
+ * @return {String|Command}
+ * @api public
+ */
+
+Command.prototype.name = function(str) {
+ if (arguments.length === 0) return this._name;
+ this._name = str;
+ return this;
+};
+
+/**
+ * Return prepared commands.
+ *
+ * @return {Array}
+ * @api private
+ */
+
+Command.prototype.prepareCommands = function() {
+ return this.commands.filter(function(cmd) {
+ return !cmd._noHelp;
+ }).map(function(cmd) {
+ var args = cmd._args.map(function(arg) {
+ return humanReadableArgName(arg);
+ }).join(' ');
+
+ return [
+ cmd._name +
+ (cmd._alias ? '|' + cmd._alias : '') +
+ (cmd.options.length ? ' [options]' : '') +
+ (args ? ' ' + args : ''),
+ cmd._description
+ ];
+ });
+};
+
+/**
+ * Return the largest command length.
+ *
+ * @return {Number}
+ * @api private
+ */
+
+Command.prototype.largestCommandLength = function() {
+ var commands = this.prepareCommands();
+ return commands.reduce(function(max, command) {
+ return Math.max(max, command[0].length);
+ }, 0);
+};
+
+/**
+ * Return the largest option length.
+ *
+ * @return {Number}
+ * @api private
+ */
+
+Command.prototype.largestOptionLength = function() {
+ var options = [].slice.call(this.options);
+ options.push({
+ flags: '-h, --help'
+ });
+ return options.reduce(function(max, option) {
+ return Math.max(max, option.flags.length);
+ }, 0);
+};
+
+/**
+ * Return the largest arg length.
+ *
+ * @return {Number}
+ * @api private
+ */
+
+Command.prototype.largestArgLength = function() {
+ return this._args.reduce(function(max, arg) {
+ return Math.max(max, arg.name.length);
+ }, 0);
+};
+
+/**
+ * Return the pad width.
+ *
+ * @return {Number}
+ * @api private
+ */
+
+Command.prototype.padWidth = function() {
+ var width = this.largestOptionLength();
+ if (this._argsDescription && this._args.length) {
+ if (this.largestArgLength() > width) {
+ width = this.largestArgLength();
+ }
+ }
+
+ if (this.commands && this.commands.length) {
+ if (this.largestCommandLength() > width) {
+ width = this.largestCommandLength();
+ }
+ }
+
+ return width;
+};
+
+/**
+ * Return help for options.
+ *
+ * @return {String}
+ * @api private
+ */
+
+Command.prototype.optionHelp = function() {
+ var width = this.padWidth();
+
+ // Append the help information
+ return this.options.map(function(option) {
+ return pad(option.flags, width) + ' ' + option.description +
+ ((option.bool && option.defaultValue !== undefined) ? ' (default: ' + JSON.stringify(option.defaultValue) + ')' : '');
+ }).concat([pad('-h, --help', width) + ' ' + 'output usage information'])
+ .join('\n');
+};
+
+/**
+ * Return command help documentation.
+ *
+ * @return {String}
+ * @api private
+ */
+
+Command.prototype.commandHelp = function() {
+ if (!this.commands.length) return '';
+
+ var commands = this.prepareCommands();
+ var width = this.padWidth();
+
+ return [
+ 'Commands:',
+ commands.map(function(cmd) {
+ var desc = cmd[1] ? ' ' + cmd[1] : '';
+ return (desc ? pad(cmd[0], width) : cmd[0]) + desc;
+ }).join('\n').replace(/^/gm, ' '),
+ ''
+ ].join('\n');
+};
+
+/**
+ * Return program help documentation.
+ *
+ * @return {String}
+ * @api private
+ */
+
+Command.prototype.helpInformation = function() {
+ var desc = [];
+ if (this._description) {
+ desc = [
+ this._description,
+ ''
+ ];
+
+ var argsDescription = this._argsDescription;
+ if (argsDescription && this._args.length) {
+ var width = this.padWidth();
+ desc.push('Arguments:');
+ desc.push('');
+ this._args.forEach(function(arg) {
+ desc.push(' ' + pad(arg.name, width) + ' ' + argsDescription[arg.name]);
+ });
+ desc.push('');
+ }
+ }
+
+ var cmdName = this._name;
+ if (this._alias) {
+ cmdName = cmdName + '|' + this._alias;
+ }
+ var usage = [
+ 'Usage: ' + cmdName + ' ' + this.usage(),
+ ''
+ ];
+
+ var cmds = [];
+ var commandHelp = this.commandHelp();
+ if (commandHelp) cmds = [commandHelp];
+
+ var options = [
+ 'Options:',
+ '' + this.optionHelp().replace(/^/gm, ' '),
+ ''
+ ];
+
+ return usage
+ .concat(desc)
+ .concat(options)
+ .concat(cmds)
+ .join('\n');
+};
+
+/**
+ * Output help information for this command
+ *
+ * @api public
+ */
+
+Command.prototype.outputHelp = function(cb) {
+ if (!cb) {
+ cb = function(passthru) {
+ return passthru;
+ };
+ }
+ process.stdout.write(cb(this.helpInformation()));
+ this.emit('--help');
+};
+
+/**
+ * Output help information and exit.
+ *
+ * @api public
+ */
+
+Command.prototype.help = function(cb) {
+ this.outputHelp(cb);
+ process.exit();
+};
+
+/**
+ * Camel-case the given `flag`
+ *
+ * @param {String} flag
+ * @return {String}
+ * @api private
+ */
+
+function camelcase(flag) {
+ return flag.split('-').reduce(function(str, word) {
+ return str + word[0].toUpperCase() + word.slice(1);
+ });
+}
+
+/**
+ * Pad `str` to `width`.
+ *
+ * @param {String} str
+ * @param {Number} width
+ * @return {String}
+ * @api private
+ */
+
+function pad(str, width) {
+ var len = Math.max(0, width - str.length);
+ return str + Array(len + 1).join(' ');
+}
+
+/**
+ * Output help information if necessary
+ *
+ * @param {Command} command to output help for
+ * @param {Array} array of options to search for -h or --help
+ * @api private
+ */
+
+function outputHelpIfNecessary(cmd, options) {
+ options = options || [];
+ for (var i = 0; i < options.length; i++) {
+ if (options[i] === '--help' || options[i] === '-h') {
+ cmd.outputHelp();
+ process.exit(0);
+ }
+ }
+}
+
+/**
+ * Takes an argument an returns its human readable equivalent for help usage.
+ *
+ * @param {Object} arg
+ * @return {String}
+ * @api private
+ */
+
+function humanReadableArgName(arg) {
+ var nameOutput = arg.name + (arg.variadic === true ? '...' : '');
+
+ return arg.required
+ ? '<' + nameOutput + '>'
+ : '[' + nameOutput + ']';
+}
+
+// for versions before node v0.8 when there weren't `fs.existsSync`
+function exists(file) {
+ try {
+ if (fs.statSync(file).isFile()) {
+ return true;
+ }
+ } catch (e) {
+ return false;
+ }
+}
diff --git a/chromium/third_party/node/node_modules/commander/package.json b/chromium/third_party/node/node_modules/commander/package.json
new file mode 100644
index 00000000000..0023c5cdf5f
--- /dev/null
+++ b/chromium/third_party/node/node_modules/commander/package.json
@@ -0,0 +1,38 @@
+{
+ "name": "commander",
+ "version": "2.20.3",
+ "description": "the complete solution for node.js command-line programs",
+ "keywords": [
+ "commander",
+ "command",
+ "option",
+ "parser"
+ ],
+ "author": "TJ Holowaychuk <tj@vision-media.ca>",
+ "license": "MIT",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/tj/commander.js.git"
+ },
+ "scripts": {
+ "lint": "eslint index.js",
+ "test": "node test/run.js && npm run test-typings",
+ "test-typings": "tsc -p tsconfig.json"
+ },
+ "main": "index",
+ "files": [
+ "index.js",
+ "typings/index.d.ts"
+ ],
+ "dependencies": {},
+ "devDependencies": {
+ "@types/node": "^12.7.8",
+ "eslint": "^6.4.0",
+ "should": "^13.2.3",
+ "sinon": "^7.5.0",
+ "standard": "^14.3.1",
+ "ts-node": "^8.4.1",
+ "typescript": "^3.6.3"
+ },
+ "typings": "typings/index.d.ts"
+}
diff --git a/chromium/third_party/node/node_modules/concat-map/LICENSE b/chromium/third_party/node/node_modules/concat-map/LICENSE
new file mode 100644
index 00000000000..ee27ba4b441
--- /dev/null
+++ b/chromium/third_party/node/node_modules/concat-map/LICENSE
@@ -0,0 +1,18 @@
+This software is released under the MIT license:
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/chromium/third_party/node/node_modules/concat-map/README.markdown b/chromium/third_party/node/node_modules/concat-map/README.markdown
new file mode 100644
index 00000000000..408f70a1be4
--- /dev/null
+++ b/chromium/third_party/node/node_modules/concat-map/README.markdown
@@ -0,0 +1,62 @@
+concat-map
+==========
+
+Concatenative mapdashery.
+
+[![browser support](http://ci.testling.com/substack/node-concat-map.png)](http://ci.testling.com/substack/node-concat-map)
+
+[![build status](https://secure.travis-ci.org/substack/node-concat-map.png)](http://travis-ci.org/substack/node-concat-map)
+
+example
+=======
+
+``` js
+var concatMap = require('concat-map');
+var xs = [ 1, 2, 3, 4, 5, 6 ];
+var ys = concatMap(xs, function (x) {
+ return x % 2 ? [ x - 0.1, x, x + 0.1 ] : [];
+});
+console.dir(ys);
+```
+
+***
+
+```
+[ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]
+```
+
+methods
+=======
+
+``` js
+var concatMap = require('concat-map')
+```
+
+concatMap(xs, fn)
+-----------------
+
+Return an array of concatenated elements by calling `fn(x, i)` for each element
+`x` and each index `i` in the array `xs`.
+
+When `fn(x, i)` returns an array, its result will be concatenated with the
+result array. If `fn(x, i)` returns anything else, that value will be pushed
+onto the end of the result array.
+
+install
+=======
+
+With [npm](http://npmjs.org) do:
+
+```
+npm install concat-map
+```
+
+license
+=======
+
+MIT
+
+notes
+=====
+
+This module was written while sitting high above the ground in a tree.
diff --git a/chromium/third_party/node/node_modules/concat-map/index.js b/chromium/third_party/node/node_modules/concat-map/index.js
new file mode 100644
index 00000000000..b29a7812e50
--- /dev/null
+++ b/chromium/third_party/node/node_modules/concat-map/index.js
@@ -0,0 +1,13 @@
+module.exports = function (xs, fn) {
+ var res = [];
+ for (var i = 0; i < xs.length; i++) {
+ var x = fn(xs[i], i);
+ if (isArray(x)) res.push.apply(res, x);
+ else res.push(x);
+ }
+ return res;
+};
+
+var isArray = Array.isArray || function (xs) {
+ return Object.prototype.toString.call(xs) === '[object Array]';
+};
diff --git a/chromium/third_party/node/node_modules/concat-map/package.json b/chromium/third_party/node/node_modules/concat-map/package.json
new file mode 100644
index 00000000000..d3640e6b027
--- /dev/null
+++ b/chromium/third_party/node/node_modules/concat-map/package.json
@@ -0,0 +1,43 @@
+{
+ "name" : "concat-map",
+ "description" : "concatenative mapdashery",
+ "version" : "0.0.1",
+ "repository" : {
+ "type" : "git",
+ "url" : "git://github.com/substack/node-concat-map.git"
+ },
+ "main" : "index.js",
+ "keywords" : [
+ "concat",
+ "concatMap",
+ "map",
+ "functional",
+ "higher-order"
+ ],
+ "directories" : {
+ "example" : "example",
+ "test" : "test"
+ },
+ "scripts" : {
+ "test" : "tape test/*.js"
+ },
+ "devDependencies" : {
+ "tape" : "~2.4.0"
+ },
+ "license" : "MIT",
+ "author" : {
+ "name" : "James Halliday",
+ "email" : "mail@substack.net",
+ "url" : "http://substack.net"
+ },
+ "testling" : {
+ "files" : "test/*.js",
+ "browsers" : {
+ "ie" : [ 6, 7, 8, 9 ],
+ "ff" : [ 3.5, 10, 15.0 ],
+ "chrome" : [ 10, 22 ],
+ "safari" : [ 5.1 ],
+ "opera" : [ 12 ]
+ }
+ }
+}
diff --git a/chromium/third_party/node/node_modules/debug/LICENSE b/chromium/third_party/node/node_modules/debug/LICENSE
new file mode 100644
index 00000000000..1a9820e262b
--- /dev/null
+++ b/chromium/third_party/node/node_modules/debug/LICENSE
@@ -0,0 +1,20 @@
+(The MIT License)
+
+Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
+Copyright (c) 2018-2021 Josh Junon
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software
+and associated documentation files (the 'Software'), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
+LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/chromium/third_party/node/node_modules/debug/package.json b/chromium/third_party/node/node_modules/debug/package.json
new file mode 100644
index 00000000000..cb7efa8eec3
--- /dev/null
+++ b/chromium/third_party/node/node_modules/debug/package.json
@@ -0,0 +1,59 @@
+{
+ "name": "debug",
+ "version": "4.3.3",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/debug-js/debug.git"
+ },
+ "description": "Lightweight debugging utility for Node.js and the browser",
+ "keywords": [
+ "debug",
+ "log",
+ "debugger"
+ ],
+ "files": [
+ "src",
+ "LICENSE",
+ "README.md"
+ ],
+ "author": "Josh Junon <josh.junon@protonmail.com>",
+ "contributors": [
+ "TJ Holowaychuk <tj@vision-media.ca>",
+ "Nathan Rajlich <nathan@tootallnate.net> (http://n8.io)",
+ "Andrew Rhyne <rhyneandrew@gmail.com>"
+ ],
+ "license": "MIT",
+ "scripts": {
+ "lint": "xo",
+ "test": "npm run test:node && npm run test:browser && npm run lint",
+ "test:node": "istanbul cover _mocha -- test.js",
+ "test:browser": "karma start --single-run",
+ "test:coverage": "cat ./coverage/lcov.info | coveralls"
+ },
+ "dependencies": {
+ "ms": "2.1.2"
+ },
+ "devDependencies": {
+ "brfs": "^2.0.1",
+ "browserify": "^16.2.3",
+ "coveralls": "^3.0.2",
+ "istanbul": "^0.4.5",
+ "karma": "^3.1.4",
+ "karma-browserify": "^6.0.0",
+ "karma-chrome-launcher": "^2.2.0",
+ "karma-mocha": "^1.3.0",
+ "mocha": "^5.2.0",
+ "mocha-lcov-reporter": "^1.2.0",
+ "xo": "^0.23.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ },
+ "main": "./src/index.js",
+ "browser": "./src/browser.js",
+ "engines": {
+ "node": ">=6.0"
+ }
+}
diff --git a/chromium/third_party/node/node_modules/debug/src/browser.js b/chromium/third_party/node/node_modules/debug/src/browser.js
new file mode 100644
index 00000000000..cd0fc35d1ee
--- /dev/null
+++ b/chromium/third_party/node/node_modules/debug/src/browser.js
@@ -0,0 +1,269 @@
+/* eslint-env browser */
+
+/**
+ * This is the web browser implementation of `debug()`.
+ */
+
+exports.formatArgs = formatArgs;
+exports.save = save;
+exports.load = load;
+exports.useColors = useColors;
+exports.storage = localstorage();
+exports.destroy = (() => {
+ let warned = false;
+
+ return () => {
+ if (!warned) {
+ warned = true;
+ console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
+ }
+ };
+})();
+
+/**
+ * Colors.
+ */
+
+exports.colors = [
+ '#0000CC',
+ '#0000FF',
+ '#0033CC',
+ '#0033FF',
+ '#0066CC',
+ '#0066FF',
+ '#0099CC',
+ '#0099FF',
+ '#00CC00',
+ '#00CC33',
+ '#00CC66',
+ '#00CC99',
+ '#00CCCC',
+ '#00CCFF',
+ '#3300CC',
+ '#3300FF',
+ '#3333CC',
+ '#3333FF',
+ '#3366CC',
+ '#3366FF',
+ '#3399CC',
+ '#3399FF',
+ '#33CC00',
+ '#33CC33',
+ '#33CC66',
+ '#33CC99',
+ '#33CCCC',
+ '#33CCFF',
+ '#6600CC',
+ '#6600FF',
+ '#6633CC',
+ '#6633FF',
+ '#66CC00',
+ '#66CC33',
+ '#9900CC',
+ '#9900FF',
+ '#9933CC',
+ '#9933FF',
+ '#99CC00',
+ '#99CC33',
+ '#CC0000',
+ '#CC0033',
+ '#CC0066',
+ '#CC0099',
+ '#CC00CC',
+ '#CC00FF',
+ '#CC3300',
+ '#CC3333',
+ '#CC3366',
+ '#CC3399',
+ '#CC33CC',
+ '#CC33FF',
+ '#CC6600',
+ '#CC6633',
+ '#CC9900',
+ '#CC9933',
+ '#CCCC00',
+ '#CCCC33',
+ '#FF0000',
+ '#FF0033',
+ '#FF0066',
+ '#FF0099',
+ '#FF00CC',
+ '#FF00FF',
+ '#FF3300',
+ '#FF3333',
+ '#FF3366',
+ '#FF3399',
+ '#FF33CC',
+ '#FF33FF',
+ '#FF6600',
+ '#FF6633',
+ '#FF9900',
+ '#FF9933',
+ '#FFCC00',
+ '#FFCC33'
+];
+
+/**
+ * Currently only WebKit-based Web Inspectors, Firefox >= v31,
+ * and the Firebug extension (any Firefox version) are known
+ * to support "%c" CSS customizations.
+ *
+ * TODO: add a `localStorage` variable to explicitly enable/disable colors
+ */
+
+// eslint-disable-next-line complexity
+function useColors() {
+ // NB: In an Electron preload script, document will be defined but not fully
+ // initialized. Since we know we're in Chrome, we'll just detect this case
+ // explicitly
+ if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
+ return true;
+ }
+
+ // Internet Explorer and Edge do not support colors.
+ if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
+ return false;
+ }
+
+ // Is webkit? http://stackoverflow.com/a/16459606/376773
+ // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
+ return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
+ // Is firebug? http://stackoverflow.com/a/398120/376773
+ (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
+ // Is firefox >= v31?
+ // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
+ (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
+ // Double check webkit in userAgent just in case we are in a worker
+ (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
+}
+
+/**
+ * Colorize log arguments if enabled.
+ *
+ * @api public
+ */
+
+function formatArgs(args) {
+ args[0] = (this.useColors ? '%c' : '') +
+ this.namespace +
+ (this.useColors ? ' %c' : ' ') +
+ args[0] +
+ (this.useColors ? '%c ' : ' ') +
+ '+' + module.exports.humanize(this.diff);
+
+ if (!this.useColors) {
+ return;
+ }
+
+ const c = 'color: ' + this.color;
+ args.splice(1, 0, c, 'color: inherit');
+
+ // The final "%c" is somewhat tricky, because there could be other
+ // arguments passed either before or after the %c, so we need to
+ // figure out the correct index to insert the CSS into
+ let index = 0;
+ let lastC = 0;
+ args[0].replace(/%[a-zA-Z%]/g, match => {
+ if (match === '%%') {
+ return;
+ }
+ index++;
+ if (match === '%c') {
+ // We only are interested in the *last* %c
+ // (the user may have provided their own)
+ lastC = index;
+ }
+ });
+
+ args.splice(lastC, 0, c);
+}
+
+/**
+ * Invokes `console.debug()` when available.
+ * No-op when `console.debug` is not a "function".
+ * If `console.debug` is not available, falls back
+ * to `console.log`.
+ *
+ * @api public
+ */
+exports.log = console.debug || console.log || (() => {});
+
+/**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+function save(namespaces) {
+ try {
+ if (namespaces) {
+ exports.storage.setItem('debug', namespaces);
+ } else {
+ exports.storage.removeItem('debug');
+ }
+ } catch (error) {
+ // Swallow
+ // XXX (@Qix-) should we be logging these?
+ }
+}
+
+/**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
+function load() {
+ let r;
+ try {
+ r = exports.storage.getItem('debug');
+ } catch (error) {
+ // Swallow
+ // XXX (@Qix-) should we be logging these?
+ }
+
+ // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
+ if (!r && typeof process !== 'undefined' && 'env' in process) {
+ r = process.env.DEBUG;
+ }
+
+ return r;
+}
+
+/**
+ * Localstorage attempts to return the localstorage.
+ *
+ * This is necessary because safari throws
+ * when a user disables cookies/localstorage
+ * and you attempt to access it.
+ *
+ * @return {LocalStorage}
+ * @api private
+ */
+
+function localstorage() {
+ try {
+ // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
+ // The Browser also has localStorage in the global context.
+ return localStorage;
+ } catch (error) {
+ // Swallow
+ // XXX (@Qix-) should we be logging these?
+ }
+}
+
+module.exports = require('./common')(exports);
+
+const {formatters} = module.exports;
+
+/**
+ * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
+ */
+
+formatters.j = function (v) {
+ try {
+ return JSON.stringify(v);
+ } catch (error) {
+ return '[UnexpectedJSONParseError]: ' + error.message;
+ }
+};
diff --git a/chromium/third_party/node/node_modules/debug/src/common.js b/chromium/third_party/node/node_modules/debug/src/common.js
new file mode 100644
index 00000000000..6d571d2844d
--- /dev/null
+++ b/chromium/third_party/node/node_modules/debug/src/common.js
@@ -0,0 +1,274 @@
+
+/**
+ * This is the common logic for both the Node.js and web browser
+ * implementations of `debug()`.
+ */
+
+function setup(env) {
+ createDebug.debug = createDebug;
+ createDebug.default = createDebug;
+ createDebug.coerce = coerce;
+ createDebug.disable = disable;
+ createDebug.enable = enable;
+ createDebug.enabled = enabled;
+ createDebug.humanize = require('ms');
+ createDebug.destroy = destroy;
+
+ Object.keys(env).forEach(key => {
+ createDebug[key] = env[key];
+ });
+
+ /**
+ * The currently active debug mode names, and names to skip.
+ */
+
+ createDebug.names = [];
+ createDebug.skips = [];
+
+ /**
+ * Map of special "%n" handling functions, for the debug "format" argument.
+ *
+ * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
+ */
+ createDebug.formatters = {};
+
+ /**
+ * Selects a color for a debug namespace
+ * @param {String} namespace The namespace string for the debug instance to be colored
+ * @return {Number|String} An ANSI color code for the given namespace
+ * @api private
+ */
+ function selectColor(namespace) {
+ let hash = 0;
+
+ for (let i = 0; i < namespace.length; i++) {
+ hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
+ hash |= 0; // Convert to 32bit integer
+ }
+
+ return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
+ }
+ createDebug.selectColor = selectColor;
+
+ /**
+ * Create a debugger with the given `namespace`.
+ *
+ * @param {String} namespace
+ * @return {Function}
+ * @api public
+ */
+ function createDebug(namespace) {
+ let prevTime;
+ let enableOverride = null;
+ let namespacesCache;
+ let enabledCache;
+
+ function debug(...args) {
+ // Disabled?
+ if (!debug.enabled) {
+ return;
+ }
+
+ const self = debug;
+
+ // Set `diff` timestamp
+ const curr = Number(new Date());
+ const ms = curr - (prevTime || curr);
+ self.diff = ms;
+ self.prev = prevTime;
+ self.curr = curr;
+ prevTime = curr;
+
+ args[0] = createDebug.coerce(args[0]);
+
+ if (typeof args[0] !== 'string') {
+ // Anything else let's inspect with %O
+ args.unshift('%O');
+ }
+
+ // Apply any `formatters` transformations
+ let index = 0;
+ args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
+ // If we encounter an escaped % then don't increase the array index
+ if (match === '%%') {
+ return '%';
+ }
+ index++;
+ const formatter = createDebug.formatters[format];
+ if (typeof formatter === 'function') {
+ const val = args[index];
+ match = formatter.call(self, val);
+
+ // Now we need to remove `args[index]` since it's inlined in the `format`
+ args.splice(index, 1);
+ index--;
+ }
+ return match;
+ });
+
+ // Apply env-specific formatting (colors, etc.)
+ createDebug.formatArgs.call(self, args);
+
+ const logFn = self.log || createDebug.log;
+ logFn.apply(self, args);
+ }
+
+ debug.namespace = namespace;
+ debug.useColors = createDebug.useColors();
+ debug.color = createDebug.selectColor(namespace);
+ debug.extend = extend;
+ debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
+
+ Object.defineProperty(debug, 'enabled', {
+ enumerable: true,
+ configurable: false,
+ get: () => {
+ if (enableOverride !== null) {
+ return enableOverride;
+ }
+ if (namespacesCache !== createDebug.namespaces) {
+ namespacesCache = createDebug.namespaces;
+ enabledCache = createDebug.enabled(namespace);
+ }
+
+ return enabledCache;
+ },
+ set: v => {
+ enableOverride = v;
+ }
+ });
+
+ // Env-specific initialization logic for debug instances
+ if (typeof createDebug.init === 'function') {
+ createDebug.init(debug);
+ }
+
+ return debug;
+ }
+
+ function extend(namespace, delimiter) {
+ const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
+ newDebug.log = this.log;
+ return newDebug;
+ }
+
+ /**
+ * Enables a debug mode by namespaces. This can include modes
+ * separated by a colon and wildcards.
+ *
+ * @param {String} namespaces
+ * @api public
+ */
+ function enable(namespaces) {
+ createDebug.save(namespaces);
+ createDebug.namespaces = namespaces;
+
+ createDebug.names = [];
+ createDebug.skips = [];
+
+ let i;
+ const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
+ const len = split.length;
+
+ for (i = 0; i < len; i++) {
+ if (!split[i]) {
+ // ignore empty strings
+ continue;
+ }
+
+ namespaces = split[i].replace(/\*/g, '.*?');
+
+ if (namespaces[0] === '-') {
+ createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
+ } else {
+ createDebug.names.push(new RegExp('^' + namespaces + '$'));
+ }
+ }
+ }
+
+ /**
+ * Disable debug output.
+ *
+ * @return {String} namespaces
+ * @api public
+ */
+ function disable() {
+ const namespaces = [
+ ...createDebug.names.map(toNamespace),
+ ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
+ ].join(',');
+ createDebug.enable('');
+ return namespaces;
+ }
+
+ /**
+ * Returns true if the given mode name is enabled, false otherwise.
+ *
+ * @param {String} name
+ * @return {Boolean}
+ * @api public
+ */
+ function enabled(name) {
+ if (name[name.length - 1] === '*') {
+ return true;
+ }
+
+ let i;
+ let len;
+
+ for (i = 0, len = createDebug.skips.length; i < len; i++) {
+ if (createDebug.skips[i].test(name)) {
+ return false;
+ }
+ }
+
+ for (i = 0, len = createDebug.names.length; i < len; i++) {
+ if (createDebug.names[i].test(name)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Convert regexp to namespace
+ *
+ * @param {RegExp} regxep
+ * @return {String} namespace
+ * @api private
+ */
+ function toNamespace(regexp) {
+ return regexp.toString()
+ .substring(2, regexp.toString().length - 2)
+ .replace(/\.\*\?$/, '*');
+ }
+
+ /**
+ * Coerce `val`.
+ *
+ * @param {Mixed} val
+ * @return {Mixed}
+ * @api private
+ */
+ function coerce(val) {
+ if (val instanceof Error) {
+ return val.stack || val.message;
+ }
+ return val;
+ }
+
+ /**
+ * XXX DO NOT USE. This is a temporary stub function.
+ * XXX It WILL be removed in the next major release.
+ */
+ function destroy() {
+ console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
+ }
+
+ createDebug.enable(createDebug.load());
+
+ return createDebug;
+}
+
+module.exports = setup;
diff --git a/chromium/third_party/node/node_modules/debug/src/index.js b/chromium/third_party/node/node_modules/debug/src/index.js
new file mode 100644
index 00000000000..bf4c57f259d
--- /dev/null
+++ b/chromium/third_party/node/node_modules/debug/src/index.js
@@ -0,0 +1,10 @@
+/**
+ * Detect Electron renderer / nwjs process, which is node, but we should
+ * treat as a browser.
+ */
+
+if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
+ module.exports = require('./browser.js');
+} else {
+ module.exports = require('./node.js');
+}
diff --git a/chromium/third_party/node/node_modules/debug/src/node.js b/chromium/third_party/node/node_modules/debug/src/node.js
new file mode 100644
index 00000000000..79bc085cb02
--- /dev/null
+++ b/chromium/third_party/node/node_modules/debug/src/node.js
@@ -0,0 +1,263 @@
+/**
+ * Module dependencies.
+ */
+
+const tty = require('tty');
+const util = require('util');
+
+/**
+ * This is the Node.js implementation of `debug()`.
+ */
+
+exports.init = init;
+exports.log = log;
+exports.formatArgs = formatArgs;
+exports.save = save;
+exports.load = load;
+exports.useColors = useColors;
+exports.destroy = util.deprecate(
+ () => {},
+ 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
+);
+
+/**
+ * Colors.
+ */
+
+exports.colors = [6, 2, 3, 4, 5, 1];
+
+try {
+ // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
+ // eslint-disable-next-line import/no-extraneous-dependencies
+ const supportsColor = require('supports-color');
+
+ if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
+ exports.colors = [
+ 20,
+ 21,
+ 26,
+ 27,
+ 32,
+ 33,
+ 38,
+ 39,
+ 40,
+ 41,
+ 42,
+ 43,
+ 44,
+ 45,
+ 56,
+ 57,
+ 62,
+ 63,
+ 68,
+ 69,
+ 74,
+ 75,
+ 76,
+ 77,
+ 78,
+ 79,
+ 80,
+ 81,
+ 92,
+ 93,
+ 98,
+ 99,
+ 112,
+ 113,
+ 128,
+ 129,
+ 134,
+ 135,
+ 148,
+ 149,
+ 160,
+ 161,
+ 162,
+ 163,
+ 164,
+ 165,
+ 166,
+ 167,
+ 168,
+ 169,
+ 170,
+ 171,
+ 172,
+ 173,
+ 178,
+ 179,
+ 184,
+ 185,
+ 196,
+ 197,
+ 198,
+ 199,
+ 200,
+ 201,
+ 202,
+ 203,
+ 204,
+ 205,
+ 206,
+ 207,
+ 208,
+ 209,
+ 214,
+ 215,
+ 220,
+ 221
+ ];
+ }
+} catch (error) {
+ // Swallow - we only care if `supports-color` is available; it doesn't have to be.
+}
+
+/**
+ * Build up the default `inspectOpts` object from the environment variables.
+ *
+ * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
+ */
+
+exports.inspectOpts = Object.keys(process.env).filter(key => {
+ return /^debug_/i.test(key);
+}).reduce((obj, key) => {
+ // Camel-case
+ const prop = key
+ .substring(6)
+ .toLowerCase()
+ .replace(/_([a-z])/g, (_, k) => {
+ return k.toUpperCase();
+ });
+
+ // Coerce string value into JS value
+ let val = process.env[key];
+ if (/^(yes|on|true|enabled)$/i.test(val)) {
+ val = true;
+ } else if (/^(no|off|false|disabled)$/i.test(val)) {
+ val = false;
+ } else if (val === 'null') {
+ val = null;
+ } else {
+ val = Number(val);
+ }
+
+ obj[prop] = val;
+ return obj;
+}, {});
+
+/**
+ * Is stdout a TTY? Colored output is enabled when `true`.
+ */
+
+function useColors() {
+ return 'colors' in exports.inspectOpts ?
+ Boolean(exports.inspectOpts.colors) :
+ tty.isatty(process.stderr.fd);
+}
+
+/**
+ * Adds ANSI color escape codes if enabled.
+ *
+ * @api public
+ */
+
+function formatArgs(args) {
+ const {namespace: name, useColors} = this;
+
+ if (useColors) {
+ const c = this.color;
+ const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
+ const prefix = ` ${colorCode};1m${name} \u001B[0m`;
+
+ args[0] = prefix + args[0].split('\n').join('\n' + prefix);
+ args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
+ } else {
+ args[0] = getDate() + name + ' ' + args[0];
+ }
+}
+
+function getDate() {
+ if (exports.inspectOpts.hideDate) {
+ return '';
+ }
+ return new Date().toISOString() + ' ';
+}
+
+/**
+ * Invokes `util.format()` with the specified arguments and writes to stderr.
+ */
+
+function log(...args) {
+ return process.stderr.write(util.format(...args) + '\n');
+}
+
+/**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+function save(namespaces) {
+ if (namespaces) {
+ process.env.DEBUG = namespaces;
+ } else {
+ // If you set a process.env field to null or undefined, it gets cast to the
+ // string 'null' or 'undefined'. Just delete instead.
+ delete process.env.DEBUG;
+ }
+}
+
+/**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
+
+function load() {
+ return process.env.DEBUG;
+}
+
+/**
+ * Init logic for `debug` instances.
+ *
+ * Create a new `inspectOpts` object in case `useColors` is set
+ * differently for a particular `debug` instance.
+ */
+
+function init(debug) {
+ debug.inspectOpts = {};
+
+ const keys = Object.keys(exports.inspectOpts);
+ for (let i = 0; i < keys.length; i++) {
+ debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
+ }
+}
+
+module.exports = require('./common')(exports);
+
+const {formatters} = module.exports;
+
+/**
+ * Map %o to `util.inspect()`, all on a single line.
+ */
+
+formatters.o = function (v) {
+ this.inspectOpts.colors = this.useColors;
+ return util.inspect(v, this.inspectOpts)
+ .split('\n')
+ .map(str => str.trim())
+ .join(' ');
+};
+
+/**
+ * Map %O to `util.inspect()`, allowing multiple lines if needed.
+ */
+
+formatters.O = function (v) {
+ this.inspectOpts.colors = this.useColors;
+ return util.inspect(v, this.inspectOpts);
+};
diff --git a/chromium/third_party/node/node_modules/escape-string-regexp/index.js b/chromium/third_party/node/node_modules/escape-string-regexp/index.js
new file mode 100644
index 00000000000..7834bf9b24c
--- /dev/null
+++ b/chromium/third_party/node/node_modules/escape-string-regexp/index.js
@@ -0,0 +1,11 @@
+'use strict';
+
+var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
+
+module.exports = function (str) {
+ if (typeof str !== 'string') {
+ throw new TypeError('Expected a string');
+ }
+
+ return str.replace(matchOperatorsRe, '\\$&');
+};
diff --git a/chromium/third_party/node/node_modules/escape-string-regexp/license b/chromium/third_party/node/node_modules/escape-string-regexp/license
new file mode 100644
index 00000000000..654d0bfe943
--- /dev/null
+++ b/chromium/third_party/node/node_modules/escape-string-regexp/license
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/chromium/third_party/node/node_modules/escape-string-regexp/package.json b/chromium/third_party/node/node_modules/escape-string-regexp/package.json
new file mode 100644
index 00000000000..f307df34a23
--- /dev/null
+++ b/chromium/third_party/node/node_modules/escape-string-regexp/package.json
@@ -0,0 +1,41 @@
+{
+ "name": "escape-string-regexp",
+ "version": "1.0.5",
+ "description": "Escape RegExp special characters",
+ "license": "MIT",
+ "repository": "sindresorhus/escape-string-regexp",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "maintainers": [
+ "Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)",
+ "Joshua Boy Nicolai Appelman <joshua@jbna.nl> (jbna.nl)"
+ ],
+ "engines": {
+ "node": ">=0.8.0"
+ },
+ "scripts": {
+ "test": "xo && ava"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "escape",
+ "regex",
+ "regexp",
+ "re",
+ "regular",
+ "expression",
+ "string",
+ "str",
+ "special",
+ "characters"
+ ],
+ "devDependencies": {
+ "ava": "*",
+ "xo": "*"
+ }
+}
diff --git a/chromium/third_party/node/node_modules/esutils/LICENSE.BSD b/chromium/third_party/node/node_modules/esutils/LICENSE.BSD
new file mode 100644
index 00000000000..3e580c355a9
--- /dev/null
+++ b/chromium/third_party/node/node_modules/esutils/LICENSE.BSD
@@ -0,0 +1,19 @@
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/chromium/third_party/node/node_modules/esutils/lib/ast.js b/chromium/third_party/node/node_modules/esutils/lib/ast.js
new file mode 100644
index 00000000000..8faadae1ce7
--- /dev/null
+++ b/chromium/third_party/node/node_modules/esutils/lib/ast.js
@@ -0,0 +1,144 @@
+/*
+ Copyright (C) 2013 Yusuke Suzuki <utatane.tea@gmail.com>
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+(function () {
+ 'use strict';
+
+ function isExpression(node) {
+ if (node == null) { return false; }
+ switch (node.type) {
+ case 'ArrayExpression':
+ case 'AssignmentExpression':
+ case 'BinaryExpression':
+ case 'CallExpression':
+ case 'ConditionalExpression':
+ case 'FunctionExpression':
+ case 'Identifier':
+ case 'Literal':
+ case 'LogicalExpression':
+ case 'MemberExpression':
+ case 'NewExpression':
+ case 'ObjectExpression':
+ case 'SequenceExpression':
+ case 'ThisExpression':
+ case 'UnaryExpression':
+ case 'UpdateExpression':
+ return true;
+ }
+ return false;
+ }
+
+ function isIterationStatement(node) {
+ if (node == null) { return false; }
+ switch (node.type) {
+ case 'DoWhileStatement':
+ case 'ForInStatement':
+ case 'ForStatement':
+ case 'WhileStatement':
+ return true;
+ }
+ return false;
+ }
+
+ function isStatement(node) {
+ if (node == null) { return false; }
+ switch (node.type) {
+ case 'BlockStatement':
+ case 'BreakStatement':
+ case 'ContinueStatement':
+ case 'DebuggerStatement':
+ case 'DoWhileStatement':
+ case 'EmptyStatement':
+ case 'ExpressionStatement':
+ case 'ForInStatement':
+ case 'ForStatement':
+ case 'IfStatement':
+ case 'LabeledStatement':
+ case 'ReturnStatement':
+ case 'SwitchStatement':
+ case 'ThrowStatement':
+ case 'TryStatement':
+ case 'VariableDeclaration':
+ case 'WhileStatement':
+ case 'WithStatement':
+ return true;
+ }
+ return false;
+ }
+
+ function isSourceElement(node) {
+ return isStatement(node) || node != null && node.type === 'FunctionDeclaration';
+ }
+
+ function trailingStatement(node) {
+ switch (node.type) {
+ case 'IfStatement':
+ if (node.alternate != null) {
+ return node.alternate;
+ }
+ return node.consequent;
+
+ case 'LabeledStatement':
+ case 'ForStatement':
+ case 'ForInStatement':
+ case 'WhileStatement':
+ case 'WithStatement':
+ return node.body;
+ }
+ return null;
+ }
+
+ function isProblematicIfStatement(node) {
+ var current;
+
+ if (node.type !== 'IfStatement') {
+ return false;
+ }
+ if (node.alternate == null) {
+ return false;
+ }
+ current = node.consequent;
+ do {
+ if (current.type === 'IfStatement') {
+ if (current.alternate == null) {
+ return true;
+ }
+ }
+ current = trailingStatement(current);
+ } while (current);
+
+ return false;
+ }
+
+ module.exports = {
+ isExpression: isExpression,
+ isStatement: isStatement,
+ isIterationStatement: isIterationStatement,
+ isSourceElement: isSourceElement,
+ isProblematicIfStatement: isProblematicIfStatement,
+
+ trailingStatement: trailingStatement
+ };
+}());
+/* vim: set sw=4 ts=4 et tw=80 : */
diff --git a/chromium/third_party/node/node_modules/esutils/lib/code.js b/chromium/third_party/node/node_modules/esutils/lib/code.js
new file mode 100644
index 00000000000..23136af91f9
--- /dev/null
+++ b/chromium/third_party/node/node_modules/esutils/lib/code.js
@@ -0,0 +1,135 @@
+/*
+ Copyright (C) 2013-2014 Yusuke Suzuki <utatane.tea@gmail.com>
+ Copyright (C) 2014 Ivan Nikulin <ifaaan@gmail.com>
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+(function () {
+ 'use strict';
+
+ var ES6Regex, ES5Regex, NON_ASCII_WHITESPACES, IDENTIFIER_START, IDENTIFIER_PART, ch;
+
+ // See `tools/generate-identifier-regex.js`.
+ ES5Regex = {
+ // ECMAScript 5.1/Unicode v9.0.0 NonAsciiIdentifierStart:
+ NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,
+ // ECMAScript 5.1/Unicode v9.0.0 NonAsciiIdentifierPart:
+ NonAsciiIdentifierPart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/
+ };
+
+ ES6Regex = {
+ // ECMAScript 6/Unicode v9.0.0 NonAsciiIdentifierStart:
+ NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,
+ // ECMAScript 6/Unicode v9.0.0 NonAsciiIdentifierPart:
+ NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/
+ };
+
+ function isDecimalDigit(ch) {
+ return 0x30 <= ch && ch <= 0x39; // 0..9
+ }
+
+ function isHexDigit(ch) {
+ return 0x30 <= ch && ch <= 0x39 || // 0..9
+ 0x61 <= ch && ch <= 0x66 || // a..f
+ 0x41 <= ch && ch <= 0x46; // A..F
+ }
+
+ function isOctalDigit(ch) {
+ return ch >= 0x30 && ch <= 0x37; // 0..7
+ }
+
+ // 7.2 White Space
+
+ NON_ASCII_WHITESPACES = [
+ 0x1680,
+ 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A,
+ 0x202F, 0x205F,
+ 0x3000,
+ 0xFEFF
+ ];
+
+ function isWhiteSpace(ch) {
+ return ch === 0x20 || ch === 0x09 || ch === 0x0B || ch === 0x0C || ch === 0xA0 ||
+ ch >= 0x1680 && NON_ASCII_WHITESPACES.indexOf(ch) >= 0;
+ }
+
+ // 7.3 Line Terminators
+
+ function isLineTerminator(ch) {
+ return ch === 0x0A || ch === 0x0D || ch === 0x2028 || ch === 0x2029;
+ }
+
+ // 7.6 Identifier Names and Identifiers
+
+ function fromCodePoint(cp) {
+ if (cp <= 0xFFFF) { return String.fromCharCode(cp); }
+ var cu1 = String.fromCharCode(Math.floor((cp - 0x10000) / 0x400) + 0xD800);
+ var cu2 = String.fromCharCode(((cp - 0x10000) % 0x400) + 0xDC00);
+ return cu1 + cu2;
+ }
+
+ IDENTIFIER_START = new Array(0x80);
+ for(ch = 0; ch < 0x80; ++ch) {
+ IDENTIFIER_START[ch] =
+ ch >= 0x61 && ch <= 0x7A || // a..z
+ ch >= 0x41 && ch <= 0x5A || // A..Z
+ ch === 0x24 || ch === 0x5F; // $ (dollar) and _ (underscore)
+ }
+
+ IDENTIFIER_PART = new Array(0x80);
+ for(ch = 0; ch < 0x80; ++ch) {
+ IDENTIFIER_PART[ch] =
+ ch >= 0x61 && ch <= 0x7A || // a..z
+ ch >= 0x41 && ch <= 0x5A || // A..Z
+ ch >= 0x30 && ch <= 0x39 || // 0..9
+ ch === 0x24 || ch === 0x5F; // $ (dollar) and _ (underscore)
+ }
+
+ function isIdentifierStartES5(ch) {
+ return ch < 0x80 ? IDENTIFIER_START[ch] : ES5Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch));
+ }
+
+ function isIdentifierPartES5(ch) {
+ return ch < 0x80 ? IDENTIFIER_PART[ch] : ES5Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch));
+ }
+
+ function isIdentifierStartES6(ch) {
+ return ch < 0x80 ? IDENTIFIER_START[ch] : ES6Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch));
+ }
+
+ function isIdentifierPartES6(ch) {
+ return ch < 0x80 ? IDENTIFIER_PART[ch] : ES6Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch));
+ }
+
+ module.exports = {
+ isDecimalDigit: isDecimalDigit,
+ isHexDigit: isHexDigit,
+ isOctalDigit: isOctalDigit,
+ isWhiteSpace: isWhiteSpace,
+ isLineTerminator: isLineTerminator,
+ isIdentifierStartES5: isIdentifierStartES5,
+ isIdentifierPartES5: isIdentifierPartES5,
+ isIdentifierStartES6: isIdentifierStartES6,
+ isIdentifierPartES6: isIdentifierPartES6
+ };
+}());
+/* vim: set sw=4 ts=4 et tw=80 : */
diff --git a/chromium/third_party/node/node_modules/esutils/lib/keyword.js b/chromium/third_party/node/node_modules/esutils/lib/keyword.js
new file mode 100644
index 00000000000..13c8c6a967c
--- /dev/null
+++ b/chromium/third_party/node/node_modules/esutils/lib/keyword.js
@@ -0,0 +1,165 @@
+/*
+ Copyright (C) 2013 Yusuke Suzuki <utatane.tea@gmail.com>
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+(function () {
+ 'use strict';
+
+ var code = require('./code');
+
+ function isStrictModeReservedWordES6(id) {
+ switch (id) {
+ case 'implements':
+ case 'interface':
+ case 'package':
+ case 'private':
+ case 'protected':
+ case 'public':
+ case 'static':
+ case 'let':
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ function isKeywordES5(id, strict) {
+ // yield should not be treated as keyword under non-strict mode.
+ if (!strict && id === 'yield') {
+ return false;
+ }
+ return isKeywordES6(id, strict);
+ }
+
+ function isKeywordES6(id, strict) {
+ if (strict && isStrictModeReservedWordES6(id)) {
+ return true;
+ }
+
+ switch (id.length) {
+ case 2:
+ return (id === 'if') || (id === 'in') || (id === 'do');
+ case 3:
+ return (id === 'var') || (id === 'for') || (id === 'new') || (id === 'try');
+ case 4:
+ return (id === 'this') || (id === 'else') || (id === 'case') ||
+ (id === 'void') || (id === 'with') || (id === 'enum');
+ case 5:
+ return (id === 'while') || (id === 'break') || (id === 'catch') ||
+ (id === 'throw') || (id === 'const') || (id === 'yield') ||
+ (id === 'class') || (id === 'super');
+ case 6:
+ return (id === 'return') || (id === 'typeof') || (id === 'delete') ||
+ (id === 'switch') || (id === 'export') || (id === 'import');
+ case 7:
+ return (id === 'default') || (id === 'finally') || (id === 'extends');
+ case 8:
+ return (id === 'function') || (id === 'continue') || (id === 'debugger');
+ case 10:
+ return (id === 'instanceof');
+ default:
+ return false;
+ }
+ }
+
+ function isReservedWordES5(id, strict) {
+ return id === 'null' || id === 'true' || id === 'false' || isKeywordES5(id, strict);
+ }
+
+ function isReservedWordES6(id, strict) {
+ return id === 'null' || id === 'true' || id === 'false' || isKeywordES6(id, strict);
+ }
+
+ function isRestrictedWord(id) {
+ return id === 'eval' || id === 'arguments';
+ }
+
+ function isIdentifierNameES5(id) {
+ var i, iz, ch;
+
+ if (id.length === 0) { return false; }
+
+ ch = id.charCodeAt(0);
+ if (!code.isIdentifierStartES5(ch)) {
+ return false;
+ }
+
+ for (i = 1, iz = id.length; i < iz; ++i) {
+ ch = id.charCodeAt(i);
+ if (!code.isIdentifierPartES5(ch)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ function decodeUtf16(lead, trail) {
+ return (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;
+ }
+
+ function isIdentifierNameES6(id) {
+ var i, iz, ch, lowCh, check;
+
+ if (id.length === 0) { return false; }
+
+ check = code.isIdentifierStartES6;
+ for (i = 0, iz = id.length; i < iz; ++i) {
+ ch = id.charCodeAt(i);
+ if (0xD800 <= ch && ch <= 0xDBFF) {
+ ++i;
+ if (i >= iz) { return false; }
+ lowCh = id.charCodeAt(i);
+ if (!(0xDC00 <= lowCh && lowCh <= 0xDFFF)) {
+ return false;
+ }
+ ch = decodeUtf16(ch, lowCh);
+ }
+ if (!check(ch)) {
+ return false;
+ }
+ check = code.isIdentifierPartES6;
+ }
+ return true;
+ }
+
+ function isIdentifierES5(id, strict) {
+ return isIdentifierNameES5(id) && !isReservedWordES5(id, strict);
+ }
+
+ function isIdentifierES6(id, strict) {
+ return isIdentifierNameES6(id) && !isReservedWordES6(id, strict);
+ }
+
+ module.exports = {
+ isKeywordES5: isKeywordES5,
+ isKeywordES6: isKeywordES6,
+ isReservedWordES5: isReservedWordES5,
+ isReservedWordES6: isReservedWordES6,
+ isRestrictedWord: isRestrictedWord,
+ isIdentifierNameES5: isIdentifierNameES5,
+ isIdentifierNameES6: isIdentifierNameES6,
+ isIdentifierES5: isIdentifierES5,
+ isIdentifierES6: isIdentifierES6
+ };
+}());
+/* vim: set sw=4 ts=4 et tw=80 : */
diff --git a/chromium/third_party/node/node_modules/esutils/lib/utils.js b/chromium/third_party/node/node_modules/esutils/lib/utils.js
new file mode 100644
index 00000000000..ce18faa6bc8
--- /dev/null
+++ b/chromium/third_party/node/node_modules/esutils/lib/utils.js
@@ -0,0 +1,33 @@
+/*
+ Copyright (C) 2013 Yusuke Suzuki <utatane.tea@gmail.com>
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+(function () {
+ 'use strict';
+
+ exports.ast = require('./ast');
+ exports.code = require('./code');
+ exports.keyword = require('./keyword');
+}());
+/* vim: set sw=4 ts=4 et tw=80 : */
diff --git a/chromium/third_party/node/node_modules/esutils/package.json b/chromium/third_party/node/node_modules/esutils/package.json
new file mode 100644
index 00000000000..8396f4cee3f
--- /dev/null
+++ b/chromium/third_party/node/node_modules/esutils/package.json
@@ -0,0 +1,44 @@
+{
+ "name": "esutils",
+ "description": "utility box for ECMAScript language tools",
+ "homepage": "https://github.com/estools/esutils",
+ "main": "lib/utils.js",
+ "version": "2.0.3",
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "directories": {
+ "lib": "./lib"
+ },
+ "files": [
+ "LICENSE.BSD",
+ "README.md",
+ "lib"
+ ],
+ "maintainers": [
+ {
+ "name": "Yusuke Suzuki",
+ "email": "utatane.tea@gmail.com",
+ "web": "http://github.com/Constellation"
+ }
+ ],
+ "repository": {
+ "type": "git",
+ "url": "http://github.com/estools/esutils.git"
+ },
+ "devDependencies": {
+ "chai": "~1.7.2",
+ "coffee-script": "~1.6.3",
+ "jshint": "2.6.3",
+ "mocha": "~2.2.1",
+ "regenerate": "~1.3.1",
+ "unicode-9.0.0": "~0.7.0"
+ },
+ "license": "BSD-2-Clause",
+ "scripts": {
+ "test": "npm run-script lint && npm run-script unit-test",
+ "lint": "jshint lib/*.js",
+ "unit-test": "mocha --compilers coffee:coffee-script -R spec",
+ "generate-regex": "node tools/generate-identifier-regex.js"
+ }
+}
diff --git a/chromium/third_party/node/node_modules/function-bind/LICENSE b/chromium/third_party/node/node_modules/function-bind/LICENSE
new file mode 100644
index 00000000000..62d6d237ff1
--- /dev/null
+++ b/chromium/third_party/node/node_modules/function-bind/LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2013 Raynos.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
diff --git a/chromium/third_party/node/node_modules/function-bind/implementation.js b/chromium/third_party/node/node_modules/function-bind/implementation.js
new file mode 100644
index 00000000000..cc4daec1b08
--- /dev/null
+++ b/chromium/third_party/node/node_modules/function-bind/implementation.js
@@ -0,0 +1,52 @@
+'use strict';
+
+/* eslint no-invalid-this: 1 */
+
+var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
+var slice = Array.prototype.slice;
+var toStr = Object.prototype.toString;
+var funcType = '[object Function]';
+
+module.exports = function bind(that) {
+ var target = this;
+ if (typeof target !== 'function' || toStr.call(target) !== funcType) {
+ throw new TypeError(ERROR_MESSAGE + target);
+ }
+ var args = slice.call(arguments, 1);
+
+ var bound;
+ var binder = function () {
+ if (this instanceof bound) {
+ var result = target.apply(
+ this,
+ args.concat(slice.call(arguments))
+ );
+ if (Object(result) === result) {
+ return result;
+ }
+ return this;
+ } else {
+ return target.apply(
+ that,
+ args.concat(slice.call(arguments))
+ );
+ }
+ };
+
+ var boundLength = Math.max(0, target.length - args.length);
+ var boundArgs = [];
+ for (var i = 0; i < boundLength; i++) {
+ boundArgs.push('$' + i);
+ }
+
+ bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
+
+ if (target.prototype) {
+ var Empty = function Empty() {};
+ Empty.prototype = target.prototype;
+ bound.prototype = new Empty();
+ Empty.prototype = null;
+ }
+
+ return bound;
+};
diff --git a/chromium/third_party/node/node_modules/function-bind/index.js b/chromium/third_party/node/node_modules/function-bind/index.js
new file mode 100644
index 00000000000..3bb6b960988
--- /dev/null
+++ b/chromium/third_party/node/node_modules/function-bind/index.js
@@ -0,0 +1,5 @@
+'use strict';
+
+var implementation = require('./implementation');
+
+module.exports = Function.prototype.bind || implementation;
diff --git a/chromium/third_party/node/node_modules/function-bind/package.json b/chromium/third_party/node/node_modules/function-bind/package.json
new file mode 100644
index 00000000000..20a1727cbf8
--- /dev/null
+++ b/chromium/third_party/node/node_modules/function-bind/package.json
@@ -0,0 +1,63 @@
+{
+ "name": "function-bind",
+ "version": "1.1.1",
+ "description": "Implementation of Function.prototype.bind",
+ "keywords": [
+ "function",
+ "bind",
+ "shim",
+ "es5"
+ ],
+ "author": "Raynos <raynos2@gmail.com>",
+ "repository": "git://github.com/Raynos/function-bind.git",
+ "main": "index",
+ "homepage": "https://github.com/Raynos/function-bind",
+ "contributors": [
+ {
+ "name": "Raynos"
+ },
+ {
+ "name": "Jordan Harband",
+ "url": "https://github.com/ljharb"
+ }
+ ],
+ "bugs": {
+ "url": "https://github.com/Raynos/function-bind/issues",
+ "email": "raynos2@gmail.com"
+ },
+ "dependencies": {},
+ "devDependencies": {
+ "@ljharb/eslint-config": "^12.2.1",
+ "covert": "^1.1.0",
+ "eslint": "^4.5.0",
+ "jscs": "^3.0.7",
+ "tape": "^4.8.0"
+ },
+ "license": "MIT",
+ "scripts": {
+ "pretest": "npm run lint",
+ "test": "npm run tests-only",
+ "posttest": "npm run coverage -- --quiet",
+ "tests-only": "node test",
+ "coverage": "covert test/*.js",
+ "lint": "npm run jscs && npm run eslint",
+ "jscs": "jscs *.js */*.js",
+ "eslint": "eslint *.js */*.js"
+ },
+ "testling": {
+ "files": "test/index.js",
+ "browsers": [
+ "ie/8..latest",
+ "firefox/16..latest",
+ "firefox/nightly",
+ "chrome/22..latest",
+ "chrome/canary",
+ "opera/12..latest",
+ "opera/next",
+ "safari/5.1..latest",
+ "ipad/6.0..latest",
+ "iphone/6.0..latest",
+ "android-browser/4.2..latest"
+ ]
+ }
+}
diff --git a/chromium/third_party/node/node_modules/globals/globals.json b/chromium/third_party/node/node_modules/globals/globals.json
new file mode 100644
index 00000000000..6f5ac02f1ea
--- /dev/null
+++ b/chromium/third_party/node/node_modules/globals/globals.json
@@ -0,0 +1,1563 @@
+{
+ "builtin": {
+ "Array": false,
+ "ArrayBuffer": false,
+ "Atomics": false,
+ "BigInt": false,
+ "BigInt64Array": false,
+ "BigUint64Array": false,
+ "Boolean": false,
+ "constructor": false,
+ "DataView": false,
+ "Date": false,
+ "decodeURI": false,
+ "decodeURIComponent": false,
+ "encodeURI": false,
+ "encodeURIComponent": false,
+ "Error": false,
+ "escape": false,
+ "eval": false,
+ "EvalError": false,
+ "Float32Array": false,
+ "Float64Array": false,
+ "Function": false,
+ "globalThis": false,
+ "hasOwnProperty": false,
+ "Infinity": false,
+ "Int16Array": false,
+ "Int32Array": false,
+ "Int8Array": false,
+ "isFinite": false,
+ "isNaN": false,
+ "isPrototypeOf": false,
+ "JSON": false,
+ "Map": false,
+ "Math": false,
+ "NaN": false,
+ "Number": false,
+ "Object": false,
+ "parseFloat": false,
+ "parseInt": false,
+ "Promise": false,
+ "propertyIsEnumerable": false,
+ "Proxy": false,
+ "RangeError": false,
+ "ReferenceError": false,
+ "Reflect": false,
+ "RegExp": false,
+ "Set": false,
+ "SharedArrayBuffer": false,
+ "String": false,
+ "Symbol": false,
+ "SyntaxError": false,
+ "toLocaleString": false,
+ "toString": false,
+ "TypeError": false,
+ "Uint16Array": false,
+ "Uint32Array": false,
+ "Uint8Array": false,
+ "Uint8ClampedArray": false,
+ "undefined": false,
+ "unescape": false,
+ "URIError": false,
+ "valueOf": false,
+ "WeakMap": false,
+ "WeakSet": false
+ },
+ "es5": {
+ "Array": false,
+ "Boolean": false,
+ "constructor": false,
+ "Date": false,
+ "decodeURI": false,
+ "decodeURIComponent": false,
+ "encodeURI": false,
+ "encodeURIComponent": false,
+ "Error": false,
+ "escape": false,
+ "eval": false,
+ "EvalError": false,
+ "Function": false,
+ "hasOwnProperty": false,
+ "Infinity": false,
+ "isFinite": false,
+ "isNaN": false,
+ "isPrototypeOf": false,
+ "JSON": false,
+ "Math": false,
+ "NaN": false,
+ "Number": false,
+ "Object": false,
+ "parseFloat": false,
+ "parseInt": false,
+ "propertyIsEnumerable": false,
+ "RangeError": false,
+ "ReferenceError": false,
+ "RegExp": false,
+ "String": false,
+ "SyntaxError": false,
+ "toLocaleString": false,
+ "toString": false,
+ "TypeError": false,
+ "undefined": false,
+ "unescape": false,
+ "URIError": false,
+ "valueOf": false
+ },
+ "es2015": {
+ "Array": false,
+ "ArrayBuffer": false,
+ "Boolean": false,
+ "constructor": false,
+ "DataView": false,
+ "Date": false,
+ "decodeURI": false,
+ "decodeURIComponent": false,
+ "encodeURI": false,
+ "encodeURIComponent": false,
+ "Error": false,
+ "escape": false,
+ "eval": false,
+ "EvalError": false,
+ "Float32Array": false,
+ "Float64Array": false,
+ "Function": false,
+ "hasOwnProperty": false,
+ "Infinity": false,
+ "Int16Array": false,
+ "Int32Array": false,
+ "Int8Array": false,
+ "isFinite": false,
+ "isNaN": false,
+ "isPrototypeOf": false,
+ "JSON": false,
+ "Map": false,
+ "Math": false,
+ "NaN": false,
+ "Number": false,
+ "Object": false,
+ "parseFloat": false,
+ "parseInt": false,
+ "Promise": false,
+ "propertyIsEnumerable": false,
+ "Proxy": false,
+ "RangeError": false,
+ "ReferenceError": false,
+ "Reflect": false,
+ "RegExp": false,
+ "Set": false,
+ "String": false,
+ "Symbol": false,
+ "SyntaxError": false,
+ "toLocaleString": false,
+ "toString": false,
+ "TypeError": false,
+ "Uint16Array": false,
+ "Uint32Array": false,
+ "Uint8Array": false,
+ "Uint8ClampedArray": false,
+ "undefined": false,
+ "unescape": false,
+ "URIError": false,
+ "valueOf": false,
+ "WeakMap": false,
+ "WeakSet": false
+ },
+ "es2017": {
+ "Array": false,
+ "ArrayBuffer": false,
+ "Atomics": false,
+ "Boolean": false,
+ "constructor": false,
+ "DataView": false,
+ "Date": false,
+ "decodeURI": false,
+ "decodeURIComponent": false,
+ "encodeURI": false,
+ "encodeURIComponent": false,
+ "Error": false,
+ "escape": false,
+ "eval": false,
+ "EvalError": false,
+ "Float32Array": false,
+ "Float64Array": false,
+ "Function": false,
+ "hasOwnProperty": false,
+ "Infinity": false,
+ "Int16Array": false,
+ "Int32Array": false,
+ "Int8Array": false,
+ "isFinite": false,
+ "isNaN": false,
+ "isPrototypeOf": false,
+ "JSON": false,
+ "Map": false,
+ "Math": false,
+ "NaN": false,
+ "Number": false,
+ "Object": false,
+ "parseFloat": false,
+ "parseInt": false,
+ "Promise": false,
+ "propertyIsEnumerable": false,
+ "Proxy": false,
+ "RangeError": false,
+ "ReferenceError": false,
+ "Reflect": false,
+ "RegExp": false,
+ "Set": false,
+ "SharedArrayBuffer": false,
+ "String": false,
+ "Symbol": false,
+ "SyntaxError": false,
+ "toLocaleString": false,
+ "toString": false,
+ "TypeError": false,
+ "Uint16Array": false,
+ "Uint32Array": false,
+ "Uint8Array": false,
+ "Uint8ClampedArray": false,
+ "undefined": false,
+ "unescape": false,
+ "URIError": false,
+ "valueOf": false,
+ "WeakMap": false,
+ "WeakSet": false
+ },
+ "browser": {
+ "AbortController": false,
+ "AbortSignal": false,
+ "addEventListener": false,
+ "alert": false,
+ "AnalyserNode": false,
+ "Animation": false,
+ "AnimationEffectReadOnly": false,
+ "AnimationEffectTiming": false,
+ "AnimationEffectTimingReadOnly": false,
+ "AnimationEvent": false,
+ "AnimationPlaybackEvent": false,
+ "AnimationTimeline": false,
+ "applicationCache": false,
+ "ApplicationCache": false,
+ "ApplicationCacheErrorEvent": false,
+ "atob": false,
+ "Attr": false,
+ "Audio": false,
+ "AudioBuffer": false,
+ "AudioBufferSourceNode": false,
+ "AudioContext": false,
+ "AudioDestinationNode": false,
+ "AudioListener": false,
+ "AudioNode": false,
+ "AudioParam": false,
+ "AudioProcessingEvent": false,
+ "AudioScheduledSourceNode": false,
+ "AudioWorkletGlobalScope ": false,
+ "AudioWorkletNode": false,
+ "AudioWorkletProcessor": false,
+ "BarProp": false,
+ "BaseAudioContext": false,
+ "BatteryManager": false,
+ "BeforeUnloadEvent": false,
+ "BiquadFilterNode": false,
+ "Blob": false,
+ "BlobEvent": false,
+ "blur": false,
+ "BroadcastChannel": false,
+ "btoa": false,
+ "BudgetService": false,
+ "ByteLengthQueuingStrategy": false,
+ "Cache": false,
+ "caches": false,
+ "CacheStorage": false,
+ "cancelAnimationFrame": false,
+ "cancelIdleCallback": false,
+ "CanvasCaptureMediaStreamTrack": false,
+ "CanvasGradient": false,
+ "CanvasPattern": false,
+ "CanvasRenderingContext2D": false,
+ "ChannelMergerNode": false,
+ "ChannelSplitterNode": false,
+ "CharacterData": false,
+ "clearInterval": false,
+ "clearTimeout": false,
+ "clientInformation": false,
+ "ClipboardEvent": false,
+ "close": false,
+ "closed": false,
+ "CloseEvent": false,
+ "Comment": false,
+ "CompositionEvent": false,
+ "confirm": false,
+ "console": false,
+ "ConstantSourceNode": false,
+ "ConvolverNode": false,
+ "CountQueuingStrategy": false,
+ "createImageBitmap": false,
+ "Credential": false,
+ "CredentialsContainer": false,
+ "crypto": false,
+ "Crypto": false,
+ "CryptoKey": false,
+ "CSS": false,
+ "CSSConditionRule": false,
+ "CSSFontFaceRule": false,
+ "CSSGroupingRule": false,
+ "CSSImportRule": false,
+ "CSSKeyframeRule": false,
+ "CSSKeyframesRule": false,
+ "CSSMediaRule": false,
+ "CSSNamespaceRule": false,
+ "CSSPageRule": false,
+ "CSSRule": false,
+ "CSSRuleList": false,
+ "CSSStyleDeclaration": false,
+ "CSSStyleRule": false,
+ "CSSStyleSheet": false,
+ "CSSSupportsRule": false,
+ "CustomElementRegistry": false,
+ "customElements": false,
+ "CustomEvent": false,
+ "DataTransfer": false,
+ "DataTransferItem": false,
+ "DataTransferItemList": false,
+ "defaultstatus": false,
+ "defaultStatus": false,
+ "DelayNode": false,
+ "DeviceMotionEvent": false,
+ "DeviceOrientationEvent": false,
+ "devicePixelRatio": false,
+ "dispatchEvent": false,
+ "document": false,
+ "Document": false,
+ "DocumentFragment": false,
+ "DocumentType": false,
+ "DOMError": false,
+ "DOMException": false,
+ "DOMImplementation": false,
+ "DOMMatrix": false,
+ "DOMMatrixReadOnly": false,
+ "DOMParser": false,
+ "DOMPoint": false,
+ "DOMPointReadOnly": false,
+ "DOMQuad": false,
+ "DOMRect": false,
+ "DOMRectReadOnly": false,
+ "DOMStringList": false,
+ "DOMStringMap": false,
+ "DOMTokenList": false,
+ "DragEvent": false,
+ "DynamicsCompressorNode": false,
+ "Element": false,
+ "ErrorEvent": false,
+ "event": false,
+ "Event": false,
+ "EventSource": false,
+ "EventTarget": false,
+ "external": false,
+ "fetch": false,
+ "File": false,
+ "FileList": false,
+ "FileReader": false,
+ "find": false,
+ "focus": false,
+ "FocusEvent": false,
+ "FontFace": false,
+ "FontFaceSetLoadEvent": false,
+ "FormData": false,
+ "frameElement": false,
+ "frames": false,
+ "GainNode": false,
+ "Gamepad": false,
+ "GamepadButton": false,
+ "GamepadEvent": false,
+ "getComputedStyle": false,
+ "getSelection": false,
+ "HashChangeEvent": false,
+ "Headers": false,
+ "history": false,
+ "History": false,
+ "HTMLAllCollection": false,
+ "HTMLAnchorElement": false,
+ "HTMLAreaElement": false,
+ "HTMLAudioElement": false,
+ "HTMLBaseElement": false,
+ "HTMLBodyElement": false,
+ "HTMLBRElement": false,
+ "HTMLButtonElement": false,
+ "HTMLCanvasElement": false,
+ "HTMLCollection": false,
+ "HTMLContentElement": false,
+ "HTMLDataElement": false,
+ "HTMLDataListElement": false,
+ "HTMLDetailsElement": false,
+ "HTMLDialogElement": false,
+ "HTMLDirectoryElement": false,
+ "HTMLDivElement": false,
+ "HTMLDListElement": false,
+ "HTMLDocument": false,
+ "HTMLElement": false,
+ "HTMLEmbedElement": false,
+ "HTMLFieldSetElement": false,
+ "HTMLFontElement": false,
+ "HTMLFormControlsCollection": false,
+ "HTMLFormElement": false,
+ "HTMLFrameElement": false,
+ "HTMLFrameSetElement": false,
+ "HTMLHeadElement": false,
+ "HTMLHeadingElement": false,
+ "HTMLHRElement": false,
+ "HTMLHtmlElement": false,
+ "HTMLIFrameElement": false,
+ "HTMLImageElement": false,
+ "HTMLInputElement": false,
+ "HTMLLabelElement": false,
+ "HTMLLegendElement": false,
+ "HTMLLIElement": false,
+ "HTMLLinkElement": false,
+ "HTMLMapElement": false,
+ "HTMLMarqueeElement": false,
+ "HTMLMediaElement": false,
+ "HTMLMenuElement": false,
+ "HTMLMetaElement": false,
+ "HTMLMeterElement": false,
+ "HTMLModElement": false,
+ "HTMLObjectElement": false,
+ "HTMLOListElement": false,
+ "HTMLOptGroupElement": false,
+ "HTMLOptionElement": false,
+ "HTMLOptionsCollection": false,
+ "HTMLOutputElement": false,
+ "HTMLParagraphElement": false,
+ "HTMLParamElement": false,
+ "HTMLPictureElement": false,
+ "HTMLPreElement": false,
+ "HTMLProgressElement": false,
+ "HTMLQuoteElement": false,
+ "HTMLScriptElement": false,
+ "HTMLSelectElement": false,
+ "HTMLShadowElement": false,
+ "HTMLSlotElement": false,
+ "HTMLSourceElement": false,
+ "HTMLSpanElement": false,
+ "HTMLStyleElement": false,
+ "HTMLTableCaptionElement": false,
+ "HTMLTableCellElement": false,
+ "HTMLTableColElement": false,
+ "HTMLTableElement": false,
+ "HTMLTableRowElement": false,
+ "HTMLTableSectionElement": false,
+ "HTMLTemplateElement": false,
+ "HTMLTextAreaElement": false,
+ "HTMLTimeElement": false,
+ "HTMLTitleElement": false,
+ "HTMLTrackElement": false,
+ "HTMLUListElement": false,
+ "HTMLUnknownElement": false,
+ "HTMLVideoElement": false,
+ "IDBCursor": false,
+ "IDBCursorWithValue": false,
+ "IDBDatabase": false,
+ "IDBFactory": false,
+ "IDBIndex": false,
+ "IDBKeyRange": false,
+ "IDBObjectStore": false,
+ "IDBOpenDBRequest": false,
+ "IDBRequest": false,
+ "IDBTransaction": false,
+ "IDBVersionChangeEvent": false,
+ "IdleDeadline": false,
+ "IIRFilterNode": false,
+ "Image": false,
+ "ImageBitmap": false,
+ "ImageBitmapRenderingContext": false,
+ "ImageCapture": false,
+ "ImageData": false,
+ "indexedDB": false,
+ "innerHeight": false,
+ "innerWidth": false,
+ "InputEvent": false,
+ "IntersectionObserver": false,
+ "IntersectionObserverEntry": false,
+ "Intl": false,
+ "isSecureContext": false,
+ "KeyboardEvent": false,
+ "KeyframeEffect": false,
+ "KeyframeEffectReadOnly": false,
+ "length": false,
+ "localStorage": false,
+ "location": true,
+ "Location": false,
+ "locationbar": false,
+ "matchMedia": false,
+ "MediaDeviceInfo": false,
+ "MediaDevices": false,
+ "MediaElementAudioSourceNode": false,
+ "MediaEncryptedEvent": false,
+ "MediaError": false,
+ "MediaKeyMessageEvent": false,
+ "MediaKeySession": false,
+ "MediaKeyStatusMap": false,
+ "MediaKeySystemAccess": false,
+ "MediaList": false,
+ "MediaQueryList": false,
+ "MediaQueryListEvent": false,
+ "MediaRecorder": false,
+ "MediaSettingsRange": false,
+ "MediaSource": false,
+ "MediaStream": false,
+ "MediaStreamAudioDestinationNode": false,
+ "MediaStreamAudioSourceNode": false,
+ "MediaStreamEvent": false,
+ "MediaStreamTrack": false,
+ "MediaStreamTrackEvent": false,
+ "menubar": false,
+ "MessageChannel": false,
+ "MessageEvent": false,
+ "MessagePort": false,
+ "MIDIAccess": false,
+ "MIDIConnectionEvent": false,
+ "MIDIInput": false,
+ "MIDIInputMap": false,
+ "MIDIMessageEvent": false,
+ "MIDIOutput": false,
+ "MIDIOutputMap": false,
+ "MIDIPort": false,
+ "MimeType": false,
+ "MimeTypeArray": false,
+ "MouseEvent": false,
+ "moveBy": false,
+ "moveTo": false,
+ "MutationEvent": false,
+ "MutationObserver": false,
+ "MutationRecord": false,
+ "name": false,
+ "NamedNodeMap": false,
+ "NavigationPreloadManager": false,
+ "navigator": false,
+ "Navigator": false,
+ "NetworkInformation": false,
+ "Node": false,
+ "NodeFilter": false,
+ "NodeIterator": false,
+ "NodeList": false,
+ "Notification": false,
+ "OfflineAudioCompletionEvent": false,
+ "OfflineAudioContext": false,
+ "offscreenBuffering": false,
+ "OffscreenCanvas": true,
+ "onabort": true,
+ "onafterprint": true,
+ "onanimationend": true,
+ "onanimationiteration": true,
+ "onanimationstart": true,
+ "onappinstalled": true,
+ "onauxclick": true,
+ "onbeforeinstallprompt": true,
+ "onbeforeprint": true,
+ "onbeforeunload": true,
+ "onblur": true,
+ "oncancel": true,
+ "oncanplay": true,
+ "oncanplaythrough": true,
+ "onchange": true,
+ "onclick": true,
+ "onclose": true,
+ "oncontextmenu": true,
+ "oncuechange": true,
+ "ondblclick": true,
+ "ondevicemotion": true,
+ "ondeviceorientation": true,
+ "ondeviceorientationabsolute": true,
+ "ondrag": true,
+ "ondragend": true,
+ "ondragenter": true,
+ "ondragleave": true,
+ "ondragover": true,
+ "ondragstart": true,
+ "ondrop": true,
+ "ondurationchange": true,
+ "onemptied": true,
+ "onended": true,
+ "onerror": true,
+ "onfocus": true,
+ "ongotpointercapture": true,
+ "onhashchange": true,
+ "oninput": true,
+ "oninvalid": true,
+ "onkeydown": true,
+ "onkeypress": true,
+ "onkeyup": true,
+ "onlanguagechange": true,
+ "onload": true,
+ "onloadeddata": true,
+ "onloadedmetadata": true,
+ "onloadstart": true,
+ "onlostpointercapture": true,
+ "onmessage": true,
+ "onmessageerror": true,
+ "onmousedown": true,
+ "onmouseenter": true,
+ "onmouseleave": true,
+ "onmousemove": true,
+ "onmouseout": true,
+ "onmouseover": true,
+ "onmouseup": true,
+ "onmousewheel": true,
+ "onoffline": true,
+ "ononline": true,
+ "onpagehide": true,
+ "onpageshow": true,
+ "onpause": true,
+ "onplay": true,
+ "onplaying": true,
+ "onpointercancel": true,
+ "onpointerdown": true,
+ "onpointerenter": true,
+ "onpointerleave": true,
+ "onpointermove": true,
+ "onpointerout": true,
+ "onpointerover": true,
+ "onpointerup": true,
+ "onpopstate": true,
+ "onprogress": true,
+ "onratechange": true,
+ "onrejectionhandled": true,
+ "onreset": true,
+ "onresize": true,
+ "onscroll": true,
+ "onsearch": true,
+ "onseeked": true,
+ "onseeking": true,
+ "onselect": true,
+ "onstalled": true,
+ "onstorage": true,
+ "onsubmit": true,
+ "onsuspend": true,
+ "ontimeupdate": true,
+ "ontoggle": true,
+ "ontransitionend": true,
+ "onunhandledrejection": true,
+ "onunload": true,
+ "onvolumechange": true,
+ "onwaiting": true,
+ "onwheel": true,
+ "open": false,
+ "openDatabase": false,
+ "opener": false,
+ "Option": false,
+ "origin": false,
+ "OscillatorNode": false,
+ "outerHeight": false,
+ "outerWidth": false,
+ "PageTransitionEvent": false,
+ "pageXOffset": false,
+ "pageYOffset": false,
+ "PannerNode": false,
+ "parent": false,
+ "Path2D": false,
+ "PaymentAddress": false,
+ "PaymentRequest": false,
+ "PaymentRequestUpdateEvent": false,
+ "PaymentResponse": false,
+ "performance": false,
+ "Performance": false,
+ "PerformanceEntry": false,
+ "PerformanceLongTaskTiming": false,
+ "PerformanceMark": false,
+ "PerformanceMeasure": false,
+ "PerformanceNavigation": false,
+ "PerformanceNavigationTiming": false,
+ "PerformanceObserver": false,
+ "PerformanceObserverEntryList": false,
+ "PerformancePaintTiming": false,
+ "PerformanceResourceTiming": false,
+ "PerformanceTiming": false,
+ "PeriodicWave": false,
+ "Permissions": false,
+ "PermissionStatus": false,
+ "personalbar": false,
+ "PhotoCapabilities": false,
+ "Plugin": false,
+ "PluginArray": false,
+ "PointerEvent": false,
+ "PopStateEvent": false,
+ "postMessage": false,
+ "Presentation": false,
+ "PresentationAvailability": false,
+ "PresentationConnection": false,
+ "PresentationConnectionAvailableEvent": false,
+ "PresentationConnectionCloseEvent": false,
+ "PresentationConnectionList": false,
+ "PresentationReceiver": false,
+ "PresentationRequest": false,
+ "print": false,
+ "ProcessingInstruction": false,
+ "ProgressEvent": false,
+ "PromiseRejectionEvent": false,
+ "prompt": false,
+ "PushManager": false,
+ "PushSubscription": false,
+ "PushSubscriptionOptions": false,
+ "queueMicrotask": false,
+ "RadioNodeList": false,
+ "Range": false,
+ "ReadableStream": false,
+ "registerProcessor": false,
+ "RemotePlayback": false,
+ "removeEventListener": false,
+ "Request": false,
+ "requestAnimationFrame": false,
+ "requestIdleCallback": false,
+ "resizeBy": false,
+ "ResizeObserver": false,
+ "ResizeObserverEntry": false,
+ "resizeTo": false,
+ "Response": false,
+ "RTCCertificate": false,
+ "RTCDataChannel": false,
+ "RTCDataChannelEvent": false,
+ "RTCDtlsTransport": false,
+ "RTCIceCandidate": false,
+ "RTCIceGatherer": false,
+ "RTCIceTransport": false,
+ "RTCPeerConnection": false,
+ "RTCPeerConnectionIceEvent": false,
+ "RTCRtpContributingSource": false,
+ "RTCRtpReceiver": false,
+ "RTCRtpSender": false,
+ "RTCSctpTransport": false,
+ "RTCSessionDescription": false,
+ "RTCStatsReport": false,
+ "RTCTrackEvent": false,
+ "screen": false,
+ "Screen": false,
+ "screenLeft": false,
+ "ScreenOrientation": false,
+ "screenTop": false,
+ "screenX": false,
+ "screenY": false,
+ "ScriptProcessorNode": false,
+ "scroll": false,
+ "scrollbars": false,
+ "scrollBy": false,
+ "scrollTo": false,
+ "scrollX": false,
+ "scrollY": false,
+ "SecurityPolicyViolationEvent": false,
+ "Selection": false,
+ "self": false,
+ "ServiceWorker": false,
+ "ServiceWorkerContainer": false,
+ "ServiceWorkerRegistration": false,
+ "sessionStorage": false,
+ "setInterval": false,
+ "setTimeout": false,
+ "ShadowRoot": false,
+ "SharedWorker": false,
+ "SourceBuffer": false,
+ "SourceBufferList": false,
+ "speechSynthesis": false,
+ "SpeechSynthesisEvent": false,
+ "SpeechSynthesisUtterance": false,
+ "StaticRange": false,
+ "status": false,
+ "statusbar": false,
+ "StereoPannerNode": false,
+ "stop": false,
+ "Storage": false,
+ "StorageEvent": false,
+ "StorageManager": false,
+ "styleMedia": false,
+ "StyleSheet": false,
+ "StyleSheetList": false,
+ "SubtleCrypto": false,
+ "SVGAElement": false,
+ "SVGAngle": false,
+ "SVGAnimatedAngle": false,
+ "SVGAnimatedBoolean": false,
+ "SVGAnimatedEnumeration": false,
+ "SVGAnimatedInteger": false,
+ "SVGAnimatedLength": false,
+ "SVGAnimatedLengthList": false,
+ "SVGAnimatedNumber": false,
+ "SVGAnimatedNumberList": false,
+ "SVGAnimatedPreserveAspectRatio": false,
+ "SVGAnimatedRect": false,
+ "SVGAnimatedString": false,
+ "SVGAnimatedTransformList": false,
+ "SVGAnimateElement": false,
+ "SVGAnimateMotionElement": false,
+ "SVGAnimateTransformElement": false,
+ "SVGAnimationElement": false,
+ "SVGCircleElement": false,
+ "SVGClipPathElement": false,
+ "SVGComponentTransferFunctionElement": false,
+ "SVGDefsElement": false,
+ "SVGDescElement": false,
+ "SVGDiscardElement": false,
+ "SVGElement": false,
+ "SVGEllipseElement": false,
+ "SVGFEBlendElement": false,
+ "SVGFEColorMatrixElement": false,
+ "SVGFEComponentTransferElement": false,
+ "SVGFECompositeElement": false,
+ "SVGFEConvolveMatrixElement": false,
+ "SVGFEDiffuseLightingElement": false,
+ "SVGFEDisplacementMapElement": false,
+ "SVGFEDistantLightElement": false,
+ "SVGFEDropShadowElement": false,
+ "SVGFEFloodElement": false,
+ "SVGFEFuncAElement": false,
+ "SVGFEFuncBElement": false,
+ "SVGFEFuncGElement": false,
+ "SVGFEFuncRElement": false,
+ "SVGFEGaussianBlurElement": false,
+ "SVGFEImageElement": false,
+ "SVGFEMergeElement": false,
+ "SVGFEMergeNodeElement": false,
+ "SVGFEMorphologyElement": false,
+ "SVGFEOffsetElement": false,
+ "SVGFEPointLightElement": false,
+ "SVGFESpecularLightingElement": false,
+ "SVGFESpotLightElement": false,
+ "SVGFETileElement": false,
+ "SVGFETurbulenceElement": false,
+ "SVGFilterElement": false,
+ "SVGForeignObjectElement": false,
+ "SVGGElement": false,
+ "SVGGeometryElement": false,
+ "SVGGradientElement": false,
+ "SVGGraphicsElement": false,
+ "SVGImageElement": false,
+ "SVGLength": false,
+ "SVGLengthList": false,
+ "SVGLinearGradientElement": false,
+ "SVGLineElement": false,
+ "SVGMarkerElement": false,
+ "SVGMaskElement": false,
+ "SVGMatrix": false,
+ "SVGMetadataElement": false,
+ "SVGMPathElement": false,
+ "SVGNumber": false,
+ "SVGNumberList": false,
+ "SVGPathElement": false,
+ "SVGPatternElement": false,
+ "SVGPoint": false,
+ "SVGPointList": false,
+ "SVGPolygonElement": false,
+ "SVGPolylineElement": false,
+ "SVGPreserveAspectRatio": false,
+ "SVGRadialGradientElement": false,
+ "SVGRect": false,
+ "SVGRectElement": false,
+ "SVGScriptElement": false,
+ "SVGSetElement": false,
+ "SVGStopElement": false,
+ "SVGStringList": false,
+ "SVGStyleElement": false,
+ "SVGSVGElement": false,
+ "SVGSwitchElement": false,
+ "SVGSymbolElement": false,
+ "SVGTextContentElement": false,
+ "SVGTextElement": false,
+ "SVGTextPathElement": false,
+ "SVGTextPositioningElement": false,
+ "SVGTitleElement": false,
+ "SVGTransform": false,
+ "SVGTransformList": false,
+ "SVGTSpanElement": false,
+ "SVGUnitTypes": false,
+ "SVGUseElement": false,
+ "SVGViewElement": false,
+ "TaskAttributionTiming": false,
+ "Text": false,
+ "TextDecoder": false,
+ "TextEncoder": false,
+ "TextEvent": false,
+ "TextMetrics": false,
+ "TextTrack": false,
+ "TextTrackCue": false,
+ "TextTrackCueList": false,
+ "TextTrackList": false,
+ "TimeRanges": false,
+ "toolbar": false,
+ "top": false,
+ "Touch": false,
+ "TouchEvent": false,
+ "TouchList": false,
+ "TrackEvent": false,
+ "TransitionEvent": false,
+ "TreeWalker": false,
+ "UIEvent": false,
+ "URL": false,
+ "URLSearchParams": false,
+ "ValidityState": false,
+ "visualViewport": false,
+ "VisualViewport": false,
+ "VTTCue": false,
+ "WaveShaperNode": false,
+ "WebAssembly": false,
+ "WebGL2RenderingContext": false,
+ "WebGLActiveInfo": false,
+ "WebGLBuffer": false,
+ "WebGLContextEvent": false,
+ "WebGLFramebuffer": false,
+ "WebGLProgram": false,
+ "WebGLQuery": false,
+ "WebGLRenderbuffer": false,
+ "WebGLRenderingContext": false,
+ "WebGLSampler": false,
+ "WebGLShader": false,
+ "WebGLShaderPrecisionFormat": false,
+ "WebGLSync": false,
+ "WebGLTexture": false,
+ "WebGLTransformFeedback": false,
+ "WebGLUniformLocation": false,
+ "WebGLVertexArrayObject": false,
+ "WebSocket": false,
+ "WheelEvent": false,
+ "window": false,
+ "Window": false,
+ "Worker": false,
+ "WritableStream": false,
+ "XMLDocument": false,
+ "XMLHttpRequest": false,
+ "XMLHttpRequestEventTarget": false,
+ "XMLHttpRequestUpload": false,
+ "XMLSerializer": false,
+ "XPathEvaluator": false,
+ "XPathExpression": false,
+ "XPathResult": false,
+ "XSLTProcessor": false
+ },
+ "worker": {
+ "addEventListener": false,
+ "applicationCache": false,
+ "atob": false,
+ "Blob": false,
+ "BroadcastChannel": false,
+ "btoa": false,
+ "Cache": false,
+ "caches": false,
+ "clearInterval": false,
+ "clearTimeout": false,
+ "close": true,
+ "console": false,
+ "fetch": false,
+ "FileReaderSync": false,
+ "FormData": false,
+ "Headers": false,
+ "IDBCursor": false,
+ "IDBCursorWithValue": false,
+ "IDBDatabase": false,
+ "IDBFactory": false,
+ "IDBIndex": false,
+ "IDBKeyRange": false,
+ "IDBObjectStore": false,
+ "IDBOpenDBRequest": false,
+ "IDBRequest": false,
+ "IDBTransaction": false,
+ "IDBVersionChangeEvent": false,
+ "ImageData": false,
+ "importScripts": true,
+ "indexedDB": false,
+ "location": false,
+ "MessageChannel": false,
+ "MessagePort": false,
+ "name": false,
+ "navigator": false,
+ "Notification": false,
+ "onclose": true,
+ "onconnect": true,
+ "onerror": true,
+ "onlanguagechange": true,
+ "onmessage": true,
+ "onoffline": true,
+ "ononline": true,
+ "onrejectionhandled": true,
+ "onunhandledrejection": true,
+ "performance": false,
+ "Performance": false,
+ "PerformanceEntry": false,
+ "PerformanceMark": false,
+ "PerformanceMeasure": false,
+ "PerformanceNavigation": false,
+ "PerformanceResourceTiming": false,
+ "PerformanceTiming": false,
+ "postMessage": true,
+ "Promise": false,
+ "queueMicrotask": false,
+ "removeEventListener": false,
+ "Request": false,
+ "Response": false,
+ "self": true,
+ "ServiceWorkerRegistration": false,
+ "setInterval": false,
+ "setTimeout": false,
+ "TextDecoder": false,
+ "TextEncoder": false,
+ "URL": false,
+ "URLSearchParams": false,
+ "WebSocket": false,
+ "Worker": false,
+ "WorkerGlobalScope": false,
+ "XMLHttpRequest": false
+ },
+ "node": {
+ "__dirname": false,
+ "__filename": false,
+ "Buffer": false,
+ "clearImmediate": false,
+ "clearInterval": false,
+ "clearTimeout": false,
+ "console": false,
+ "exports": true,
+ "global": false,
+ "Intl": false,
+ "module": false,
+ "process": false,
+ "queueMicrotask": false,
+ "require": false,
+ "setImmediate": false,
+ "setInterval": false,
+ "setTimeout": false,
+ "TextDecoder": false,
+ "TextEncoder": false,
+ "URL": false,
+ "URLSearchParams": false
+ },
+ "commonjs": {
+ "exports": true,
+ "global": false,
+ "module": false,
+ "require": false
+ },
+ "amd": {
+ "define": false,
+ "require": false
+ },
+ "mocha": {
+ "after": false,
+ "afterEach": false,
+ "before": false,
+ "beforeEach": false,
+ "context": false,
+ "describe": false,
+ "it": false,
+ "mocha": false,
+ "run": false,
+ "setup": false,
+ "specify": false,
+ "suite": false,
+ "suiteSetup": false,
+ "suiteTeardown": false,
+ "teardown": false,
+ "test": false,
+ "xcontext": false,
+ "xdescribe": false,
+ "xit": false,
+ "xspecify": false
+ },
+ "jasmine": {
+ "afterAll": false,
+ "afterEach": false,
+ "beforeAll": false,
+ "beforeEach": false,
+ "describe": false,
+ "expect": false,
+ "fail": false,
+ "fdescribe": false,
+ "fit": false,
+ "it": false,
+ "jasmine": false,
+ "pending": false,
+ "runs": false,
+ "spyOn": false,
+ "spyOnProperty": false,
+ "waits": false,
+ "waitsFor": false,
+ "xdescribe": false,
+ "xit": false
+ },
+ "jest": {
+ "afterAll": false,
+ "afterEach": false,
+ "beforeAll": false,
+ "beforeEach": false,
+ "describe": false,
+ "expect": false,
+ "fdescribe": false,
+ "fit": false,
+ "it": false,
+ "jest": false,
+ "pit": false,
+ "require": false,
+ "test": false,
+ "xdescribe": false,
+ "xit": false,
+ "xtest": false
+ },
+ "qunit": {
+ "asyncTest": false,
+ "deepEqual": false,
+ "equal": false,
+ "expect": false,
+ "module": false,
+ "notDeepEqual": false,
+ "notEqual": false,
+ "notOk": false,
+ "notPropEqual": false,
+ "notStrictEqual": false,
+ "ok": false,
+ "propEqual": false,
+ "QUnit": false,
+ "raises": false,
+ "start": false,
+ "stop": false,
+ "strictEqual": false,
+ "test": false,
+ "throws": false
+ },
+ "phantomjs": {
+ "console": true,
+ "exports": true,
+ "phantom": true,
+ "require": true,
+ "WebPage": true
+ },
+ "couch": {
+ "emit": false,
+ "exports": false,
+ "getRow": false,
+ "log": false,
+ "module": false,
+ "provides": false,
+ "require": false,
+ "respond": false,
+ "send": false,
+ "start": false,
+ "sum": false
+ },
+ "rhino": {
+ "defineClass": false,
+ "deserialize": false,
+ "gc": false,
+ "help": false,
+ "importClass": false,
+ "importPackage": false,
+ "java": false,
+ "load": false,
+ "loadClass": false,
+ "Packages": false,
+ "print": false,
+ "quit": false,
+ "readFile": false,
+ "readUrl": false,
+ "runCommand": false,
+ "seal": false,
+ "serialize": false,
+ "spawn": false,
+ "sync": false,
+ "toint32": false,
+ "version": false
+ },
+ "nashorn": {
+ "__DIR__": false,
+ "__FILE__": false,
+ "__LINE__": false,
+ "com": false,
+ "edu": false,
+ "exit": false,
+ "java": false,
+ "Java": false,
+ "javafx": false,
+ "JavaImporter": false,
+ "javax": false,
+ "JSAdapter": false,
+ "load": false,
+ "loadWithNewGlobal": false,
+ "org": false,
+ "Packages": false,
+ "print": false,
+ "quit": false
+ },
+ "wsh": {
+ "ActiveXObject": true,
+ "Enumerator": true,
+ "GetObject": true,
+ "ScriptEngine": true,
+ "ScriptEngineBuildVersion": true,
+ "ScriptEngineMajorVersion": true,
+ "ScriptEngineMinorVersion": true,
+ "VBArray": true,
+ "WScript": true,
+ "WSH": true,
+ "XDomainRequest": true
+ },
+ "jquery": {
+ "$": false,
+ "jQuery": false
+ },
+ "yui": {
+ "YAHOO": false,
+ "YAHOO_config": false,
+ "YUI": false,
+ "YUI_config": false
+ },
+ "shelljs": {
+ "cat": false,
+ "cd": false,
+ "chmod": false,
+ "config": false,
+ "cp": false,
+ "dirs": false,
+ "echo": false,
+ "env": false,
+ "error": false,
+ "exec": false,
+ "exit": false,
+ "find": false,
+ "grep": false,
+ "ln": false,
+ "ls": false,
+ "mkdir": false,
+ "mv": false,
+ "popd": false,
+ "pushd": false,
+ "pwd": false,
+ "rm": false,
+ "sed": false,
+ "set": false,
+ "target": false,
+ "tempdir": false,
+ "test": false,
+ "touch": false,
+ "which": false
+ },
+ "prototypejs": {
+ "$": false,
+ "$$": false,
+ "$A": false,
+ "$break": false,
+ "$continue": false,
+ "$F": false,
+ "$H": false,
+ "$R": false,
+ "$w": false,
+ "Abstract": false,
+ "Ajax": false,
+ "Autocompleter": false,
+ "Builder": false,
+ "Class": false,
+ "Control": false,
+ "Draggable": false,
+ "Draggables": false,
+ "Droppables": false,
+ "Effect": false,
+ "Element": false,
+ "Enumerable": false,
+ "Event": false,
+ "Field": false,
+ "Form": false,
+ "Hash": false,
+ "Insertion": false,
+ "ObjectRange": false,
+ "PeriodicalExecuter": false,
+ "Position": false,
+ "Prototype": false,
+ "Scriptaculous": false,
+ "Selector": false,
+ "Sortable": false,
+ "SortableObserver": false,
+ "Sound": false,
+ "Template": false,
+ "Toggle": false,
+ "Try": false
+ },
+ "meteor": {
+ "_": false,
+ "$": false,
+ "Accounts": false,
+ "AccountsClient": false,
+ "AccountsCommon": false,
+ "AccountsServer": false,
+ "App": false,
+ "Assets": false,
+ "Blaze": false,
+ "check": false,
+ "Cordova": false,
+ "DDP": false,
+ "DDPRateLimiter": false,
+ "DDPServer": false,
+ "Deps": false,
+ "EJSON": false,
+ "Email": false,
+ "HTTP": false,
+ "Log": false,
+ "Match": false,
+ "Meteor": false,
+ "Mongo": false,
+ "MongoInternals": false,
+ "Npm": false,
+ "Package": false,
+ "Plugin": false,
+ "process": false,
+ "Random": false,
+ "ReactiveDict": false,
+ "ReactiveVar": false,
+ "Router": false,
+ "ServiceConfiguration": false,
+ "Session": false,
+ "share": false,
+ "Spacebars": false,
+ "Template": false,
+ "Tinytest": false,
+ "Tracker": false,
+ "UI": false,
+ "Utils": false,
+ "WebApp": false,
+ "WebAppInternals": false
+ },
+ "mongo": {
+ "_isWindows": false,
+ "_rand": false,
+ "BulkWriteResult": false,
+ "cat": false,
+ "cd": false,
+ "connect": false,
+ "db": false,
+ "getHostName": false,
+ "getMemInfo": false,
+ "hostname": false,
+ "ISODate": false,
+ "listFiles": false,
+ "load": false,
+ "ls": false,
+ "md5sumFile": false,
+ "mkdir": false,
+ "Mongo": false,
+ "NumberInt": false,
+ "NumberLong": false,
+ "ObjectId": false,
+ "PlanCache": false,
+ "print": false,
+ "printjson": false,
+ "pwd": false,
+ "quit": false,
+ "removeFile": false,
+ "rs": false,
+ "sh": false,
+ "UUID": false,
+ "version": false,
+ "WriteResult": false
+ },
+ "applescript": {
+ "$": false,
+ "Application": false,
+ "Automation": false,
+ "console": false,
+ "delay": false,
+ "Library": false,
+ "ObjC": false,
+ "ObjectSpecifier": false,
+ "Path": false,
+ "Progress": false,
+ "Ref": false
+ },
+ "serviceworker": {
+ "addEventListener": false,
+ "applicationCache": false,
+ "atob": false,
+ "Blob": false,
+ "BroadcastChannel": false,
+ "btoa": false,
+ "Cache": false,
+ "caches": false,
+ "CacheStorage": false,
+ "clearInterval": false,
+ "clearTimeout": false,
+ "Client": false,
+ "clients": false,
+ "Clients": false,
+ "close": true,
+ "console": false,
+ "ExtendableEvent": false,
+ "ExtendableMessageEvent": false,
+ "fetch": false,
+ "FetchEvent": false,
+ "FileReaderSync": false,
+ "FormData": false,
+ "Headers": false,
+ "IDBCursor": false,
+ "IDBCursorWithValue": false,
+ "IDBDatabase": false,
+ "IDBFactory": false,
+ "IDBIndex": false,
+ "IDBKeyRange": false,
+ "IDBObjectStore": false,
+ "IDBOpenDBRequest": false,
+ "IDBRequest": false,
+ "IDBTransaction": false,
+ "IDBVersionChangeEvent": false,
+ "ImageData": false,
+ "importScripts": false,
+ "indexedDB": false,
+ "location": false,
+ "MessageChannel": false,
+ "MessagePort": false,
+ "name": false,
+ "navigator": false,
+ "Notification": false,
+ "onclose": true,
+ "onconnect": true,
+ "onerror": true,
+ "onfetch": true,
+ "oninstall": true,
+ "onlanguagechange": true,
+ "onmessage": true,
+ "onmessageerror": true,
+ "onnotificationclick": true,
+ "onnotificationclose": true,
+ "onoffline": true,
+ "ononline": true,
+ "onpush": true,
+ "onpushsubscriptionchange": true,
+ "onrejectionhandled": true,
+ "onsync": true,
+ "onunhandledrejection": true,
+ "performance": false,
+ "Performance": false,
+ "PerformanceEntry": false,
+ "PerformanceMark": false,
+ "PerformanceMeasure": false,
+ "PerformanceNavigation": false,
+ "PerformanceResourceTiming": false,
+ "PerformanceTiming": false,
+ "postMessage": true,
+ "Promise": false,
+ "queueMicrotask": false,
+ "registration": false,
+ "removeEventListener": false,
+ "Request": false,
+ "Response": false,
+ "self": false,
+ "ServiceWorker": false,
+ "ServiceWorkerContainer": false,
+ "ServiceWorkerGlobalScope": false,
+ "ServiceWorkerMessageEvent": false,
+ "ServiceWorkerRegistration": false,
+ "setInterval": false,
+ "setTimeout": false,
+ "skipWaiting": false,
+ "TextDecoder": false,
+ "TextEncoder": false,
+ "URL": false,
+ "URLSearchParams": false,
+ "WebSocket": false,
+ "WindowClient": false,
+ "Worker": false,
+ "WorkerGlobalScope": false,
+ "XMLHttpRequest": false
+ },
+ "atomtest": {
+ "advanceClock": false,
+ "fakeClearInterval": false,
+ "fakeClearTimeout": false,
+ "fakeSetInterval": false,
+ "fakeSetTimeout": false,
+ "resetTimeouts": false,
+ "waitsForPromise": false
+ },
+ "embertest": {
+ "andThen": false,
+ "click": false,
+ "currentPath": false,
+ "currentRouteName": false,
+ "currentURL": false,
+ "fillIn": false,
+ "find": false,
+ "findAll": false,
+ "findWithAssert": false,
+ "keyEvent": false,
+ "pauseTest": false,
+ "resumeTest": false,
+ "triggerEvent": false,
+ "visit": false,
+ "wait": false
+ },
+ "protractor": {
+ "$": false,
+ "$$": false,
+ "browser": false,
+ "by": false,
+ "By": false,
+ "DartObject": false,
+ "element": false,
+ "protractor": false
+ },
+ "shared-node-browser": {
+ "clearInterval": false,
+ "clearTimeout": false,
+ "console": false,
+ "setInterval": false,
+ "setTimeout": false,
+ "URL": false,
+ "URLSearchParams": false
+ },
+ "webextensions": {
+ "browser": false,
+ "chrome": false,
+ "opr": false
+ },
+ "greasemonkey": {
+ "cloneInto": false,
+ "createObjectIn": false,
+ "exportFunction": false,
+ "GM": false,
+ "GM_addStyle": false,
+ "GM_deleteValue": false,
+ "GM_getResourceText": false,
+ "GM_getResourceURL": false,
+ "GM_getValue": false,
+ "GM_info": false,
+ "GM_listValues": false,
+ "GM_log": false,
+ "GM_openInTab": false,
+ "GM_registerMenuCommand": false,
+ "GM_setClipboard": false,
+ "GM_setValue": false,
+ "GM_xmlhttpRequest": false,
+ "unsafeWindow": false
+ },
+ "devtools": {
+ "$": false,
+ "$_": false,
+ "$$": false,
+ "$0": false,
+ "$1": false,
+ "$2": false,
+ "$3": false,
+ "$4": false,
+ "$x": false,
+ "chrome": false,
+ "clear": false,
+ "copy": false,
+ "debug": false,
+ "dir": false,
+ "dirxml": false,
+ "getEventListeners": false,
+ "inspect": false,
+ "keys": false,
+ "monitor": false,
+ "monitorEvents": false,
+ "profile": false,
+ "profileEnd": false,
+ "queryObjects": false,
+ "table": false,
+ "undebug": false,
+ "unmonitor": false,
+ "unmonitorEvents": false,
+ "values": false
+ }
+}
diff --git a/chromium/third_party/node/node_modules/globals/index.js b/chromium/third_party/node/node_modules/globals/index.js
new file mode 100644
index 00000000000..a951582e417
--- /dev/null
+++ b/chromium/third_party/node/node_modules/globals/index.js
@@ -0,0 +1,2 @@
+'use strict';
+module.exports = require('./globals.json');
diff --git a/chromium/third_party/node/node_modules/globals/license b/chromium/third_party/node/node_modules/globals/license
new file mode 100644
index 00000000000..e7af2f77107
--- /dev/null
+++ b/chromium/third_party/node/node_modules/globals/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/chromium/third_party/node/node_modules/globals/package.json b/chromium/third_party/node/node_modules/globals/package.json
new file mode 100644
index 00000000000..dfe459b6fa6
--- /dev/null
+++ b/chromium/third_party/node/node_modules/globals/package.json
@@ -0,0 +1,41 @@
+{
+ "name": "globals",
+ "version": "11.12.0",
+ "description": "Global identifiers from different JavaScript environments",
+ "license": "MIT",
+ "repository": "sindresorhus/globals",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=4"
+ },
+ "scripts": {
+ "test": "xo && ava"
+ },
+ "files": [
+ "index.js",
+ "globals.json"
+ ],
+ "keywords": [
+ "globals",
+ "global",
+ "identifiers",
+ "variables",
+ "vars",
+ "jshint",
+ "eslint",
+ "environments"
+ ],
+ "devDependencies": {
+ "ava": "0.21.0",
+ "xo": "0.18.0"
+ },
+ "xo": {
+ "ignores": [
+ "get-browser-globals.js"
+ ]
+ }
+}
diff --git a/chromium/third_party/node/node_modules/has-flag/index.js b/chromium/third_party/node/node_modules/has-flag/index.js
new file mode 100644
index 00000000000..5139728fba6
--- /dev/null
+++ b/chromium/third_party/node/node_modules/has-flag/index.js
@@ -0,0 +1,8 @@
+'use strict';
+module.exports = (flag, argv) => {
+ argv = argv || process.argv;
+ const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
+ const pos = argv.indexOf(prefix + flag);
+ const terminatorPos = argv.indexOf('--');
+ return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
+};
diff --git a/chromium/third_party/node/node_modules/has-flag/license b/chromium/third_party/node/node_modules/has-flag/license
new file mode 100644
index 00000000000..e7af2f77107
--- /dev/null
+++ b/chromium/third_party/node/node_modules/has-flag/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/chromium/third_party/node/node_modules/has-flag/package.json b/chromium/third_party/node/node_modules/has-flag/package.json
new file mode 100644
index 00000000000..e1eb17a15ed
--- /dev/null
+++ b/chromium/third_party/node/node_modules/has-flag/package.json
@@ -0,0 +1,44 @@
+{
+ "name": "has-flag",
+ "version": "3.0.0",
+ "description": "Check if argv has a specific flag",
+ "license": "MIT",
+ "repository": "sindresorhus/has-flag",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=4"
+ },
+ "scripts": {
+ "test": "xo && ava"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "has",
+ "check",
+ "detect",
+ "contains",
+ "find",
+ "flag",
+ "cli",
+ "command-line",
+ "argv",
+ "process",
+ "arg",
+ "args",
+ "argument",
+ "arguments",
+ "getopt",
+ "minimist",
+ "optimist"
+ ],
+ "devDependencies": {
+ "ava": "*",
+ "xo": "*"
+ }
+}
diff --git a/chromium/third_party/node/node_modules/has/LICENSE-MIT b/chromium/third_party/node/node_modules/has/LICENSE-MIT
new file mode 100644
index 00000000000..ae7014d385d
--- /dev/null
+++ b/chromium/third_party/node/node_modules/has/LICENSE-MIT
@@ -0,0 +1,22 @@
+Copyright (c) 2013 Thiago de Arruda
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/chromium/third_party/node/node_modules/has/package.json b/chromium/third_party/node/node_modules/has/package.json
new file mode 100644
index 00000000000..7c4592f16de
--- /dev/null
+++ b/chromium/third_party/node/node_modules/has/package.json
@@ -0,0 +1,48 @@
+{
+ "name": "has",
+ "description": "Object.prototype.hasOwnProperty.call shortcut",
+ "version": "1.0.3",
+ "homepage": "https://github.com/tarruda/has",
+ "author": {
+ "name": "Thiago de Arruda",
+ "email": "tpadilha84@gmail.com"
+ },
+ "contributors": [
+ {
+ "name": "Jordan Harband",
+ "email": "ljharb@gmail.com",
+ "url": "http://ljharb.codes"
+ }
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/tarruda/has.git"
+ },
+ "bugs": {
+ "url": "https://github.com/tarruda/has/issues"
+ },
+ "license": "MIT",
+ "licenses": [
+ {
+ "type": "MIT",
+ "url": "https://github.com/tarruda/has/blob/master/LICENSE-MIT"
+ }
+ ],
+ "main": "./src",
+ "dependencies": {
+ "function-bind": "^1.1.1"
+ },
+ "devDependencies": {
+ "@ljharb/eslint-config": "^12.2.1",
+ "eslint": "^4.19.1",
+ "tape": "^4.9.0"
+ },
+ "engines": {
+ "node": ">= 0.4.0"
+ },
+ "scripts": {
+ "lint": "eslint .",
+ "pretest": "npm run lint",
+ "test": "tape test"
+ }
+}
diff --git a/chromium/third_party/node/node_modules/has/src/index.js b/chromium/third_party/node/node_modules/has/src/index.js
new file mode 100644
index 00000000000..dd92dd9094e
--- /dev/null
+++ b/chromium/third_party/node/node_modules/has/src/index.js
@@ -0,0 +1,5 @@
+'use strict';
+
+var bind = require('function-bind');
+
+module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);
diff --git a/chromium/third_party/node/node_modules/is-core-module/LICENSE b/chromium/third_party/node/node_modules/is-core-module/LICENSE
new file mode 100644
index 00000000000..2e502872a74
--- /dev/null
+++ b/chromium/third_party/node/node_modules/is-core-module/LICENSE
@@ -0,0 +1,20 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Dave Justice
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file
diff --git a/chromium/third_party/node/node_modules/is-core-module/core.json b/chromium/third_party/node/node_modules/is-core-module/core.json
new file mode 100644
index 00000000000..5cd90d1732b
--- /dev/null
+++ b/chromium/third_party/node/node_modules/is-core-module/core.json
@@ -0,0 +1,150 @@
+{
+ "assert": true,
+ "node:assert": [">= 14.18 && < 15", ">= 16"],
+ "assert/strict": ">= 15",
+ "node:assert/strict": ">= 16",
+ "async_hooks": ">= 8",
+ "node:async_hooks": [">= 14.18 && < 15", ">= 16"],
+ "buffer_ieee754": "< 0.9.7",
+ "buffer": true,
+ "node:buffer": [">= 14.18 && < 15", ">= 16"],
+ "child_process": true,
+ "node:child_process": [">= 14.18 && < 15", ">= 16"],
+ "cluster": true,
+ "node:cluster": [">= 14.18 && < 15", ">= 16"],
+ "console": true,
+ "node:console": [">= 14.18 && < 15", ">= 16"],
+ "constants": true,
+ "node:constants": [">= 14.18 && < 15", ">= 16"],
+ "crypto": true,
+ "node:crypto": [">= 14.18 && < 15", ">= 16"],
+ "_debug_agent": ">= 1 && < 8",
+ "_debugger": "< 8",
+ "dgram": true,
+ "node:dgram": [">= 14.18 && < 15", ">= 16"],
+ "diagnostics_channel": [">= 14.17 && < 15", ">= 15.1"],
+ "node:diagnostics_channel": [">= 14.18 && < 15", ">= 16"],
+ "dns": true,
+ "node:dns": [">= 14.18 && < 15", ">= 16"],
+ "dns/promises": ">= 15",
+ "node:dns/promises": ">= 16",
+ "domain": ">= 0.7.12",
+ "node:domain": [">= 14.18 && < 15", ">= 16"],
+ "events": true,
+ "node:events": [">= 14.18 && < 15", ">= 16"],
+ "freelist": "< 6",
+ "fs": true,
+ "node:fs": [">= 14.18 && < 15", ">= 16"],
+ "fs/promises": [">= 10 && < 10.1", ">= 14"],
+ "node:fs/promises": [">= 14.18 && < 15", ">= 16"],
+ "_http_agent": ">= 0.11.1",
+ "node:_http_agent": [">= 14.18 && < 15", ">= 16"],
+ "_http_client": ">= 0.11.1",
+ "node:_http_client": [">= 14.18 && < 15", ">= 16"],
+ "_http_common": ">= 0.11.1",
+ "node:_http_common": [">= 14.18 && < 15", ">= 16"],
+ "_http_incoming": ">= 0.11.1",
+ "node:_http_incoming": [">= 14.18 && < 15", ">= 16"],
+ "_http_outgoing": ">= 0.11.1",
+ "node:_http_outgoing": [">= 14.18 && < 15", ">= 16"],
+ "_http_server": ">= 0.11.1",
+ "node:_http_server": [">= 14.18 && < 15", ">= 16"],
+ "http": true,
+ "node:http": [">= 14.18 && < 15", ">= 16"],
+ "http2": ">= 8.8",
+ "node:http2": [">= 14.18 && < 15", ">= 16"],
+ "https": true,
+ "node:https": [">= 14.18 && < 15", ">= 16"],
+ "inspector": ">= 8",
+ "node:inspector": [">= 14.18 && < 15", ">= 16"],
+ "_linklist": "< 8",
+ "module": true,
+ "node:module": [">= 14.18 && < 15", ">= 16"],
+ "net": true,
+ "node:net": [">= 14.18 && < 15", ">= 16"],
+ "node-inspect/lib/_inspect": ">= 7.6 && < 12",
+ "node-inspect/lib/internal/inspect_client": ">= 7.6 && < 12",
+ "node-inspect/lib/internal/inspect_repl": ">= 7.6 && < 12",
+ "os": true,
+ "node:os": [">= 14.18 && < 15", ">= 16"],
+ "path": true,
+ "node:path": [">= 14.18 && < 15", ">= 16"],
+ "path/posix": ">= 15.3",
+ "node:path/posix": ">= 16",
+ "path/win32": ">= 15.3",
+ "node:path/win32": ">= 16",
+ "perf_hooks": ">= 8.5",
+ "node:perf_hooks": [">= 14.18 && < 15", ">= 16"],
+ "process": ">= 1",
+ "node:process": [">= 14.18 && < 15", ">= 16"],
+ "punycode": true,
+ "node:punycode": [">= 14.18 && < 15", ">= 16"],
+ "querystring": true,
+ "node:querystring": [">= 14.18 && < 15", ">= 16"],
+ "readline": true,
+ "node:readline": [">= 14.18 && < 15", ">= 16"],
+ "repl": true,
+ "node:repl": [">= 14.18 && < 15", ">= 16"],
+ "smalloc": ">= 0.11.5 && < 3",
+ "_stream_duplex": ">= 0.9.4",
+ "node:_stream_duplex": [">= 14.18 && < 15", ">= 16"],
+ "_stream_transform": ">= 0.9.4",
+ "node:_stream_transform": [">= 14.18 && < 15", ">= 16"],
+ "_stream_wrap": ">= 1.4.1",
+ "node:_stream_wrap": [">= 14.18 && < 15", ">= 16"],
+ "_stream_passthrough": ">= 0.9.4",
+ "node:_stream_passthrough": [">= 14.18 && < 15", ">= 16"],
+ "_stream_readable": ">= 0.9.4",
+ "node:_stream_readable": [">= 14.18 && < 15", ">= 16"],
+ "_stream_writable": ">= 0.9.4",
+ "node:_stream_writable": [">= 14.18 && < 15", ">= 16"],
+ "stream": true,
+ "node:stream": [">= 14.18 && < 15", ">= 16"],
+ "stream/consumers": ">= 16.7",
+ "node:stream/consumers": ">= 16.7",
+ "stream/promises": ">= 15",
+ "node:stream/promises": ">= 16",
+ "stream/web": ">= 16.5",
+ "node:stream/web": ">= 16.5",
+ "string_decoder": true,
+ "node:string_decoder": [">= 14.18 && < 15", ">= 16"],
+ "sys": [">= 0.6 && < 0.7", ">= 0.8"],
+ "node:sys": [">= 14.18 && < 15", ">= 16"],
+ "timers": true,
+ "node:timers": [">= 14.18 && < 15", ">= 16"],
+ "timers/promises": ">= 15",
+ "node:timers/promises": ">= 16",
+ "_tls_common": ">= 0.11.13",
+ "node:_tls_common": [">= 14.18 && < 15", ">= 16"],
+ "_tls_legacy": ">= 0.11.3 && < 10",
+ "_tls_wrap": ">= 0.11.3",
+ "node:_tls_wrap": [">= 14.18 && < 15", ">= 16"],
+ "tls": true,
+ "node:tls": [">= 14.18 && < 15", ">= 16"],
+ "trace_events": ">= 10",
+ "node:trace_events": [">= 14.18 && < 15", ">= 16"],
+ "tty": true,
+ "node:tty": [">= 14.18 && < 15", ">= 16"],
+ "url": true,
+ "node:url": [">= 14.18 && < 15", ">= 16"],
+ "util": true,
+ "node:util": [">= 14.18 && < 15", ">= 16"],
+ "util/types": ">= 15.3",
+ "node:util/types": ">= 16",
+ "v8/tools/arguments": ">= 10 && < 12",
+ "v8/tools/codemap": [">= 4.4 && < 5", ">= 5.2 && < 12"],
+ "v8/tools/consarray": [">= 4.4 && < 5", ">= 5.2 && < 12"],
+ "v8/tools/csvparser": [">= 4.4 && < 5", ">= 5.2 && < 12"],
+ "v8/tools/logreader": [">= 4.4 && < 5", ">= 5.2 && < 12"],
+ "v8/tools/profile_view": [">= 4.4 && < 5", ">= 5.2 && < 12"],
+ "v8/tools/splaytree": [">= 4.4 && < 5", ">= 5.2 && < 12"],
+ "v8": ">= 1",
+ "node:v8": [">= 14.18 && < 15", ">= 16"],
+ "vm": true,
+ "node:vm": [">= 14.18 && < 15", ">= 16"],
+ "wasi": ">= 13.4 && < 13.5",
+ "worker_threads": ">= 11.7",
+ "node:worker_threads": [">= 14.18 && < 15", ">= 16"],
+ "zlib": true,
+ "node:zlib": [">= 14.18 && < 15", ">= 16"]
+}
diff --git a/chromium/third_party/node/node_modules/is-core-module/index.js b/chromium/third_party/node/node_modules/is-core-module/index.js
new file mode 100644
index 00000000000..f9637e0e7d3
--- /dev/null
+++ b/chromium/third_party/node/node_modules/is-core-module/index.js
@@ -0,0 +1,69 @@
+'use strict';
+
+var has = require('has');
+
+function specifierIncluded(current, specifier) {
+ var nodeParts = current.split('.');
+ var parts = specifier.split(' ');
+ var op = parts.length > 1 ? parts[0] : '=';
+ var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split('.');
+
+ for (var i = 0; i < 3; ++i) {
+ var cur = parseInt(nodeParts[i] || 0, 10);
+ var ver = parseInt(versionParts[i] || 0, 10);
+ if (cur === ver) {
+ continue; // eslint-disable-line no-restricted-syntax, no-continue
+ }
+ if (op === '<') {
+ return cur < ver;
+ }
+ if (op === '>=') {
+ return cur >= ver;
+ }
+ return false;
+ }
+ return op === '>=';
+}
+
+function matchesRange(current, range) {
+ var specifiers = range.split(/ ?&& ?/);
+ if (specifiers.length === 0) {
+ return false;
+ }
+ for (var i = 0; i < specifiers.length; ++i) {
+ if (!specifierIncluded(current, specifiers[i])) {
+ return false;
+ }
+ }
+ return true;
+}
+
+function versionIncluded(nodeVersion, specifierValue) {
+ if (typeof specifierValue === 'boolean') {
+ return specifierValue;
+ }
+
+ var current = typeof nodeVersion === 'undefined'
+ ? process.versions && process.versions.node
+ : nodeVersion;
+
+ if (typeof current !== 'string') {
+ throw new TypeError(typeof nodeVersion === 'undefined' ? 'Unable to determine current node version' : 'If provided, a valid node version is required');
+ }
+
+ if (specifierValue && typeof specifierValue === 'object') {
+ for (var i = 0; i < specifierValue.length; ++i) {
+ if (matchesRange(current, specifierValue[i])) {
+ return true;
+ }
+ }
+ return false;
+ }
+ return matchesRange(current, specifierValue);
+}
+
+var data = require('./core.json');
+
+module.exports = function isCore(x, nodeVersion) {
+ return has(data, x) && versionIncluded(nodeVersion, data[x]);
+};
diff --git a/chromium/third_party/node/node_modules/is-core-module/package.json b/chromium/third_party/node/node_modules/is-core-module/package.json
new file mode 100644
index 00000000000..2b58b2332cd
--- /dev/null
+++ b/chromium/third_party/node/node_modules/is-core-module/package.json
@@ -0,0 +1,69 @@
+{
+ "name": "is-core-module",
+ "version": "2.7.0",
+ "description": "Is this specifier a node.js core module?",
+ "main": "index.js",
+ "sideEffects": false,
+ "exports": {
+ ".": [
+ {
+ "default": "./index.js"
+ },
+ "./index.js"
+ ],
+ "./package.json": "./package.json"
+ },
+ "scripts": {
+ "prepublish": "not-in-publish || npm run prepublishOnly",
+ "prepublishOnly": "safe-publish-latest",
+ "lint": "eslint .",
+ "pretest": "npm run lint",
+ "tests-only": "tape 'test/**/*.js'",
+ "test": "nyc npm run tests-only",
+ "posttest": "aud --production",
+ "version": "auto-changelog && git add CHANGELOG.md",
+ "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/inspect-js/is-core-module.git"
+ },
+ "keywords": [
+ "core",
+ "modules",
+ "module",
+ "npm",
+ "node",
+ "dependencies"
+ ],
+ "author": "Jordan Harband <ljharb@gmail.com>",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ },
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/inspect-js/is-core-module/issues"
+ },
+ "homepage": "https://github.com/inspect-js/is-core-module",
+ "dependencies": {
+ "has": "^1.0.3"
+ },
+ "devDependencies": {
+ "@ljharb/eslint-config": "^18.0.0",
+ "aud": "^1.1.5",
+ "auto-changelog": "^2.3.0",
+ "eslint": "^7.32.0",
+ "nyc": "^10.3.2",
+ "safe-publish-latest": "^1.1.4",
+ "semver": "^6.3.0",
+ "tape": "^5.3.1"
+ },
+ "auto-changelog": {
+ "output": "CHANGELOG.md",
+ "template": "keepachangelog",
+ "unreleased": false,
+ "commitLimit": false,
+ "backfillLimit": false,
+ "hideCredit": true
+ }
+}
diff --git a/chromium/third_party/node/node_modules/js-tokens/LICENSE b/chromium/third_party/node/node_modules/js-tokens/LICENSE
new file mode 100644
index 00000000000..54aef52f3a4
--- /dev/null
+++ b/chromium/third_party/node/node_modules/js-tokens/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014, 2015, 2016, 2017, 2018 Simon Lydell
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/chromium/third_party/node/node_modules/js-tokens/index.js b/chromium/third_party/node/node_modules/js-tokens/index.js
new file mode 100644
index 00000000000..b23a4a0e7f4
--- /dev/null
+++ b/chromium/third_party/node/node_modules/js-tokens/index.js
@@ -0,0 +1,23 @@
+// Copyright 2014, 2015, 2016, 2017, 2018 Simon Lydell
+// License: MIT. (See LICENSE.)
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+})
+
+// This regex comes from regex.coffee, and is inserted here by generate-index.js
+// (run `npm run build`).
+exports.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g
+
+exports.matchToToken = function(match) {
+ var token = {type: "invalid", value: match[0], closed: undefined}
+ if (match[ 1]) token.type = "string" , token.closed = !!(match[3] || match[4])
+ else if (match[ 5]) token.type = "comment"
+ else if (match[ 6]) token.type = "comment", token.closed = !!match[7]
+ else if (match[ 8]) token.type = "regex"
+ else if (match[ 9]) token.type = "number"
+ else if (match[10]) token.type = "name"
+ else if (match[11]) token.type = "punctuator"
+ else if (match[12]) token.type = "whitespace"
+ return token
+}
diff --git a/chromium/third_party/node/node_modules/js-tokens/package.json b/chromium/third_party/node/node_modules/js-tokens/package.json
new file mode 100644
index 00000000000..66752fab275
--- /dev/null
+++ b/chromium/third_party/node/node_modules/js-tokens/package.json
@@ -0,0 +1,30 @@
+{
+ "name": "js-tokens",
+ "version": "4.0.0",
+ "author": "Simon Lydell",
+ "license": "MIT",
+ "description": "A regex that tokenizes JavaScript.",
+ "keywords": [
+ "JavaScript",
+ "js",
+ "token",
+ "tokenize",
+ "regex"
+ ],
+ "files": [
+ "index.js"
+ ],
+ "repository": "lydell/js-tokens",
+ "scripts": {
+ "test": "mocha --ui tdd",
+ "esprima-compare": "node esprima-compare ./index.js everything.js/es5.js",
+ "build": "node generate-index.js",
+ "dev": "npm run build && npm test"
+ },
+ "devDependencies": {
+ "coffeescript": "2.1.1",
+ "esprima": "4.0.0",
+ "everything.js": "1.0.3",
+ "mocha": "5.0.0"
+ }
+}
diff --git a/chromium/third_party/node/node_modules/jsesc/LICENSE-MIT.txt b/chromium/third_party/node/node_modules/jsesc/LICENSE-MIT.txt
new file mode 100644
index 00000000000..a41e0a7ef97
--- /dev/null
+++ b/chromium/third_party/node/node_modules/jsesc/LICENSE-MIT.txt
@@ -0,0 +1,20 @@
+Copyright Mathias Bynens <https://mathiasbynens.be/>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/chromium/third_party/node/node_modules/jsesc/bin/jsesc b/chromium/third_party/node/node_modules/jsesc/bin/jsesc
new file mode 100755
index 00000000000..e9a541db322
--- /dev/null
+++ b/chromium/third_party/node/node_modules/jsesc/bin/jsesc
@@ -0,0 +1,148 @@
+#!/usr/bin/env node
+(function() {
+
+ var fs = require('fs');
+ var stringEscape = require('../jsesc.js');
+ var strings = process.argv.splice(2);
+ var stdin = process.stdin;
+ var data;
+ var timeout;
+ var isObject = false;
+ var options = {};
+ var log = console.log;
+
+ var main = function() {
+ var option = strings[0];
+
+ if (/^(?:-h|--help|undefined)$/.test(option)) {
+ log(
+ 'jsesc v%s - https://mths.be/jsesc',
+ stringEscape.version
+ );
+ log([
+ '\nUsage:\n',
+ '\tjsesc [string]',
+ '\tjsesc [-s | --single-quotes] [string]',
+ '\tjsesc [-d | --double-quotes] [string]',
+ '\tjsesc [-w | --wrap] [string]',
+ '\tjsesc [-e | --escape-everything] [string]',
+ '\tjsesc [-t | --escape-etago] [string]',
+ '\tjsesc [-6 | --es6] [string]',
+ '\tjsesc [-l | --lowercase-hex] [string]',
+ '\tjsesc [-j | --json] [string]',
+ '\tjsesc [-o | --object] [stringified_object]', // `JSON.parse()` the argument
+ '\tjsesc [-p | --pretty] [string]', // `compact: false`
+ '\tjsesc [-v | --version]',
+ '\tjsesc [-h | --help]',
+ '\nExamples:\n',
+ '\tjsesc \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'',
+ '\tjsesc --json \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'',
+ '\tjsesc --json --escape-everything \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'',
+ '\tjsesc --double-quotes --wrap \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'',
+ '\techo \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\' | jsesc'
+ ].join('\n'));
+ return process.exit(1);
+ }
+
+ if (/^(?:-v|--version)$/.test(option)) {
+ log('v%s', stringEscape.version);
+ return process.exit(1);
+ }
+
+ strings.forEach(function(string) {
+ // Process options
+ if (/^(?:-s|--single-quotes)$/.test(string)) {
+ options.quotes = 'single';
+ return;
+ }
+ if (/^(?:-d|--double-quotes)$/.test(string)) {
+ options.quotes = 'double';
+ return;
+ }
+ if (/^(?:-w|--wrap)$/.test(string)) {
+ options.wrap = true;
+ return;
+ }
+ if (/^(?:-e|--escape-everything)$/.test(string)) {
+ options.escapeEverything = true;
+ return;
+ }
+ if (/^(?:-t|--escape-etago)$/.test(string)) {
+ options.escapeEtago = true;
+ return;
+ }
+ if (/^(?:-6|--es6)$/.test(string)) {
+ options.es6 = true;
+ return;
+ }
+ if (/^(?:-l|--lowercase-hex)$/.test(string)) {
+ options.lowercaseHex = true;
+ return;
+ }
+ if (/^(?:-j|--json)$/.test(string)) {
+ options.json = true;
+ return;
+ }
+ if (/^(?:-o|--object)$/.test(string)) {
+ isObject = true;
+ return;
+ }
+ if (/^(?:-p|--pretty)$/.test(string)) {
+ isObject = true;
+ options.compact = false;
+ return;
+ }
+
+ // Process string(s)
+ var result;
+ try {
+ if (isObject) {
+ string = JSON.parse(string);
+ }
+ result = stringEscape(string, options);
+ log(result);
+ } catch(error) {
+ log(error.message + '\n');
+ log('Error: failed to escape.');
+ log('If you think this is a bug in jsesc, please report it:');
+ log('https://github.com/mathiasbynens/jsesc/issues/new');
+ log(
+ '\nStack trace using jsesc@%s:\n',
+ stringEscape.version
+ );
+ log(error.stack);
+ return process.exit(1);
+ }
+ });
+ // Return with exit status 0 outside of the `forEach` loop, in case
+ // multiple strings were passed in.
+ return process.exit(0);
+
+ };
+
+ if (stdin.isTTY) {
+ // handle shell arguments
+ main();
+ } else {
+ // Either the script is called from within a non-TTY context,
+ // or `stdin` content is being piped in.
+ if (!process.stdout.isTTY) { // called from a non-TTY context
+ timeout = setTimeout(function() {
+ // if no piped data arrived after a while, handle shell arguments
+ main();
+ }, 250);
+ }
+
+ data = '';
+ stdin.on('data', function(chunk) {
+ clearTimeout(timeout);
+ data += chunk;
+ });
+ stdin.on('end', function() {
+ strings.push(data.trim());
+ main();
+ });
+ stdin.resume();
+ }
+
+}());
diff --git a/chromium/third_party/node/node_modules/jsesc/jsesc.js b/chromium/third_party/node/node_modules/jsesc/jsesc.js
new file mode 100644
index 00000000000..7b8b9236144
--- /dev/null
+++ b/chromium/third_party/node/node_modules/jsesc/jsesc.js
@@ -0,0 +1,329 @@
+'use strict';
+
+const object = {};
+const hasOwnProperty = object.hasOwnProperty;
+const forOwn = (object, callback) => {
+ for (const key in object) {
+ if (hasOwnProperty.call(object, key)) {
+ callback(key, object[key]);
+ }
+ }
+};
+
+const extend = (destination, source) => {
+ if (!source) {
+ return destination;
+ }
+ forOwn(source, (key, value) => {
+ destination[key] = value;
+ });
+ return destination;
+};
+
+const forEach = (array, callback) => {
+ const length = array.length;
+ let index = -1;
+ while (++index < length) {
+ callback(array[index]);
+ }
+};
+
+const toString = object.toString;
+const isArray = Array.isArray;
+const isBuffer = Buffer.isBuffer;
+const isObject = (value) => {
+ // This is a very simple check, but it’s good enough for what we need.
+ return toString.call(value) == '[object Object]';
+};
+const isString = (value) => {
+ return typeof value == 'string' ||
+ toString.call(value) == '[object String]';
+};
+const isNumber = (value) => {
+ return typeof value == 'number' ||
+ toString.call(value) == '[object Number]';
+};
+const isFunction = (value) => {
+ return typeof value == 'function';
+};
+const isMap = (value) => {
+ return toString.call(value) == '[object Map]';
+};
+const isSet = (value) => {
+ return toString.call(value) == '[object Set]';
+};
+
+/*--------------------------------------------------------------------------*/
+
+// https://mathiasbynens.be/notes/javascript-escapes#single
+const singleEscapes = {
+ '"': '\\"',
+ '\'': '\\\'',
+ '\\': '\\\\',
+ '\b': '\\b',
+ '\f': '\\f',
+ '\n': '\\n',
+ '\r': '\\r',
+ '\t': '\\t'
+ // `\v` is omitted intentionally, because in IE < 9, '\v' == 'v'.
+ // '\v': '\\x0B'
+};
+const regexSingleEscape = /["'\\\b\f\n\r\t]/;
+
+const regexDigit = /[0-9]/;
+const regexWhitelist = /[ !#-&\(-\[\]-_a-~]/;
+
+const jsesc = (argument, options) => {
+ const increaseIndentation = () => {
+ oldIndent = indent;
+ ++options.indentLevel;
+ indent = options.indent.repeat(options.indentLevel)
+ };
+ // Handle options
+ const defaults = {
+ 'escapeEverything': false,
+ 'minimal': false,
+ 'isScriptContext': false,
+ 'quotes': 'single',
+ 'wrap': false,
+ 'es6': false,
+ 'json': false,
+ 'compact': true,
+ 'lowercaseHex': false,
+ 'numbers': 'decimal',
+ 'indent': '\t',
+ 'indentLevel': 0,
+ '__inline1__': false,
+ '__inline2__': false
+ };
+ const json = options && options.json;
+ if (json) {
+ defaults.quotes = 'double';
+ defaults.wrap = true;
+ }
+ options = extend(defaults, options);
+ if (
+ options.quotes != 'single' &&
+ options.quotes != 'double' &&
+ options.quotes != 'backtick'
+ ) {
+ options.quotes = 'single';
+ }
+ const quote = options.quotes == 'double' ?
+ '"' :
+ (options.quotes == 'backtick' ?
+ '`' :
+ '\''
+ );
+ const compact = options.compact;
+ const lowercaseHex = options.lowercaseHex;
+ let indent = options.indent.repeat(options.indentLevel);
+ let oldIndent = '';
+ const inline1 = options.__inline1__;
+ const inline2 = options.__inline2__;
+ const newLine = compact ? '' : '\n';
+ let result;
+ let isEmpty = true;
+ const useBinNumbers = options.numbers == 'binary';
+ const useOctNumbers = options.numbers == 'octal';
+ const useDecNumbers = options.numbers == 'decimal';
+ const useHexNumbers = options.numbers == 'hexadecimal';
+
+ if (json && argument && isFunction(argument.toJSON)) {
+ argument = argument.toJSON();
+ }
+
+ if (!isString(argument)) {
+ if (isMap(argument)) {
+ if (argument.size == 0) {
+ return 'new Map()';
+ }
+ if (!compact) {
+ options.__inline1__ = true;
+ options.__inline2__ = false;
+ }
+ return 'new Map(' + jsesc(Array.from(argument), options) + ')';
+ }
+ if (isSet(argument)) {
+ if (argument.size == 0) {
+ return 'new Set()';
+ }
+ return 'new Set(' + jsesc(Array.from(argument), options) + ')';
+ }
+ if (isBuffer(argument)) {
+ if (argument.length == 0) {
+ return 'Buffer.from([])';
+ }
+ return 'Buffer.from(' + jsesc(Array.from(argument), options) + ')';
+ }
+ if (isArray(argument)) {
+ result = [];
+ options.wrap = true;
+ if (inline1) {
+ options.__inline1__ = false;
+ options.__inline2__ = true;
+ }
+ if (!inline2) {
+ increaseIndentation();
+ }
+ forEach(argument, (value) => {
+ isEmpty = false;
+ if (inline2) {
+ options.__inline2__ = false;
+ }
+ result.push(
+ (compact || inline2 ? '' : indent) +
+ jsesc(value, options)
+ );
+ });
+ if (isEmpty) {
+ return '[]';
+ }
+ if (inline2) {
+ return '[' + result.join(', ') + ']';
+ }
+ return '[' + newLine + result.join(',' + newLine) + newLine +
+ (compact ? '' : oldIndent) + ']';
+ } else if (isNumber(argument)) {
+ if (json) {
+ // Some number values (e.g. `Infinity`) cannot be represented in JSON.
+ return JSON.stringify(argument);
+ }
+ if (useDecNumbers) {
+ return String(argument);
+ }
+ if (useHexNumbers) {
+ let hexadecimal = argument.toString(16);
+ if (!lowercaseHex) {
+ hexadecimal = hexadecimal.toUpperCase();
+ }
+ return '0x' + hexadecimal;
+ }
+ if (useBinNumbers) {
+ return '0b' + argument.toString(2);
+ }
+ if (useOctNumbers) {
+ return '0o' + argument.toString(8);
+ }
+ } else if (!isObject(argument)) {
+ if (json) {
+ // For some values (e.g. `undefined`, `function` objects),
+ // `JSON.stringify(value)` returns `undefined` (which isn’t valid
+ // JSON) instead of `'null'`.
+ return JSON.stringify(argument) || 'null';
+ }
+ return String(argument);
+ } else { // it’s an object
+ result = [];
+ options.wrap = true;
+ increaseIndentation();
+ forOwn(argument, (key, value) => {
+ isEmpty = false;
+ result.push(
+ (compact ? '' : indent) +
+ jsesc(key, options) + ':' +
+ (compact ? '' : ' ') +
+ jsesc(value, options)
+ );
+ });
+ if (isEmpty) {
+ return '{}';
+ }
+ return '{' + newLine + result.join(',' + newLine) + newLine +
+ (compact ? '' : oldIndent) + '}';
+ }
+ }
+
+ const string = argument;
+ // Loop over each code unit in the string and escape it
+ let index = -1;
+ const length = string.length;
+ result = '';
+ while (++index < length) {
+ const character = string.charAt(index);
+ if (options.es6) {
+ const first = string.charCodeAt(index);
+ if ( // check if it’s the start of a surrogate pair
+ first >= 0xD800 && first <= 0xDBFF && // high surrogate
+ length > index + 1 // there is a next code unit
+ ) {
+ const second = string.charCodeAt(index + 1);
+ if (second >= 0xDC00 && second <= 0xDFFF) { // low surrogate
+ // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
+ const codePoint = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
+ let hexadecimal = codePoint.toString(16);
+ if (!lowercaseHex) {
+ hexadecimal = hexadecimal.toUpperCase();
+ }
+ result += '\\u{' + hexadecimal + '}';
+ ++index;
+ continue;
+ }
+ }
+ }
+ if (!options.escapeEverything) {
+ if (regexWhitelist.test(character)) {
+ // It’s a printable ASCII character that is not `"`, `'` or `\`,
+ // so don’t escape it.
+ result += character;
+ continue;
+ }
+ if (character == '"') {
+ result += quote == character ? '\\"' : character;
+ continue;
+ }
+ if (character == '`') {
+ result += quote == character ? '\\`' : character;
+ continue;
+ }
+ if (character == '\'') {
+ result += quote == character ? '\\\'' : character;
+ continue;
+ }
+ }
+ if (
+ character == '\0' &&
+ !json &&
+ !regexDigit.test(string.charAt(index + 1))
+ ) {
+ result += '\\0';
+ continue;
+ }
+ if (regexSingleEscape.test(character)) {
+ // no need for a `hasOwnProperty` check here
+ result += singleEscapes[character];
+ continue;
+ }
+ const charCode = character.charCodeAt(0);
+ if (options.minimal && charCode != 0x2028 && charCode != 0x2029) {
+ result += character;
+ continue;
+ }
+ let hexadecimal = charCode.toString(16);
+ if (!lowercaseHex) {
+ hexadecimal = hexadecimal.toUpperCase();
+ }
+ const longhand = hexadecimal.length > 2 || json;
+ const escaped = '\\' + (longhand ? 'u' : 'x') +
+ ('0000' + hexadecimal).slice(longhand ? -4 : -2);
+ result += escaped;
+ continue;
+ }
+ if (options.wrap) {
+ result = quote + result + quote;
+ }
+ if (quote == '`') {
+ result = result.replace(/\$\{/g, '\\\$\{');
+ }
+ if (options.isScriptContext) {
+ // https://mathiasbynens.be/notes/etago
+ return result
+ .replace(/<\/(script|style)/gi, '<\\/$1')
+ .replace(/<!--/g, json ? '\\u003C!--' : '\\x3C!--');
+ }
+ return result;
+};
+
+jsesc.version = '2.5.2';
+
+module.exports = jsesc;
diff --git a/chromium/third_party/node/node_modules/jsesc/man/jsesc.1 b/chromium/third_party/node/node_modules/jsesc/man/jsesc.1
new file mode 100644
index 00000000000..2655ee7ae79
--- /dev/null
+++ b/chromium/third_party/node/node_modules/jsesc/man/jsesc.1
@@ -0,0 +1,94 @@
+.Dd May 13, 2016
+.Dt jsesc 1
+.Sh NAME
+.Nm jsesc
+.Nd escape strings for use in JavaScript string literals
+.Sh SYNOPSIS
+.Nm
+.Op Fl s | -single-quotes Ar string
+.br
+.Op Fl d | -double-quotes Ar string
+.br
+.Op Fl w | -wrap Ar string
+.br
+.Op Fl e | -escape-everything Ar string
+.br
+.Op Fl 6 | -es6 Ar string
+.br
+.Op Fl l | -lowercase-hex Ar string
+.br
+.Op Fl j | -json Ar string
+.br
+.Op Fl p | -object Ar string
+.br
+.Op Fl p | -pretty Ar string
+.br
+.Op Fl v | -version
+.br
+.Op Fl h | -help
+.Sh DESCRIPTION
+.Nm
+escapes strings for use in JavaScript string literals while generating the shortest possible valid ASCII-only output.
+.Sh OPTIONS
+.Bl -ohang -offset
+.It Sy "-s, --single-quotes"
+Escape any occurrences of ' in the input string as \\', so that the output can be used in a JavaScript string literal wrapped in single quotes.
+.It Sy "-d, --double-quotes"
+Escape any occurrences of " in the input string as \\", so that the output can be used in a JavaScript string literal wrapped in double quotes.
+.It Sy "-w, --wrap"
+Make sure the output is a valid JavaScript string literal wrapped in quotes. The type of quotes can be specified using the
+.Ar -s | --single-quotes
+or
+.Ar -d | --double-quotes
+settings.
+.It Sy "-6, --es6"
+Escape any astral Unicode symbols using ECMAScript 6 Unicode code point escape sequences.
+.It Sy "-e, --escape-everything"
+Escape all the symbols in the output, even printable ASCII symbols.
+.It Sy "-j, --json"
+Make sure the output is valid JSON. Hexadecimal character escape sequences and the \\v or \\0 escape sequences will not be used. Setting this flag enables the
+.Ar -d | --double-quotes
+and
+.Ar -w | --wrap
+settings.
+.It Sy "-o, --object"
+Treat the input as a JavaScript object rather than a string. Accepted values are flat arrays containing only string values, and flat objects containing only string values.
+.It Sy "-p, --pretty"
+Pretty-print the output for objects, using whitespace to make it more readable. Setting this flag enables the
+.It Sy "-l, --lowercase-hex"
+Use lowercase for alphabetical hexadecimal digits in escape sequences.
+.Ar -o | --object
+setting.
+.It Sy "-v, --version"
+Print jsesc's version.
+.It Sy "-h, --help"
+Show the help screen.
+.El
+.Sh EXIT STATUS
+The
+.Nm jsesc
+utility exits with one of the following values:
+.Pp
+.Bl -tag -width flag -compact
+.It Li 0
+.Nm
+successfully escaped the given string and printed the result.
+.It Li 1
+.Nm
+wasn't instructed to escape anything (for example, the
+.Ar --help
+flag was set); or, an error occurred.
+.El
+.Sh EXAMPLES
+.Bl -ohang -offset
+.It Sy "jsesc 'foo bar baz'"
+Print an escaped version of the given string.
+.It Sy echo\ 'foo bar baz'\ |\ jsesc
+Print an escaped version of the string that gets piped in.
+.El
+.Sh BUGS
+jsesc's bug tracker is located at <https://github.com/mathiasbynens/jsesc/issues>.
+.Sh AUTHOR
+Mathias Bynens <https://mathiasbynens.be/>
+.Sh WWW
+<https://mths.be/jsesc>
diff --git a/chromium/third_party/node/node_modules/jsesc/package.json b/chromium/third_party/node/node_modules/jsesc/package.json
new file mode 100644
index 00000000000..f89a7c62a04
--- /dev/null
+++ b/chromium/third_party/node/node_modules/jsesc/package.json
@@ -0,0 +1,54 @@
+{
+ "name": "jsesc",
+ "version": "2.5.2",
+ "description": "Given some data, jsesc returns the shortest possible stringified & ASCII-safe representation of that data.",
+ "homepage": "https://mths.be/jsesc",
+ "engines": {
+ "node": ">=4"
+ },
+ "main": "jsesc.js",
+ "bin": "bin/jsesc",
+ "man": "man/jsesc.1",
+ "keywords": [
+ "buffer",
+ "escape",
+ "javascript",
+ "json",
+ "map",
+ "set",
+ "string",
+ "stringify",
+ "tool"
+ ],
+ "license": "MIT",
+ "author": {
+ "name": "Mathias Bynens",
+ "url": "https://mathiasbynens.be/"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/mathiasbynens/jsesc.git"
+ },
+ "bugs": "https://github.com/mathiasbynens/jsesc/issues",
+ "files": [
+ "LICENSE-MIT.txt",
+ "jsesc.js",
+ "bin/",
+ "man/"
+ ],
+ "scripts": {
+ "build": "grunt template",
+ "coveralls": "istanbul cover --verbose --dir 'coverage' 'tests/tests.js' && coveralls < coverage/lcov.info'",
+ "cover": "istanbul cover --report 'html' --verbose --dir 'coverage' 'tests/tests.js'",
+ "test": "mocha tests"
+ },
+ "devDependencies": {
+ "coveralls": "^2.11.6",
+ "grunt": "^0.4.5",
+ "grunt-template": "^0.2.3",
+ "istanbul": "^0.4.2",
+ "mocha": "*",
+ "regenerate": "^1.3.0",
+ "requirejs": "^2.1.22"
+ }
+}
diff --git a/chromium/third_party/node/node_modules/minimatch/LICENSE b/chromium/third_party/node/node_modules/minimatch/LICENSE
new file mode 100644
index 00000000000..19129e315fe
--- /dev/null
+++ b/chromium/third_party/node/node_modules/minimatch/LICENSE
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/chromium/third_party/node/node_modules/minimatch/minimatch.js b/chromium/third_party/node/node_modules/minimatch/minimatch.js
new file mode 100644
index 00000000000..5b5f8cf444d
--- /dev/null
+++ b/chromium/third_party/node/node_modules/minimatch/minimatch.js
@@ -0,0 +1,923 @@
+module.exports = minimatch
+minimatch.Minimatch = Minimatch
+
+var path = { sep: '/' }
+try {
+ path = require('path')
+} catch (er) {}
+
+var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}
+var expand = require('brace-expansion')
+
+var plTypes = {
+ '!': { open: '(?:(?!(?:', close: '))[^/]*?)'},
+ '?': { open: '(?:', close: ')?' },
+ '+': { open: '(?:', close: ')+' },
+ '*': { open: '(?:', close: ')*' },
+ '@': { open: '(?:', close: ')' }
+}
+
+// any single thing other than /
+// don't need to escape / when using new RegExp()
+var qmark = '[^/]'
+
+// * => any number of characters
+var star = qmark + '*?'
+
+// ** when dots are allowed. Anything goes, except .. and .
+// not (^ or / followed by one or two dots followed by $ or /),
+// followed by anything, any number of times.
+var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?'
+
+// not a ^ or / followed by a dot,
+// followed by anything, any number of times.
+var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?'
+
+// characters that need to be escaped in RegExp.
+var reSpecials = charSet('().*{}+?[]^$\\!')
+
+// "abc" -> { a:true, b:true, c:true }
+function charSet (s) {
+ return s.split('').reduce(function (set, c) {
+ set[c] = true
+ return set
+ }, {})
+}
+
+// normalizes slashes.
+var slashSplit = /\/+/
+
+minimatch.filter = filter
+function filter (pattern, options) {
+ options = options || {}
+ return function (p, i, list) {
+ return minimatch(p, pattern, options)
+ }
+}
+
+function ext (a, b) {
+ a = a || {}
+ b = b || {}
+ var t = {}
+ Object.keys(b).forEach(function (k) {
+ t[k] = b[k]
+ })
+ Object.keys(a).forEach(function (k) {
+ t[k] = a[k]
+ })
+ return t
+}
+
+minimatch.defaults = function (def) {
+ if (!def || !Object.keys(def).length) return minimatch
+
+ var orig = minimatch
+
+ var m = function minimatch (p, pattern, options) {
+ return orig.minimatch(p, pattern, ext(def, options))
+ }
+
+ m.Minimatch = function Minimatch (pattern, options) {
+ return new orig.Minimatch(pattern, ext(def, options))
+ }
+
+ return m
+}
+
+Minimatch.defaults = function (def) {
+ if (!def || !Object.keys(def).length) return Minimatch
+ return minimatch.defaults(def).Minimatch
+}
+
+function minimatch (p, pattern, options) {
+ if (typeof pattern !== 'string') {
+ throw new TypeError('glob pattern string required')
+ }
+
+ if (!options) options = {}
+
+ // shortcut: comments match nothing.
+ if (!options.nocomment && pattern.charAt(0) === '#') {
+ return false
+ }
+
+ // "" only matches ""
+ if (pattern.trim() === '') return p === ''
+
+ return new Minimatch(pattern, options).match(p)
+}
+
+function Minimatch (pattern, options) {
+ if (!(this instanceof Minimatch)) {
+ return new Minimatch(pattern, options)
+ }
+
+ if (typeof pattern !== 'string') {
+ throw new TypeError('glob pattern string required')
+ }
+
+ if (!options) options = {}
+ pattern = pattern.trim()
+
+ // windows support: need to use /, not \
+ if (path.sep !== '/') {
+ pattern = pattern.split(path.sep).join('/')
+ }
+
+ this.options = options
+ this.set = []
+ this.pattern = pattern
+ this.regexp = null
+ this.negate = false
+ this.comment = false
+ this.empty = false
+
+ // make the set of regexps etc.
+ this.make()
+}
+
+Minimatch.prototype.debug = function () {}
+
+Minimatch.prototype.make = make
+function make () {
+ // don't do it more than once.
+ if (this._made) return
+
+ var pattern = this.pattern
+ var options = this.options
+
+ // empty patterns and comments match nothing.
+ if (!options.nocomment && pattern.charAt(0) === '#') {
+ this.comment = true
+ return
+ }
+ if (!pattern) {
+ this.empty = true
+ return
+ }
+
+ // step 1: figure out negation, etc.
+ this.parseNegate()
+
+ // step 2: expand braces
+ var set = this.globSet = this.braceExpand()
+
+ if (options.debug) this.debug = console.error
+
+ this.debug(this.pattern, set)
+
+ // step 3: now we have a set, so turn each one into a series of path-portion
+ // matching patterns.
+ // These will be regexps, except in the case of "**", which is
+ // set to the GLOBSTAR object for globstar behavior,
+ // and will not contain any / characters
+ set = this.globParts = set.map(function (s) {
+ return s.split(slashSplit)
+ })
+
+ this.debug(this.pattern, set)
+
+ // glob --> regexps
+ set = set.map(function (s, si, set) {
+ return s.map(this.parse, this)
+ }, this)
+
+ this.debug(this.pattern, set)
+
+ // filter out everything that didn't compile properly.
+ set = set.filter(function (s) {
+ return s.indexOf(false) === -1
+ })
+
+ this.debug(this.pattern, set)
+
+ this.set = set
+}
+
+Minimatch.prototype.parseNegate = parseNegate
+function parseNegate () {
+ var pattern = this.pattern
+ var negate = false
+ var options = this.options
+ var negateOffset = 0
+
+ if (options.nonegate) return
+
+ for (var i = 0, l = pattern.length
+ ; i < l && pattern.charAt(i) === '!'
+ ; i++) {
+ negate = !negate
+ negateOffset++
+ }
+
+ if (negateOffset) this.pattern = pattern.substr(negateOffset)
+ this.negate = negate
+}
+
+// Brace expansion:
+// a{b,c}d -> abd acd
+// a{b,}c -> abc ac
+// a{0..3}d -> a0d a1d a2d a3d
+// a{b,c{d,e}f}g -> abg acdfg acefg
+// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
+//
+// Invalid sets are not expanded.
+// a{2..}b -> a{2..}b
+// a{b}c -> a{b}c
+minimatch.braceExpand = function (pattern, options) {
+ return braceExpand(pattern, options)
+}
+
+Minimatch.prototype.braceExpand = braceExpand
+
+function braceExpand (pattern, options) {
+ if (!options) {
+ if (this instanceof Minimatch) {
+ options = this.options
+ } else {
+ options = {}
+ }
+ }
+
+ pattern = typeof pattern === 'undefined'
+ ? this.pattern : pattern
+
+ if (typeof pattern === 'undefined') {
+ throw new TypeError('undefined pattern')
+ }
+
+ if (options.nobrace ||
+ !pattern.match(/\{.*\}/)) {
+ // shortcut. no need to expand.
+ return [pattern]
+ }
+
+ return expand(pattern)
+}
+
+// parse a component of the expanded set.
+// At this point, no pattern may contain "/" in it
+// so we're going to return a 2d array, where each entry is the full
+// pattern, split on '/', and then turned into a regular expression.
+// A regexp is made at the end which joins each array with an
+// escaped /, and another full one which joins each regexp with |.
+//
+// Following the lead of Bash 4.1, note that "**" only has special meaning
+// when it is the *only* thing in a path portion. Otherwise, any series
+// of * is equivalent to a single *. Globstar behavior is enabled by
+// default, and can be disabled by setting options.noglobstar.
+Minimatch.prototype.parse = parse
+var SUBPARSE = {}
+function parse (pattern, isSub) {
+ if (pattern.length > 1024 * 64) {
+ throw new TypeError('pattern is too long')
+ }
+
+ var options = this.options
+
+ // shortcuts
+ if (!options.noglobstar && pattern === '**') return GLOBSTAR
+ if (pattern === '') return ''
+
+ var re = ''
+ var hasMagic = !!options.nocase
+ var escaping = false
+ // ? => one single character
+ var patternListStack = []
+ var negativeLists = []
+ var stateChar
+ var inClass = false
+ var reClassStart = -1
+ var classStart = -1
+ // . and .. never match anything that doesn't start with .,
+ // even when options.dot is set.
+ var patternStart = pattern.charAt(0) === '.' ? '' // anything
+ // not (start or / followed by . or .. followed by / or end)
+ : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))'
+ : '(?!\\.)'
+ var self = this
+
+ function clearStateChar () {
+ if (stateChar) {
+ // we had some state-tracking character
+ // that wasn't consumed by this pass.
+ switch (stateChar) {
+ case '*':
+ re += star
+ hasMagic = true
+ break
+ case '?':
+ re += qmark
+ hasMagic = true
+ break
+ default:
+ re += '\\' + stateChar
+ break
+ }
+ self.debug('clearStateChar %j %j', stateChar, re)
+ stateChar = false
+ }
+ }
+
+ for (var i = 0, len = pattern.length, c
+ ; (i < len) && (c = pattern.charAt(i))
+ ; i++) {
+ this.debug('%s\t%s %s %j', pattern, i, re, c)
+
+ // skip over any that are escaped.
+ if (escaping && reSpecials[c]) {
+ re += '\\' + c
+ escaping = false
+ continue
+ }
+
+ switch (c) {
+ case '/':
+ // completely not allowed, even escaped.
+ // Should already be path-split by now.
+ return false
+
+ case '\\':
+ clearStateChar()
+ escaping = true
+ continue
+
+ // the various stateChar values
+ // for the "extglob" stuff.
+ case '?':
+ case '*':
+ case '+':
+ case '@':
+ case '!':
+ this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c)
+
+ // all of those are literals inside a class, except that
+ // the glob [!a] means [^a] in regexp
+ if (inClass) {
+ this.debug(' in class')
+ if (c === '!' && i === classStart + 1) c = '^'
+ re += c
+ continue
+ }
+
+ // if we already have a stateChar, then it means
+ // that there was something like ** or +? in there.
+ // Handle the stateChar, then proceed with this one.
+ self.debug('call clearStateChar %j', stateChar)
+ clearStateChar()
+ stateChar = c
+ // if extglob is disabled, then +(asdf|foo) isn't a thing.
+ // just clear the statechar *now*, rather than even diving into
+ // the patternList stuff.
+ if (options.noext) clearStateChar()
+ continue
+
+ case '(':
+ if (inClass) {
+ re += '('
+ continue
+ }
+
+ if (!stateChar) {
+ re += '\\('
+ continue
+ }
+
+ patternListStack.push({
+ type: stateChar,
+ start: i - 1,
+ reStart: re.length,
+ open: plTypes[stateChar].open,
+ close: plTypes[stateChar].close
+ })
+ // negation is (?:(?!js)[^/]*)
+ re += stateChar === '!' ? '(?:(?!(?:' : '(?:'
+ this.debug('plType %j %j', stateChar, re)
+ stateChar = false
+ continue
+
+ case ')':
+ if (inClass || !patternListStack.length) {
+ re += '\\)'
+ continue
+ }
+
+ clearStateChar()
+ hasMagic = true
+ var pl = patternListStack.pop()
+ // negation is (?:(?!js)[^/]*)
+ // The others are (?:<pattern>)<type>
+ re += pl.close
+ if (pl.type === '!') {
+ negativeLists.push(pl)
+ }
+ pl.reEnd = re.length
+ continue
+
+ case '|':
+ if (inClass || !patternListStack.length || escaping) {
+ re += '\\|'
+ escaping = false
+ continue
+ }
+
+ clearStateChar()
+ re += '|'
+ continue
+
+ // these are mostly the same in regexp and glob
+ case '[':
+ // swallow any state-tracking char before the [
+ clearStateChar()
+
+ if (inClass) {
+ re += '\\' + c
+ continue
+ }
+
+ inClass = true
+ classStart = i
+ reClassStart = re.length
+ re += c
+ continue
+
+ case ']':
+ // a right bracket shall lose its special
+ // meaning and represent itself in
+ // a bracket expression if it occurs
+ // first in the list. -- POSIX.2 2.8.3.2
+ if (i === classStart + 1 || !inClass) {
+ re += '\\' + c
+ escaping = false
+ continue
+ }
+
+ // handle the case where we left a class open.
+ // "[z-a]" is valid, equivalent to "\[z-a\]"
+ if (inClass) {
+ // split where the last [ was, make sure we don't have
+ // an invalid re. if so, re-walk the contents of the
+ // would-be class to re-translate any characters that
+ // were passed through as-is
+ // TODO: It would probably be faster to determine this
+ // without a try/catch and a new RegExp, but it's tricky
+ // to do safely. For now, this is safe and works.
+ var cs = pattern.substring(classStart + 1, i)
+ try {
+ RegExp('[' + cs + ']')
+ } catch (er) {
+ // not a valid class!
+ var sp = this.parse(cs, SUBPARSE)
+ re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]'
+ hasMagic = hasMagic || sp[1]
+ inClass = false
+ continue
+ }
+ }
+
+ // finish up the class.
+ hasMagic = true
+ inClass = false
+ re += c
+ continue
+
+ default:
+ // swallow any state char that wasn't consumed
+ clearStateChar()
+
+ if (escaping) {
+ // no need
+ escaping = false
+ } else if (reSpecials[c]
+ && !(c === '^' && inClass)) {
+ re += '\\'
+ }
+
+ re += c
+
+ } // switch
+ } // for
+
+ // handle the case where we left a class open.
+ // "[abc" is valid, equivalent to "\[abc"
+ if (inClass) {
+ // split where the last [ was, and escape it
+ // this is a huge pita. We now have to re-walk
+ // the contents of the would-be class to re-translate
+ // any characters that were passed through as-is
+ cs = pattern.substr(classStart + 1)
+ sp = this.parse(cs, SUBPARSE)
+ re = re.substr(0, reClassStart) + '\\[' + sp[0]
+ hasMagic = hasMagic || sp[1]
+ }
+
+ // handle the case where we had a +( thing at the *end*
+ // of the pattern.
+ // each pattern list stack adds 3 chars, and we need to go through
+ // and escape any | chars that were passed through as-is for the regexp.
+ // Go through and escape them, taking care not to double-escape any
+ // | chars that were already escaped.
+ for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
+ var tail = re.slice(pl.reStart + pl.open.length)
+ this.debug('setting tail', re, pl)
+ // maybe some even number of \, then maybe 1 \, followed by a |
+ tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) {
+ if (!$2) {
+ // the | isn't already escaped, so escape it.
+ $2 = '\\'
+ }
+
+ // need to escape all those slashes *again*, without escaping the
+ // one that we need for escaping the | character. As it works out,
+ // escaping an even number of slashes can be done by simply repeating
+ // it exactly after itself. That's why this trick works.
+ //
+ // I am sorry that you have to see this.
+ return $1 + $1 + $2 + '|'
+ })
+
+ this.debug('tail=%j\n %s', tail, tail, pl, re)
+ var t = pl.type === '*' ? star
+ : pl.type === '?' ? qmark
+ : '\\' + pl.type
+
+ hasMagic = true
+ re = re.slice(0, pl.reStart) + t + '\\(' + tail
+ }
+
+ // handle trailing things that only matter at the very end.
+ clearStateChar()
+ if (escaping) {
+ // trailing \\
+ re += '\\\\'
+ }
+
+ // only need to apply the nodot start if the re starts with
+ // something that could conceivably capture a dot
+ var addPatternStart = false
+ switch (re.charAt(0)) {
+ case '.':
+ case '[':
+ case '(': addPatternStart = true
+ }
+
+ // Hack to work around lack of negative lookbehind in JS
+ // A pattern like: *.!(x).!(y|z) needs to ensure that a name
+ // like 'a.xyz.yz' doesn't match. So, the first negative
+ // lookahead, has to look ALL the way ahead, to the end of
+ // the pattern.
+ for (var n = negativeLists.length - 1; n > -1; n--) {
+ var nl = negativeLists[n]
+
+ var nlBefore = re.slice(0, nl.reStart)
+ var nlFirst = re.slice(nl.reStart, nl.reEnd - 8)
+ var nlLast = re.slice(nl.reEnd - 8, nl.reEnd)
+ var nlAfter = re.slice(nl.reEnd)
+
+ nlLast += nlAfter
+
+ // Handle nested stuff like *(*.js|!(*.json)), where open parens
+ // mean that we should *not* include the ) in the bit that is considered
+ // "after" the negated section.
+ var openParensBefore = nlBefore.split('(').length - 1
+ var cleanAfter = nlAfter
+ for (i = 0; i < openParensBefore; i++) {
+ cleanAfter = cleanAfter.replace(/\)[+*?]?/, '')
+ }
+ nlAfter = cleanAfter
+
+ var dollar = ''
+ if (nlAfter === '' && isSub !== SUBPARSE) {
+ dollar = '$'
+ }
+ var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast
+ re = newRe
+ }
+
+ // if the re is not "" at this point, then we need to make sure
+ // it doesn't match against an empty path part.
+ // Otherwise a/* will match a/, which it should not.
+ if (re !== '' && hasMagic) {
+ re = '(?=.)' + re
+ }
+
+ if (addPatternStart) {
+ re = patternStart + re
+ }
+
+ // parsing just a piece of a larger pattern.
+ if (isSub === SUBPARSE) {
+ return [re, hasMagic]
+ }
+
+ // skip the regexp for non-magical patterns
+ // unescape anything in it, though, so that it'll be
+ // an exact match against a file etc.
+ if (!hasMagic) {
+ return globUnescape(pattern)
+ }
+
+ var flags = options.nocase ? 'i' : ''
+ try {
+ var regExp = new RegExp('^' + re + '$', flags)
+ } catch (er) {
+ // If it was an invalid regular expression, then it can't match
+ // anything. This trick looks for a character after the end of
+ // the string, which is of course impossible, except in multi-line
+ // mode, but it's not a /m regex.
+ return new RegExp('$.')
+ }
+
+ regExp._glob = pattern
+ regExp._src = re
+
+ return regExp
+}
+
+minimatch.makeRe = function (pattern, options) {
+ return new Minimatch(pattern, options || {}).makeRe()
+}
+
+Minimatch.prototype.makeRe = makeRe
+function makeRe () {
+ if (this.regexp || this.regexp === false) return this.regexp
+
+ // at this point, this.set is a 2d array of partial
+ // pattern strings, or "**".
+ //
+ // It's better to use .match(). This function shouldn't
+ // be used, really, but it's pretty convenient sometimes,
+ // when you just want to work with a regex.
+ var set = this.set
+
+ if (!set.length) {
+ this.regexp = false
+ return this.regexp
+ }
+ var options = this.options
+
+ var twoStar = options.noglobstar ? star
+ : options.dot ? twoStarDot
+ : twoStarNoDot
+ var flags = options.nocase ? 'i' : ''
+
+ var re = set.map(function (pattern) {
+ return pattern.map(function (p) {
+ return (p === GLOBSTAR) ? twoStar
+ : (typeof p === 'string') ? regExpEscape(p)
+ : p._src
+ }).join('\\\/')
+ }).join('|')
+
+ // must match entire pattern
+ // ending in a * or ** will make it less strict.
+ re = '^(?:' + re + ')$'
+
+ // can match anything, as long as it's not this.
+ if (this.negate) re = '^(?!' + re + ').*$'
+
+ try {
+ this.regexp = new RegExp(re, flags)
+ } catch (ex) {
+ this.regexp = false
+ }
+ return this.regexp
+}
+
+minimatch.match = function (list, pattern, options) {
+ options = options || {}
+ var mm = new Minimatch(pattern, options)
+ list = list.filter(function (f) {
+ return mm.match(f)
+ })
+ if (mm.options.nonull && !list.length) {
+ list.push(pattern)
+ }
+ return list
+}
+
+Minimatch.prototype.match = match
+function match (f, partial) {
+ this.debug('match', f, this.pattern)
+ // short-circuit in the case of busted things.
+ // comments, etc.
+ if (this.comment) return false
+ if (this.empty) return f === ''
+
+ if (f === '/' && partial) return true
+
+ var options = this.options
+
+ // windows: need to use /, not \
+ if (path.sep !== '/') {
+ f = f.split(path.sep).join('/')
+ }
+
+ // treat the test path as a set of pathparts.
+ f = f.split(slashSplit)
+ this.debug(this.pattern, 'split', f)
+
+ // just ONE of the pattern sets in this.set needs to match
+ // in order for it to be valid. If negating, then just one
+ // match means that we have failed.
+ // Either way, return on the first hit.
+
+ var set = this.set
+ this.debug(this.pattern, 'set', set)
+
+ // Find the basename of the path by looking for the last non-empty segment
+ var filename
+ var i
+ for (i = f.length - 1; i >= 0; i--) {
+ filename = f[i]
+ if (filename) break
+ }
+
+ for (i = 0; i < set.length; i++) {
+ var pattern = set[i]
+ var file = f
+ if (options.matchBase && pattern.length === 1) {
+ file = [filename]
+ }
+ var hit = this.matchOne(file, pattern, partial)
+ if (hit) {
+ if (options.flipNegate) return true
+ return !this.negate
+ }
+ }
+
+ // didn't get any hits. this is success if it's a negative
+ // pattern, failure otherwise.
+ if (options.flipNegate) return false
+ return this.negate
+}
+
+// set partial to true to test if, for example,
+// "/a/b" matches the start of "/*/b/*/d"
+// Partial means, if you run out of file before you run
+// out of pattern, then that's fine, as long as all
+// the parts match.
+Minimatch.prototype.matchOne = function (file, pattern, partial) {
+ var options = this.options
+
+ this.debug('matchOne',
+ { 'this': this, file: file, pattern: pattern })
+
+ this.debug('matchOne', file.length, pattern.length)
+
+ for (var fi = 0,
+ pi = 0,
+ fl = file.length,
+ pl = pattern.length
+ ; (fi < fl) && (pi < pl)
+ ; fi++, pi++) {
+ this.debug('matchOne loop')
+ var p = pattern[pi]
+ var f = file[fi]
+
+ this.debug(pattern, p, f)
+
+ // should be impossible.
+ // some invalid regexp stuff in the set.
+ if (p === false) return false
+
+ if (p === GLOBSTAR) {
+ this.debug('GLOBSTAR', [pattern, p, f])
+
+ // "**"
+ // a/**/b/**/c would match the following:
+ // a/b/x/y/z/c
+ // a/x/y/z/b/c
+ // a/b/x/b/x/c
+ // a/b/c
+ // To do this, take the rest of the pattern after
+ // the **, and see if it would match the file remainder.
+ // If so, return success.
+ // If not, the ** "swallows" a segment, and try again.
+ // This is recursively awful.
+ //
+ // a/**/b/**/c matching a/b/x/y/z/c
+ // - a matches a
+ // - doublestar
+ // - matchOne(b/x/y/z/c, b/**/c)
+ // - b matches b
+ // - doublestar
+ // - matchOne(x/y/z/c, c) -> no
+ // - matchOne(y/z/c, c) -> no
+ // - matchOne(z/c, c) -> no
+ // - matchOne(c, c) yes, hit
+ var fr = fi
+ var pr = pi + 1
+ if (pr === pl) {
+ this.debug('** at the end')
+ // a ** at the end will just swallow the rest.
+ // We have found a match.
+ // however, it will not swallow /.x, unless
+ // options.dot is set.
+ // . and .. are *never* matched by **, for explosively
+ // exponential reasons.
+ for (; fi < fl; fi++) {
+ if (file[fi] === '.' || file[fi] === '..' ||
+ (!options.dot && file[fi].charAt(0) === '.')) return false
+ }
+ return true
+ }
+
+ // ok, let's see if we can swallow whatever we can.
+ while (fr < fl) {
+ var swallowee = file[fr]
+
+ this.debug('\nglobstar while', file, fr, pattern, pr, swallowee)
+
+ // XXX remove this slice. Just pass the start index.
+ if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
+ this.debug('globstar found match!', fr, fl, swallowee)
+ // found a match.
+ return true
+ } else {
+ // can't swallow "." or ".." ever.
+ // can only swallow ".foo" when explicitly asked.
+ if (swallowee === '.' || swallowee === '..' ||
+ (!options.dot && swallowee.charAt(0) === '.')) {
+ this.debug('dot detected!', file, fr, pattern, pr)
+ break
+ }
+
+ // ** swallows a segment, and continue.
+ this.debug('globstar swallow a segment, and continue')
+ fr++
+ }
+ }
+
+ // no match was found.
+ // However, in partial mode, we can't say this is necessarily over.
+ // If there's more *pattern* left, then
+ if (partial) {
+ // ran out of file
+ this.debug('\n>>> no match, partial?', file, fr, pattern, pr)
+ if (fr === fl) return true
+ }
+ return false
+ }
+
+ // something other than **
+ // non-magic patterns just have to match exactly
+ // patterns with magic have been turned into regexps.
+ var hit
+ if (typeof p === 'string') {
+ if (options.nocase) {
+ hit = f.toLowerCase() === p.toLowerCase()
+ } else {
+ hit = f === p
+ }
+ this.debug('string match', p, f, hit)
+ } else {
+ hit = f.match(p)
+ this.debug('pattern match', p, f, hit)
+ }
+
+ if (!hit) return false
+ }
+
+ // Note: ending in / means that we'll get a final ""
+ // at the end of the pattern. This can only match a
+ // corresponding "" at the end of the file.
+ // If the file ends in /, then it can only match a
+ // a pattern that ends in /, unless the pattern just
+ // doesn't have any more for it. But, a/b/ should *not*
+ // match "a/b/*", even though "" matches against the
+ // [^/]*? pattern, except in partial mode, where it might
+ // simply not be reached yet.
+ // However, a/b/ should still satisfy a/*
+
+ // now either we fell off the end of the pattern, or we're done.
+ if (fi === fl && pi === pl) {
+ // ran out of pattern and filename at the same time.
+ // an exact hit!
+ return true
+ } else if (fi === fl) {
+ // ran out of file, but still had pattern left.
+ // this is ok if we're doing the match as part of
+ // a glob fs traversal.
+ return partial
+ } else if (pi === pl) {
+ // ran out of pattern, still have file left.
+ // this is only acceptable if we're on the very last
+ // empty segment of a file with a trailing slash.
+ // a/* should match a/b/
+ var emptyFileEnd = (fi === fl - 1) && (file[fi] === '')
+ return emptyFileEnd
+ }
+
+ // should be unreachable.
+ throw new Error('wtf?')
+}
+
+// replace stuff like \* with *
+function globUnescape (s) {
+ return s.replace(/\\(.)/g, '$1')
+}
+
+function regExpEscape (s) {
+ return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')
+}
diff --git a/chromium/third_party/node/node_modules/minimatch/package.json b/chromium/third_party/node/node_modules/minimatch/package.json
new file mode 100644
index 00000000000..c4514c80777
--- /dev/null
+++ b/chromium/third_party/node/node_modules/minimatch/package.json
@@ -0,0 +1,30 @@
+{
+ "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me)",
+ "name": "minimatch",
+ "description": "a glob matcher in javascript",
+ "version": "3.0.4",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/isaacs/minimatch.git"
+ },
+ "main": "minimatch.js",
+ "scripts": {
+ "test": "tap test/*.js --cov",
+ "preversion": "npm test",
+ "postversion": "npm publish",
+ "postpublish": "git push origin --all; git push origin --tags"
+ },
+ "engines": {
+ "node": "*"
+ },
+ "dependencies": {
+ "brace-expansion": "^1.1.7"
+ },
+ "devDependencies": {
+ "tap": "^10.3.2"
+ },
+ "license": "ISC",
+ "files": [
+ "minimatch.js"
+ ]
+}
diff --git a/chromium/third_party/node/node_modules/ms/index.js b/chromium/third_party/node/node_modules/ms/index.js
new file mode 100644
index 00000000000..c4498bcc212
--- /dev/null
+++ b/chromium/third_party/node/node_modules/ms/index.js
@@ -0,0 +1,162 @@
+/**
+ * Helpers.
+ */
+
+var s = 1000;
+var m = s * 60;
+var h = m * 60;
+var d = h * 24;
+var w = d * 7;
+var y = d * 365.25;
+
+/**
+ * Parse or format the given `val`.
+ *
+ * Options:
+ *
+ * - `long` verbose formatting [false]
+ *
+ * @param {String|Number} val
+ * @param {Object} [options]
+ * @throws {Error} throw an error if val is not a non-empty string or a number
+ * @return {String|Number}
+ * @api public
+ */
+
+module.exports = function(val, options) {
+ options = options || {};
+ var type = typeof val;
+ if (type === 'string' && val.length > 0) {
+ return parse(val);
+ } else if (type === 'number' && isFinite(val)) {
+ return options.long ? fmtLong(val) : fmtShort(val);
+ }
+ throw new Error(
+ 'val is not a non-empty string or a valid number. val=' +
+ JSON.stringify(val)
+ );
+};
+
+/**
+ * Parse the given `str` and return milliseconds.
+ *
+ * @param {String} str
+ * @return {Number}
+ * @api private
+ */
+
+function parse(str) {
+ str = String(str);
+ if (str.length > 100) {
+ return;
+ }
+ var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
+ str
+ );
+ if (!match) {
+ return;
+ }
+ var n = parseFloat(match[1]);
+ var type = (match[2] || 'ms').toLowerCase();
+ switch (type) {
+ case 'years':
+ case 'year':
+ case 'yrs':
+ case 'yr':
+ case 'y':
+ return n * y;
+ case 'weeks':
+ case 'week':
+ case 'w':
+ return n * w;
+ case 'days':
+ case 'day':
+ case 'd':
+ return n * d;
+ case 'hours':
+ case 'hour':
+ case 'hrs':
+ case 'hr':
+ case 'h':
+ return n * h;
+ case 'minutes':
+ case 'minute':
+ case 'mins':
+ case 'min':
+ case 'm':
+ return n * m;
+ case 'seconds':
+ case 'second':
+ case 'secs':
+ case 'sec':
+ case 's':
+ return n * s;
+ case 'milliseconds':
+ case 'millisecond':
+ case 'msecs':
+ case 'msec':
+ case 'ms':
+ return n;
+ default:
+ return undefined;
+ }
+}
+
+/**
+ * Short format for `ms`.
+ *
+ * @param {Number} ms
+ * @return {String}
+ * @api private
+ */
+
+function fmtShort(ms) {
+ var msAbs = Math.abs(ms);
+ if (msAbs >= d) {
+ return Math.round(ms / d) + 'd';
+ }
+ if (msAbs >= h) {
+ return Math.round(ms / h) + 'h';
+ }
+ if (msAbs >= m) {
+ return Math.round(ms / m) + 'm';
+ }
+ if (msAbs >= s) {
+ return Math.round(ms / s) + 's';
+ }
+ return ms + 'ms';
+}
+
+/**
+ * Long format for `ms`.
+ *
+ * @param {Number} ms
+ * @return {String}
+ * @api private
+ */
+
+function fmtLong(ms) {
+ var msAbs = Math.abs(ms);
+ if (msAbs >= d) {
+ return plural(ms, msAbs, d, 'day');
+ }
+ if (msAbs >= h) {
+ return plural(ms, msAbs, h, 'hour');
+ }
+ if (msAbs >= m) {
+ return plural(ms, msAbs, m, 'minute');
+ }
+ if (msAbs >= s) {
+ return plural(ms, msAbs, s, 'second');
+ }
+ return ms + ' ms';
+}
+
+/**
+ * Pluralization helper.
+ */
+
+function plural(ms, msAbs, n, name) {
+ var isPlural = msAbs >= n * 1.5;
+ return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
+}
diff --git a/chromium/third_party/node/node_modules/ms/package.json b/chromium/third_party/node/node_modules/ms/package.json
new file mode 100644
index 00000000000..eea666e1fb0
--- /dev/null
+++ b/chromium/third_party/node/node_modules/ms/package.json
@@ -0,0 +1,37 @@
+{
+ "name": "ms",
+ "version": "2.1.2",
+ "description": "Tiny millisecond conversion utility",
+ "repository": "zeit/ms",
+ "main": "./index",
+ "files": [
+ "index.js"
+ ],
+ "scripts": {
+ "precommit": "lint-staged",
+ "lint": "eslint lib/* bin/*",
+ "test": "mocha tests.js"
+ },
+ "eslintConfig": {
+ "extends": "eslint:recommended",
+ "env": {
+ "node": true,
+ "es6": true
+ }
+ },
+ "lint-staged": {
+ "*.js": [
+ "npm run lint",
+ "prettier --single-quote --write",
+ "git add"
+ ]
+ },
+ "license": "MIT",
+ "devDependencies": {
+ "eslint": "4.12.1",
+ "expect.js": "0.3.1",
+ "husky": "0.14.3",
+ "lint-staged": "5.0.0",
+ "mocha": "4.0.1"
+ }
+}
diff --git a/chromium/third_party/node/node_modules/path-is-inside/LICENSE.txt b/chromium/third_party/node/node_modules/path-is-inside/LICENSE.txt
new file mode 100644
index 00000000000..0bdbb61c9de
--- /dev/null
+++ b/chromium/third_party/node/node_modules/path-is-inside/LICENSE.txt
@@ -0,0 +1,47 @@
+Dual licensed under WTFPL and MIT:
+
+---
+
+Copyright © 2013–2016 Domenic Denicola <d@domenic.me>
+
+This work is free. You can redistribute it and/or modify it under the
+terms of the Do What The Fuck You Want To Public License, Version 2,
+as published by Sam Hocevar. See below for more details.
+
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+ Version 2, December 2004
+
+ Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
+
+ Everyone is permitted to copy and distribute verbatim or modified
+ copies of this license document, and changing it is allowed as long
+ as the name is changed.
+
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. You just DO WHAT THE FUCK YOU WANT TO.
+
+---
+
+The MIT License (MIT)
+
+Copyright © 2013–2016 Domenic Denicola <d@domenic.me>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/chromium/third_party/node/node_modules/path-is-inside/lib/path-is-inside.js b/chromium/third_party/node/node_modules/path-is-inside/lib/path-is-inside.js
new file mode 100644
index 00000000000..596dfd3b3c5
--- /dev/null
+++ b/chromium/third_party/node/node_modules/path-is-inside/lib/path-is-inside.js
@@ -0,0 +1,28 @@
+"use strict";
+
+var path = require("path");
+
+module.exports = function (thePath, potentialParent) {
+ // For inside-directory checking, we want to allow trailing slashes, so normalize.
+ thePath = stripTrailingSep(thePath);
+ potentialParent = stripTrailingSep(potentialParent);
+
+ // Node treats only Windows as case-insensitive in its path module; we follow those conventions.
+ if (process.platform === "win32") {
+ thePath = thePath.toLowerCase();
+ potentialParent = potentialParent.toLowerCase();
+ }
+
+ return thePath.lastIndexOf(potentialParent, 0) === 0 &&
+ (
+ thePath[potentialParent.length] === path.sep ||
+ thePath[potentialParent.length] === undefined
+ );
+};
+
+function stripTrailingSep(thePath) {
+ if (thePath[thePath.length - 1] === path.sep) {
+ return thePath.slice(0, -1);
+ }
+ return thePath;
+}
diff --git a/chromium/third_party/node/node_modules/path-is-inside/package.json b/chromium/third_party/node/node_modules/path-is-inside/package.json
new file mode 100644
index 00000000000..74c56e6959f
--- /dev/null
+++ b/chromium/third_party/node/node_modules/path-is-inside/package.json
@@ -0,0 +1,21 @@
+{
+ "name": "path-is-inside",
+ "description": "Tests whether one path is inside another path",
+ "keywords": ["path", "directory", "folder", "inside", "relative"],
+ "version": "1.0.2",
+ "author": "Domenic Denicola <d@domenic.me> (https://domenic.me)",
+ "license": "(WTFPL OR MIT)",
+ "repository": "domenic/path-is-inside",
+ "main": "lib/path-is-inside.js",
+ "files": [
+ "lib"
+ ],
+ "scripts": {
+ "test": "mocha",
+ "lint": "jshint lib"
+ },
+ "devDependencies": {
+ "jshint": "~2.3.0",
+ "mocha": "~1.15.1"
+ }
+}
diff --git a/chromium/third_party/node/node_modules/resolve/LICENSE b/chromium/third_party/node/node_modules/resolve/LICENSE
new file mode 100644
index 00000000000..ff4fce28af3
--- /dev/null
+++ b/chromium/third_party/node/node_modules/resolve/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2012 James Halliday
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/chromium/third_party/node/node_modules/resolve/index.js b/chromium/third_party/node/node_modules/resolve/index.js
new file mode 100644
index 00000000000..125d8146423
--- /dev/null
+++ b/chromium/third_party/node/node_modules/resolve/index.js
@@ -0,0 +1,6 @@
+var async = require('./lib/async');
+async.core = require('./lib/core');
+async.isCore = require('./lib/is-core');
+async.sync = require('./lib/sync');
+
+module.exports = async;
diff --git a/chromium/third_party/node/node_modules/resolve/lib/async.js b/chromium/third_party/node/node_modules/resolve/lib/async.js
new file mode 100644
index 00000000000..02e80ac80e5
--- /dev/null
+++ b/chromium/third_party/node/node_modules/resolve/lib/async.js
@@ -0,0 +1,320 @@
+var fs = require('fs');
+var path = require('path');
+var caller = require('./caller');
+var nodeModulesPaths = require('./node-modules-paths');
+var normalizeOptions = require('./normalize-options');
+var isCore = require('is-core-module');
+
+var realpathFS = fs.realpath && typeof fs.realpath.native === 'function' ? fs.realpath.native : fs.realpath;
+
+var defaultIsFile = function isFile(file, cb) {
+ fs.stat(file, function (err, stat) {
+ if (!err) {
+ return cb(null, stat.isFile() || stat.isFIFO());
+ }
+ if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false);
+ return cb(err);
+ });
+};
+
+var defaultIsDir = function isDirectory(dir, cb) {
+ fs.stat(dir, function (err, stat) {
+ if (!err) {
+ return cb(null, stat.isDirectory());
+ }
+ if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false);
+ return cb(err);
+ });
+};
+
+var defaultRealpath = function realpath(x, cb) {
+ realpathFS(x, function (realpathErr, realPath) {
+ if (realpathErr && realpathErr.code !== 'ENOENT') cb(realpathErr);
+ else cb(null, realpathErr ? x : realPath);
+ });
+};
+
+var maybeRealpath = function maybeRealpath(realpath, x, opts, cb) {
+ if (opts && opts.preserveSymlinks === false) {
+ realpath(x, cb);
+ } else {
+ cb(null, x);
+ }
+};
+
+var defaultReadPackage = function defaultReadPackage(readFile, pkgfile, cb) {
+ readFile(pkgfile, function (readFileErr, body) {
+ if (readFileErr) cb(readFileErr);
+ else {
+ try {
+ var pkg = JSON.parse(body);
+ cb(null, pkg);
+ } catch (jsonErr) {
+ cb(null);
+ }
+ }
+ });
+};
+
+var getPackageCandidates = function getPackageCandidates(x, start, opts) {
+ var dirs = nodeModulesPaths(start, opts, x);
+ for (var i = 0; i < dirs.length; i++) {
+ dirs[i] = path.join(dirs[i], x);
+ }
+ return dirs;
+};
+
+module.exports = function resolve(x, options, callback) {
+ var cb = callback;
+ var opts = options;
+ if (typeof options === 'function') {
+ cb = opts;
+ opts = {};
+ }
+ if (typeof x !== 'string') {
+ var err = new TypeError('Path must be a string.');
+ return process.nextTick(function () {
+ cb(err);
+ });
+ }
+
+ opts = normalizeOptions(x, opts);
+
+ var isFile = opts.isFile || defaultIsFile;
+ var isDirectory = opts.isDirectory || defaultIsDir;
+ var readFile = opts.readFile || fs.readFile;
+ var realpath = opts.realpath || defaultRealpath;
+ var readPackage = opts.readPackage || defaultReadPackage;
+ if (opts.readFile && opts.readPackage) {
+ var conflictErr = new TypeError('`readFile` and `readPackage` are mutually exclusive.');
+ return process.nextTick(function () {
+ cb(conflictErr);
+ });
+ }
+ var packageIterator = opts.packageIterator;
+
+ var extensions = opts.extensions || ['.js'];
+ var includeCoreModules = opts.includeCoreModules !== false;
+ var basedir = opts.basedir || path.dirname(caller());
+ var parent = opts.filename || basedir;
+
+ opts.paths = opts.paths || [];
+
+ // ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory
+ var absoluteStart = path.resolve(basedir);
+
+ maybeRealpath(
+ realpath,
+ absoluteStart,
+ opts,
+ function (err, realStart) {
+ if (err) cb(err);
+ else init(realStart);
+ }
+ );
+
+ var res;
+ function init(basedir) {
+ if ((/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/).test(x)) {
+ res = path.resolve(basedir, x);
+ if (x === '.' || x === '..' || x.slice(-1) === '/') res += '/';
+ if ((/\/$/).test(x) && res === basedir) {
+ loadAsDirectory(res, opts.package, onfile);
+ } else loadAsFile(res, opts.package, onfile);
+ } else if (includeCoreModules && isCore(x)) {
+ return cb(null, x);
+ } else loadNodeModules(x, basedir, function (err, n, pkg) {
+ if (err) cb(err);
+ else if (n) {
+ return maybeRealpath(realpath, n, opts, function (err, realN) {
+ if (err) {
+ cb(err);
+ } else {
+ cb(null, realN, pkg);
+ }
+ });
+ } else {
+ var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'");
+ moduleError.code = 'MODULE_NOT_FOUND';
+ cb(moduleError);
+ }
+ });
+ }
+
+ function onfile(err, m, pkg) {
+ if (err) cb(err);
+ else if (m) cb(null, m, pkg);
+ else loadAsDirectory(res, function (err, d, pkg) {
+ if (err) cb(err);
+ else if (d) {
+ maybeRealpath(realpath, d, opts, function (err, realD) {
+ if (err) {
+ cb(err);
+ } else {
+ cb(null, realD, pkg);
+ }
+ });
+ } else {
+ var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'");
+ moduleError.code = 'MODULE_NOT_FOUND';
+ cb(moduleError);
+ }
+ });
+ }
+
+ function loadAsFile(x, thePackage, callback) {
+ var loadAsFilePackage = thePackage;
+ var cb = callback;
+ if (typeof loadAsFilePackage === 'function') {
+ cb = loadAsFilePackage;
+ loadAsFilePackage = undefined;
+ }
+
+ var exts = [''].concat(extensions);
+ load(exts, x, loadAsFilePackage);
+
+ function load(exts, x, loadPackage) {
+ if (exts.length === 0) return cb(null, undefined, loadPackage);
+ var file = x + exts[0];
+
+ var pkg = loadPackage;
+ if (pkg) onpkg(null, pkg);
+ else loadpkg(path.dirname(file), onpkg);
+
+ function onpkg(err, pkg_, dir) {
+ pkg = pkg_;
+ if (err) return cb(err);
+ if (dir && pkg && opts.pathFilter) {
+ var rfile = path.relative(dir, file);
+ var rel = rfile.slice(0, rfile.length - exts[0].length);
+ var r = opts.pathFilter(pkg, x, rel);
+ if (r) return load(
+ [''].concat(extensions.slice()),
+ path.resolve(dir, r),
+ pkg
+ );
+ }
+ isFile(file, onex);
+ }
+ function onex(err, ex) {
+ if (err) return cb(err);
+ if (ex) return cb(null, file, pkg);
+ load(exts.slice(1), x, pkg);
+ }
+ }
+ }
+
+ function loadpkg(dir, cb) {
+ if (dir === '' || dir === '/') return cb(null);
+ if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) {
+ return cb(null);
+ }
+ if ((/[/\\]node_modules[/\\]*$/).test(dir)) return cb(null);
+
+ maybeRealpath(realpath, dir, opts, function (unwrapErr, pkgdir) {
+ if (unwrapErr) return loadpkg(path.dirname(dir), cb);
+ var pkgfile = path.join(pkgdir, 'package.json');
+ isFile(pkgfile, function (err, ex) {
+ // on err, ex is false
+ if (!ex) return loadpkg(path.dirname(dir), cb);
+
+ readPackage(readFile, pkgfile, function (err, pkgParam) {
+ if (err) cb(err);
+
+ var pkg = pkgParam;
+
+ if (pkg && opts.packageFilter) {
+ pkg = opts.packageFilter(pkg, pkgfile);
+ }
+ cb(null, pkg, dir);
+ });
+ });
+ });
+ }
+
+ function loadAsDirectory(x, loadAsDirectoryPackage, callback) {
+ var cb = callback;
+ var fpkg = loadAsDirectoryPackage;
+ if (typeof fpkg === 'function') {
+ cb = fpkg;
+ fpkg = opts.package;
+ }
+
+ maybeRealpath(realpath, x, opts, function (unwrapErr, pkgdir) {
+ if (unwrapErr) return cb(unwrapErr);
+ var pkgfile = path.join(pkgdir, 'package.json');
+ isFile(pkgfile, function (err, ex) {
+ if (err) return cb(err);
+ if (!ex) return loadAsFile(path.join(x, 'index'), fpkg, cb);
+
+ readPackage(readFile, pkgfile, function (err, pkgParam) {
+ if (err) return cb(err);
+
+ var pkg = pkgParam;
+
+ if (pkg && opts.packageFilter) {
+ pkg = opts.packageFilter(pkg, pkgfile);
+ }
+
+ if (pkg && pkg.main) {
+ if (typeof pkg.main !== 'string') {
+ var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string');
+ mainError.code = 'INVALID_PACKAGE_MAIN';
+ return cb(mainError);
+ }
+ if (pkg.main === '.' || pkg.main === './') {
+ pkg.main = 'index';
+ }
+ loadAsFile(path.resolve(x, pkg.main), pkg, function (err, m, pkg) {
+ if (err) return cb(err);
+ if (m) return cb(null, m, pkg);
+ if (!pkg) return loadAsFile(path.join(x, 'index'), pkg, cb);
+
+ var dir = path.resolve(x, pkg.main);
+ loadAsDirectory(dir, pkg, function (err, n, pkg) {
+ if (err) return cb(err);
+ if (n) return cb(null, n, pkg);
+ loadAsFile(path.join(x, 'index'), pkg, cb);
+ });
+ });
+ return;
+ }
+
+ loadAsFile(path.join(x, '/index'), pkg, cb);
+ });
+ });
+ });
+ }
+
+ function processDirs(cb, dirs) {
+ if (dirs.length === 0) return cb(null, undefined);
+ var dir = dirs[0];
+
+ isDirectory(path.dirname(dir), isdir);
+
+ function isdir(err, isdir) {
+ if (err) return cb(err);
+ if (!isdir) return processDirs(cb, dirs.slice(1));
+ loadAsFile(dir, opts.package, onfile);
+ }
+
+ function onfile(err, m, pkg) {
+ if (err) return cb(err);
+ if (m) return cb(null, m, pkg);
+ loadAsDirectory(dir, opts.package, ondir);
+ }
+
+ function ondir(err, n, pkg) {
+ if (err) return cb(err);
+ if (n) return cb(null, n, pkg);
+ processDirs(cb, dirs.slice(1));
+ }
+ }
+ function loadNodeModules(x, start, cb) {
+ var thunk = function () { return getPackageCandidates(x, start, opts); };
+ processDirs(
+ cb,
+ packageIterator ? packageIterator(x, start, thunk, opts) : thunk()
+ );
+ }
+};
diff --git a/chromium/third_party/node/node_modules/resolve/lib/caller.js b/chromium/third_party/node/node_modules/resolve/lib/caller.js
new file mode 100644
index 00000000000..b14a2804ae8
--- /dev/null
+++ b/chromium/third_party/node/node_modules/resolve/lib/caller.js
@@ -0,0 +1,8 @@
+module.exports = function () {
+ // see https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi
+ var origPrepareStackTrace = Error.prepareStackTrace;
+ Error.prepareStackTrace = function (_, stack) { return stack; };
+ var stack = (new Error()).stack;
+ Error.prepareStackTrace = origPrepareStackTrace;
+ return stack[2].getFileName();
+};
diff --git a/chromium/third_party/node/node_modules/resolve/lib/core.js b/chromium/third_party/node/node_modules/resolve/lib/core.js
new file mode 100644
index 00000000000..c417d23c5a8
--- /dev/null
+++ b/chromium/third_party/node/node_modules/resolve/lib/core.js
@@ -0,0 +1,53 @@
+var current = (process.versions && process.versions.node && process.versions.node.split('.')) || [];
+
+function specifierIncluded(specifier) {
+ var parts = specifier.split(' ');
+ var op = parts.length > 1 ? parts[0] : '=';
+ var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split('.');
+
+ for (var i = 0; i < 3; ++i) {
+ var cur = parseInt(current[i] || 0, 10);
+ var ver = parseInt(versionParts[i] || 0, 10);
+ if (cur === ver) {
+ continue; // eslint-disable-line no-restricted-syntax, no-continue
+ }
+ if (op === '<') {
+ return cur < ver;
+ } else if (op === '>=') {
+ return cur >= ver;
+ } else {
+ return false;
+ }
+ }
+ return op === '>=';
+}
+
+function matchesRange(range) {
+ var specifiers = range.split(/ ?&& ?/);
+ if (specifiers.length === 0) { return false; }
+ for (var i = 0; i < specifiers.length; ++i) {
+ if (!specifierIncluded(specifiers[i])) { return false; }
+ }
+ return true;
+}
+
+function versionIncluded(specifierValue) {
+ if (typeof specifierValue === 'boolean') { return specifierValue; }
+ if (specifierValue && typeof specifierValue === 'object') {
+ for (var i = 0; i < specifierValue.length; ++i) {
+ if (matchesRange(specifierValue[i])) { return true; }
+ }
+ return false;
+ }
+ return matchesRange(specifierValue);
+}
+
+var data = require('./core.json');
+
+var core = {};
+for (var mod in data) { // eslint-disable-line no-restricted-syntax
+ if (Object.prototype.hasOwnProperty.call(data, mod)) {
+ core[mod] = versionIncluded(data[mod]);
+ }
+}
+module.exports = core;
diff --git a/chromium/third_party/node/node_modules/resolve/lib/core.json b/chromium/third_party/node/node_modules/resolve/lib/core.json
new file mode 100644
index 00000000000..0238b61a4c7
--- /dev/null
+++ b/chromium/third_party/node/node_modules/resolve/lib/core.json
@@ -0,0 +1,83 @@
+{
+ "assert": true,
+ "assert/strict": ">= 15",
+ "async_hooks": ">= 8",
+ "buffer_ieee754": "< 0.9.7",
+ "buffer": true,
+ "child_process": true,
+ "cluster": true,
+ "console": true,
+ "constants": true,
+ "crypto": true,
+ "_debug_agent": ">= 1 && < 8",
+ "_debugger": "< 8",
+ "dgram": true,
+ "diagnostics_channel": ">= 15.1",
+ "dns": true,
+ "dns/promises": ">= 15",
+ "domain": ">= 0.7.12",
+ "events": true,
+ "freelist": "< 6",
+ "fs": true,
+ "fs/promises": [">= 10 && < 10.1", ">= 14"],
+ "_http_agent": ">= 0.11.1",
+ "_http_client": ">= 0.11.1",
+ "_http_common": ">= 0.11.1",
+ "_http_incoming": ">= 0.11.1",
+ "_http_outgoing": ">= 0.11.1",
+ "_http_server": ">= 0.11.1",
+ "http": true,
+ "http2": ">= 8.8",
+ "https": true,
+ "inspector": ">= 8.0.0",
+ "_linklist": "< 8",
+ "module": true,
+ "net": true,
+ "node-inspect/lib/_inspect": ">= 7.6.0 && < 12",
+ "node-inspect/lib/internal/inspect_client": ">= 7.6.0 && < 12",
+ "node-inspect/lib/internal/inspect_repl": ">= 7.6.0 && < 12",
+ "os": true,
+ "path": true,
+ "path/posix": ">= 15.3",
+ "path/win32": ">= 15.3",
+ "perf_hooks": ">= 8.5",
+ "process": ">= 1",
+ "punycode": true,
+ "querystring": true,
+ "readline": true,
+ "repl": true,
+ "smalloc": ">= 0.11.5 && < 3",
+ "_stream_duplex": ">= 0.9.4",
+ "_stream_transform": ">= 0.9.4",
+ "_stream_wrap": ">= 1.4.1",
+ "_stream_passthrough": ">= 0.9.4",
+ "_stream_readable": ">= 0.9.4",
+ "_stream_writable": ">= 0.9.4",
+ "stream": true,
+ "stream/promises": ">= 15",
+ "string_decoder": true,
+ "sys": [">= 0.6 && < 0.7", ">= 0.8"],
+ "timers": true,
+ "timers/promises": ">= 15",
+ "_tls_common": ">= 0.11.13",
+ "_tls_legacy": ">= 0.11.3 && < 10",
+ "_tls_wrap": ">= 0.11.3",
+ "tls": true,
+ "trace_events": ">= 10",
+ "tty": true,
+ "url": true,
+ "util": true,
+ "util/types": ">= 15.3",
+ "v8/tools/arguments": ">= 10 && < 12",
+ "v8/tools/codemap": [">= 4.4.0 && < 5", ">= 5.2.0 && < 12"],
+ "v8/tools/consarray": [">= 4.4.0 && < 5", ">= 5.2.0 && < 12"],
+ "v8/tools/csvparser": [">= 4.4.0 && < 5", ">= 5.2.0 && < 12"],
+ "v8/tools/logreader": [">= 4.4.0 && < 5", ">= 5.2.0 && < 12"],
+ "v8/tools/profile_view": [">= 4.4.0 && < 5", ">= 5.2.0 && < 12"],
+ "v8/tools/splaytree": [">= 4.4.0 && < 5", ">= 5.2.0 && < 12"],
+ "v8": ">= 1",
+ "vm": true,
+ "wasi": ">= 13.4 && < 13.5",
+ "worker_threads": ">= 11.7",
+ "zlib": true
+}
diff --git a/chromium/third_party/node/node_modules/resolve/lib/is-core.js b/chromium/third_party/node/node_modules/resolve/lib/is-core.js
new file mode 100644
index 00000000000..537f5c782ff
--- /dev/null
+++ b/chromium/third_party/node/node_modules/resolve/lib/is-core.js
@@ -0,0 +1,5 @@
+var isCoreModule = require('is-core-module');
+
+module.exports = function isCore(x) {
+ return isCoreModule(x);
+};
diff --git a/chromium/third_party/node/node_modules/resolve/lib/node-modules-paths.js b/chromium/third_party/node/node_modules/resolve/lib/node-modules-paths.js
new file mode 100644
index 00000000000..2b43813a7a5
--- /dev/null
+++ b/chromium/third_party/node/node_modules/resolve/lib/node-modules-paths.js
@@ -0,0 +1,42 @@
+var path = require('path');
+var parse = path.parse || require('path-parse');
+
+var getNodeModulesDirs = function getNodeModulesDirs(absoluteStart, modules) {
+ var prefix = '/';
+ if ((/^([A-Za-z]:)/).test(absoluteStart)) {
+ prefix = '';
+ } else if ((/^\\\\/).test(absoluteStart)) {
+ prefix = '\\\\';
+ }
+
+ var paths = [absoluteStart];
+ var parsed = parse(absoluteStart);
+ while (parsed.dir !== paths[paths.length - 1]) {
+ paths.push(parsed.dir);
+ parsed = parse(parsed.dir);
+ }
+
+ return paths.reduce(function (dirs, aPath) {
+ return dirs.concat(modules.map(function (moduleDir) {
+ return path.resolve(prefix, aPath, moduleDir);
+ }));
+ }, []);
+};
+
+module.exports = function nodeModulesPaths(start, opts, request) {
+ var modules = opts && opts.moduleDirectory
+ ? [].concat(opts.moduleDirectory)
+ : ['node_modules'];
+
+ if (opts && typeof opts.paths === 'function') {
+ return opts.paths(
+ request,
+ start,
+ function () { return getNodeModulesDirs(start, modules); },
+ opts
+ );
+ }
+
+ var dirs = getNodeModulesDirs(start, modules);
+ return opts && opts.paths ? dirs.concat(opts.paths) : dirs;
+};
diff --git a/chromium/third_party/node/node_modules/resolve/lib/normalize-options.js b/chromium/third_party/node/node_modules/resolve/lib/normalize-options.js
new file mode 100644
index 00000000000..4b56904eaea
--- /dev/null
+++ b/chromium/third_party/node/node_modules/resolve/lib/normalize-options.js
@@ -0,0 +1,10 @@
+module.exports = function (x, opts) {
+ /**
+ * This file is purposefully a passthrough. It's expected that third-party
+ * environments will override it at runtime in order to inject special logic
+ * into `resolve` (by manipulating the options). One such example is the PnP
+ * code path in Yarn.
+ */
+
+ return opts || {};
+};
diff --git a/chromium/third_party/node/node_modules/resolve/lib/sync.js b/chromium/third_party/node/node_modules/resolve/lib/sync.js
new file mode 100644
index 00000000000..ef9bd803cee
--- /dev/null
+++ b/chromium/third_party/node/node_modules/resolve/lib/sync.js
@@ -0,0 +1,199 @@
+var isCore = require('is-core-module');
+var fs = require('fs');
+var path = require('path');
+var caller = require('./caller');
+var nodeModulesPaths = require('./node-modules-paths');
+var normalizeOptions = require('./normalize-options');
+
+var realpathFS = fs.realpathSync && typeof fs.realpathSync.native === 'function' ? fs.realpathSync.native : fs.realpathSync;
+
+var defaultIsFile = function isFile(file) {
+ try {
+ var stat = fs.statSync(file);
+ } catch (e) {
+ if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false;
+ throw e;
+ }
+ return stat.isFile() || stat.isFIFO();
+};
+
+var defaultIsDir = function isDirectory(dir) {
+ try {
+ var stat = fs.statSync(dir);
+ } catch (e) {
+ if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false;
+ throw e;
+ }
+ return stat.isDirectory();
+};
+
+var defaultRealpathSync = function realpathSync(x) {
+ try {
+ return realpathFS(x);
+ } catch (realpathErr) {
+ if (realpathErr.code !== 'ENOENT') {
+ throw realpathErr;
+ }
+ }
+ return x;
+};
+
+var maybeRealpathSync = function maybeRealpathSync(realpathSync, x, opts) {
+ if (opts && opts.preserveSymlinks === false) {
+ return realpathSync(x);
+ }
+ return x;
+};
+
+var defaultReadPackageSync = function defaultReadPackageSync(readFileSync, pkgfile) {
+ var body = readFileSync(pkgfile);
+ try {
+ var pkg = JSON.parse(body);
+ return pkg;
+ } catch (jsonErr) {}
+};
+
+var getPackageCandidates = function getPackageCandidates(x, start, opts) {
+ var dirs = nodeModulesPaths(start, opts, x);
+ for (var i = 0; i < dirs.length; i++) {
+ dirs[i] = path.join(dirs[i], x);
+ }
+ return dirs;
+};
+
+module.exports = function resolveSync(x, options) {
+ if (typeof x !== 'string') {
+ throw new TypeError('Path must be a string.');
+ }
+ var opts = normalizeOptions(x, options);
+
+ var isFile = opts.isFile || defaultIsFile;
+ var readFileSync = opts.readFileSync || fs.readFileSync;
+ var isDirectory = opts.isDirectory || defaultIsDir;
+ var realpathSync = opts.realpathSync || defaultRealpathSync;
+ var readPackageSync = opts.readPackageSync || defaultReadPackageSync;
+ if (opts.readFileSync && opts.readPackageSync) {
+ throw new TypeError('`readFileSync` and `readPackageSync` are mutually exclusive.');
+ }
+ var packageIterator = opts.packageIterator;
+
+ var extensions = opts.extensions || ['.js'];
+ var includeCoreModules = opts.includeCoreModules !== false;
+ var basedir = opts.basedir || path.dirname(caller());
+ var parent = opts.filename || basedir;
+
+ opts.paths = opts.paths || [];
+
+ // ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory
+ var absoluteStart = maybeRealpathSync(realpathSync, path.resolve(basedir), opts);
+
+ if ((/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/).test(x)) {
+ var res = path.resolve(absoluteStart, x);
+ if (x === '.' || x === '..' || x.slice(-1) === '/') res += '/';
+ var m = loadAsFileSync(res) || loadAsDirectorySync(res);
+ if (m) return maybeRealpathSync(realpathSync, m, opts);
+ } else if (includeCoreModules && isCore(x)) {
+ return x;
+ } else {
+ var n = loadNodeModulesSync(x, absoluteStart);
+ if (n) return maybeRealpathSync(realpathSync, n, opts);
+ }
+
+ var err = new Error("Cannot find module '" + x + "' from '" + parent + "'");
+ err.code = 'MODULE_NOT_FOUND';
+ throw err;
+
+ function loadAsFileSync(x) {
+ var pkg = loadpkg(path.dirname(x));
+
+ if (pkg && pkg.dir && pkg.pkg && opts.pathFilter) {
+ var rfile = path.relative(pkg.dir, x);
+ var r = opts.pathFilter(pkg.pkg, x, rfile);
+ if (r) {
+ x = path.resolve(pkg.dir, r); // eslint-disable-line no-param-reassign
+ }
+ }
+
+ if (isFile(x)) {
+ return x;
+ }
+
+ for (var i = 0; i < extensions.length; i++) {
+ var file = x + extensions[i];
+ if (isFile(file)) {
+ return file;
+ }
+ }
+ }
+
+ function loadpkg(dir) {
+ if (dir === '' || dir === '/') return;
+ if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) {
+ return;
+ }
+ if ((/[/\\]node_modules[/\\]*$/).test(dir)) return;
+
+ var pkgfile = path.join(maybeRealpathSync(realpathSync, dir, opts), 'package.json');
+
+ if (!isFile(pkgfile)) {
+ return loadpkg(path.dirname(dir));
+ }
+
+ var pkg = readPackageSync(readFileSync, pkgfile);
+
+ if (pkg && opts.packageFilter) {
+ // v2 will pass pkgfile
+ pkg = opts.packageFilter(pkg, /*pkgfile,*/ dir); // eslint-disable-line spaced-comment
+ }
+
+ return { pkg: pkg, dir: dir };
+ }
+
+ function loadAsDirectorySync(x) {
+ var pkgfile = path.join(maybeRealpathSync(realpathSync, x, opts), '/package.json');
+ if (isFile(pkgfile)) {
+ try {
+ var pkg = readPackageSync(readFileSync, pkgfile);
+ } catch (e) {}
+
+ if (pkg && opts.packageFilter) {
+ // v2 will pass pkgfile
+ pkg = opts.packageFilter(pkg, /*pkgfile,*/ x); // eslint-disable-line spaced-comment
+ }
+
+ if (pkg && pkg.main) {
+ if (typeof pkg.main !== 'string') {
+ var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string');
+ mainError.code = 'INVALID_PACKAGE_MAIN';
+ throw mainError;
+ }
+ if (pkg.main === '.' || pkg.main === './') {
+ pkg.main = 'index';
+ }
+ try {
+ var m = loadAsFileSync(path.resolve(x, pkg.main));
+ if (m) return m;
+ var n = loadAsDirectorySync(path.resolve(x, pkg.main));
+ if (n) return n;
+ } catch (e) {}
+ }
+ }
+
+ return loadAsFileSync(path.join(x, '/index'));
+ }
+
+ function loadNodeModulesSync(x, start) {
+ var thunk = function () { return getPackageCandidates(x, start, opts); };
+ var dirs = packageIterator ? packageIterator(x, start, thunk, opts) : thunk();
+
+ for (var i = 0; i < dirs.length; i++) {
+ var dir = dirs[i];
+ if (isDirectory(path.dirname(dir))) {
+ var m = loadAsFileSync(dir);
+ if (m) return m;
+ var n = loadAsDirectorySync(dir);
+ if (n) return n;
+ }
+ }
+ }
+};
diff --git a/chromium/third_party/node/node_modules/resolve/package.json b/chromium/third_party/node/node_modules/resolve/package.json
new file mode 100644
index 00000000000..52a78a2338a
--- /dev/null
+++ b/chromium/third_party/node/node_modules/resolve/package.json
@@ -0,0 +1,51 @@
+{
+ "name": "resolve",
+ "description": "resolve like require.resolve() on behalf of files asynchronously and synchronously",
+ "version": "1.20.0",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/browserify/resolve.git"
+ },
+ "main": "index.js",
+ "keywords": [
+ "resolve",
+ "require",
+ "node",
+ "module"
+ ],
+ "scripts": {
+ "prepublish": "safe-publish-latest && cp node_modules/is-core-module/core.json ./lib/ ||:",
+ "prelint": "eclint check '**/*'",
+ "lint": "eslint --ext=js,mjs .",
+ "pretests-only": "cd ./test/resolver/nested_symlinks && node mylib/sync && node mylib/async",
+ "tests-only": "tape test/*.js",
+ "pretest": "npm run lint",
+ "test": "npm run --silent tests-only",
+ "posttest": "npm run test:multirepo && aud --production",
+ "test:multirepo": "cd ./test/resolver/multirepo && npm install && npm test"
+ },
+ "devDependencies": {
+ "@ljharb/eslint-config": "^17.5.1",
+ "array.prototype.map": "^1.0.3",
+ "aud": "^1.1.4",
+ "eclint": "^2.8.1",
+ "eslint": "^7.19.0",
+ "object-keys": "^1.1.1",
+ "safe-publish-latest": "^1.1.4",
+ "tap": "0.4.13",
+ "tape": "^5.1.1"
+ },
+ "license": "MIT",
+ "author": {
+ "name": "James Halliday",
+ "email": "mail@substack.net",
+ "url": "http://substack.net"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ },
+ "dependencies": {
+ "is-core-module": "^2.2.0",
+ "path-parse": "^1.0.6"
+ }
+}
diff --git a/chromium/third_party/node/node_modules/resolve/readme.markdown b/chromium/third_party/node/node_modules/resolve/readme.markdown
new file mode 100644
index 00000000000..7c9f2dcd533
--- /dev/null
+++ b/chromium/third_party/node/node_modules/resolve/readme.markdown
@@ -0,0 +1,279 @@
+# resolve
+
+implements the [node `require.resolve()`
+algorithm](https://nodejs.org/api/modules.html#modules_all_together)
+such that you can `require.resolve()` on behalf of a file asynchronously and
+synchronously
+
+[![build status](https://secure.travis-ci.org/browserify/resolve.png)](http://travis-ci.org/browserify/resolve)
+
+# example
+
+asynchronously resolve:
+
+```js
+var resolve = require('resolve');
+resolve('tap', { basedir: __dirname }, function (err, res) {
+ if (err) console.error(err);
+ else console.log(res);
+});
+```
+
+```
+$ node example/async.js
+/home/substack/projects/node-resolve/node_modules/tap/lib/main.js
+```
+
+synchronously resolve:
+
+```js
+var resolve = require('resolve');
+var res = resolve.sync('tap', { basedir: __dirname });
+console.log(res);
+```
+
+```
+$ node example/sync.js
+/home/substack/projects/node-resolve/node_modules/tap/lib/main.js
+```
+
+# methods
+
+```js
+var resolve = require('resolve');
+```
+
+For both the synchronous and asynchronous methods, errors may have any of the following `err.code` values:
+
+- `MODULE_NOT_FOUND`: the given path string (`id`) could not be resolved to a module
+- `INVALID_BASEDIR`: the specified `opts.basedir` doesn't exist, or is not a directory
+- `INVALID_PACKAGE_MAIN`: a `package.json` was encountered with an invalid `main` property (eg. not a string)
+
+## resolve(id, opts={}, cb)
+
+Asynchronously resolve the module path string `id` into `cb(err, res [, pkg])`, where `pkg` (if defined) is the data from `package.json`.
+
+options are:
+
+* opts.basedir - directory to begin resolving from
+
+* opts.package - `package.json` data applicable to the module being loaded
+
+* opts.extensions - array of file extensions to search in order
+
+* opts.includeCoreModules - set to `false` to exclude node core modules (e.g. `fs`) from the search
+
+* opts.readFile - how to read files asynchronously
+
+* opts.isFile - function to asynchronously test whether a file exists
+
+* opts.isDirectory - function to asynchronously test whether a directory exists
+
+* opts.realpath - function to asynchronously resolve a potential symlink to its real path
+
+* `opts.readPackage(readFile, pkgfile, cb)` - function to asynchronously read and parse a package.json file
+ * readFile - the passed `opts.readFile` or `fs.readFile` if not specified
+ * pkgfile - path to package.json
+ * cb - callback
+
+* `opts.packageFilter(pkg, pkgfile, dir)` - transform the parsed package.json contents before looking at the "main" field
+ * pkg - package data
+ * pkgfile - path to package.json
+ * dir - directory for package.json
+
+* `opts.pathFilter(pkg, path, relativePath)` - transform a path within a package
+ * pkg - package data
+ * path - the path being resolved
+ * relativePath - the path relative from the package.json location
+ * returns - a relative path that will be joined from the package.json location
+
+* opts.paths - require.paths array to use if nothing is found on the normal `node_modules` recursive walk (probably don't use this)
+
+ For advanced users, `paths` can also be a `opts.paths(request, start, opts)` function
+ * request - the import specifier being resolved
+ * start - lookup path
+ * getNodeModulesDirs - a thunk (no-argument function) that returns the paths using standard `node_modules` resolution
+ * opts - the resolution options
+
+* `opts.packageIterator(request, start, opts)` - return the list of candidate paths where the packages sources may be found (probably don't use this)
+ * request - the import specifier being resolved
+ * start - lookup path
+ * getPackageCandidates - a thunk (no-argument function) that returns the paths using standard `node_modules` resolution
+ * opts - the resolution options
+
+* opts.moduleDirectory - directory (or directories) in which to recursively look for modules. default: `"node_modules"`
+
+* opts.preserveSymlinks - if true, doesn't resolve `basedir` to real path before resolving.
+This is the way Node resolves dependencies when executed with the [--preserve-symlinks](https://nodejs.org/api/all.html#cli_preserve_symlinks) flag.
+**Note:** this property is currently `true` by default but it will be changed to
+`false` in the next major version because *Node's resolution algorithm does not preserve symlinks by default*.
+
+default `opts` values:
+
+```js
+{
+ paths: [],
+ basedir: __dirname,
+ extensions: ['.js'],
+ includeCoreModules: true,
+ readFile: fs.readFile,
+ isFile: function isFile(file, cb) {
+ fs.stat(file, function (err, stat) {
+ if (!err) {
+ return cb(null, stat.isFile() || stat.isFIFO());
+ }
+ if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false);
+ return cb(err);
+ });
+ },
+ isDirectory: function isDirectory(dir, cb) {
+ fs.stat(dir, function (err, stat) {
+ if (!err) {
+ return cb(null, stat.isDirectory());
+ }
+ if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false);
+ return cb(err);
+ });
+ },
+ realpath: function realpath(file, cb) {
+ var realpath = typeof fs.realpath.native === 'function' ? fs.realpath.native : fs.realpath;
+ realpath(file, function (realPathErr, realPath) {
+ if (realPathErr && realPathErr.code !== 'ENOENT') cb(realPathErr);
+ else cb(null, realPathErr ? file : realPath);
+ });
+ },
+ readPackage: function defaultReadPackage(readFile, pkgfile, cb) {
+ readFile(pkgfile, function (readFileErr, body) {
+ if (readFileErr) cb(readFileErr);
+ else {
+ try {
+ var pkg = JSON.parse(body);
+ cb(null, pkg);
+ } catch (jsonErr) {
+ cb(null);
+ }
+ }
+ });
+ },
+ moduleDirectory: 'node_modules',
+ preserveSymlinks: true
+}
+```
+
+## resolve.sync(id, opts)
+
+Synchronously resolve the module path string `id`, returning the result and
+throwing an error when `id` can't be resolved.
+
+options are:
+
+* opts.basedir - directory to begin resolving from
+
+* opts.extensions - array of file extensions to search in order
+
+* opts.includeCoreModules - set to `false` to exclude node core modules (e.g. `fs`) from the search
+
+* opts.readFileSync - how to read files synchronously
+
+* opts.isFile - function to synchronously test whether a file exists
+
+* opts.isDirectory - function to synchronously test whether a directory exists
+
+* opts.realpathSync - function to synchronously resolve a potential symlink to its real path
+
+* `opts.readPackageSync(readFileSync, pkgfile)` - function to synchronously read and parse a package.json file
+ * readFileSync - the passed `opts.readFileSync` or `fs.readFileSync` if not specified
+ * pkgfile - path to package.json
+
+* `opts.packageFilter(pkg, dir)` - transform the parsed package.json contents before looking at the "main" field
+ * pkg - package data
+ * dir - directory for package.json (Note: the second argument will change to "pkgfile" in v2)
+
+* `opts.pathFilter(pkg, path, relativePath)` - transform a path within a package
+ * pkg - package data
+ * path - the path being resolved
+ * relativePath - the path relative from the package.json location
+ * returns - a relative path that will be joined from the package.json location
+
+* opts.paths - require.paths array to use if nothing is found on the normal `node_modules` recursive walk (probably don't use this)
+
+ For advanced users, `paths` can also be a `opts.paths(request, start, opts)` function
+ * request - the import specifier being resolved
+ * start - lookup path
+ * getNodeModulesDirs - a thunk (no-argument function) that returns the paths using standard `node_modules` resolution
+ * opts - the resolution options
+
+* `opts.packageIterator(request, start, opts)` - return the list of candidate paths where the packages sources may be found (probably don't use this)
+ * request - the import specifier being resolved
+ * start - lookup path
+ * getPackageCandidates - a thunk (no-argument function) that returns the paths using standard `node_modules` resolution
+ * opts - the resolution options
+
+* opts.moduleDirectory - directory (or directories) in which to recursively look for modules. default: `"node_modules"`
+
+* opts.preserveSymlinks - if true, doesn't resolve `basedir` to real path before resolving.
+This is the way Node resolves dependencies when executed with the [--preserve-symlinks](https://nodejs.org/api/all.html#cli_preserve_symlinks) flag.
+**Note:** this property is currently `true` by default but it will be changed to
+`false` in the next major version because *Node's resolution algorithm does not preserve symlinks by default*.
+
+default `opts` values:
+
+```js
+{
+ paths: [],
+ basedir: __dirname,
+ extensions: ['.js'],
+ includeCoreModules: true,
+ readFileSync: fs.readFileSync,
+ isFile: function isFile(file) {
+ try {
+ var stat = fs.statSync(file);
+ } catch (e) {
+ if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false;
+ throw e;
+ }
+ return stat.isFile() || stat.isFIFO();
+ },
+ isDirectory: function isDirectory(dir) {
+ try {
+ var stat = fs.statSync(dir);
+ } catch (e) {
+ if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false;
+ throw e;
+ }
+ return stat.isDirectory();
+ },
+ realpathSync: function realpathSync(file) {
+ try {
+ var realpath = typeof fs.realpathSync.native === 'function' ? fs.realpathSync.native : fs.realpathSync;
+ return realpath(file);
+ } catch (realPathErr) {
+ if (realPathErr.code !== 'ENOENT') {
+ throw realPathErr;
+ }
+ }
+ return file;
+ },
+ readPackageSync: function defaultReadPackageSync(readFileSync, pkgfile) {
+ var body = readFileSync(pkgfile);
+ try {
+ var pkg = JSON.parse(body);
+ return pkg;
+ } catch (jsonErr) {}
+ },
+ moduleDirectory: 'node_modules',
+ preserveSymlinks: true
+}
+```
+
+# install
+
+With [npm](https://npmjs.org) do:
+
+```sh
+npm install resolve
+```
+
+# license
+
+MIT
diff --git a/chromium/third_party/node/node_modules/supports-color/browser.js b/chromium/third_party/node/node_modules/supports-color/browser.js
new file mode 100644
index 00000000000..62afa3a7425
--- /dev/null
+++ b/chromium/third_party/node/node_modules/supports-color/browser.js
@@ -0,0 +1,5 @@
+'use strict';
+module.exports = {
+ stdout: false,
+ stderr: false
+};
diff --git a/chromium/third_party/node/node_modules/supports-color/index.js b/chromium/third_party/node/node_modules/supports-color/index.js
new file mode 100644
index 00000000000..1704131bdf6
--- /dev/null
+++ b/chromium/third_party/node/node_modules/supports-color/index.js
@@ -0,0 +1,131 @@
+'use strict';
+const os = require('os');
+const hasFlag = require('has-flag');
+
+const env = process.env;
+
+let forceColor;
+if (hasFlag('no-color') ||
+ hasFlag('no-colors') ||
+ hasFlag('color=false')) {
+ forceColor = false;
+} else if (hasFlag('color') ||
+ hasFlag('colors') ||
+ hasFlag('color=true') ||
+ hasFlag('color=always')) {
+ forceColor = true;
+}
+if ('FORCE_COLOR' in env) {
+ forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
+}
+
+function translateLevel(level) {
+ if (level === 0) {
+ return false;
+ }
+
+ return {
+ level,
+ hasBasic: true,
+ has256: level >= 2,
+ has16m: level >= 3
+ };
+}
+
+function supportsColor(stream) {
+ if (forceColor === false) {
+ return 0;
+ }
+
+ if (hasFlag('color=16m') ||
+ hasFlag('color=full') ||
+ hasFlag('color=truecolor')) {
+ return 3;
+ }
+
+ if (hasFlag('color=256')) {
+ return 2;
+ }
+
+ if (stream && !stream.isTTY && forceColor !== true) {
+ return 0;
+ }
+
+ const min = forceColor ? 1 : 0;
+
+ if (process.platform === 'win32') {
+ // Node.js 7.5.0 is the first version of Node.js to include a patch to
+ // libuv that enables 256 color output on Windows. Anything earlier and it
+ // won't work. However, here we target Node.js 8 at minimum as it is an LTS
+ // release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows
+ // release that supports 256 colors. Windows 10 build 14931 is the first release
+ // that supports 16m/TrueColor.
+ const osRelease = os.release().split('.');
+ if (
+ Number(process.versions.node.split('.')[0]) >= 8 &&
+ Number(osRelease[0]) >= 10 &&
+ Number(osRelease[2]) >= 10586
+ ) {
+ return Number(osRelease[2]) >= 14931 ? 3 : 2;
+ }
+
+ return 1;
+ }
+
+ if ('CI' in env) {
+ if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
+ return 1;
+ }
+
+ return min;
+ }
+
+ if ('TEAMCITY_VERSION' in env) {
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
+ }
+
+ if (env.COLORTERM === 'truecolor') {
+ return 3;
+ }
+
+ if ('TERM_PROGRAM' in env) {
+ const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
+
+ switch (env.TERM_PROGRAM) {
+ case 'iTerm.app':
+ return version >= 3 ? 3 : 2;
+ case 'Apple_Terminal':
+ return 2;
+ // No default
+ }
+ }
+
+ if (/-256(color)?$/i.test(env.TERM)) {
+ return 2;
+ }
+
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
+ return 1;
+ }
+
+ if ('COLORTERM' in env) {
+ return 1;
+ }
+
+ if (env.TERM === 'dumb') {
+ return min;
+ }
+
+ return min;
+}
+
+function getSupportLevel(stream) {
+ const level = supportsColor(stream);
+ return translateLevel(level);
+}
+
+module.exports = {
+ supportsColor: getSupportLevel,
+ stdout: getSupportLevel(process.stdout),
+ stderr: getSupportLevel(process.stderr)
+};
diff --git a/chromium/third_party/node/node_modules/supports-color/license b/chromium/third_party/node/node_modules/supports-color/license
new file mode 100644
index 00000000000..e7af2f77107
--- /dev/null
+++ b/chromium/third_party/node/node_modules/supports-color/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/chromium/third_party/node/node_modules/supports-color/package.json b/chromium/third_party/node/node_modules/supports-color/package.json
new file mode 100644
index 00000000000..ad199f5cdb0
--- /dev/null
+++ b/chromium/third_party/node/node_modules/supports-color/package.json
@@ -0,0 +1,53 @@
+{
+ "name": "supports-color",
+ "version": "5.5.0",
+ "description": "Detect whether a terminal supports color",
+ "license": "MIT",
+ "repository": "chalk/supports-color",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=4"
+ },
+ "scripts": {
+ "test": "xo && ava"
+ },
+ "files": [
+ "index.js",
+ "browser.js"
+ ],
+ "keywords": [
+ "color",
+ "colour",
+ "colors",
+ "terminal",
+ "console",
+ "cli",
+ "ansi",
+ "styles",
+ "tty",
+ "rgb",
+ "256",
+ "shell",
+ "xterm",
+ "command-line",
+ "support",
+ "supports",
+ "capability",
+ "detect",
+ "truecolor",
+ "16m"
+ ],
+ "dependencies": {
+ "has-flag": "^3.0.0"
+ },
+ "devDependencies": {
+ "ava": "^0.25.0",
+ "import-fresh": "^2.0.0",
+ "xo": "^0.20.0"
+ },
+ "browser": "browser.js"
+}
diff --git a/chromium/third_party/node/node_modules/to-fast-properties/index.js b/chromium/third_party/node/node_modules/to-fast-properties/index.js
new file mode 100644
index 00000000000..028c88af01d
--- /dev/null
+++ b/chromium/third_party/node/node_modules/to-fast-properties/index.js
@@ -0,0 +1,27 @@
+'use strict';
+
+let fastProto = null;
+
+// Creates an object with permanently fast properties in V8. See Toon Verwaest's
+// post https://medium.com/@tverwaes/setting-up-prototypes-in-v8-ec9c9491dfe2#5f62
+// for more details. Use %HasFastProperties(object) and the Node.js flag
+// --allow-natives-syntax to check whether an object has fast properties.
+function FastObject(o) {
+ // A prototype object will have "fast properties" enabled once it is checked
+ // against the inline property cache of a function, e.g. fastProto.property:
+ // https://github.com/v8/v8/blob/6.0.122/test/mjsunit/fast-prototype.js#L48-L63
+ if (fastProto !== null && typeof fastProto.property) {
+ const result = fastProto;
+ fastProto = FastObject.prototype = null;
+ return result;
+ }
+ fastProto = FastObject.prototype = o == null ? Object.create(null) : o;
+ return new FastObject;
+}
+
+// Initialize the inline property cache of FastObject
+FastObject();
+
+module.exports = function toFastproperties(o) {
+ return FastObject(o);
+};
diff --git a/chromium/third_party/node/node_modules/to-fast-properties/license b/chromium/third_party/node/node_modules/to-fast-properties/license
new file mode 100644
index 00000000000..cef79eff984
--- /dev/null
+++ b/chromium/third_party/node/node_modules/to-fast-properties/license
@@ -0,0 +1,10 @@
+MIT License
+
+Copyright (c) 2014 Petka Antonov
+ 2015 Sindre Sorhus
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/chromium/third_party/node/node_modules/to-fast-properties/package.json b/chromium/third_party/node/node_modules/to-fast-properties/package.json
new file mode 100644
index 00000000000..7a64b2ccb13
--- /dev/null
+++ b/chromium/third_party/node/node_modules/to-fast-properties/package.json
@@ -0,0 +1,35 @@
+{
+ "name": "to-fast-properties",
+ "version": "2.0.0",
+ "description": "Force V8 to use fast properties for an object",
+ "license": "MIT",
+ "repository": "sindresorhus/to-fast-properties",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=4"
+ },
+ "scripts": {
+ "test": "node --allow-natives-syntax test.js"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "object",
+ "obj",
+ "properties",
+ "props",
+ "v8",
+ "optimize",
+ "fast",
+ "convert",
+ "mode"
+ ],
+ "devDependencies": {
+ "ava": "0.0.4"
+ }
+}