Update npm packages (73 packages including @jqhtml 2.3.36)
Update npm registry domain from privatenpm.hanson.xyz to npm.internal.hanson.xyz 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
61
node_modules/webpack/lib/javascript/JavascriptParser.js
generated
vendored
61
node_modules/webpack/lib/javascript/JavascriptParser.js
generated
vendored
@@ -318,7 +318,7 @@ class VariableInfo {
|
||||
/** @typedef {Literal | string | null | undefined} ImportSource */
|
||||
|
||||
/**
|
||||
* @typedef {Omit<ParseOptions, "sourceType"> & {sourceType: "module" | "script" | "auto"}} InternalParseOptions
|
||||
* @typedef {Omit<ParseOptions, "sourceType"> & { sourceType: "module" | "script" | "auto" }} InternalParseOptions
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -347,12 +347,13 @@ class VariableInfo {
|
||||
/** @typedef {symbol} Tag */
|
||||
|
||||
/** @typedef {import("../dependencies/HarmonyImportDependencyParserPlugin").HarmonySettings} HarmonySettings */
|
||||
/** @typedef {import("../dependencies/HarmonyImportDependencyParserPlugin").HarmonySpecifierGuards} HarmonySpecifierGuards */
|
||||
/** @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 {HarmonySettings | ImportSettings | CommonJsImportSettings | TopLevelSymbol | CompatibilitySettings | HarmonySpecifierGuards} KnownTagData */
|
||||
/** @typedef {KnownTagData | Record<string, EXPECTED_ANY>} TagData */
|
||||
|
||||
/**
|
||||
@@ -519,6 +520,8 @@ class JavascriptParser extends Parser {
|
||||
statement: new SyncBailHook(["statement"]),
|
||||
/** @type {SyncBailHook<[IfStatement], boolean | void>} */
|
||||
statementIf: new SyncBailHook(["statement"]),
|
||||
/** @type {SyncBailHook<[Expression], ((walk: () => void) => void) | void>} */
|
||||
collectGuards: new SyncBailHook(["expression"]),
|
||||
/** @type {SyncBailHook<[Expression, ClassExpression | ClassDeclaration | MaybeNamedClassDeclaration], boolean | void>} */
|
||||
classExtendsExpression: new SyncBailHook([
|
||||
"expression",
|
||||
@@ -747,6 +750,7 @@ class JavascriptParser extends Parser {
|
||||
return;
|
||||
}
|
||||
|
||||
/** @type {undefined | string} */
|
||||
let regExp;
|
||||
const arg1 = expr.arguments[0];
|
||||
|
||||
@@ -769,6 +773,7 @@ class JavascriptParser extends Parser {
|
||||
);
|
||||
}
|
||||
|
||||
/** @type {undefined | string} */
|
||||
let flags;
|
||||
const arg2 = expr.arguments[1];
|
||||
|
||||
@@ -1597,7 +1602,7 @@ class JavascriptParser extends Parser {
|
||||
const arg1Eval = this.evaluateExpression(arg1);
|
||||
if (!arg1Eval.isString()) return;
|
||||
const arg1Value = /** @type {string} */ (arg1Eval.string);
|
||||
|
||||
/** @type {number} */
|
||||
let result;
|
||||
if (arg2) {
|
||||
if (arg2.type === "SpreadElement") return;
|
||||
@@ -1642,7 +1647,9 @@ class JavascriptParser extends Parser {
|
||||
.for(fn)
|
||||
.tap(CLASS_NAME, (expr, param) => {
|
||||
if (!param.isString()) return;
|
||||
/** @type {BasicEvaluatedExpression} */
|
||||
let arg1;
|
||||
/** @type {string} */
|
||||
let result;
|
||||
const str = /** @type {string} */ (param.string);
|
||||
switch (expr.arguments.length) {
|
||||
@@ -1682,7 +1689,7 @@ class JavascriptParser extends Parser {
|
||||
/**
|
||||
* @param {"cooked" | "raw"} kind kind of values to get
|
||||
* @param {TemplateLiteral} templateLiteralExpr TemplateLiteral expr
|
||||
* @returns {{quasis: BasicEvaluatedExpression[], parts: BasicEvaluatedExpression[]}} Simplified template
|
||||
* @returns {{ quasis: BasicEvaluatedExpression[], parts: BasicEvaluatedExpression[] }} Simplified template
|
||||
*/
|
||||
const getSimplifiedTemplateResult = (kind, templateLiteralExpr) => {
|
||||
/** @type {BasicEvaluatedExpression[]} */
|
||||
@@ -1764,7 +1771,8 @@ class JavascriptParser extends Parser {
|
||||
.for("concat")
|
||||
.tap(CLASS_NAME, (expr, param) => {
|
||||
if (!param.isString() && !param.isWrapped()) return;
|
||||
let stringSuffix = null;
|
||||
/** @type {undefined | BasicEvaluatedExpression} */
|
||||
let stringSuffix;
|
||||
let hasUnknownParams = false;
|
||||
/** @type {BasicEvaluatedExpression[]} */
|
||||
const innerExpressions = [];
|
||||
@@ -1840,6 +1848,7 @@ class JavascriptParser extends Parser {
|
||||
if (!param.isString()) return;
|
||||
if (expr.arguments.length !== 1) return;
|
||||
if (expr.arguments[0].type === "SpreadElement") return;
|
||||
/** @type {string[]} */
|
||||
let result;
|
||||
const arg = this.evaluateExpression(expr.arguments[0]);
|
||||
if (arg.isString()) {
|
||||
@@ -1865,6 +1874,7 @@ class JavascriptParser extends Parser {
|
||||
|
||||
const condition = this.evaluateExpression(expr.test);
|
||||
const conditionValue = condition.asBool();
|
||||
/** @type {BasicEvaluatedExpression} */
|
||||
let res;
|
||||
if (conditionValue === undefined) {
|
||||
const consequent = this.evaluateExpression(expr.consequent);
|
||||
@@ -1983,6 +1993,7 @@ class JavascriptParser extends Parser {
|
||||
this.walkExpression(classy.superClass);
|
||||
}
|
||||
if (classy.body && classy.body.type === "ClassBody") {
|
||||
/** @type {Identifier[]} */
|
||||
const scopeParams = [];
|
||||
// Add class name in scope for recursive calls
|
||||
if (classy.id) {
|
||||
@@ -2318,8 +2329,16 @@ class JavascriptParser extends Parser {
|
||||
walkIfStatement(statement) {
|
||||
const result = this.hooks.statementIf.call(statement);
|
||||
if (result === undefined) {
|
||||
this.walkExpression(statement.test);
|
||||
this.walkNestedStatement(statement.consequent);
|
||||
const inGuard = this.hooks.collectGuards.call(statement.test);
|
||||
if (inGuard) {
|
||||
inGuard(() => {
|
||||
this.walkExpression(statement.test);
|
||||
this.walkNestedStatement(statement.consequent);
|
||||
});
|
||||
} else {
|
||||
this.walkExpression(statement.test);
|
||||
this.walkNestedStatement(statement.consequent);
|
||||
}
|
||||
|
||||
const consequentTerminated = this.scope.terminated;
|
||||
this.scope.terminated = undefined;
|
||||
@@ -3704,8 +3723,16 @@ class JavascriptParser extends Parser {
|
||||
walkConditionalExpression(expression) {
|
||||
const result = this.hooks.expressionConditionalOperator.call(expression);
|
||||
if (result === undefined) {
|
||||
this.walkExpression(expression.test);
|
||||
this.walkExpression(expression.consequent);
|
||||
const inGuard = this.hooks.collectGuards.call(expression.test);
|
||||
if (inGuard) {
|
||||
inGuard(() => {
|
||||
this.walkExpression(expression.test);
|
||||
this.walkExpression(expression.consequent);
|
||||
});
|
||||
} else {
|
||||
this.walkExpression(expression.test);
|
||||
this.walkExpression(expression.consequent);
|
||||
}
|
||||
|
||||
if (expression.alternate) {
|
||||
this.walkExpression(expression.alternate);
|
||||
@@ -4220,6 +4247,7 @@ class JavascriptParser extends Parser {
|
||||
* @returns {R | undefined} result of hook
|
||||
*/
|
||||
callHooksForInfoWithFallback(hookMap, info, fallback, defined, ...args) {
|
||||
/** @type {string} */
|
||||
let name;
|
||||
if (typeof info === "string") {
|
||||
name = info;
|
||||
@@ -4247,7 +4275,7 @@ class JavascriptParser extends Parser {
|
||||
}
|
||||
return;
|
||||
}
|
||||
name = info.name;
|
||||
name = /** @type {string} */ (info.name);
|
||||
}
|
||||
const hook = hookMap.get(name);
|
||||
if (hook !== undefined) {
|
||||
@@ -4255,7 +4283,7 @@ class JavascriptParser extends Parser {
|
||||
if (result !== undefined) return result;
|
||||
}
|
||||
if (fallback !== undefined) {
|
||||
return fallback(/** @type {string} */ (name));
|
||||
return fallback(name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4891,7 +4919,7 @@ class JavascriptParser extends Parser {
|
||||
]).some(
|
||||
(comment) =>
|
||||
comment.type === "Block" &&
|
||||
/^\s*(#|@)__PURE__\s*$/.test(comment.value)
|
||||
/^\s*(?:#|@)__PURE__\s*$/.test(comment.value)
|
||||
);
|
||||
if (!pureFlag) return false;
|
||||
commentsStartPos = /** @type {Range} */ (expr.callee.range)[1];
|
||||
@@ -5187,8 +5215,11 @@ class JavascriptParser extends Parser {
|
||||
extractMemberExpressionChain(expression) {
|
||||
/** @type {Node} */
|
||||
let expr = expression;
|
||||
/** @type {Members} */
|
||||
const members = [];
|
||||
/** @type {MembersOptionals} */
|
||||
const membersOptionals = [];
|
||||
/** @type {MemberRanges} */
|
||||
const memberRanges = [];
|
||||
while (expr.type === "MemberExpression") {
|
||||
if (expr.computed) {
|
||||
@@ -5214,10 +5245,11 @@ class JavascriptParser extends Parser {
|
||||
|
||||
/**
|
||||
* @param {string} varName variable name
|
||||
* @returns {{name: string, info: VariableInfo | string} | undefined} name of the free variable and variable info for that
|
||||
* @returns {{ name: string, info: VariableInfo | string } | undefined} name of the free variable and variable info for that
|
||||
*/
|
||||
getFreeInfoFromVariable(varName) {
|
||||
const info = this.getVariableInfo(varName);
|
||||
/** @type {string} */
|
||||
let name;
|
||||
if (info instanceof VariableInfo && info.name) {
|
||||
if (!info.isFree()) return;
|
||||
@@ -5232,10 +5264,11 @@ class JavascriptParser extends Parser {
|
||||
|
||||
/**
|
||||
* @param {string} varName variable name
|
||||
* @returns {{name: string, info: VariableInfo | string} | undefined} name of the free variable and variable info for that
|
||||
* @returns {{ name: string, info: VariableInfo | string } | undefined} name of the free variable and variable info for that
|
||||
*/
|
||||
getNameInfoFromVariable(varName) {
|
||||
const info = this.getVariableInfo(varName);
|
||||
/** @type {string} */
|
||||
let name;
|
||||
if (info instanceof VariableInfo && info.name) {
|
||||
if (!info.isFree() && !info.isTagged()) return;
|
||||
|
||||
Reference in New Issue
Block a user