Socket
Socket
Sign inDemoInstall

svelte

Package Overview
Dependencies
18
Maintainers
3
Versions
596
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.0.0-next.92 to 5.0.0-next.93

2

package.json

@@ -5,3 +5,3 @@ {

"license": "MIT",
"version": "5.0.0-next.92",
"version": "5.0.0-next.93",
"type": "module",

@@ -8,0 +8,0 @@ "types": "./types/index.d.ts",

@@ -285,3 +285,5 @@ /** @typedef {{ start?: number, end?: number }} NodeLike */

'invalid-style-directive-modifier': () =>
`Invalid 'style:' modifier. Valid modifiers are: 'important'`
`Invalid 'style:' modifier. Valid modifiers are: 'important'`,
'invalid-sequence-expression': () =>
`Sequence expressions are not allowed as attribute/directive values in runes mode, unless wrapped in parentheses`
};

@@ -288,0 +290,0 @@

@@ -44,3 +44,3 @@ import { getLocator } from 'locate-character';

const analysis = analyze_component(parsed, combined_options);
const analysis = analyze_component(parsed, source, combined_options);

@@ -47,0 +47,0 @@ const result = transform_component(analysis, source, combined_options);

@@ -261,6 +261,7 @@ import is_reference from 'is-reference';

* @param {import('#compiler').Root} root
* @param {string} source
* @param {import('#compiler').ValidatedCompileOptions} options
* @returns {import('../types.js').ComponentAnalysis}
*/
export function analyze_component(root, options) {
export function analyze_component(root, source, options) {
const scope_root = new ScopeRoot();

@@ -400,3 +401,4 @@

keyframes: []
}
},
source
};

@@ -403,0 +405,0 @@

@@ -53,2 +53,14 @@ import {

if (attribute.type === 'Attribute') {
if (context.state.analysis.runes && is_expression_attribute(attribute)) {
const expression = attribute.value[0].expression;
if (expression.type === 'SequenceExpression') {
let i = /** @type {number} */ (expression.start);
while (--i > 0) {
const char = context.state.analysis.source[i];
if (char === '(') break; // parenthesized sequence expressions are ok
if (char === '{') error(expression, 'invalid-sequence-expression');
}
}
}
validate_attribute_name(attribute, context);

@@ -85,2 +97,11 @@

if (attribute.type === 'Attribute') {
const is_expression = is_expression_attribute(attribute);
if (context.state.analysis.runes && is_expression) {
const expression = attribute.value[0].expression;
if (expression.type === 'SequenceExpression') {
error(expression, 'invalid-sequence-expression');
}
}
if (regex_illegal_attribute_character.test(attribute.name)) {

@@ -91,3 +112,3 @@ error(attribute, 'invalid-attribute-name', attribute.name);

if (attribute.name.startsWith('on') && attribute.name.length > 2) {
if (!is_expression_attribute(attribute)) {
if (!is_expression) {
error(attribute, 'invalid-event-attribute-value');

@@ -94,0 +115,0 @@ }

@@ -76,2 +76,3 @@ import type {

};
source: string;
}

@@ -78,0 +79,0 @@

@@ -304,3 +304,13 @@ import { noop } from '../../../shared/utils.js';

})
.catch(noop);
.catch((e) => {
// Error for DOMException: The user aborted a request. This results in two things:
// - startTime is `null`
// - currentTime is `null`
// We can't use the existence of an AbortError as this error and error code is shared
// with other Web APIs such as fetch().
if (animation.startTime !== null && animation.currentTime !== null) {
throw e;
}
});
} else {

@@ -307,0 +317,0 @@ // Timer

@@ -237,2 +237,8 @@ import { DEV } from 'esm-env';

export function destroy_effect(effect) {
var dom = effect.dom;
if (dom !== null) {
remove(dom);
}
destroy_effect_children(effect);

@@ -250,6 +256,2 @@ remove_reactions(effect, 0);

if (effect.dom !== null) {
remove(effect.dom);
}
var parent = effect.parent;

@@ -256,0 +258,0 @@

@@ -9,3 +9,3 @@ // generated during release, do not modify

*/
export const VERSION = '5.0.0-next.92';
export const VERSION = '5.0.0-next.93';
export const PUBLIC_VERSION = '5';

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc