mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-11-21 14:13:36 +08:00
docs:更新文档
This commit is contained in:
99
node_modules/@babel/parser/lib/util/class-scope.js
generated
vendored
Normal file
99
node_modules/@babel/parser/lib/util/class-scope.js
generated
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = exports.ClassScope = void 0;
|
||||
|
||||
var _scopeflags = require("./scopeflags");
|
||||
|
||||
var _error = require("../parser/error");
|
||||
|
||||
class ClassScope {
|
||||
constructor() {
|
||||
this.privateNames = new Set();
|
||||
this.loneAccessors = new Map();
|
||||
this.undefinedPrivateNames = new Map();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.ClassScope = ClassScope;
|
||||
|
||||
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 (let _i = 0, _Array$from = Array.from(oldClassScope.undefinedPrivateNames); _i < _Array$from.length; _i++) {
|
||||
const [name, pos] = _Array$from[_i];
|
||||
|
||||
if (current) {
|
||||
if (!current.undefinedPrivateNames.has(name)) {
|
||||
current.undefinedPrivateNames.set(name, pos);
|
||||
}
|
||||
} else {
|
||||
this.raise(pos, _error.Errors.InvalidPrivateFieldResolution, name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
declarePrivateName(name, elementType, pos) {
|
||||
const classScope = this.current();
|
||||
let redefined = classScope.privateNames.has(name);
|
||||
|
||||
if (elementType & _scopeflags.CLASS_ELEMENT_KIND_ACCESSOR) {
|
||||
const accessor = redefined && classScope.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;
|
||||
redefined = oldKind === newKind || oldStatic !== newStatic;
|
||||
if (!redefined) classScope.loneAccessors.delete(name);
|
||||
} else if (!redefined) {
|
||||
classScope.loneAccessors.set(name, elementType);
|
||||
}
|
||||
}
|
||||
|
||||
if (redefined) {
|
||||
this.raise(pos, _error.Errors.PrivateNameRedeclaration, name);
|
||||
}
|
||||
|
||||
classScope.privateNames.add(name);
|
||||
classScope.undefinedPrivateNames.delete(name);
|
||||
}
|
||||
|
||||
usePrivateName(name, pos) {
|
||||
let classScope;
|
||||
|
||||
for (let _i2 = 0, _this$stack = this.stack; _i2 < _this$stack.length; _i2++) {
|
||||
classScope = _this$stack[_i2];
|
||||
if (classScope.privateNames.has(name)) return;
|
||||
}
|
||||
|
||||
if (classScope) {
|
||||
classScope.undefinedPrivateNames.set(name, pos);
|
||||
} else {
|
||||
this.raise(pos, _error.Errors.InvalidPrivateFieldResolution, name);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.default = ClassScopeHandler;
|
||||
138
node_modules/@babel/parser/lib/util/expression-scope.js
generated
vendored
Normal file
138
node_modules/@babel/parser/lib/util/expression-scope.js
generated
vendored
Normal file
@@ -0,0 +1,138 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.newParameterDeclarationScope = newParameterDeclarationScope;
|
||||
exports.newArrowHeadScope = newArrowHeadScope;
|
||||
exports.newAsyncArrowScope = newAsyncArrowScope;
|
||||
exports.newExpressionScope = newExpressionScope;
|
||||
exports.default = void 0;
|
||||
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, message) {
|
||||
this.errors.set(pos, message);
|
||||
}
|
||||
|
||||
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, message) {
|
||||
const {
|
||||
stack
|
||||
} = this;
|
||||
let i = stack.length - 1;
|
||||
let scope = stack[i];
|
||||
|
||||
while (!scope.isCertainlyParameterDeclaration()) {
|
||||
if (scope.canBeArrowParameterDeclaration()) {
|
||||
scope.recordDeclarationError(pos, message);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
scope = stack[--i];
|
||||
}
|
||||
|
||||
this.raise(pos, message);
|
||||
}
|
||||
|
||||
recordAsyncArrowParametersError(pos, message) {
|
||||
const {
|
||||
stack
|
||||
} = this;
|
||||
let i = stack.length - 1;
|
||||
let scope = stack[i];
|
||||
|
||||
while (scope.canBeArrowParameterDeclaration()) {
|
||||
if (scope.type === kMaybeAsyncArrowParameterDeclaration) {
|
||||
scope.recordDeclarationError(pos, message);
|
||||
}
|
||||
|
||||
scope = stack[--i];
|
||||
}
|
||||
}
|
||||
|
||||
validateAsPattern() {
|
||||
const {
|
||||
stack
|
||||
} = this;
|
||||
const currentScope = stack[stack.length - 1];
|
||||
if (!currentScope.canBeArrowParameterDeclaration()) return;
|
||||
currentScope.iterateErrors((message, pos) => {
|
||||
this.raise(pos, message);
|
||||
let i = stack.length - 2;
|
||||
let scope = stack[i];
|
||||
|
||||
while (scope.canBeArrowParameterDeclaration()) {
|
||||
scope.clearDeclarationError(pos);
|
||||
scope = stack[--i];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.default = ExpressionScopeHandler;
|
||||
|
||||
function newParameterDeclarationScope() {
|
||||
return new ExpressionScope(kParameterDeclaration);
|
||||
}
|
||||
|
||||
function newArrowHeadScope() {
|
||||
return new ArrowHeadParsingScope(kMaybeArrowParameterDeclaration);
|
||||
}
|
||||
|
||||
function newAsyncArrowScope() {
|
||||
return new ArrowHeadParsingScope(kMaybeAsyncArrowParameterDeclaration);
|
||||
}
|
||||
|
||||
function newExpressionScope() {
|
||||
return new ExpressionScope();
|
||||
}
|
||||
58
node_modules/@babel/parser/lib/util/identifier.js
generated
vendored
Normal file
58
node_modules/@babel/parser/lib/util/identifier.js
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.isIteratorStart = isIteratorStart;
|
||||
Object.defineProperty(exports, "isIdentifierStart", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _helperValidatorIdentifier.isIdentifierStart;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isIdentifierChar", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _helperValidatorIdentifier.isIdentifierChar;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isReservedWord", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _helperValidatorIdentifier.isReservedWord;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isStrictBindOnlyReservedWord", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _helperValidatorIdentifier.isStrictBindOnlyReservedWord;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isStrictBindReservedWord", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _helperValidatorIdentifier.isStrictBindReservedWord;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isStrictReservedWord", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _helperValidatorIdentifier.isStrictReservedWord;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isKeyword", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _helperValidatorIdentifier.isKeyword;
|
||||
}
|
||||
});
|
||||
exports.keywordRelationalOperator = void 0;
|
||||
|
||||
var _helperValidatorIdentifier = require("@babel/helper-validator-identifier");
|
||||
|
||||
const keywordRelationalOperator = /^in(stanceof)?$/;
|
||||
exports.keywordRelationalOperator = keywordRelationalOperator;
|
||||
|
||||
function isIteratorStart(current, next) {
|
||||
return current === 64 && next === 64;
|
||||
}
|
||||
49
node_modules/@babel/parser/lib/util/location.js
generated
vendored
Normal file
49
node_modules/@babel/parser/lib/util/location.js
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getLineInfo = getLineInfo;
|
||||
exports.SourceLocation = exports.Position = void 0;
|
||||
|
||||
var _whitespace = require("./whitespace");
|
||||
|
||||
class Position {
|
||||
constructor(line, col) {
|
||||
this.line = void 0;
|
||||
this.column = void 0;
|
||||
this.line = line;
|
||||
this.column = col;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.Position = Position;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.SourceLocation = SourceLocation;
|
||||
|
||||
function getLineInfo(input, offset) {
|
||||
let line = 1;
|
||||
let lineStart = 0;
|
||||
let match;
|
||||
_whitespace.lineBreakG.lastIndex = 0;
|
||||
|
||||
while ((match = _whitespace.lineBreakG.exec(input)) && match.index < offset) {
|
||||
line++;
|
||||
lineStart = _whitespace.lineBreakG.lastIndex;
|
||||
}
|
||||
|
||||
return new Position(line, offset - lineStart);
|
||||
}
|
||||
58
node_modules/@babel/parser/lib/util/production-parameter.js
generated
vendored
Normal file
58
node_modules/@babel/parser/lib/util/production-parameter.js
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.functionFlags = functionFlags;
|
||||
exports.default = exports.PARAM_IN = exports.PARAM_RETURN = exports.PARAM_AWAIT = exports.PARAM_YIELD = exports.PARAM = void 0;
|
||||
const PARAM = 0b0000,
|
||||
PARAM_YIELD = 0b0001,
|
||||
PARAM_AWAIT = 0b0010,
|
||||
PARAM_RETURN = 0b0100,
|
||||
PARAM_IN = 0b1000;
|
||||
exports.PARAM_IN = PARAM_IN;
|
||||
exports.PARAM_RETURN = PARAM_RETURN;
|
||||
exports.PARAM_AWAIT = PARAM_AWAIT;
|
||||
exports.PARAM_YIELD = PARAM_YIELD;
|
||||
exports.PARAM = PARAM;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.default = ProductionParameterHandler;
|
||||
|
||||
function functionFlags(isAsync, isGenerator) {
|
||||
return (isAsync ? PARAM_AWAIT : 0) | (isGenerator ? PARAM_YIELD : 0);
|
||||
}
|
||||
168
node_modules/@babel/parser/lib/util/scope.js
generated
vendored
Normal file
168
node_modules/@babel/parser/lib/util/scope.js
generated
vendored
Normal file
@@ -0,0 +1,168 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = exports.Scope = void 0;
|
||||
|
||||
var _scopeflags = require("./scopeflags");
|
||||
|
||||
var N = _interopRequireWildcard(require("../types"));
|
||||
|
||||
var _error = require("../parser/error");
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
class Scope {
|
||||
constructor(flags) {
|
||||
this.flags = void 0;
|
||||
this.var = [];
|
||||
this.lexical = [];
|
||||
this.functions = [];
|
||||
this.flags = flags;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.Scope = Scope;
|
||||
|
||||
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.currentVarScope().flags & _scopeflags.SCOPE_FUNCTION) > 0;
|
||||
}
|
||||
|
||||
get allowSuper() {
|
||||
return (this.currentThisScope().flags & _scopeflags.SCOPE_SUPER) > 0;
|
||||
}
|
||||
|
||||
get allowDirectSuper() {
|
||||
return (this.currentThisScope().flags & _scopeflags.SCOPE_DIRECT_SUPER) > 0;
|
||||
}
|
||||
|
||||
get inClass() {
|
||||
return (this.currentThisScope().flags & _scopeflags.SCOPE_CLASS) > 0;
|
||||
}
|
||||
|
||||
get inNonArrowFunction() {
|
||||
return (this.currentThisScope().flags & _scopeflags.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 & _scopeflags.SCOPE_FUNCTION || !this.inModule && scope.flags & _scopeflags.SCOPE_PROGRAM);
|
||||
}
|
||||
|
||||
declareName(name, bindingType, pos) {
|
||||
let scope = this.currentScope();
|
||||
|
||||
if (bindingType & _scopeflags.BIND_SCOPE_LEXICAL || bindingType & _scopeflags.BIND_SCOPE_FUNCTION) {
|
||||
this.checkRedeclarationInScope(scope, name, bindingType, pos);
|
||||
|
||||
if (bindingType & _scopeflags.BIND_SCOPE_FUNCTION) {
|
||||
scope.functions.push(name);
|
||||
} else {
|
||||
scope.lexical.push(name);
|
||||
}
|
||||
|
||||
if (bindingType & _scopeflags.BIND_SCOPE_LEXICAL) {
|
||||
this.maybeExportDefined(scope, name);
|
||||
}
|
||||
} else if (bindingType & _scopeflags.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.push(name);
|
||||
this.maybeExportDefined(scope, name);
|
||||
if (scope.flags & _scopeflags.SCOPE_VAR) break;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.inModule && scope.flags & _scopeflags.SCOPE_PROGRAM) {
|
||||
this.undefinedExports.delete(name);
|
||||
}
|
||||
}
|
||||
|
||||
maybeExportDefined(scope, name) {
|
||||
if (this.inModule && scope.flags & _scopeflags.SCOPE_PROGRAM) {
|
||||
this.undefinedExports.delete(name);
|
||||
}
|
||||
}
|
||||
|
||||
checkRedeclarationInScope(scope, name, bindingType, pos) {
|
||||
if (this.isRedeclaredInScope(scope, name, bindingType)) {
|
||||
this.raise(pos, _error.Errors.VarRedeclaration, name);
|
||||
}
|
||||
}
|
||||
|
||||
isRedeclaredInScope(scope, name, bindingType) {
|
||||
if (!(bindingType & _scopeflags.BIND_KIND_VALUE)) return false;
|
||||
|
||||
if (bindingType & _scopeflags.BIND_SCOPE_LEXICAL) {
|
||||
return scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1;
|
||||
}
|
||||
|
||||
if (bindingType & _scopeflags.BIND_SCOPE_FUNCTION) {
|
||||
return scope.lexical.indexOf(name) > -1 || !this.treatFunctionsAsVarInScope(scope) && scope.var.indexOf(name) > -1;
|
||||
}
|
||||
|
||||
return scope.lexical.indexOf(name) > -1 && !(scope.flags & _scopeflags.SCOPE_SIMPLE_CATCH && scope.lexical[0] === name) || !this.treatFunctionsAsVarInScope(scope) && scope.functions.indexOf(name) > -1;
|
||||
}
|
||||
|
||||
checkLocalExport(id) {
|
||||
if (this.scopeStack[0].lexical.indexOf(id.name) === -1 && this.scopeStack[0].var.indexOf(id.name) === -1 && this.scopeStack[0].functions.indexOf(id.name) === -1) {
|
||||
this.undefinedExports.set(id.name, id.start);
|
||||
}
|
||||
}
|
||||
|
||||
currentScope() {
|
||||
return this.scopeStack[this.scopeStack.length - 1];
|
||||
}
|
||||
|
||||
currentVarScope() {
|
||||
for (let i = this.scopeStack.length - 1;; i--) {
|
||||
const scope = this.scopeStack[i];
|
||||
|
||||
if (scope.flags & _scopeflags.SCOPE_VAR) {
|
||||
return scope;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
currentThisScope() {
|
||||
for (let i = this.scopeStack.length - 1;; i--) {
|
||||
const scope = this.scopeStack[i];
|
||||
|
||||
if ((scope.flags & _scopeflags.SCOPE_VAR || scope.flags & _scopeflags.SCOPE_CLASS) && !(scope.flags & _scopeflags.SCOPE_ARROW)) {
|
||||
return scope;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.default = ScopeHandler;
|
||||
90
node_modules/@babel/parser/lib/util/scopeflags.js
generated
vendored
Normal file
90
node_modules/@babel/parser/lib/util/scopeflags.js
generated
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.CLASS_ELEMENT_OTHER = exports.CLASS_ELEMENT_INSTANCE_SETTER = exports.CLASS_ELEMENT_INSTANCE_GETTER = exports.CLASS_ELEMENT_STATIC_SETTER = exports.CLASS_ELEMENT_STATIC_GETTER = exports.CLASS_ELEMENT_KIND_ACCESSOR = exports.CLASS_ELEMENT_KIND_SETTER = exports.CLASS_ELEMENT_KIND_GETTER = exports.CLASS_ELEMENT_FLAG_STATIC = exports.BIND_TS_NAMESPACE = exports.BIND_TS_CONST_ENUM = exports.BIND_OUTSIDE = exports.BIND_NONE = exports.BIND_TS_AMBIENT = exports.BIND_TS_ENUM = exports.BIND_TS_TYPE = exports.BIND_TS_INTERFACE = exports.BIND_FUNCTION = exports.BIND_VAR = exports.BIND_LEXICAL = exports.BIND_CLASS = exports.BIND_FLAGS_TS_EXPORT_ONLY = exports.BIND_FLAGS_TS_CONST_ENUM = exports.BIND_FLAGS_TS_ENUM = exports.BIND_FLAGS_CLASS = exports.BIND_FLAGS_NONE = exports.BIND_SCOPE_OUTSIDE = exports.BIND_SCOPE_FUNCTION = exports.BIND_SCOPE_LEXICAL = exports.BIND_SCOPE_VAR = exports.BIND_KIND_TYPE = exports.BIND_KIND_VALUE = exports.SCOPE_VAR = exports.SCOPE_TS_MODULE = exports.SCOPE_CLASS = exports.SCOPE_DIRECT_SUPER = exports.SCOPE_SUPER = exports.SCOPE_SIMPLE_CATCH = exports.SCOPE_ARROW = exports.SCOPE_FUNCTION = exports.SCOPE_PROGRAM = exports.SCOPE_OTHER = void 0;
|
||||
const SCOPE_OTHER = 0b00000000,
|
||||
SCOPE_PROGRAM = 0b00000001,
|
||||
SCOPE_FUNCTION = 0b00000010,
|
||||
SCOPE_ARROW = 0b00000100,
|
||||
SCOPE_SIMPLE_CATCH = 0b00001000,
|
||||
SCOPE_SUPER = 0b00010000,
|
||||
SCOPE_DIRECT_SUPER = 0b00100000,
|
||||
SCOPE_CLASS = 0b01000000,
|
||||
SCOPE_TS_MODULE = 0b10000000,
|
||||
SCOPE_VAR = SCOPE_PROGRAM | SCOPE_FUNCTION | SCOPE_TS_MODULE;
|
||||
exports.SCOPE_VAR = SCOPE_VAR;
|
||||
exports.SCOPE_TS_MODULE = SCOPE_TS_MODULE;
|
||||
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 = 0b00000_0000_01,
|
||||
BIND_KIND_TYPE = 0b00000_0000_10,
|
||||
BIND_SCOPE_VAR = 0b00000_0001_00,
|
||||
BIND_SCOPE_LEXICAL = 0b00000_0010_00,
|
||||
BIND_SCOPE_FUNCTION = 0b00000_0100_00,
|
||||
BIND_SCOPE_OUTSIDE = 0b00000_1000_00,
|
||||
BIND_FLAGS_NONE = 0b00001_0000_00,
|
||||
BIND_FLAGS_CLASS = 0b00010_0000_00,
|
||||
BIND_FLAGS_TS_ENUM = 0b00100_0000_00,
|
||||
BIND_FLAGS_TS_CONST_ENUM = 0b01000_0000_00,
|
||||
BIND_FLAGS_TS_EXPORT_ONLY = 0b10000_0000_00;
|
||||
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_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;
|
||||
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_LEXICAL = BIND_LEXICAL;
|
||||
exports.BIND_CLASS = BIND_CLASS;
|
||||
const CLASS_ELEMENT_FLAG_STATIC = 0b1_00,
|
||||
CLASS_ELEMENT_KIND_GETTER = 0b0_10,
|
||||
CLASS_ELEMENT_KIND_SETTER = 0b0_01,
|
||||
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;
|
||||
58
node_modules/@babel/parser/lib/util/whitespace.js
generated
vendored
Normal file
58
node_modules/@babel/parser/lib/util/whitespace.js
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.isNewLine = isNewLine;
|
||||
exports.isWhitespace = isWhitespace;
|
||||
exports.skipWhiteSpace = exports.lineBreakG = exports.lineBreak = void 0;
|
||||
const lineBreak = /\r\n?|[\n\u2028\u2029]/;
|
||||
exports.lineBreak = lineBreak;
|
||||
const lineBreakG = new RegExp(lineBreak.source, "g");
|
||||
exports.lineBreakG = lineBreakG;
|
||||
|
||||
function isNewLine(code) {
|
||||
switch (code) {
|
||||
case 10:
|
||||
case 13:
|
||||
case 8232:
|
||||
case 8233:
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
const skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
|
||||
exports.skipWhiteSpace = skipWhiteSpace;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user