Comparing version
@@ -5,3 +5,3 @@ { | ||
"license": "MIT", | ||
"version": "5.37.0", | ||
"version": "5.37.1", | ||
"type": "module", | ||
@@ -8,0 +8,0 @@ "types": "./types/index.d.ts", |
@@ -22,3 +22,3 @@ <a href="https://svelte.dev"> | ||
```bash | ||
```sh | ||
npx sv create my-app | ||
@@ -25,0 +25,0 @@ cd my-app |
/** @import { AST } from '#compiler' */ | ||
/** @import { Comment } from 'estree' */ | ||
// @ts-expect-error acorn type definitions are borked in the release we use | ||
@@ -27,8 +26,2 @@ import { isIdentifierStart, isIdentifierChar } from 'acorn'; | ||
/** | ||
* @readonly | ||
* @type {string} | ||
*/ | ||
template_untrimmed; | ||
/** | ||
* Whether or not we're in loose parsing mode, in which | ||
@@ -71,3 +64,2 @@ * case we try to continue parsing as much as possible | ||
this.loose = loose; | ||
this.template_untrimmed = template; | ||
this.template = template.trimEnd(); | ||
@@ -74,0 +66,0 @@ |
@@ -373,10 +373,2 @@ /** @import { Expression } from 'estree' */ | ||
parser.allow_whitespace(); | ||
if (parser.index === parser.template.length) { | ||
while ( | ||
parser.index < parser.template_untrimmed.length && | ||
regex_whitespace.test(parser.template_untrimmed[parser.index]) | ||
) { | ||
parser.index++; | ||
} | ||
} | ||
} | ||
@@ -383,0 +375,0 @@ } |
@@ -454,2 +454,4 @@ /** @import { Expression, Node, Program } from 'estree' */ | ||
const is_custom_element = !!options.customElementOptions || options.customElement; | ||
// TODO remove all the ?? stuff, we don't need it now that we're validating the config | ||
@@ -504,9 +506,9 @@ /** @type {ComponentAnalysis} */ | ||
uses_event_attributes: false, | ||
custom_element: options.customElementOptions ?? options.customElement, | ||
inject_styles: options.css === 'injected' || options.customElement, | ||
accessors: options.customElement | ||
? true | ||
: (runes ? false : !!options.accessors) || | ||
// because $set method needs accessors | ||
options.compatibility?.componentApi === 4, | ||
custom_element: is_custom_element, | ||
inject_styles: options.css === 'injected' || is_custom_element, | ||
accessors: | ||
is_custom_element || | ||
(runes ? false : !!options.accessors) || | ||
// because $set method needs accessors | ||
options.compatibility?.componentApi === 4, | ||
reactive_statements: new Map(), | ||
@@ -513,0 +515,0 @@ binding_groups: new Map(), |
@@ -624,4 +624,5 @@ /** @import * as ESTree from 'estree' */ | ||
if (analysis.custom_element) { | ||
const ce = analysis.custom_element; | ||
const ce = options.customElementOptions ?? options.customElement; | ||
if (ce) { | ||
const ce_props = typeof ce === 'boolean' ? {} : ce.props || {}; | ||
@@ -628,0 +629,0 @@ |
/** @import { BlockStatement, Pattern, Statement } from 'estree' */ | ||
/** @import { AST } from '#compiler' */ | ||
/** @import { ComponentClientTransformState, ComponentContext } from '../types' */ | ||
import { extract_identifiers } from '../../../../utils/ast.js'; | ||
import { extract_identifiers, is_expression_async } from '../../../../utils/ast.js'; | ||
import * as b from '#compiler/builders'; | ||
@@ -18,3 +18,6 @@ import { create_derived } from '../utils.js'; | ||
// Visit {#await <expression>} first to ensure that scopes are in the correct order | ||
const expression = b.thunk(build_expression(context, node.expression, node.metadata.expression)); | ||
const expression = b.thunk( | ||
build_expression(context, node.expression, node.metadata.expression), | ||
node.metadata.expression.has_await | ||
); | ||
@@ -21,0 +24,0 @@ let then_block; |
@@ -85,3 +85,5 @@ /** @import { CallExpression, Expression } from 'estree' */ | ||
) && | ||
node.arguments.some((arg) => arg.type !== 'Literal') // TODO more cases? | ||
node.arguments.some( | ||
(arg) => arg.type === 'SpreadElement' || context.state.scope.evaluate(arg).has_unknown | ||
) | ||
) { | ||
@@ -88,0 +90,0 @@ return b.call( |
@@ -6,3 +6,3 @@ /** @import { AST } from '#compiler' */ | ||
const modifiers = [ | ||
const modifiers = /** @type {const} */ ([ | ||
'stopPropagation', | ||
@@ -14,3 +14,3 @@ 'stopImmediatePropagation', | ||
'once' | ||
]; | ||
]); | ||
@@ -17,0 +17,0 @@ /** |
@@ -184,2 +184,9 @@ /** @import { ArrowFunctionExpression, BinaryOperator, ClassDeclaration, Expression, FunctionDeclaration, FunctionExpression, Identifier, ImportDeclaration, MemberExpression, LogicalOperator, Node, Pattern, UnaryOperator, VariableDeclarator, Super } from 'estree' */ | ||
/** | ||
* True if the possible values contains `UNKNOWN` | ||
* @readonly | ||
* @type {boolean} | ||
*/ | ||
has_unknown = false; | ||
/** | ||
* True if the value is known to not be null/undefined | ||
@@ -544,2 +551,6 @@ * @readonly | ||
} | ||
if (value === UNKNOWN) { | ||
this.has_unknown = true; | ||
} | ||
} | ||
@@ -546,0 +557,0 @@ |
import { DEV } from 'esm-env'; | ||
import { queue_micro_task } from './task.js'; | ||
import { register_style } from '../dev/css.js'; | ||
import { effect } from '../reactivity/effects.js'; | ||
@@ -11,3 +11,3 @@ /** | ||
// Use `queue_micro_task` to ensure `anchor` is in the DOM, otherwise getRootNode() will yield wrong results | ||
queue_micro_task(() => { | ||
effect(() => { | ||
var root = anchor.getRootNode(); | ||
@@ -14,0 +14,0 @@ |
@@ -7,3 +7,3 @@ // generated during release, do not modify | ||
*/ | ||
export const VERSION = '5.37.0'; | ||
export const VERSION = '5.37.1'; | ||
export const PUBLIC_VERSION = '5'; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
2585649
057012
0.02%