Comparing version 5.14.2 to 5.14.3
@@ -5,3 +5,3 @@ { | ||
"license": "MIT", | ||
"version": "5.14.2", | ||
"version": "5.14.3", | ||
"type": "module", | ||
@@ -141,3 +141,3 @@ "types": "./types/index.d.ts", | ||
"esm-env": "^1.2.1", | ||
"esrap": "^1.2.3", | ||
"esrap": "^1.3.1", | ||
"is-reference": "^3.0.3", | ||
@@ -144,0 +144,0 @@ "locate-character": "^3.0.0", |
@@ -20,2 +20,12 @@ /** @import { Context, Visitors } from 'zimmerframe' */ | ||
const visitors = { | ||
_(node, context) { | ||
context.next(); | ||
// TODO there may come a time when we decide to preserve type annotations. | ||
// until that day comes, we just delete them so they don't confuse esrap | ||
delete node.typeAnnotation; | ||
delete node.typeParameters; | ||
delete node.returnType; | ||
delete node.accessibility; | ||
}, | ||
Decorator(node) { | ||
@@ -82,7 +92,2 @@ e.typescript_invalid_feature(node, 'decorators (related TSC proposal is not stage 4 yet)'); | ||
}, | ||
TSTypeAnnotation() { | ||
// This isn't correct, strictly speaking, and could result in invalid ASTs (like an empty statement within function parameters), | ||
// but esrap, our printing tool, just ignores these AST nodes at invalid positions, so it's fine | ||
return b.empty; | ||
}, | ||
TSInterfaceDeclaration() { | ||
@@ -94,8 +99,2 @@ return b.empty; | ||
}, | ||
TSTypeParameterDeclaration() { | ||
return b.empty; | ||
}, | ||
TSTypeParameterInstantiation() { | ||
return b.empty; | ||
}, | ||
TSEnumDeclaration(node) { | ||
@@ -102,0 +101,0 @@ e.typescript_invalid_feature(node, 'enums'); |
@@ -701,4 +701,12 @@ /** @import { Expression, Node, Program } from 'estree' */ | ||
for (const node of analysis.module.ast.body) { | ||
if (node.type === 'ExportNamedDeclaration' && node.specifiers !== null && node.source == null) { | ||
if ( | ||
node.type === 'ExportNamedDeclaration' && | ||
// @ts-expect-error | ||
node.exportKind !== 'type' && | ||
node.specifiers !== null && | ||
node.source == null | ||
) { | ||
for (const specifier of node.specifiers) { | ||
// @ts-expect-error | ||
if (specifier.exportKind === 'type') continue; | ||
if (specifier.local.type !== 'Identifier') continue; | ||
@@ -705,0 +713,0 @@ |
@@ -36,2 +36,4 @@ /** @import { ValidatedCompileOptions, CompileResult, ValidatedModuleCompileOptions } from '#compiler' */ | ||
const js_source_name = get_source_name(options.filename, options.outputFilename, 'input.svelte'); | ||
// @ts-expect-error | ||
const js = print(program, { | ||
@@ -43,2 +45,3 @@ // include source content; makes it easier/more robust looking up the source map code | ||
}); | ||
merge_with_preprocessor_map(js, options, js_source_name); | ||
@@ -97,2 +100,3 @@ | ||
return { | ||
// @ts-expect-error | ||
js: print(program, { | ||
@@ -99,0 +103,0 @@ // include source content; makes it easier/more robust looking up the source map code |
@@ -436,3 +436,9 @@ /** @import { ClassDeclaration, Expression, FunctionDeclaration, Identifier, ImportDeclaration, MemberExpression, Node, Pattern, VariableDeclarator } from 'estree' */ | ||
ImportDeclaration(node, { state }) { | ||
// @ts-expect-error | ||
if (node.importKind === 'type') return; | ||
for (const specifier of node.specifiers) { | ||
// @ts-expect-error | ||
if (specifier.importKind === 'type') continue; | ||
state.scope.declare(specifier.local, 'normal', 'import', node); | ||
@@ -439,0 +445,0 @@ } |
@@ -20,6 +20,7 @@ import * as w from '../warnings.js'; | ||
if (index === -1) { | ||
const test = indexOf.call(get_proxied_value(this), get_proxied_value(item), from_index); | ||
if (test !== -1) { | ||
w.state_proxy_equality_mismatch('array.indexOf(...)'); | ||
for (let i = from_index ?? 0; i < this.length; i += 1) { | ||
if (get_proxied_value(this[i]) === item) { | ||
w.state_proxy_equality_mismatch('array.indexOf(...)'); | ||
break; | ||
} | ||
} | ||
@@ -37,12 +38,7 @@ } | ||
if (index === -1) { | ||
// we need to specify this.length - 1 because it's probably using something like | ||
// `arguments` inside so passing undefined is different from not passing anything | ||
const test = lastIndexOf.call( | ||
get_proxied_value(this), | ||
get_proxied_value(item), | ||
from_index ?? this.length - 1 | ||
); | ||
if (test !== -1) { | ||
w.state_proxy_equality_mismatch('array.lastIndexOf(...)'); | ||
for (let i = 0; i <= (from_index ?? this.length - 1); i += 1) { | ||
if (get_proxied_value(this[i]) === item) { | ||
w.state_proxy_equality_mismatch('array.lastIndexOf(...)'); | ||
break; | ||
} | ||
} | ||
@@ -58,6 +54,7 @@ } | ||
if (!has) { | ||
const test = includes.call(get_proxied_value(this), get_proxied_value(item), from_index); | ||
if (test) { | ||
w.state_proxy_equality_mismatch('array.includes(...)'); | ||
for (let i = 0; i < this.length; i += 1) { | ||
if (get_proxied_value(this[i]) === item) { | ||
w.state_proxy_equality_mismatch('array.includes(...)'); | ||
break; | ||
} | ||
} | ||
@@ -64,0 +61,0 @@ } |
@@ -9,3 +9,3 @@ // generated during release, do not modify | ||
*/ | ||
export const VERSION = '5.14.2'; | ||
export const VERSION = '5.14.3'; | ||
export const PUBLIC_VERSION = '5'; |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2464492
54294
Updatedesrap@^1.3.1