Enhance refactor commands with controller-aware Route() updates and fix code quality violations
Add semantic token highlighting for 'that' variable and comment file references in VS Code extension Add Phone_Text_Input and Currency_Input components with formatting utilities Implement client widgets, form standardization, and soft delete functionality Add modal scroll lock and update documentation Implement comprehensive modal system with form integration and validation Fix modal component instantiation using jQuery plugin API Implement modal system with responsive sizing, queuing, and validation support Implement form submission with validation, error handling, and loading states Implement country/state selectors with dynamic data loading and Bootstrap styling Revert Rsx::Route() highlighting in Blade/PHP files Target specific PHP scopes for Rsx::Route() highlighting in Blade Expand injection selector for Rsx::Route() highlighting Add custom syntax highlighting for Rsx::Route() and Rsx.Route() calls Update jqhtml packages to v2.2.165 Add bundle path validation for common mistakes (development mode only) Create Ajax_Select_Input widget and Rsx_Reference_Data controller Create Country_Select_Input widget with default country support Initialize Tom Select on Select_Input widgets Add Tom Select bundle for enhanced select dropdowns Implement ISO 3166 geographic data system for country/region selection Implement widget-based form system with disabled state support 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
175
node_modules/webpack/lib/javascript/JavascriptParser.js
generated
vendored
175
node_modules/webpack/lib/javascript/JavascriptParser.js
generated
vendored
@@ -24,7 +24,6 @@ const BasicEvaluatedExpression = require("./BasicEvaluatedExpression");
|
||||
/** @typedef {import("estree").BlockStatement} BlockStatement */
|
||||
/** @typedef {import("estree").SequenceExpression} SequenceExpression */
|
||||
/** @typedef {import("estree").CallExpression} CallExpression */
|
||||
/** @typedef {import("estree").BaseCallExpression} BaseCallExpression */
|
||||
/** @typedef {import("estree").StaticBlock} StaticBlock */
|
||||
/** @typedef {import("estree").ClassDeclaration} ClassDeclaration */
|
||||
/** @typedef {import("estree").ForStatement} ForStatement */
|
||||
@@ -36,6 +35,8 @@ const BasicEvaluatedExpression = require("./BasicEvaluatedExpression");
|
||||
/** @typedef {import("estree").PrivateIdentifier} PrivateIdentifier */
|
||||
/** @typedef {import("estree").PropertyDefinition} PropertyDefinition */
|
||||
/** @typedef {import("estree").Expression} Expression */
|
||||
/** @typedef {import("estree").ImportAttribute} ImportAttribute */
|
||||
/** @typedef {import("estree").ImportDeclaration} ImportDeclaration */
|
||||
/** @typedef {import("estree").Identifier} Identifier */
|
||||
/** @typedef {import("estree").VariableDeclaration} VariableDeclaration */
|
||||
/** @typedef {import("estree").IfStatement} IfStatement */
|
||||
@@ -48,7 +49,6 @@ const BasicEvaluatedExpression = require("./BasicEvaluatedExpression");
|
||||
/** @typedef {import("estree").MetaProperty} MetaProperty */
|
||||
/** @typedef {import("estree").Property} Property */
|
||||
/** @typedef {import("estree").AssignmentPattern} AssignmentPattern */
|
||||
/** @typedef {import("estree").ChainElement} ChainElement */
|
||||
/** @typedef {import("estree").Pattern} Pattern */
|
||||
/** @typedef {import("estree").UpdateExpression} UpdateExpression */
|
||||
/** @typedef {import("estree").ObjectExpression} ObjectExpression */
|
||||
@@ -74,6 +74,8 @@ const BasicEvaluatedExpression = require("./BasicEvaluatedExpression");
|
||||
/** @typedef {import("estree").WhileStatement} WhileStatement */
|
||||
/** @typedef {import("estree").ArrowFunctionExpression} ArrowFunctionExpression */
|
||||
/** @typedef {import("estree").ExpressionStatement} ExpressionStatement */
|
||||
/** @typedef {import("estree").ExportAllDeclaration} ExportAllDeclaration */
|
||||
/** @typedef {import("estree").ExportNamedDeclaration} ExportNamedDeclaration */
|
||||
/** @typedef {import("estree").FunctionDeclaration} FunctionDeclaration */
|
||||
/** @typedef {import("estree").DoWhileStatement} DoWhileStatement */
|
||||
/** @typedef {import("estree").TryStatement} TryStatement */
|
||||
@@ -83,10 +85,9 @@ const BasicEvaluatedExpression = require("./BasicEvaluatedExpression");
|
||||
/** @typedef {import("estree").Statement} Statement */
|
||||
/** @typedef {import("estree").ExportDefaultDeclaration} ExportDefaultDeclaration */
|
||||
/** @typedef {import("estree").Super} Super */
|
||||
/** @typedef {import("estree").ImportSpecifier} ImportSpecifier */
|
||||
/** @typedef {import("estree").TaggedTemplateExpression} TaggedTemplateExpression */
|
||||
/** @typedef {import("estree").TemplateLiteral} TemplateLiteral */
|
||||
/** @typedef {import("estree").AssignmentProperty} AssignmentProperty */
|
||||
/** @typedef {import("estree").ModuleDeclaration} ModuleDeclaration */
|
||||
/** @typedef {import("estree").MaybeNamedFunctionDeclaration} MaybeNamedFunctionDeclaration */
|
||||
/** @typedef {import("estree").MaybeNamedClassDeclaration} MaybeNamedClassDeclaration */
|
||||
/**
|
||||
@@ -95,19 +96,17 @@ const BasicEvaluatedExpression = require("./BasicEvaluatedExpression");
|
||||
*/
|
||||
/** @typedef {import("../Parser").ParserState} ParserState */
|
||||
/** @typedef {import("../Parser").PreparsedAst} PreparsedAst */
|
||||
/** @typedef {{ name: string | VariableInfo, rootInfo: string | VariableInfo, getMembers: () => string[], getMembersOptionals: () => boolean[], getMemberRanges: () => Range[] }} GetInfoResult */
|
||||
|
||||
/** @typedef {{ name: string | VariableInfo, rootInfo: string | VariableInfo, getMembers: () => Members, getMembersOptionals: () => MembersOptionals, getMemberRanges: () => MemberRanges }} GetInfoResult */
|
||||
/** @typedef {Statement | ModuleDeclaration | Expression | MaybeNamedFunctionDeclaration | MaybeNamedClassDeclaration} StatementPathItem */
|
||||
/** @typedef {(ident: string) => void} OnIdentString */
|
||||
/** @typedef {(ident: string, identifier: Identifier) => void} OnIdent */
|
||||
/** @typedef {StatementPathItem[]} StatementPath */
|
||||
|
||||
/** @typedef {Set<DestructuringAssignmentProperty>} DestructuringAssignmentProperties */
|
||||
|
||||
// TODO remove cast when @types/estree has been updated to import assertions
|
||||
/** @typedef {import("estree").BaseNode & { type: "ImportAttribute", key: Identifier | Literal, value: Literal }} ImportAttribute */
|
||||
/** @typedef {import("estree").ImportDeclaration & { attributes?: Array<ImportAttribute>, phase?: "defer" }} ImportDeclaration */
|
||||
/** @typedef {import("estree").ExportNamedDeclaration & { attributes?: Array<ImportAttribute> }} ExportNamedDeclaration */
|
||||
/** @typedef {import("estree").ExportAllDeclaration & { attributes?: Array<ImportAttribute> }} ExportAllDeclaration */
|
||||
/** @typedef {import("estree").ImportExpression & { options?: Expression | null, phase?: "defer" }} ImportExpression */
|
||||
/** @typedef {ImportDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration | ExportAllDeclaration} ModuleDeclaration */
|
||||
/** @typedef {import("estree").ImportExpression & { phase?: "defer" }} ImportExpression */
|
||||
|
||||
/** @type {string[]} */
|
||||
const EMPTY_ARRAY = [];
|
||||
@@ -301,7 +300,15 @@ class VariableInfo {
|
||||
/** @typedef {Omit<AcornOptions, "sourceType" | "ecmaVersion"> & { sourceType: "module" | "script" | "auto", ecmaVersion?: AcornOptions["ecmaVersion"] }} ParseOptions */
|
||||
|
||||
/** @typedef {symbol} Tag */
|
||||
/** @typedef {Record<string, TODO>} TagData */
|
||||
|
||||
/** @typedef {import("../dependencies/HarmonyImportDependencyParserPlugin").HarmonySettings} HarmonySettings */
|
||||
/** @typedef {import("../dependencies/ImportParserPlugin").ImportSettings} ImportSettings */
|
||||
/** @typedef {import("../dependencies/CommonJsImportsParserPlugin").CommonJsImportSettings} CommonJsImportSettings */
|
||||
/** @typedef {import("../CompatibilityPlugin").CompatibilitySettings} CompatibilitySettings */
|
||||
/** @typedef {import("../optimize/InnerGraph").TopLevelSymbol} TopLevelSymbol */
|
||||
|
||||
/** @typedef {HarmonySettings | ImportSettings | CommonJsImportSettings | TopLevelSymbol | CompatibilitySettings} KnownTagData */
|
||||
/** @typedef {KnownTagData | Record<string, EXPECTED_ANY>} TagData */
|
||||
|
||||
/**
|
||||
* @typedef {object} TagInfo
|
||||
@@ -310,6 +317,11 @@ class VariableInfo {
|
||||
* @property {TagInfo | undefined} next
|
||||
*/
|
||||
|
||||
/** @typedef {string[]} CalleeMembers */
|
||||
/** @typedef {string[]} Members */
|
||||
/** @typedef {boolean[]} MembersOptionals */
|
||||
/** @typedef {Range[]} MemberRanges */
|
||||
|
||||
const SCOPE_INFO_TERMINATED_RETURN = 1;
|
||||
const SCOPE_INFO_TERMINATED_THROW = 2;
|
||||
|
||||
@@ -330,7 +342,8 @@ const SCOPE_INFO_TERMINATED_THROW = 2;
|
||||
/**
|
||||
* @typedef {object} DestructuringAssignmentProperty
|
||||
* @property {string} id
|
||||
* @property {Range | undefined=} range
|
||||
* @property {Range} range
|
||||
* @property {Set<DestructuringAssignmentProperty> | undefined=} pattern
|
||||
* @property {boolean | string} shorthand
|
||||
*/
|
||||
|
||||
@@ -359,7 +372,7 @@ const joinRanges = (startRange, endRange) => {
|
||||
* Helper function used to generate a string representation of a
|
||||
* [member expression](https://github.com/estree/estree/blob/master/es5.md#memberexpression).
|
||||
* @param {string} object object to name
|
||||
* @param {string[]} membersReversed reversed list of members
|
||||
* @param {Members} membersReversed reversed list of members
|
||||
* @returns {string} member expression as a string
|
||||
* @example
|
||||
* ```js
|
||||
@@ -532,20 +545,20 @@ class JavascriptParser extends Parser {
|
||||
rename: new HookMap(() => new SyncBailHook(["initExpression"])),
|
||||
/** @type {HookMap<SyncBailHook<[AssignmentExpression], boolean | void>>} */
|
||||
assign: new HookMap(() => new SyncBailHook(["expression"])),
|
||||
/** @type {HookMap<SyncBailHook<[AssignmentExpression, string[]], boolean | void>>} */
|
||||
/** @type {HookMap<SyncBailHook<[AssignmentExpression, Members], boolean | void>>} */
|
||||
assignMemberChain: new HookMap(
|
||||
() => new SyncBailHook(["expression", "members"])
|
||||
),
|
||||
/** @type {HookMap<SyncBailHook<[Expression], boolean | void>>} */
|
||||
typeof: new HookMap(() => new SyncBailHook(["expression"])),
|
||||
/** @type {SyncBailHook<[ImportExpression], boolean | void>} */
|
||||
importCall: new SyncBailHook(["expression"]),
|
||||
/** @type {SyncBailHook<[ImportExpression, CallExpression?], boolean | void>} */
|
||||
importCall: new SyncBailHook(["expression", "importThen"]),
|
||||
/** @type {SyncBailHook<[Expression | ForOfStatement], boolean | void>} */
|
||||
topLevelAwait: new SyncBailHook(["expression"]),
|
||||
/** @type {HookMap<SyncBailHook<[CallExpression], boolean | void>>} */
|
||||
call: new HookMap(() => new SyncBailHook(["expression"])),
|
||||
/** Something like "a.b()" */
|
||||
/** @type {HookMap<SyncBailHook<[CallExpression, string[], boolean[], Range[]], boolean | void>>} */
|
||||
/** @type {HookMap<SyncBailHook<[CallExpression, Members, MembersOptionals, MemberRanges], boolean | void>>} */
|
||||
callMemberChain: new HookMap(
|
||||
() =>
|
||||
new SyncBailHook([
|
||||
@@ -556,7 +569,7 @@ class JavascriptParser extends Parser {
|
||||
])
|
||||
),
|
||||
/** Something like "a.b().c.d" */
|
||||
/** @type {HookMap<SyncBailHook<[Expression, string[], CallExpression, string[], Range[]], boolean | void>>} */
|
||||
/** @type {HookMap<SyncBailHook<[Expression, CalleeMembers, CallExpression, Members, MemberRanges], boolean | void>>} */
|
||||
memberChainOfCallMemberChain: new HookMap(
|
||||
() =>
|
||||
new SyncBailHook([
|
||||
@@ -568,7 +581,7 @@ class JavascriptParser extends Parser {
|
||||
])
|
||||
),
|
||||
/** Something like "a.b().c.d()"" */
|
||||
/** @type {HookMap<SyncBailHook<[CallExpression, string[], CallExpression, string[], Range[]], boolean | void>>} */
|
||||
/** @type {HookMap<SyncBailHook<[CallExpression, CalleeMembers, CallExpression, Members, MemberRanges], boolean | void>>} */
|
||||
callMemberChainOfCallMemberChain: new HookMap(
|
||||
() =>
|
||||
new SyncBailHook([
|
||||
@@ -587,7 +600,7 @@ class JavascriptParser extends Parser {
|
||||
binaryExpression: new SyncBailHook(["binaryExpression"]),
|
||||
/** @type {HookMap<SyncBailHook<[Expression], boolean | void>>} */
|
||||
expression: new HookMap(() => new SyncBailHook(["expression"])),
|
||||
/** @type {HookMap<SyncBailHook<[MemberExpression, string[], boolean[], Range[]], boolean | void>>} */
|
||||
/** @type {HookMap<SyncBailHook<[MemberExpression, Members, MembersOptionals, MemberRanges], boolean | void>>} */
|
||||
expressionMemberChain: new HookMap(
|
||||
() =>
|
||||
new SyncBailHook([
|
||||
@@ -597,7 +610,7 @@ class JavascriptParser extends Parser {
|
||||
"memberRanges"
|
||||
])
|
||||
),
|
||||
/** @type {HookMap<SyncBailHook<[MemberExpression, string[]], boolean | void>>} */
|
||||
/** @type {HookMap<SyncBailHook<[MemberExpression, Members], boolean | void>>} */
|
||||
unhandledExpressionMemberChain: new HookMap(
|
||||
() => new SyncBailHook(["expression", "members"])
|
||||
),
|
||||
@@ -616,9 +629,9 @@ class JavascriptParser extends Parser {
|
||||
});
|
||||
this.sourceType = sourceType;
|
||||
/** @type {ScopeInfo} */
|
||||
this.scope = /** @type {TODO} */ (undefined);
|
||||
this.scope = /** @type {EXPECTED_ANY} */ (undefined);
|
||||
/** @type {ParserState} */
|
||||
this.state = /** @type {TODO} */ (undefined);
|
||||
this.state = /** @type {EXPECTED_ANY} */ (undefined);
|
||||
/** @type {Comment[] | undefined} */
|
||||
this.comments = undefined;
|
||||
/** @type {Set<number> | undefined} */
|
||||
@@ -627,7 +640,7 @@ class JavascriptParser extends Parser {
|
||||
this.statementPath = undefined;
|
||||
/** @type {Statement | ModuleDeclaration | Expression | MaybeNamedFunctionDeclaration | MaybeNamedClassDeclaration | undefined} */
|
||||
this.prevStatement = undefined;
|
||||
/** @type {WeakMap<Expression, Set<DestructuringAssignmentProperty>> | undefined} */
|
||||
/** @type {WeakMap<Expression, DestructuringAssignmentProperties> | undefined} */
|
||||
this.destructuringAssignmentProperties = undefined;
|
||||
/** @type {TagData | undefined} */
|
||||
this.currentTagData = undefined;
|
||||
@@ -1891,7 +1904,7 @@ class JavascriptParser extends Parser {
|
||||
|
||||
/**
|
||||
* @param {Expression} node node
|
||||
* @returns {Set<DestructuringAssignmentProperty> | undefined} destructured identifiers
|
||||
* @returns {DestructuringAssignmentProperties | undefined} destructured identifiers
|
||||
*/
|
||||
destructuringAssignmentPropertiesFor(node) {
|
||||
if (!this.destructuringAssignmentProperties) return;
|
||||
@@ -2644,7 +2657,7 @@ class JavascriptParser extends Parser {
|
||||
// check multiple assignments
|
||||
if (this.destructuringAssignmentProperties.has(destructuring)) {
|
||||
const set =
|
||||
/** @type {Set<DestructuringAssignmentProperty>} */
|
||||
/** @type {DestructuringAssignmentProperties} */
|
||||
(this.destructuringAssignmentProperties.get(destructuring));
|
||||
for (const id of keys) set.add(id);
|
||||
} else {
|
||||
@@ -2829,11 +2842,16 @@ class JavascriptParser extends Parser {
|
||||
* @param {ExportDefaultDeclaration} statement statement
|
||||
*/
|
||||
blockPreWalkExportDefaultDeclaration(statement) {
|
||||
const prev = this.prevStatement;
|
||||
if (
|
||||
statement.declaration.type === "FunctionDeclaration" ||
|
||||
statement.declaration.type === "ClassDeclaration"
|
||||
) {
|
||||
const prev = this.prevStatement;
|
||||
|
||||
this.preWalkStatement(/** @type {TODO} */ (statement.declaration));
|
||||
this.prevStatement = prev;
|
||||
this.blockPreWalkStatement(/** @type {TODO} */ (statement.declaration));
|
||||
this.preWalkStatement(statement.declaration);
|
||||
this.prevStatement = prev;
|
||||
this.blockPreWalkStatement(statement.declaration);
|
||||
}
|
||||
|
||||
if (
|
||||
/** @type {MaybeNamedFunctionDeclaration | MaybeNamedClassDeclaration} */
|
||||
@@ -2885,15 +2903,7 @@ class JavascriptParser extends Parser {
|
||||
this.walkExpression(statement.declaration);
|
||||
}
|
||||
|
||||
if (!this.hooks.exportExpression.call(statement, statement.declaration)) {
|
||||
this.hooks.exportSpecifier.call(
|
||||
statement,
|
||||
/** @type {TODO} */
|
||||
(statement.declaration),
|
||||
"default",
|
||||
undefined
|
||||
);
|
||||
}
|
||||
this.hooks.exportExpression.call(statement, statement.declaration);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2963,10 +2973,10 @@ class JavascriptParser extends Parser {
|
||||
|
||||
/**
|
||||
* @param {ObjectPattern} objectPattern object pattern
|
||||
* @returns {Set<DestructuringAssignmentProperty> | undefined} set of names or undefined if not all keys are identifiers
|
||||
* @returns {DestructuringAssignmentProperties | undefined} set of names or undefined if not all keys are identifiers
|
||||
*/
|
||||
_preWalkObjectPattern(objectPattern) {
|
||||
/** @type {Set<DestructuringAssignmentProperty>} */
|
||||
/** @type {DestructuringAssignmentProperties} */
|
||||
const props = new Set();
|
||||
const properties = objectPattern.properties;
|
||||
for (let i = 0; i < properties.length; i++) {
|
||||
@@ -2984,18 +2994,32 @@ class JavascriptParser extends Parser {
|
||||
}
|
||||
const key = property.key;
|
||||
if (key.type === "Identifier" && !property.computed) {
|
||||
const pattern =
|
||||
property.value.type === "ObjectPattern"
|
||||
? this._preWalkObjectPattern(property.value)
|
||||
: property.value.type === "ArrayPattern"
|
||||
? this._preWalkArrayPattern(property.value)
|
||||
: undefined;
|
||||
props.add({
|
||||
id: key.name,
|
||||
range: key.range,
|
||||
range: /** @type {Range} */ (key.range),
|
||||
pattern,
|
||||
shorthand: this.scope.inShorthand
|
||||
});
|
||||
} else {
|
||||
const id = this.evaluateExpression(key);
|
||||
const str = id.asString();
|
||||
if (str) {
|
||||
const pattern =
|
||||
property.value.type === "ObjectPattern"
|
||||
? this._preWalkObjectPattern(property.value)
|
||||
: property.value.type === "ArrayPattern"
|
||||
? this._preWalkArrayPattern(property.value)
|
||||
: undefined;
|
||||
props.add({
|
||||
id: str,
|
||||
range: key.range,
|
||||
range: /** @type {Range} */ (key.range),
|
||||
pattern,
|
||||
shorthand: this.scope.inShorthand
|
||||
});
|
||||
} else {
|
||||
@@ -3009,6 +3033,35 @@ class JavascriptParser extends Parser {
|
||||
return props;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {ArrayPattern} arrayPattern array pattern
|
||||
* @returns {Set<DestructuringAssignmentProperty> | undefined} set of names or undefined if not all keys are identifiers
|
||||
*/
|
||||
_preWalkArrayPattern(arrayPattern) {
|
||||
/** @type {Set<DestructuringAssignmentProperty>} */
|
||||
const props = new Set();
|
||||
const elements = arrayPattern.elements;
|
||||
for (let i = 0; i < elements.length; i++) {
|
||||
const element = elements[i];
|
||||
if (!element) continue;
|
||||
if (element.type === "RestElement") return;
|
||||
const pattern =
|
||||
element.type === "ObjectPattern"
|
||||
? this._preWalkObjectPattern(element)
|
||||
: element.type === "ArrayPattern"
|
||||
? this._preWalkArrayPattern(element)
|
||||
: undefined;
|
||||
props.add({
|
||||
id: `${i}`,
|
||||
range: /** @type {Range} */ (element.range),
|
||||
pattern,
|
||||
shorthand: false
|
||||
});
|
||||
}
|
||||
|
||||
return props;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {VariableDeclarator} declarator variable declarator
|
||||
*/
|
||||
@@ -3833,6 +3886,18 @@ class JavascriptParser extends Parser {
|
||||
);
|
||||
if (result === true) return;
|
||||
}
|
||||
// import("./m").then(m => { ... })
|
||||
if (
|
||||
expression.callee.object.type === "ImportExpression" &&
|
||||
expression.callee.property.type === "Identifier" &&
|
||||
expression.callee.property.name === "then"
|
||||
) {
|
||||
const result = this.hooks.importCall.call(
|
||||
expression.callee.object,
|
||||
expression
|
||||
);
|
||||
if (result === true) return;
|
||||
}
|
||||
}
|
||||
const callee = this.evaluateExpression(expression.callee);
|
||||
if (callee.isIdentifier()) {
|
||||
@@ -3945,7 +4010,7 @@ class JavascriptParser extends Parser {
|
||||
* @param {MemberExpression} expression member expression
|
||||
* @param {string} name name
|
||||
* @param {string | VariableInfo} rootInfo root info
|
||||
* @param {string[]} members members
|
||||
* @param {Members} members members
|
||||
* @param {() => R | undefined} onUnhandled on unhandled callback
|
||||
*/
|
||||
walkMemberExpressionWithExpressionName(
|
||||
@@ -4027,7 +4092,7 @@ class JavascriptParser extends Parser {
|
||||
* @template R
|
||||
* @param {HookMap<SyncBailHook<T, R>>} hookMap hooks the should be called
|
||||
* @param {Expression | Super} expr expression info
|
||||
* @param {((name: string, rootInfo: string | ScopeInfo | VariableInfo, getMembers: () => string[]) => R) | undefined} fallback callback when variable in not handled by hooks
|
||||
* @param {((name: string, rootInfo: string | ScopeInfo | VariableInfo, getMembers: () => Members) => R) | undefined} fallback callback when variable in not handled by hooks
|
||||
* @param {((result?: string) => R | undefined) | undefined} defined callback when variable is defined
|
||||
* @param {AsArray<T>} args args for the hook
|
||||
* @returns {R | undefined} result of hook
|
||||
@@ -4098,7 +4163,7 @@ class JavascriptParser extends Parser {
|
||||
* @param {HookMap<SyncBailHook<T, R>>} hookMap hooks the should be called
|
||||
* @param {ExportedVariableInfo} info variable info
|
||||
* @param {((name: string) => R | undefined) | undefined} fallback callback when variable in not handled by hooks
|
||||
* @param {((result?: string) => TODO) | undefined} defined callback when variable is defined
|
||||
* @param {((result?: string) => R | undefined) | undefined} defined callback when variable is defined
|
||||
* @param {AsArray<T>} args args for the hook
|
||||
* @returns {R | undefined} result of hook
|
||||
*/
|
||||
@@ -4286,7 +4351,7 @@ class JavascriptParser extends Parser {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array<Directive | Statement | ModuleDeclaration>} statements statements
|
||||
* @param {(Directive | Statement | ModuleDeclaration)[]} statements statements
|
||||
*/
|
||||
detectMode(statements) {
|
||||
const isLiteral =
|
||||
@@ -4606,7 +4671,7 @@ class JavascriptParser extends Parser {
|
||||
terminated: undefined,
|
||||
definitions: new StackedMap()
|
||||
};
|
||||
this.state = /** @type {ParserState} */ (state);
|
||||
this.state = state;
|
||||
this.comments = comments;
|
||||
this.semicolons = semicolons;
|
||||
this.statementPath = [];
|
||||
@@ -4960,7 +5025,7 @@ class JavascriptParser extends Parser {
|
||||
|
||||
/**
|
||||
* @param {string} name variable name
|
||||
* @returns {string | ExportedVariableInfo} info for this variable
|
||||
* @returns {ExportedVariableInfo} info for this variable
|
||||
*/
|
||||
getVariableInfo(name) {
|
||||
const value = this.scope.definitions.get(name);
|
||||
@@ -4972,7 +5037,7 @@ class JavascriptParser extends Parser {
|
||||
|
||||
/**
|
||||
* @param {string} name variable name
|
||||
* @param {string | ExportedVariableInfo} variableInfo new info for this variable
|
||||
* @param {ExportedVariableInfo} variableInfo new info for this variable
|
||||
* @returns {void}
|
||||
*/
|
||||
setVariable(name, variableInfo) {
|
||||
@@ -5053,7 +5118,7 @@ class JavascriptParser extends Parser {
|
||||
|
||||
/**
|
||||
* @param {Expression | Super} expression a member expression
|
||||
* @returns {{ members: string[], object: Expression | Super, membersOptionals: boolean[], memberRanges: Range[] }} member names (reverse order) and remaining object
|
||||
* @returns {{ members: Members, object: Expression | Super, membersOptionals: MembersOptionals, memberRanges: MemberRanges }} member names (reverse order) and remaining object
|
||||
*/
|
||||
extractMemberExpressionChain(expression) {
|
||||
/** @type {Node} */
|
||||
@@ -5119,8 +5184,8 @@ class JavascriptParser extends Parser {
|
||||
return { info, name };
|
||||
}
|
||||
|
||||
/** @typedef {{ type: "call", call: CallExpression, calleeName: string, rootInfo: string | VariableInfo, getCalleeMembers: () => string[], name: string, getMembers: () => string[], getMembersOptionals: () => boolean[], getMemberRanges: () => Range[]}} CallExpressionInfo */
|
||||
/** @typedef {{ type: "expression", rootInfo: string | VariableInfo, name: string, getMembers: () => string[], getMembersOptionals: () => boolean[], getMemberRanges: () => Range[]}} ExpressionExpressionInfo */
|
||||
/** @typedef {{ type: "call", call: CallExpression, calleeName: string, rootInfo: string | VariableInfo, getCalleeMembers: () => CalleeMembers, name: string, getMembers: () => Members, getMembersOptionals: () => MembersOptionals, getMemberRanges: () => MemberRanges}} CallExpressionInfo */
|
||||
/** @typedef {{ type: "expression", rootInfo: string | VariableInfo, name: string, getMembers: () => Members, getMembersOptionals: () => MembersOptionals, getMemberRanges: () => MemberRanges}} ExpressionExpressionInfo */
|
||||
|
||||
/**
|
||||
* @param {Expression | Super} expression a member expression
|
||||
@@ -5181,7 +5246,7 @@ class JavascriptParser extends Parser {
|
||||
|
||||
/**
|
||||
* @param {Expression} expression an expression
|
||||
* @returns {{ name: string, rootInfo: ExportedVariableInfo, getMembers: () => string[]} | undefined} name info
|
||||
* @returns {{ name: string, rootInfo: ExportedVariableInfo, getMembers: () => Members} | undefined} name info
|
||||
*/
|
||||
getNameForExpression(expression) {
|
||||
return this.getMemberExpressionInfo(
|
||||
|
||||
Reference in New Issue
Block a user