@babel/parser
Advanced tools
Comparing version 7.22.7 to 7.22.10
@@ -30,3 +30,6 @@ "use strict"; | ||
function getOptions(opts) { | ||
if (opts && opts.annexB != null && opts.annexB !== false) { | ||
if (opts == null) { | ||
return Object.assign({}, defaultOptions); | ||
} | ||
if (opts.annexB != null && opts.annexB !== false) { | ||
throw new Error("The `annexB` option can only be set to `false`."); | ||
@@ -36,3 +39,4 @@ } | ||
for (const key of Object.keys(defaultOptions)) { | ||
options[key] = opts && opts[key] != null ? opts[key] : defaultOptions[key]; | ||
var _opts$key; | ||
options[key] = (_opts$key = opts[key]) != null ? _opts$key : defaultOptions[key]; | ||
} | ||
@@ -39,0 +43,0 @@ return options; |
@@ -1377,3 +1377,3 @@ "use strict"; | ||
node.generator = isGenerator; | ||
this.scope.enter(_scopeflags.SCOPE_FUNCTION | _scopeflags.SCOPE_SUPER | (inClassScope ? _scopeflags.SCOPE_CLASS : 0) | (allowDirectSuper ? _scopeflags.SCOPE_DIRECT_SUPER : 0)); | ||
this.scope.enter(_scopeflags.ScopeFlag.FUNCTION | _scopeflags.ScopeFlag.SUPER | (inClassScope ? _scopeflags.ScopeFlag.CLASS : 0) | (allowDirectSuper ? _scopeflags.ScopeFlag.DIRECT_SUPER : 0)); | ||
this.prodParam.enter((0, _productionParameter.functionFlags)(isAsync, node.generator)); | ||
@@ -1399,3 +1399,3 @@ this.parseFunctionParams(node, isConstructor); | ||
parseArrowExpression(node, params, isAsync, trailingCommaLoc) { | ||
this.scope.enter(_scopeflags.SCOPE_FUNCTION | _scopeflags.SCOPE_ARROW); | ||
this.scope.enter(_scopeflags.ScopeFlag.FUNCTION | _scopeflags.ScopeFlag.ARROW); | ||
let flags = (0, _productionParameter.functionFlags)(isAsync, false); | ||
@@ -1448,3 +1448,3 @@ if (!this.match(5) && this.prodParam.hasIn) { | ||
if (this.state.strict && node.id) { | ||
this.checkIdentifier(node.id, _scopeflags.BIND_OUTSIDE, strictModeChanged); | ||
this.checkIdentifier(node.id, _scopeflags.BindingFlag.TYPE_OUTSIDE, strictModeChanged); | ||
} | ||
@@ -1474,3 +1474,3 @@ }); | ||
in: formalParameters, | ||
binding: _scopeflags.BIND_VAR, | ||
binding: _scopeflags.BindingFlag.TYPE_VAR, | ||
checkClashes, | ||
@@ -1477,0 +1477,0 @@ strictModeChanged |
@@ -308,3 +308,3 @@ "use strict"; | ||
in: ancestor, | ||
binding = _scopeflags.BIND_NONE, | ||
binding = _scopeflags.BindingFlag.TYPE_NONE, | ||
checkClashes = false, | ||
@@ -318,3 +318,3 @@ strictModeChanged = false, | ||
if (type === "MemberExpression") { | ||
if (binding !== _scopeflags.BIND_NONE) { | ||
if (binding !== _scopeflags.BindingFlag.TYPE_NONE) { | ||
this.raise(_parseError.Errors.InvalidPropertyBindingPattern, { | ||
@@ -345,3 +345,3 @@ at: expression | ||
if (validity === false) { | ||
const ParseErrorClass = binding === _scopeflags.BIND_NONE ? _parseError.Errors.InvalidLhs : _parseError.Errors.InvalidLhsBinding; | ||
const ParseErrorClass = binding === _scopeflags.BindingFlag.TYPE_NONE ? _parseError.Errors.InvalidLhs : _parseError.Errors.InvalidLhsBinding; | ||
this.raise(ParseErrorClass, { | ||
@@ -371,3 +371,3 @@ at: expression, | ||
if (this.state.strict && (strictModeChanged ? (0, _identifier.isStrictBindReservedWord)(at.name, this.inModule) : (0, _identifier.isStrictBindOnlyReservedWord)(at.name))) { | ||
if (bindingType === _scopeflags.BIND_NONE) { | ||
if (bindingType === _scopeflags.BindingFlag.TYPE_NONE) { | ||
this.raise(_parseError.Errors.StrictEvalArguments, { | ||
@@ -384,3 +384,3 @@ at, | ||
} | ||
if (bindingType & _scopeflags.BIND_FLAGS_NO_LET_IN_LEXICAL && at.name === "let") { | ||
if (bindingType & _scopeflags.BindingFlag.FLAG_NO_LET_IN_LEXICAL && at.name === "let") { | ||
this.raise(_parseError.Errors.LetInLexicalBinding, { | ||
@@ -390,3 +390,3 @@ at | ||
} | ||
if (!(bindingType & _scopeflags.BIND_NONE)) { | ||
if (!(bindingType & _scopeflags.BindingFlag.TYPE_NONE)) { | ||
this.declareNameFromIdentifier(at, bindingType); | ||
@@ -393,0 +393,0 @@ } |
@@ -215,3 +215,3 @@ "use strict"; | ||
} | ||
this.scope.enter(_scopeflags.SCOPE_PROGRAM); | ||
this.scope.enter(_scopeflags.ScopeFlag.PROGRAM); | ||
this.prodParam.enter(paramFlags); | ||
@@ -218,0 +218,0 @@ } |
@@ -21,3 +21,3 @@ "use strict"; | ||
const scope = this.currentScope(); | ||
if (bindingType & _scopeflags.BIND_FLAGS_FLOW_DECLARE_FN) { | ||
if (bindingType & _scopeflags.BindingFlag.FLAG_FLOW_DECLARE_FN) { | ||
this.checkRedeclarationInScope(scope, name, bindingType, loc); | ||
@@ -32,3 +32,3 @@ this.maybeExportDefined(scope, name); | ||
if (super.isRedeclaredInScope(scope, name, bindingType)) return true; | ||
if (bindingType & _scopeflags.BIND_FLAGS_FLOW_DECLARE_FN) { | ||
if (bindingType & _scopeflags.BindingFlag.FLAG_FLOW_DECLARE_FN) { | ||
return !scope.declareFunctions.has(name) && (scope.lexical.has(name) || scope.functions.has(name)); | ||
@@ -35,0 +35,0 @@ } |
@@ -76,3 +76,4 @@ "use strict"; | ||
parseExpressionStatement(node, expr) { | ||
if (expr.type !== "Placeholder" || expr.extra && expr.extra.parenthesized) { | ||
var _expr$extra; | ||
if (expr.type !== "Placeholder" || (_expr$extra = expr.extra) != null && _expr$extra.parenthesized) { | ||
return super.parseExpressionStatement(node, expr); | ||
@@ -79,0 +80,0 @@ } |
@@ -30,3 +30,3 @@ "use strict"; | ||
enter(flags) { | ||
if (flags == _scopeflags.SCOPE_TS_MODULE) { | ||
if (flags == _scopeflags.ScopeFlag.TS_MODULE) { | ||
this.importsStack.push(new Set()); | ||
@@ -38,3 +38,3 @@ } | ||
const flags = super.exit(); | ||
if (flags == _scopeflags.SCOPE_TS_MODULE) { | ||
if (flags == _scopeflags.ScopeFlag.TS_MODULE) { | ||
this.importsStack.pop(); | ||
@@ -57,3 +57,3 @@ } | ||
declareName(name, bindingType, loc) { | ||
if (bindingType & _scopeflags.BIND_FLAGS_TS_IMPORT) { | ||
if (bindingType & _scopeflags.BindingFlag.FLAG_TS_IMPORT) { | ||
if (this.hasImport(name, true)) { | ||
@@ -69,3 +69,3 @@ this.parser.raise(_parseError.Errors.VarRedeclaration, { | ||
const scope = this.currentScope(); | ||
if (bindingType & _scopeflags.BIND_FLAGS_TS_EXPORT_ONLY) { | ||
if (bindingType & _scopeflags.BindingFlag.FLAG_TS_EXPORT_ONLY) { | ||
this.maybeExportDefined(scope, name); | ||
@@ -76,4 +76,4 @@ scope.exportOnlyBindings.add(name); | ||
super.declareName(name, bindingType, loc); | ||
if (bindingType & _scopeflags.BIND_KIND_TYPE) { | ||
if (!(bindingType & _scopeflags.BIND_KIND_VALUE)) { | ||
if (bindingType & _scopeflags.BindingFlag.KIND_TYPE) { | ||
if (!(bindingType & _scopeflags.BindingFlag.KIND_VALUE)) { | ||
this.checkRedeclarationInScope(scope, name, bindingType, loc); | ||
@@ -84,10 +84,12 @@ this.maybeExportDefined(scope, name); | ||
} | ||
if (bindingType & _scopeflags.BIND_FLAGS_TS_ENUM) scope.enums.add(name); | ||
if (bindingType & _scopeflags.BIND_FLAGS_TS_CONST_ENUM) scope.constEnums.add(name); | ||
if (bindingType & _scopeflags.BIND_FLAGS_CLASS) scope.classes.add(name); | ||
if (bindingType & _scopeflags.BindingFlag.FLAG_TS_ENUM) scope.enums.add(name); | ||
if (bindingType & _scopeflags.BindingFlag.FLAG_TS_CONST_ENUM) { | ||
scope.constEnums.add(name); | ||
} | ||
if (bindingType & _scopeflags.BindingFlag.FLAG_CLASS) scope.classes.add(name); | ||
} | ||
isRedeclaredInScope(scope, name, bindingType) { | ||
if (scope.enums.has(name)) { | ||
if (bindingType & _scopeflags.BIND_FLAGS_TS_ENUM) { | ||
const isConst = !!(bindingType & _scopeflags.BIND_FLAGS_TS_CONST_ENUM); | ||
if (bindingType & _scopeflags.BindingFlag.FLAG_TS_ENUM) { | ||
const isConst = !!(bindingType & _scopeflags.BindingFlag.FLAG_TS_CONST_ENUM); | ||
const wasConst = scope.constEnums.has(name); | ||
@@ -98,5 +100,5 @@ return isConst !== wasConst; | ||
} | ||
if (bindingType & _scopeflags.BIND_FLAGS_CLASS && scope.classes.has(name)) { | ||
if (bindingType & _scopeflags.BindingFlag.FLAG_CLASS && scope.classes.has(name)) { | ||
if (scope.lexical.has(name)) { | ||
return !!(bindingType & _scopeflags.BIND_KIND_VALUE); | ||
return !!(bindingType & _scopeflags.BindingFlag.KIND_VALUE); | ||
} else { | ||
@@ -106,3 +108,3 @@ return false; | ||
} | ||
if (bindingType & _scopeflags.BIND_KIND_TYPE && scope.types.has(name)) { | ||
if (bindingType & _scopeflags.BindingFlag.KIND_TYPE && scope.types.has(name)) { | ||
return true; | ||
@@ -109,0 +111,0 @@ } |
@@ -53,9 +53,9 @@ "use strict"; | ||
let redefined = privateNames.has(name); | ||
if (elementType & _scopeflags.CLASS_ELEMENT_KIND_ACCESSOR) { | ||
if (elementType & _scopeflags.ClassElementType.KIND_ACCESSOR) { | ||
const accessor = redefined && loneAccessors.get(name); | ||
if (accessor) { | ||
const oldStatic = accessor & _scopeflags.CLASS_ELEMENT_FLAG_STATIC; | ||
const newStatic = elementType & _scopeflags.CLASS_ELEMENT_FLAG_STATIC; | ||
const oldKind = accessor & _scopeflags.CLASS_ELEMENT_KIND_ACCESSOR; | ||
const newKind = elementType & _scopeflags.CLASS_ELEMENT_KIND_ACCESSOR; | ||
const oldStatic = accessor & _scopeflags.ClassElementType.FLAG_STATIC; | ||
const newStatic = elementType & _scopeflags.ClassElementType.FLAG_STATIC; | ||
const oldKind = accessor & _scopeflags.ClassElementType.KIND_ACCESSOR; | ||
const newKind = elementType & _scopeflags.ClassElementType.KIND_ACCESSOR; | ||
redefined = oldKind === newKind || oldStatic !== newStatic; | ||
@@ -62,0 +62,0 @@ if (!redefined) loneAccessors.delete(name); |
@@ -12,16 +12,11 @@ "use strict"; | ||
var _parseError = require("../parse-error"); | ||
const kExpression = 0, | ||
kMaybeArrowParameterDeclaration = 1, | ||
kMaybeAsyncArrowParameterDeclaration = 2, | ||
kParameterDeclaration = 3; | ||
class ExpressionScope { | ||
constructor(type = kExpression) { | ||
this.type = void 0; | ||
constructor(type = 0) { | ||
this.type = type; | ||
} | ||
canBeArrowParameterDeclaration() { | ||
return this.type === kMaybeAsyncArrowParameterDeclaration || this.type === kMaybeArrowParameterDeclaration; | ||
return this.type === 2 || this.type === 1; | ||
} | ||
isCertainlyParameterDeclaration() { | ||
return this.type === kParameterDeclaration; | ||
return this.type === 3; | ||
} | ||
@@ -107,3 +102,3 @@ } | ||
while (scope.canBeArrowParameterDeclaration()) { | ||
if (scope.type === kMaybeAsyncArrowParameterDeclaration) { | ||
if (scope.type === 2) { | ||
scope.recordDeclarationError(_parseError.Errors.AwaitBindingIdentifier, { | ||
@@ -137,9 +132,9 @@ at | ||
function newParameterDeclarationScope() { | ||
return new ExpressionScope(kParameterDeclaration); | ||
return new ExpressionScope(3); | ||
} | ||
function newArrowHeadScope() { | ||
return new ArrowHeadParsingScope(kMaybeArrowParameterDeclaration); | ||
return new ArrowHeadParsingScope(1); | ||
} | ||
function newAsyncArrowScope() { | ||
return new ArrowHeadParsingScope(kMaybeAsyncArrowParameterDeclaration); | ||
return new ArrowHeadParsingScope(2); | ||
} | ||
@@ -146,0 +141,0 @@ function newExpressionScope() { |
@@ -28,19 +28,19 @@ "use strict"; | ||
get inTopLevel() { | ||
return (this.currentScope().flags & _scopeflags.SCOPE_PROGRAM) > 0; | ||
return (this.currentScope().flags & _scopeflags.ScopeFlag.PROGRAM) > 0; | ||
} | ||
get inFunction() { | ||
return (this.currentVarScopeFlags() & _scopeflags.SCOPE_FUNCTION) > 0; | ||
return (this.currentVarScopeFlags() & _scopeflags.ScopeFlag.FUNCTION) > 0; | ||
} | ||
get allowSuper() { | ||
return (this.currentThisScopeFlags() & _scopeflags.SCOPE_SUPER) > 0; | ||
return (this.currentThisScopeFlags() & _scopeflags.ScopeFlag.SUPER) > 0; | ||
} | ||
get allowDirectSuper() { | ||
return (this.currentThisScopeFlags() & _scopeflags.SCOPE_DIRECT_SUPER) > 0; | ||
return (this.currentThisScopeFlags() & _scopeflags.ScopeFlag.DIRECT_SUPER) > 0; | ||
} | ||
get inClass() { | ||
return (this.currentThisScopeFlags() & _scopeflags.SCOPE_CLASS) > 0; | ||
return (this.currentThisScopeFlags() & _scopeflags.ScopeFlag.CLASS) > 0; | ||
} | ||
get inClassAndNotInNonArrowFunction() { | ||
const flags = this.currentThisScopeFlags(); | ||
return (flags & _scopeflags.SCOPE_CLASS) > 0 && (flags & _scopeflags.SCOPE_FUNCTION) === 0; | ||
return (flags & _scopeflags.ScopeFlag.CLASS) > 0 && (flags & _scopeflags.ScopeFlag.FUNCTION) === 0; | ||
} | ||
@@ -52,6 +52,6 @@ get inStaticBlock() { | ||
} = this.scopeStack[i]; | ||
if (flags & _scopeflags.SCOPE_STATIC_BLOCK) { | ||
if (flags & _scopeflags.ScopeFlag.STATIC_BLOCK) { | ||
return true; | ||
} | ||
if (flags & (_scopeflags.SCOPE_VAR | _scopeflags.SCOPE_CLASS)) { | ||
if (flags & (_scopeflags.ScopeFlag.VAR | _scopeflags.ScopeFlag.CLASS)) { | ||
return false; | ||
@@ -62,3 +62,3 @@ } | ||
get inNonArrowFunction() { | ||
return (this.currentThisScopeFlags() & _scopeflags.SCOPE_FUNCTION) > 0; | ||
return (this.currentThisScopeFlags() & _scopeflags.ScopeFlag.FUNCTION) > 0; | ||
} | ||
@@ -79,9 +79,9 @@ get treatFunctionsAsVar() { | ||
treatFunctionsAsVarInScope(scope) { | ||
return !!(scope.flags & (_scopeflags.SCOPE_FUNCTION | _scopeflags.SCOPE_STATIC_BLOCK) || !this.parser.inModule && scope.flags & _scopeflags.SCOPE_PROGRAM); | ||
return !!(scope.flags & (_scopeflags.ScopeFlag.FUNCTION | _scopeflags.ScopeFlag.STATIC_BLOCK) || !this.parser.inModule && scope.flags & _scopeflags.ScopeFlag.PROGRAM); | ||
} | ||
declareName(name, bindingType, loc) { | ||
let scope = this.currentScope(); | ||
if (bindingType & _scopeflags.BIND_SCOPE_LEXICAL || bindingType & _scopeflags.BIND_SCOPE_FUNCTION) { | ||
if (bindingType & _scopeflags.BindingFlag.SCOPE_LEXICAL || bindingType & _scopeflags.BindingFlag.SCOPE_FUNCTION) { | ||
this.checkRedeclarationInScope(scope, name, bindingType, loc); | ||
if (bindingType & _scopeflags.BIND_SCOPE_FUNCTION) { | ||
if (bindingType & _scopeflags.BindingFlag.SCOPE_FUNCTION) { | ||
scope.functions.add(name); | ||
@@ -91,6 +91,6 @@ } else { | ||
} | ||
if (bindingType & _scopeflags.BIND_SCOPE_LEXICAL) { | ||
if (bindingType & _scopeflags.BindingFlag.SCOPE_LEXICAL) { | ||
this.maybeExportDefined(scope, name); | ||
} | ||
} else if (bindingType & _scopeflags.BIND_SCOPE_VAR) { | ||
} else if (bindingType & _scopeflags.BindingFlag.SCOPE_VAR) { | ||
for (let i = this.scopeStack.length - 1; i >= 0; --i) { | ||
@@ -101,6 +101,6 @@ scope = this.scopeStack[i]; | ||
this.maybeExportDefined(scope, name); | ||
if (scope.flags & _scopeflags.SCOPE_VAR) break; | ||
if (scope.flags & _scopeflags.ScopeFlag.VAR) break; | ||
} | ||
} | ||
if (this.parser.inModule && scope.flags & _scopeflags.SCOPE_PROGRAM) { | ||
if (this.parser.inModule && scope.flags & _scopeflags.ScopeFlag.PROGRAM) { | ||
this.undefinedExports.delete(name); | ||
@@ -110,3 +110,3 @@ } | ||
maybeExportDefined(scope, name) { | ||
if (this.parser.inModule && scope.flags & _scopeflags.SCOPE_PROGRAM) { | ||
if (this.parser.inModule && scope.flags & _scopeflags.ScopeFlag.PROGRAM) { | ||
this.undefinedExports.delete(name); | ||
@@ -124,10 +124,10 @@ } | ||
isRedeclaredInScope(scope, name, bindingType) { | ||
if (!(bindingType & _scopeflags.BIND_KIND_VALUE)) return false; | ||
if (bindingType & _scopeflags.BIND_SCOPE_LEXICAL) { | ||
if (!(bindingType & _scopeflags.BindingFlag.KIND_VALUE)) return false; | ||
if (bindingType & _scopeflags.BindingFlag.SCOPE_LEXICAL) { | ||
return scope.lexical.has(name) || scope.functions.has(name) || scope.var.has(name); | ||
} | ||
if (bindingType & _scopeflags.BIND_SCOPE_FUNCTION) { | ||
if (bindingType & _scopeflags.BindingFlag.SCOPE_FUNCTION) { | ||
return scope.lexical.has(name) || !this.treatFunctionsAsVarInScope(scope) && scope.var.has(name); | ||
} | ||
return scope.lexical.has(name) && !(scope.flags & _scopeflags.SCOPE_SIMPLE_CATCH && scope.lexical.values().next().value === name) || !this.treatFunctionsAsVarInScope(scope) && scope.functions.has(name); | ||
return scope.lexical.has(name) && !(scope.flags & _scopeflags.ScopeFlag.SIMPLE_CATCH && scope.lexical.values().next().value === name) || !this.treatFunctionsAsVarInScope(scope) && scope.functions.has(name); | ||
} | ||
@@ -151,3 +151,3 @@ checkLocalExport(id) { | ||
} = this.scopeStack[i]; | ||
if (flags & _scopeflags.SCOPE_VAR) { | ||
if (flags & _scopeflags.ScopeFlag.VAR) { | ||
return flags; | ||
@@ -162,3 +162,3 @@ } | ||
} = this.scopeStack[i]; | ||
if (flags & (_scopeflags.SCOPE_VAR | _scopeflags.SCOPE_CLASS) && !(flags & _scopeflags.SCOPE_ARROW)) { | ||
if (flags & (_scopeflags.ScopeFlag.VAR | _scopeflags.ScopeFlag.CLASS) && !(flags & _scopeflags.ScopeFlag.ARROW)) { | ||
return flags; | ||
@@ -165,0 +165,0 @@ } |
@@ -6,102 +6,63 @@ "use strict"; | ||
}); | ||
exports.SCOPE_VAR = exports.SCOPE_TS_MODULE = exports.SCOPE_SUPER = exports.SCOPE_STATIC_BLOCK = exports.SCOPE_SIMPLE_CATCH = exports.SCOPE_PROGRAM = exports.SCOPE_OTHER = exports.SCOPE_FUNCTION = exports.SCOPE_DIRECT_SUPER = exports.SCOPE_CLASS = exports.SCOPE_ARROW = exports.CLASS_ELEMENT_STATIC_SETTER = exports.CLASS_ELEMENT_STATIC_GETTER = exports.CLASS_ELEMENT_OTHER = exports.CLASS_ELEMENT_KIND_SETTER = exports.CLASS_ELEMENT_KIND_GETTER = exports.CLASS_ELEMENT_KIND_ACCESSOR = exports.CLASS_ELEMENT_INSTANCE_SETTER = exports.CLASS_ELEMENT_INSTANCE_GETTER = exports.CLASS_ELEMENT_FLAG_STATIC = exports.BIND_VAR = exports.BIND_TS_TYPE_IMPORT = exports.BIND_TS_TYPE = exports.BIND_TS_NAMESPACE = exports.BIND_TS_INTERFACE = exports.BIND_TS_ENUM = exports.BIND_TS_CONST_ENUM = exports.BIND_TS_AMBIENT = exports.BIND_SCOPE_VAR = exports.BIND_SCOPE_OUTSIDE = exports.BIND_SCOPE_LEXICAL = exports.BIND_SCOPE_FUNCTION = exports.BIND_OUTSIDE = exports.BIND_NONE = exports.BIND_LEXICAL = exports.BIND_KIND_VALUE = exports.BIND_KIND_TYPE = exports.BIND_FUNCTION = exports.BIND_FLOW_DECLARE_FN = exports.BIND_FLAGS_TS_IMPORT = exports.BIND_FLAGS_TS_EXPORT_ONLY = exports.BIND_FLAGS_TS_ENUM = exports.BIND_FLAGS_TS_CONST_ENUM = exports.BIND_FLAGS_NO_LET_IN_LEXICAL = exports.BIND_FLAGS_NONE = exports.BIND_FLAGS_FLOW_DECLARE_FN = exports.BIND_FLAGS_CLASS = exports.BIND_CLASS = exports.BIND_CATCH_PARAM = void 0; | ||
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_STATIC_BLOCK | SCOPE_TS_MODULE; | ||
exports.SCOPE_VAR = SCOPE_VAR; | ||
exports.SCOPE_TS_MODULE = SCOPE_TS_MODULE; | ||
exports.SCOPE_STATIC_BLOCK = SCOPE_STATIC_BLOCK; | ||
exports.SCOPE_CLASS = SCOPE_CLASS; | ||
exports.SCOPE_DIRECT_SUPER = SCOPE_DIRECT_SUPER; | ||
exports.SCOPE_SUPER = SCOPE_SUPER; | ||
exports.SCOPE_SIMPLE_CATCH = SCOPE_SIMPLE_CATCH; | ||
exports.SCOPE_ARROW = SCOPE_ARROW; | ||
exports.SCOPE_FUNCTION = SCOPE_FUNCTION; | ||
exports.SCOPE_PROGRAM = SCOPE_PROGRAM; | ||
exports.SCOPE_OTHER = SCOPE_OTHER; | ||
const BIND_KIND_VALUE = 0b0000000000001, | ||
BIND_KIND_TYPE = 0b0000000000010, | ||
BIND_SCOPE_VAR = 0b0000000000100, | ||
BIND_SCOPE_LEXICAL = 0b0000000001000, | ||
BIND_SCOPE_FUNCTION = 0b0000000010000, | ||
BIND_SCOPE_OUTSIDE = 0b0000000100000, | ||
BIND_FLAGS_NONE = 0b00000001000000, | ||
BIND_FLAGS_CLASS = 0b00000010000000, | ||
BIND_FLAGS_TS_ENUM = 0b00000100000000, | ||
BIND_FLAGS_TS_CONST_ENUM = 0b00001000000000, | ||
BIND_FLAGS_TS_EXPORT_ONLY = 0b00010000000000, | ||
BIND_FLAGS_FLOW_DECLARE_FN = 0b00100000000000, | ||
BIND_FLAGS_TS_IMPORT = 0b01000000000000, | ||
BIND_FLAGS_NO_LET_IN_LEXICAL = 0b10000000000000; | ||
exports.BIND_FLAGS_NO_LET_IN_LEXICAL = BIND_FLAGS_NO_LET_IN_LEXICAL; | ||
exports.BIND_FLAGS_TS_IMPORT = BIND_FLAGS_TS_IMPORT; | ||
exports.BIND_FLAGS_FLOW_DECLARE_FN = BIND_FLAGS_FLOW_DECLARE_FN; | ||
exports.BIND_FLAGS_TS_EXPORT_ONLY = BIND_FLAGS_TS_EXPORT_ONLY; | ||
exports.BIND_FLAGS_TS_CONST_ENUM = BIND_FLAGS_TS_CONST_ENUM; | ||
exports.BIND_FLAGS_TS_ENUM = BIND_FLAGS_TS_ENUM; | ||
exports.BIND_FLAGS_CLASS = BIND_FLAGS_CLASS; | ||
exports.BIND_FLAGS_NONE = BIND_FLAGS_NONE; | ||
exports.BIND_SCOPE_OUTSIDE = BIND_SCOPE_OUTSIDE; | ||
exports.BIND_SCOPE_FUNCTION = BIND_SCOPE_FUNCTION; | ||
exports.BIND_SCOPE_LEXICAL = BIND_SCOPE_LEXICAL; | ||
exports.BIND_SCOPE_VAR = BIND_SCOPE_VAR; | ||
exports.BIND_KIND_TYPE = BIND_KIND_TYPE; | ||
exports.BIND_KIND_VALUE = BIND_KIND_VALUE; | ||
const BIND_CLASS = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_CLASS | BIND_FLAGS_NO_LET_IN_LEXICAL, | ||
BIND_LEXICAL = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | BIND_FLAGS_NO_LET_IN_LEXICAL, | ||
BIND_CATCH_PARAM = 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_FLAGS_NO_LET_IN_LEXICAL, | ||
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_TS_TYPE_IMPORT = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_TS_IMPORT, | ||
BIND_FLOW_DECLARE_FN = BIND_FLAGS_FLOW_DECLARE_FN; | ||
exports.BIND_FLOW_DECLARE_FN = BIND_FLOW_DECLARE_FN; | ||
exports.BIND_TS_TYPE_IMPORT = BIND_TS_TYPE_IMPORT; | ||
exports.BIND_TS_NAMESPACE = BIND_TS_NAMESPACE; | ||
exports.BIND_TS_CONST_ENUM = BIND_TS_CONST_ENUM; | ||
exports.BIND_OUTSIDE = BIND_OUTSIDE; | ||
exports.BIND_NONE = BIND_NONE; | ||
exports.BIND_TS_AMBIENT = BIND_TS_AMBIENT; | ||
exports.BIND_TS_ENUM = BIND_TS_ENUM; | ||
exports.BIND_TS_TYPE = BIND_TS_TYPE; | ||
exports.BIND_TS_INTERFACE = BIND_TS_INTERFACE; | ||
exports.BIND_FUNCTION = BIND_FUNCTION; | ||
exports.BIND_VAR = BIND_VAR; | ||
exports.BIND_CATCH_PARAM = BIND_CATCH_PARAM; | ||
exports.BIND_LEXICAL = BIND_LEXICAL; | ||
exports.BIND_CLASS = BIND_CLASS; | ||
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; | ||
exports.CLASS_ELEMENT_KIND_ACCESSOR = CLASS_ELEMENT_KIND_ACCESSOR; | ||
exports.CLASS_ELEMENT_KIND_SETTER = CLASS_ELEMENT_KIND_SETTER; | ||
exports.CLASS_ELEMENT_KIND_GETTER = CLASS_ELEMENT_KIND_GETTER; | ||
exports.CLASS_ELEMENT_FLAG_STATIC = CLASS_ELEMENT_FLAG_STATIC; | ||
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; | ||
exports.CLASS_ELEMENT_OTHER = CLASS_ELEMENT_OTHER; | ||
exports.CLASS_ELEMENT_INSTANCE_SETTER = CLASS_ELEMENT_INSTANCE_SETTER; | ||
exports.CLASS_ELEMENT_INSTANCE_GETTER = CLASS_ELEMENT_INSTANCE_GETTER; | ||
exports.CLASS_ELEMENT_STATIC_SETTER = CLASS_ELEMENT_STATIC_SETTER; | ||
exports.CLASS_ELEMENT_STATIC_GETTER = CLASS_ELEMENT_STATIC_GETTER; | ||
exports.ScopeFlag = exports.ClassElementType = exports.BindingFlag = void 0; | ||
var ScopeFlag = { | ||
OTHER: 0, | ||
PROGRAM: 1, | ||
FUNCTION: 2, | ||
ARROW: 4, | ||
SIMPLE_CATCH: 8, | ||
SUPER: 16, | ||
DIRECT_SUPER: 32, | ||
CLASS: 64, | ||
STATIC_BLOCK: 128, | ||
TS_MODULE: 256, | ||
VAR: 387 | ||
}; | ||
exports.ScopeFlag = ScopeFlag; | ||
var BindingFlag = { | ||
KIND_VALUE: 1, | ||
KIND_TYPE: 2, | ||
SCOPE_VAR: 4, | ||
SCOPE_LEXICAL: 8, | ||
SCOPE_FUNCTION: 16, | ||
SCOPE_OUTSIDE: 32, | ||
FLAG_NONE: 64, | ||
FLAG_CLASS: 128, | ||
FLAG_TS_ENUM: 256, | ||
FLAG_TS_CONST_ENUM: 512, | ||
FLAG_TS_EXPORT_ONLY: 1024, | ||
FLAG_FLOW_DECLARE_FN: 2048, | ||
FLAG_TS_IMPORT: 4096, | ||
FLAG_NO_LET_IN_LEXICAL: 8192, | ||
TYPE_CLASS: 8331, | ||
TYPE_LEXICAL: 8201, | ||
TYPE_CATCH_PARAM: 9, | ||
TYPE_VAR: 5, | ||
TYPE_FUNCTION: 17, | ||
TYPE_TS_INTERFACE: 130, | ||
TYPE_TS_TYPE: 2, | ||
TYPE_TS_ENUM: 8459, | ||
TYPE_TS_AMBIENT: 1024, | ||
TYPE_NONE: 64, | ||
TYPE_OUTSIDE: 65, | ||
TYPE_TS_CONST_ENUM: 8971, | ||
TYPE_TS_NAMESPACE: 1024, | ||
TYPE_TS_TYPE_IMPORT: 4098, | ||
TYPE_TS_VALUE_IMPORT: 4096, | ||
TYPE_FLOW_DECLARE_FN: 2048 | ||
}; | ||
exports.BindingFlag = BindingFlag; | ||
var ClassElementType = { | ||
OTHER: 0, | ||
FLAG_STATIC: 4, | ||
KIND_GETTER: 2, | ||
KIND_SETTER: 1, | ||
KIND_ACCESSOR: 3, | ||
STATIC_GETTER: 6, | ||
STATIC_SETTER: 5, | ||
INSTANCE_GETTER: 2, | ||
INSTANCE_SETTER: 1 | ||
}; | ||
exports.ClassElementType = ClassElementType; | ||
//# sourceMappingURL=scopeflags.js.map |
{ | ||
"name": "@babel/parser", | ||
"version": "7.22.7", | ||
"version": "7.22.10", | ||
"description": "A JavaScript parser", | ||
@@ -37,5 +37,5 @@ "author": "The Babel Team (https://babel.dev/team)", | ||
"devDependencies": { | ||
"@babel/code-frame": "^7.22.5", | ||
"@babel/code-frame": "^7.22.10", | ||
"@babel/helper-check-duplicate-nodes": "^7.22.5", | ||
"@babel/helper-fixtures": "^7.22.6", | ||
"@babel/helper-fixtures": "^7.22.9", | ||
"@babel/helper-string-parser": "^7.22.5", | ||
@@ -42,0 +42,0 @@ "@babel/helper-validator-identifier": "^7.22.5", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
3700407
29188