@weapp-vite/ast 6.16.5 → 6.16.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -21,8 +21,11 @@ const CONSTRUCTOR_TYPE_MAP = {
|
|
|
21
21
|
Null: "any",
|
|
22
22
|
NullConstructor: "any"
|
|
23
23
|
};
|
|
24
|
+
function hasOwn(source, key) {
|
|
25
|
+
return Object.prototype.hasOwnProperty.call(source, key);
|
|
26
|
+
}
|
|
24
27
|
function mapConstructorName(name) {
|
|
25
|
-
if (
|
|
28
|
+
if (hasOwn(CONSTRUCTOR_TYPE_MAP, name)) return CONSTRUCTOR_TYPE_MAP[name];
|
|
26
29
|
return CONSTRUCTOR_TYPE_MAP[name.endsWith("Constructor") ? name.slice(0, -11) : name] ?? "any";
|
|
27
30
|
}
|
|
28
31
|
function resolveTypeFromNode(node) {
|
|
@@ -163,7 +163,7 @@ function collectIdentifiersFromExpressionWithOxc(expression) {
|
|
|
163
163
|
case "VariableDeclarator": {
|
|
164
164
|
const bindings = /* @__PURE__ */ new Set();
|
|
165
165
|
collectPatternBindingNames(node.id, bindings);
|
|
166
|
-
const currentScope = scopes.
|
|
166
|
+
const currentScope = scopes[scopes.length - 1];
|
|
167
167
|
for (const binding of bindings) currentScope?.add(binding);
|
|
168
168
|
visit(node.init);
|
|
169
169
|
return;
|