ensure we proxy when assigning to state

proxied-state-each-blocks
Dominic Gannaway 9 months ago
parent cb731aa876
commit 4288843576

@ -219,7 +219,8 @@ export function analyze_module(ast, options) {
module: { ast, scope, scopes },
name: options.filename || 'module',
warnings,
accessors: false
accessors: false,
runes: true
};
}

@ -152,7 +152,11 @@ export function serialize_set_binding(node, context, fallback) {
if (left.object.type === 'ThisExpression' && left.property.type === 'PrivateIdentifier') {
if (context.state.private_state.has(left.property.name) && !state.in_constructor) {
const value = get_assignment_value(node, context);
return b.call('$.set', left, value);
return b.call(
'$.set',
left,
context.state.analysis.runes && should_proxy(value) ? b.call('$.proxy', value) : value
);
}
}
// @ts-expect-error
@ -202,7 +206,11 @@ export function serialize_set_binding(node, context, fallback) {
if (is_store) {
return b.call('$.store_set', serialize_get_binding(b.id(left_name), state), value);
} else {
return b.call('$.set', b.id(left_name), value);
return b.call(
'$.set',
b.id(left_name),
context.state.analysis.runes && should_proxy(value) ? b.call('$.proxy', value) : value
);
}
} else {
if (is_store) {
@ -385,7 +393,8 @@ export function should_proxy(node) {
!node ||
node.type === 'Literal' ||
node.type === 'ArrowFunctionExpression' ||
node.type === 'FunctionExpression'
node.type === 'FunctionExpression' ||
(node.type === 'Identifier' && node.name === 'undefined')
) {
return false;
}

@ -100,7 +100,8 @@ export class Scope {
is_called: false,
prop_alias: null,
expression: null,
mutation: null
mutation: null,
reassigned: false
};
this.declarations.set(node.name, binding);
this.root.conflicts.add(node.name);

@ -46,6 +46,7 @@ export interface Analysis {
module: Js;
name: string; // TODO should this be filename? it's used in `compileModule` as well as `compile`
warnings: RawWarning[];
runes: boolean;
// TODO figure out if we can move this to ComponentAnalysis
accessors: boolean;

@ -1,13 +1,13 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 35,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 35,
"type": "Element",
"name": "input",
"attributes": [
{
@ -31,4 +31,4 @@
}
]
}
}
}

@ -1,13 +1,13 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 40,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 40,
"type": "Element",
"name": "input",
"attributes": [
{
@ -73,4 +73,4 @@
}
]
}
}
}

@ -1,13 +1,13 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 29,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 29,
"type": "Element",
"name": "input",
"attributes": [
{
@ -38,4 +38,4 @@
}
]
}
}
}

@ -1,13 +1,13 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 37,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 37,
"type": "Element",
"name": "input",
"attributes": [
{
@ -39,4 +39,4 @@
}
]
}
}
}

@ -1,13 +1,13 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 21,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 21,
"type": "Element",
"name": "input",
"attributes": [
{
@ -23,4 +23,4 @@
}
]
}
}
}

@ -1,34 +1,18 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 70,
"type": "Fragment",
"children": [
{
"type": "EachBlock",
"start": 0,
"end": 70,
"type": "EachBlock",
"expression": {
"type": "Identifier",
"start": 7,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 13
}
},
"name": "things"
},
"children": [
{
"type": "Element",
"start": 33,
"end": 62,
"type": "Element",
"name": "div",
"attributes": [
{
@ -42,9 +26,9 @@
],
"children": [
{
"type": "Text",
"start": 51,
"end": 56,
"type": "Text",
"raw": "flips",
"data": "flips"
}
@ -57,6 +41,22 @@
"start": 17,
"end": 22
},
"expression": {
"type": "Identifier",
"start": 7,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 13
}
},
"name": "things"
},
"key": {
"type": "Identifier",
"start": 24,
@ -76,4 +76,4 @@
}
]
}
}
}

@ -1,13 +1,13 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 29,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 29,
"type": "Element",
"name": "div",
"attributes": [
{
@ -38,4 +38,4 @@
}
]
}
}
}

@ -1,19 +1,19 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 41,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 41,
"type": "Element",
"name": "a",
"attributes": [
{
"type": "Attribute",
"start": 3,
"end": 30,
"type": "Attribute",
"name": "href",
"value": [
{
@ -28,9 +28,9 @@
],
"children": [
{
"type": "Text",
"start": 31,
"end": 37,
"type": "Text",
"raw": "Google",
"data": "Google"
}
@ -38,4 +38,4 @@
}
]
}
}
}

@ -1,19 +1,19 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 18,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 18,
"type": "Element",
"name": "input",
"attributes": [
{
"type": "Attribute",
"start": 7,
"end": 15,
"type": "Attribute",
"name": "foo",
"value": [
{
@ -24,9 +24,9 @@
"data": "a"
},
{
"type": "MustacheTag",
"start": 12,
"end": 15,
"type": "MustacheTag",
"expression": {
"type": "Literal",
"start": 13,
@ -52,4 +52,4 @@
}
]
}
}
}

@ -1,25 +1,25 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 41,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 41,
"type": "Element",
"name": "textarea",
"attributes": [
{
"type": "Attribute",
"start": 10,
"end": 29,
"type": "Attribute",
"name": "readonly",
"value": [
{
"type": "MustacheTag",
"start": 19,
"end": 29,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 20,
@ -44,4 +44,4 @@
}
]
}
}
}

@ -1,19 +1,19 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 42,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 42,
"type": "Element",
"name": "div",
"attributes": [
{
"type": "Attribute",
"start": 5,
"end": 28,
"type": "Attribute",
"name": "style",
"value": [
{
@ -24,9 +24,9 @@
"data": "color: "
},
{
"type": "MustacheTag",
"start": 19,
"end": 26,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 20,
@ -56,9 +56,9 @@
],
"children": [
{
"type": "MustacheTag",
"start": 29,
"end": 36,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 30,
@ -80,4 +80,4 @@
}
]
}
}
}

@ -1,19 +1,19 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 38,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 38,
"type": "Element",
"name": "div",
"attributes": [
{
"type": "Attribute",
"start": 5,
"end": 9,
"type": "Attribute",
"name": "a",
"value": [
{
@ -26,15 +26,15 @@
]
},
{
"type": "Attribute",
"start": 10,
"end": 16,
"type": "Attribute",
"name": "b",
"value": [
{
"type": "MustacheTag",
"start": 12,
"end": 16,
"type": "MustacheTag",
"expression": {
"type": "Literal",
"start": 13,
@ -56,9 +56,9 @@
]
},
{
"type": "Attribute",
"start": 17,
"end": 21,
"type": "Attribute",
"name": "c",
"value": [
{
@ -71,15 +71,15 @@
]
},
{
"type": "Attribute",
"start": 22,
"end": 30,
"type": "Attribute",
"name": "d",
"value": [
{
"type": "MustacheTag",
"start": 25,
"end": 29,
"type": "MustacheTag",
"expression": {
"type": "Literal",
"start": 26,
@ -105,4 +105,4 @@
}
]
}
}
}

@ -1,19 +1,19 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 83,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 83,
"type": "Element",
"name": "div",
"attributes": [
{
"type": "Attribute",
"start": 5,
"end": 76,
"type": "Attribute",
"name": "data-foo",
"value": [
{
@ -30,4 +30,4 @@
}
]
}
}
}

@ -1,19 +1,19 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 28,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 28,
"type": "Element",
"name": "div",
"attributes": [
{
"type": "Attribute",
"start": 5,
"end": 11,
"type": "Attribute",
"name": "id",
"value": [
{
@ -26,9 +26,9 @@
]
},
{
"type": "Attribute",
"start": 12,
"end": 21,
"type": "Attribute",
"name": "class",
"value": [
{
@ -45,4 +45,4 @@
}
]
}
}
}

@ -1,25 +1,25 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 11,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 11,
"type": "Element",
"name": "div",
"attributes": [
{
"type": "Attribute",
"start": 5,
"end": 9,
"type": "Attribute",
"name": "id",
"value": [
{
"type": "AttributeShorthand",
"start": 6,
"end": 8,
"type": "AttributeShorthand",
"expression": {
"start": 6,
"end": 8,
@ -34,4 +34,4 @@
}
]
}
}
}

@ -1,19 +1,19 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 30,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 30,
"type": "Element",
"name": "textarea",
"attributes": [
{
"type": "Attribute",
"start": 10,
"end": 18,
"type": "Attribute",
"name": "readonly",
"value": true
}
@ -22,4 +22,4 @@
}
]
}
}
}

@ -1,19 +1,19 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 23,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 23,
"type": "Element",
"name": "div",
"attributes": [
{
"type": "Attribute",
"start": 5,
"end": 16,
"type": "Attribute",
"name": "class",
"value": [
{
@ -30,4 +30,4 @@
}
]
}
}
}

@ -1,13 +1,13 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 43,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 43,
"type": "Element",
"name": "div",
"attributes": [
{
@ -15,12 +15,14 @@
"end": 36,
"type": "StyleDirective",
"name": "color",
"modifiers": ["important"],
"modifiers": [
"important"
],
"value": [
{
"type": "MustacheTag",
"start": 27,
"end": 36,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 28,
@ -45,4 +47,4 @@
}
]
}
}
}

@ -1,13 +1,13 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 23,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 23,
"type": "Element",
"name": "div",
"attributes": [
{
@ -23,4 +23,4 @@
}
]
}
}
}

@ -1,13 +1,13 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 252,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 29,
"type": "Element",
"name": "div",
"attributes": [
{
@ -30,24 +30,24 @@
"children": []
},
{
"type": "Text",
"start": 29,
"end": 30,
"type": "Text",
"raw": "\n",
"data": "\n"
},
{
"type": "Element",
"start": 30,
"end": 59,
"type": "Element",
"name": "div",
"attributes": [
{
"start": 35,
"end": 52,
"type": "StyleDirective",
"modifiers": [],
"name": "color",
"modifiers": [],
"value": [
{
"start": 48,
@ -62,16 +62,16 @@
"children": []
},
{
"type": "Text",
"start": 59,
"end": 60,
"type": "Text",
"raw": "\n",
"data": "\n"
},
{
"type": "Element",
"start": 60,
"end": 87,
"type": "Element",
"name": "div",
"attributes": [
{
@ -94,16 +94,16 @@
"children": []
},
{
"type": "Text",
"start": 87,
"end": 88,
"type": "Text",
"raw": "\n",
"data": "\n"
},
{
"type": "Element",
"start": 88,
"end": 127,
"type": "Element",
"name": "div",
"attributes": [
{
@ -121,9 +121,9 @@
"data": "red"
},
{
"type": "MustacheTag",
"start": 109,
"end": 119,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 110,
@ -147,16 +147,16 @@
"children": []
},
{
"type": "Text",
"start": 127,
"end": 128,
"type": "Text",
"raw": "\n",
"data": "\n"
},
{
"type": "Element",
"start": 128,
"end": 167,
"type": "Element",
"name": "div",
"attributes": [
{
@ -174,9 +174,9 @@
"data": "red"
},
{
"type": "MustacheTag",
"start": 149,
"end": 159,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 150,
@ -200,16 +200,16 @@
"children": []
},
{
"type": "Text",
"start": 167,
"end": 168,
"type": "Text",
"raw": "\n",
"data": "\n"
},
{
"type": "Element",
"start": 168,
"end": 205,
"type": "Element",
"name": "div",
"attributes": [
{
@ -227,9 +227,9 @@
"data": "red"
},
{
"type": "MustacheTag",
"start": 188,
"end": 198,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 189,
@ -253,16 +253,16 @@
"children": []
},
{
"type": "Text",
"start": 205,
"end": 206,
"type": "Text",
"raw": "\n",
"data": "\n"
},
{
"type": "Element",
"start": 206,
"end": 252,
"type": "Element",
"name": "div",
"attributes": [
{
@ -273,9 +273,9 @@
"modifiers": [],
"value": [
{
"type": "MustacheTag",
"start": 223,
"end": 245,
"type": "MustacheTag",
"expression": {
"type": "TemplateLiteral",
"start": 224,
@ -359,4 +359,4 @@
}
]
}
}
}

@ -1,13 +1,13 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 33,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 33,
"type": "Element",
"name": "div",
"attributes": [
{
@ -18,9 +18,9 @@
"modifiers": [],
"value": [
{
"type": "MustacheTag",
"start": 17,
"end": 26,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 18,
@ -45,4 +45,4 @@
}
]
}
}
}

@ -1,19 +1,19 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 34,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 34,
"type": "Element",
"name": "div",
"attributes": [
{
"type": "Attribute",
"start": 5,
"end": 24,
"type": "Attribute",
"name": "style",
"value": [
{
@ -28,9 +28,9 @@
],
"children": [
{
"type": "Text",
"start": 25,
"end": 28,
"type": "Text",
"raw": "red",
"data": "red"
}
@ -38,4 +38,4 @@
}
]
}
}
}

@ -1,19 +1,19 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 21,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 21,
"type": "Element",
"name": "div",
"attributes": [
{
"type": "Attribute",
"start": 5,
"end": 14,
"type": "Attribute",
"name": "class",
"value": [
{
@ -30,4 +30,4 @@
}
]
}
}
}

@ -1,13 +1,13 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 38,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 38,
"type": "Element",
"name": "button",
"attributes": [
{
@ -36,9 +36,9 @@
],
"children": [
{
"type": "Text",
"start": 24,
"end": 29,
"type": "Text",
"raw": "Click",
"data": "Click"
}
@ -46,4 +46,4 @@
}
]
}
}
}

@ -1,13 +1,13 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 99,
"type": "Fragment",
"children": [
{
"type": "AwaitBlock",
"start": 0,
"end": 99,
"type": "AwaitBlock",
"expression": {
"type": "Identifier",
"start": 8,
@ -32,37 +32,37 @@
"end": 55
},
"pending": {
"type": "PendingBlock",
"start": 19,
"end": 39,
"type": "PendingBlock",
"children": [
{
"type": "Text",
"start": 19,
"end": 21,
"type": "Text",
"raw": "\n\t",
"data": "\n\t"
},
{
"type": "Element",
"start": 21,
"end": 38,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"type": "Text",
"start": 24,
"end": 34,
"type": "Text",
"raw": "loading...",
"data": "loading..."
}
]
},
{
"type": "Text",
"start": 38,
"end": 39,
"type": "Text",
"raw": "\n",
"data": "\n"
}
@ -70,42 +70,42 @@
"skip": false
},
"then": {
"type": "ThenBlock",
"start": null,
"end": null,
"type": "ThenBlock",
"children": [],
"skip": true
},
"catch": {
"type": "CatchBlock",
"start": 39,
"end": 91,
"type": "CatchBlock",
"children": [
{
"type": "Text",
"start": 56,
"end": 58,
"type": "Text",
"raw": "\n\t",
"data": "\n\t"
},
{
"type": "Element",
"start": 58,
"end": 90,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"type": "Text",
"start": 61,
"end": 68,
"type": "Text",
"raw": "oh no! ",
"data": "oh no! "
},
{
"type": "MustacheTag",
"start": 68,
"end": 86,
"type": "MustacheTag",
"expression": {
"type": "MemberExpression",
"start": 69,
@ -159,9 +159,9 @@
]
},
{
"type": "Text",
"start": 90,
"end": 91,
"type": "Text",
"raw": "\n",
"data": "\n"
}
@ -171,4 +171,4 @@
}
]
}
}
}

@ -1,13 +1,13 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 148,
"type": "Fragment",
"children": [
{
"type": "AwaitBlock",
"start": 0,
"end": 148,
"type": "AwaitBlock",
"expression": {
"type": "Identifier",
"start": 8,
@ -37,37 +37,37 @@
"end": 104
},
"pending": {
"type": "PendingBlock",
"start": 19,
"end": 39,
"type": "PendingBlock",
"children": [
{
"type": "Text",
"start": 19,
"end": 21,
"type": "Text",
"raw": "\n\t",
"data": "\n\t"
},
{
"type": "Element",
"start": 21,
"end": 38,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"type": "Text",
"start": 24,
"end": 34,
"type": "Text",
"raw": "loading...",
"data": "loading..."
}
]
},
{
"type": "Text",
"start": 38,
"end": 39,
"type": "Text",
"raw": "\n",
"data": "\n"
}
@ -75,35 +75,35 @@
"skip": false
},
"then": {
"type": "ThenBlock",
"start": 39,
"end": 88,
"type": "ThenBlock",
"children": [
{
"type": "Text",
"start": 55,
"end": 57,
"type": "Text",
"raw": "\n\t",
"data": "\n\t"
},
{
"type": "Element",
"start": 57,
"end": 87,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"type": "Text",
"start": 60,
"end": 73,
"type": "Text",
"raw": "the value is ",
"data": "the value is "
},
{
"type": "MustacheTag",
"start": 73,
"end": 83,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 74,
@ -124,9 +124,9 @@
]
},
{
"type": "Text",
"start": 87,
"end": 88,
"type": "Text",
"raw": "\n",
"data": "\n"
}
@ -134,35 +134,35 @@
"skip": false
},
"catch": {
"type": "CatchBlock",
"start": 88,
"end": 140,
"type": "CatchBlock",
"children": [
{
"type": "Text",
"start": 105,
"end": 107,
"type": "Text",
"raw": "\n\t",
"data": "\n\t"
},
{
"type": "Element",
"start": 107,
"end": 139,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"type": "Text",
"start": 110,
"end": 117,
"type": "Text",
"raw": "oh no! ",
"data": "oh no! "
},
{
"type": "MustacheTag",
"start": 117,
"end": 135,
"type": "MustacheTag",
"expression": {
"type": "MemberExpression",
"start": 118,
@ -216,9 +216,9 @@
]
},
{
"type": "Text",
"start": 139,
"end": 140,
"type": "Text",
"raw": "\n",
"data": "\n"
}
@ -228,4 +228,4 @@
}
]
}
}
}

@ -1,20 +1,20 @@
{
"html": {
"type": "Fragment",
"start": 30,
"end": 48,
"type": "Fragment",
"children": [
{
"type": "Text",
"start": 28,
"end": 30,
"type": "Text",
"raw": "\n\n",
"data": "\n\n"
},
{
"type": "InlineComponent",
"start": 30,
"end": 48,
"type": "InlineComponent",
"name": "Widget",
"attributes": [
{
@ -109,4 +109,4 @@
"sourceType": "module"
}
}
}
}

@ -1,20 +1,20 @@
{
"html": {
"type": "Fragment",
"start": 31,
"end": 56,
"type": "Fragment",
"children": [
{
"type": "Text",
"start": 29,
"end": 31,
"type": "Text",
"raw": "\n\n",
"data": "\n\n"
},
{
"type": "Element",
"start": 31,
"end": 56,
"type": "Element",
"name": "input",
"attributes": [
{
@ -119,4 +119,4 @@
"sourceType": "module"
}
}
}
}

@ -1,16 +1,19 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 30,
"type": "Fragment",
"children": [
{
"type": "Comment",
"start": 0,
"end": 30,
"type": "Comment",
"data": " svelte-ignore foo bar ",
"ignores": ["foo", "bar"]
"ignores": [
"foo",
"bar"
]
}
]
}
}
}

@ -1,16 +1,16 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 18,
"type": "Fragment",
"children": [
{
"type": "Comment",
"start": 0,
"end": 18,
"type": "Comment",
"data": " a comment ",
"ignores": []
}
]
}
}
}

@ -1,16 +1,14 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 62,
"type": "Fragment",
"children": [
{
"start": 0,
"end": 62,
"type": "InlineComponent",
"name": "svelte:component",
"attributes": [],
"children": [],
"start": 0,
"end": 62,
"expression": {
"type": "ConditionalExpression",
"start": 25,
@ -73,8 +71,10 @@
},
"name": "Bar"
}
}
},
"attributes": [],
"children": []
}
]
}
}
}

@ -1,20 +1,20 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 24,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 24,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"type": "Text",
"start": 3,
"end": 20,
"type": "Text",
"raw": "Hello & World",
"data": "Hello & World"
}
@ -22,4 +22,4 @@
}
]
}
}
}

@ -1,16 +1,16 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 17,
"type": "Fragment",
"children": [
{
"type": "Text",
"start": 0,
"end": 17,
"type": "Text",
"raw": "Hello & World",
"data": "Hello & World"
}
]
}
}
}

@ -1,29 +1,29 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 14,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 14,
"type": "Element",
"name": "div",
"attributes": [],
"children": [
{
"type": "Text",
"start": 5,
"end": 8,
"type": "Text",
"raw": "foo",
"data": "foo"
}
]
},
{
"type": "Text",
"start": 14,
"end": 16,
"type": "Text",
"raw": "\n\n",
"data": "\n\n"
}
@ -39,9 +39,13 @@
"type": "Rule",
"prelude": {
"type": "SelectorList",
"start": 25,
"end": 28,
"children": [
{
"type": "Selector",
"start": 25,
"end": 28,
"children": [
{
"type": "TypeSelector",
@ -49,27 +53,23 @@
"start": 25,
"end": 28
}
],
"start": 25,
"end": 28
]
}
],
"start": 25,
"end": 28
]
},
"block": {
"type": "Block",
"start": 29,
"end": 47,
"children": [
{
"type": "Declaration",
"property": "color",
"value": "red",
"start": 33,
"end": 43
"end": 43,
"property": "color",
"value": "red"
}
],
"start": 29,
"end": 47
]
},
"start": 25,
"end": 47
@ -81,4 +81,4 @@
"styles": "\n\tdiv {\n\t\tcolor: red;\n\t}\n"
}
}
}
}

@ -1,30 +1,31 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 101,
"type": "Fragment",
"children": [
{
"start": 0,
"end": 44,
"type": "Element",
"name": "svelte:element",
"start": 0,
"end": 44,
"tag": "div",
"attributes": [],
"children": [],
"tag": "div"
"children": []
},
{
"type": "Text",
"start": 44,
"end": 45,
"data": "\n",
"raw": "\n"
"raw": "\n",
"data": "\n"
},
{
"start": 45,
"end": 101,
"type": "Element",
"name": "svelte:element",
"start": 45,
"end": 101,
"tag": "div",
"attributes": [
{
"type": "Attribute",
@ -33,18 +34,17 @@
"name": "class",
"value": [
{
"type": "Text",
"start": 79,
"end": 82,
"data": "foo",
"raw": "foo"
"type": "Text",
"raw": "foo",
"data": "foo"
}
]
}
],
"children": [],
"tag": "div"
"children": []
}
]
}
}
}

@ -1,17 +1,16 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 101,
"type": "Fragment",
"children": [
{
"start": 0,
"end": 44,
"type": "Element",
"name": "svelte:element",
"attributes": [],
"children": [],
"start": 0,
"end": 44,
"tag": {
"type": "Identifier",
"start": 22,
"end": 25,
"loc": {
@ -24,23 +23,39 @@
"column": 25
}
},
"name": "tag",
"type": "Identifier"
}
"name": "tag"
},
"attributes": [],
"children": []
},
{
"type": "Text",
"start": 44,
"end": 45,
"data": "\n",
"raw": "\n"
"raw": "\n",
"data": "\n"
},
{
"start": 45,
"end": 101,
"type": "Element",
"name": "svelte:element",
"children": [],
"start": 45,
"end": 101,
"tag": {
"type": "Identifier",
"start": 67,
"end": 70,
"loc": {
"start": {
"line": 2,
"column": 22
},
"end": {
"line": 2,
"column": 25
}
},
"name": "tag"
},
"attributes": [
{
"type": "Attribute",
@ -49,32 +64,17 @@
"name": "class",
"value": [
{
"type": "Text",
"start": 79,
"end": 82,
"data": "foo",
"raw": "foo"
"type": "Text",
"raw": "foo",
"data": "foo"
}
]
}
],
"tag": {
"start": 67,
"end": 70,
"loc": {
"start": {
"line": 2,
"column": 22
},
"end": {
"line": 2,
"column": 25
}
},
"name": "tag",
"type": "Identifier"
}
"children": []
}
]
}
}
}

@ -1,8 +1,8 @@
{
"html": {
"type": "Fragment",
"start": null,
"end": null,
"type": "Fragment",
"children": []
},
"instance": {
@ -479,4 +479,4 @@
"sourceType": "module"
}
}
}
}

@ -1,48 +1,32 @@
{
"html": {
"type": "Fragment",
"start": 41,
"end": 112,
"type": "Fragment",
"children": [
{
"type": "Text",
"start": 39,
"end": 41,
"type": "Text",
"raw": "\n\n",
"data": "\n\n"
},
{
"type": "EachBlock",
"start": 41,
"end": 112,
"type": "EachBlock",
"expression": {
"type": "Identifier",
"start": 48,
"end": 55,
"loc": {
"start": {
"line": 5,
"column": 7
},
"end": {
"line": 5,
"column": 14
}
},
"name": "animals"
},
"children": [
{
"type": "Element",
"start": 83,
"end": 104,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"type": "MustacheTag",
"start": 86,
"end": 91,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 87,
@ -61,16 +45,16 @@
}
},
{
"type": "Text",
"start": 91,
"end": 93,
"type": "Text",
"raw": ": ",
"data": ": "
},
{
"type": "MustacheTag",
"start": 93,
"end": 100,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 94,
@ -170,6 +154,22 @@
}
}
]
},
"expression": {
"type": "Identifier",
"start": 48,
"end": 55,
"loc": {
"start": {
"line": 5,
"column": 7
},
"end": {
"line": 5,
"column": 14
}
},
"name": "animals"
}
}
]
@ -265,4 +265,4 @@
"sourceType": "module"
}
}
}
}

@ -1,41 +1,25 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 77,
"type": "Fragment",
"children": [
{
"type": "EachBlock",
"start": 0,
"end": 77,
"type": "EachBlock",
"expression": {
"type": "Identifier",
"start": 7,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 14
}
},
"name": "animals"
},
"children": [
{
"type": "Element",
"start": 27,
"end": 42,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"type": "MustacheTag",
"start": 30,
"end": 38,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 31,
@ -62,22 +46,38 @@
"start": 18,
"end": 24
},
"expression": {
"type": "Identifier",
"start": 7,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 14
}
},
"name": "animals"
},
"else": {
"type": "ElseBlock",
"start": 50,
"end": 70,
"type": "ElseBlock",
"children": [
{
"type": "Element",
"start": 52,
"end": 69,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"type": "Text",
"start": 55,
"end": 65,
"type": "Text",
"raw": "no animals",
"data": "no animals"
}
@ -88,4 +88,4 @@
}
]
}
}
}

@ -1,41 +1,25 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 58,
"type": "Fragment",
"children": [
{
"type": "EachBlock",
"start": 0,
"end": 58,
"type": "EachBlock",
"expression": {
"type": "Identifier",
"start": 7,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 14
}
},
"name": "animals"
},
"children": [
{
"type": "Element",
"start": 30,
"end": 50,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"type": "MustacheTag",
"start": 33,
"end": 36,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 34,
@ -54,16 +38,16 @@
}
},
{
"type": "Text",
"start": 36,
"end": 38,
"type": "Text",
"raw": ": ",
"data": ": "
},
{
"type": "MustacheTag",
"start": 38,
"end": 46,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 39,
@ -90,8 +74,24 @@
"start": 18,
"end": 24
},
"expression": {
"type": "Identifier",
"start": 7,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 14
}
},
"name": "animals"
},
"index": "i"
}
]
}
}
}

@ -1,41 +1,25 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 54,
"type": "Fragment",
"children": [
{
"type": "EachBlock",
"start": 0,
"end": 54,
"type": "EachBlock",
"expression": {
"type": "Identifier",
"start": 7,
"end": 12,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 12
}
},
"name": "todos"
},
"children": [
{
"type": "Element",
"start": 33,
"end": 46,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"type": "MustacheTag",
"start": 36,
"end": 42,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 37,
@ -62,6 +46,22 @@
"start": 16,
"end": 20
},
"expression": {
"type": "Identifier",
"start": 7,
"end": 12,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 12
}
},
"name": "todos"
},
"key": {
"type": "MemberExpression",
"start": 22,
@ -114,4 +114,4 @@
}
]
}
}
}

@ -1,41 +1,25 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 50,
"type": "Fragment",
"children": [
{
"type": "EachBlock",
"start": 0,
"end": 50,
"type": "EachBlock",
"expression": {
"type": "Identifier",
"start": 7,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 14
}
},
"name": "animals"
},
"children": [
{
"type": "Element",
"start": 27,
"end": 42,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"type": "MustacheTag",
"start": 30,
"end": 38,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 31,
@ -61,8 +45,24 @@
"name": "animal",
"start": 18,
"end": 24
},
"expression": {
"type": "Identifier",
"start": 7,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 14
}
},
"name": "animals"
}
}
]
}
}
}

@ -1,19 +1,19 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 43,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 21,
"type": "Element",
"name": "span",
"attributes": [
{
"type": "Attribute",
"start": 6,
"end": 13,
"type": "Attribute",
"name": "attr",
"value": [
{
@ -29,22 +29,22 @@
"children": []
},
{
"type": "Text",
"start": 21,
"end": 22,
"type": "Text",
"raw": "\n",
"data": "\n"
},
{
"type": "Element",
"start": 22,
"end": 43,
"type": "Element",
"name": "span",
"attributes": [
{
"type": "Attribute",
"start": 28,
"end": 35,
"type": "Attribute",
"name": "attr",
"value": [
{
@ -61,4 +61,4 @@
}
]
}
}
}

@ -1,19 +1,19 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 49,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 24,
"type": "Element",
"name": "span",
"attributes": [
{
"type": "Attribute",
"start": 6,
"end": 16,
"type": "Attribute",
"name": "attr",
"value": [
{
@ -29,22 +29,22 @@
"children": []
},
{
"type": "Text",
"start": 24,
"end": 25,
"type": "Text",
"raw": "\n",
"data": "\n"
},
{
"type": "Element",
"start": 25,
"end": 49,
"type": "Element",
"name": "span",
"attributes": [
{
"type": "Attribute",
"start": 31,
"end": 41,
"type": "Attribute",
"name": "attr",
"value": [
{
@ -61,4 +61,4 @@
}
]
}
}
}

@ -1,27 +1,27 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 22,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 22,
"type": "Element",
"name": "h1",
"attributes": [],
"children": [
{
"type": "Text",
"start": 4,
"end": 10,
"type": "Text",
"raw": "hello ",
"data": "hello "
},
{
"type": "MustacheTag",
"start": 10,
"end": 16,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 11,
@ -40,9 +40,9 @@
}
},
{
"type": "Text",
"start": 16,
"end": 17,
"type": "Text",
"raw": "!",
"data": "!"
}
@ -50,4 +50,4 @@
}
]
}
}
}

@ -1,20 +1,20 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 17,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 17,
"type": "Element",
"name": "span",
"attributes": [],
"children": [
{
"type": "Text",
"start": 6,
"end": 10,
"type": "Text",
"raw": "test",
"data": "test"
}
@ -22,4 +22,4 @@
}
]
}
}
}

@ -1,19 +1,19 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 15,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 15,
"type": "Element",
"name": "!doctype",
"attributes": [
{
"type": "Attribute",
"start": 10,
"end": 14,
"type": "Attribute",
"name": "html",
"value": true
}
@ -22,4 +22,4 @@
}
]
}
}
}

@ -1,13 +1,13 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 97,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 61,
"type": "Element",
"name": "button",
"attributes": [
{
@ -105,25 +105,25 @@
],
"children": [
{
"type": "Text",
"start": 46,
"end": 52,
"type": "Text",
"raw": "toggle",
"data": "toggle"
}
]
},
{
"type": "Text",
"start": 61,
"end": 63,
"type": "Text",
"raw": "\n\n",
"data": "\n\n"
},
{
"type": "IfBlock",
"start": 63,
"end": 97,
"type": "IfBlock",
"expression": {
"type": "Identifier",
"start": 68,
@ -142,16 +142,16 @@
},
"children": [
{
"type": "Element",
"start": 78,
"end": 91,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"type": "Text",
"start": 81,
"end": 87,
"type": "Text",
"raw": "hello!",
"data": "hello!"
}
@ -161,4 +161,4 @@
}
]
}
}
}

@ -1,13 +1,13 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 51,
"type": "Fragment",
"children": [
{
"type": "IfBlock",
"start": 0,
"end": 51,
"type": "IfBlock",
"expression": {
"type": "Identifier",
"start": 5,
@ -26,16 +26,16 @@
},
"children": [
{
"type": "Element",
"start": 11,
"end": 21,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"type": "Text",
"start": 14,
"end": 17,
"type": "Text",
"raw": "foo",
"data": "foo"
}
@ -43,21 +43,21 @@
}
],
"else": {
"type": "ElseBlock",
"start": 29,
"end": 46,
"type": "ElseBlock",
"children": [
{
"type": "Element",
"start": 31,
"end": 45,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"type": "Text",
"start": 34,
"end": 41,
"type": "Text",
"raw": "not foo",
"data": "not foo"
}
@ -68,4 +68,4 @@
}
]
}
}
}

@ -1,13 +1,13 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 89,
"type": "Fragment",
"children": [
{
"type": "IfBlock",
"start": 0,
"end": 89,
"type": "IfBlock",
"expression": {
"type": "BinaryExpression",
"start": 5,
@ -59,16 +59,16 @@
},
"children": [
{
"type": "Element",
"start": 14,
"end": 41,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"type": "Text",
"start": 17,
"end": 37,
"type": "Text",
"raw": "x is greater than 10",
"data": "x is greater than 10"
}
@ -76,15 +76,14 @@
}
],
"else": {
"type": "ElseBlock",
"start": 58,
"end": 84,
"type": "ElseBlock",
"children": [
{
"type": "IfBlock",
"start": 58,
"end": 89,
"type": "IfBlock",
"elseif": true,
"expression": {
"type": "BinaryExpression",
"start": 52,
@ -136,26 +135,27 @@
},
"children": [
{
"type": "Element",
"start": 60,
"end": 83,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"type": "Text",
"start": 63,
"end": 79,
"type": "Text",
"raw": "x is less than 5",
"data": "x is less than 5"
}
]
}
]
],
"elseif": true
}
]
}
}
]
}
}
}

@ -1,13 +1,13 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 17,
"type": "Fragment",
"children": [
{
"type": "IfBlock",
"start": 0,
"end": 17,
"type": "IfBlock",
"expression": {
"type": "Identifier",
"start": 5,
@ -26,9 +26,9 @@
},
"children": [
{
"type": "Text",
"start": 9,
"end": 12,
"type": "Text",
"raw": "bar",
"data": "bar"
}
@ -36,4 +36,4 @@
}
]
}
}
}

@ -1,66 +1,66 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 31,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 31,
"type": "Element",
"name": "ul",
"attributes": [],
"children": [
{
"type": "Text",
"start": 4,
"end": 6,
"type": "Text",
"raw": "\n\t",
"data": "\n\t"
},
{
"type": "Element",
"start": 6,
"end": 13,
"type": "Element",
"name": "li",
"attributes": [],
"children": [
{
"type": "Text",
"start": 10,
"end": 13,
"type": "Text",
"raw": "a\n\t",
"data": "a\n\t"
}
]
},
{
"type": "Element",
"start": 13,
"end": 20,
"type": "Element",
"name": "li",
"attributes": [],
"children": [
{
"type": "Text",
"start": 17,
"end": 20,
"type": "Text",
"raw": "b\n\t",
"data": "b\n\t"
}
]
},
{
"type": "Element",
"start": 20,
"end": 26,
"type": "Element",
"name": "li",
"attributes": [],
"children": [
{
"type": "Text",
"start": 24,
"end": 26,
"type": "Text",
"raw": "c\n",
"data": "c\n"
}
@ -70,4 +70,4 @@
}
]
}
}
}

@ -1,20 +1,20 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 19,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 19,
"type": "Element",
"name": "span",
"attributes": [],
"children": [
{
"type": "Text",
"start": 6,
"end": 12,
"type": "Text",
"raw": " ",
"data": " "
}
@ -22,4 +22,4 @@
}
]
}
}
}

@ -1,13 +1,13 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 148,
"type": "Fragment",
"children": [
{
"type": "IfBlock",
"start": 0,
"end": 33,
"type": "IfBlock",
"expression": {
"type": "Literal",
"start": 5,
@ -27,32 +27,32 @@
},
"children": [
{
"type": "Element",
"start": 12,
"end": 19,
"type": "Element",
"name": "input",
"attributes": [],
"children": []
}
],
"else": {
"type": "ElseBlock",
"start": 27,
"end": 28,
"type": "ElseBlock",
"children": []
}
},
{
"type": "Text",
"start": 33,
"end": 35,
"type": "Text",
"raw": "\n\n",
"data": "\n\n"
},
{
"type": "IfBlock",
"start": 35,
"end": 65,
"type": "IfBlock",
"expression": {
"type": "Literal",
"start": 40,
@ -72,32 +72,32 @@
},
"children": [
{
"type": "Element",
"start": 47,
"end": 51,
"type": "Element",
"name": "br",
"attributes": [],
"children": []
}
],
"else": {
"type": "ElseBlock",
"start": 59,
"end": 60,
"type": "ElseBlock",
"children": []
}
},
{
"type": "Text",
"start": 65,
"end": 67,
"type": "Text",
"raw": "\n\n",
"data": "\n\n"
},
{
"type": "AwaitBlock",
"start": 67,
"end": 108,
"type": "AwaitBlock",
"expression": {
"type": "Literal",
"start": 75,
@ -123,29 +123,29 @@
},
"error": null,
"pending": {
"type": "PendingBlock",
"start": 80,
"end": 90,
"type": "PendingBlock",
"children": [
{
"type": "Text",
"start": 80,
"end": 82,
"type": "Text",
"raw": "\n\t",
"data": "\n\t"
},
{
"type": "Element",
"start": 82,
"end": 89,
"type": "Element",
"name": "input",
"attributes": [],
"children": []
},
{
"type": "Text",
"start": 89,
"end": 90,
"type": "Text",
"raw": "\n",
"data": "\n"
}
@ -153,14 +153,14 @@
"skip": false
},
"then": {
"type": "ThenBlock",
"start": 90,
"end": 100,
"type": "ThenBlock",
"children": [
{
"type": "Text",
"start": 99,
"end": 100,
"type": "Text",
"raw": "\n",
"data": "\n"
}
@ -168,24 +168,24 @@
"skip": false
},
"catch": {
"type": "CatchBlock",
"start": null,
"end": null,
"type": "CatchBlock",
"children": [],
"skip": true
}
},
{
"type": "Text",
"start": 108,
"end": 110,
"type": "Text",
"raw": "\n\n",
"data": "\n\n"
},
{
"type": "AwaitBlock",
"start": 110,
"end": 148,
"type": "AwaitBlock",
"expression": {
"type": "Literal",
"start": 118,
@ -211,29 +211,29 @@
},
"error": null,
"pending": {
"type": "PendingBlock",
"start": 123,
"end": 130,
"type": "PendingBlock",
"children": [
{
"type": "Text",
"start": 123,
"end": 125,
"type": "Text",
"raw": "\n\t",
"data": "\n\t"
},
{
"type": "Element",
"start": 125,
"end": 129,
"type": "Element",
"name": "br",
"attributes": [],
"children": []
},
{
"type": "Text",
"start": 129,
"end": 130,
"type": "Text",
"raw": "\n",
"data": "\n"
}
@ -241,14 +241,14 @@
"skip": false
},
"then": {
"type": "ThenBlock",
"start": 130,
"end": 140,
"type": "ThenBlock",
"children": [
{
"type": "Text",
"start": 139,
"end": 140,
"type": "Text",
"raw": "\n",
"data": "\n"
}
@ -256,13 +256,13 @@
"skip": false
},
"catch": {
"type": "CatchBlock",
"start": null,
"end": null,
"type": "CatchBlock",
"children": [],
"skip": true
}
}
]
}
}
}

@ -1,27 +1,27 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 34,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 34,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"type": "Text",
"start": 3,
"end": 4,
"type": "Text",
"raw": " ",
"data": " "
},
{
"type": "RawMustacheTag",
"start": 4,
"end": 16,
"type": "RawMustacheTag",
"expression": {
"type": "Identifier",
"start": 11,
@ -40,16 +40,16 @@
}
},
{
"type": "Text",
"start": 16,
"end": 17,
"type": "Text",
"raw": " ",
"data": " "
},
{
"type": "RawMustacheTag",
"start": 17,
"end": 29,
"type": "RawMustacheTag",
"expression": {
"type": "Identifier",
"start": 24,
@ -68,9 +68,9 @@
}
},
{
"type": "Text",
"start": 29,
"end": 30,
"type": "Text",
"raw": " ",
"data": " "
}
@ -78,4 +78,4 @@
}
]
}
}
}

@ -1,20 +1,20 @@
{
"html": {
"type": "Fragment",
"start": 30,
"end": 63,
"type": "Fragment",
"children": [
{
"type": "Text",
"start": 28,
"end": 30,
"type": "Text",
"raw": "\n\n",
"data": "\n\n"
},
{
"type": "Element",
"start": 30,
"end": 63,
"type": "Element",
"name": "canvas",
"attributes": [
{
@ -119,4 +119,4 @@
"sourceType": "module"
}
}
}
}

@ -1,34 +1,34 @@
{
"html": {
"type": "Fragment",
"start": 79,
"end": 101,
"type": "Fragment",
"children": [
{
"type": "Text",
"start": 77,
"end": 79,
"type": "Text",
"raw": "\n\n",
"data": "\n\n"
},
{
"type": "Element",
"start": 79,
"end": 101,
"type": "Element",
"name": "h1",
"attributes": [],
"children": [
{
"type": "Text",
"start": 83,
"end": 89,
"type": "Text",
"raw": "Hello ",
"data": "Hello "
},
{
"type": "MustacheTag",
"start": 89,
"end": 95,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 90,
@ -47,9 +47,9 @@
}
},
{
"type": "Text",
"start": 95,
"end": 96,
"type": "Text",
"raw": "!",
"data": "!"
}
@ -147,4 +147,4 @@
"sourceType": "module"
}
}
}
}

@ -1,13 +1,13 @@
{
"html": {
"type": "Fragment",
"start": 62,
"end": 60,
"type": "Fragment",
"children": [
{
"type": "Text",
"start": 60,
"end": 62,
"type": "Text",
"raw": "\n\n",
"data": "\n\n"
}
@ -175,4 +175,4 @@
"sourceType": "module"
}
}
}
}

@ -1,34 +1,34 @@
{
"html": {
"type": "Fragment",
"start": 41,
"end": 63,
"type": "Fragment",
"children": [
{
"type": "Text",
"start": 39,
"end": 41,
"type": "Text",
"raw": "\n\n",
"data": "\n\n"
},
{
"type": "Element",
"start": 41,
"end": 63,
"type": "Element",
"name": "h1",
"attributes": [],
"children": [
{
"type": "Text",
"start": 45,
"end": 51,
"type": "Text",
"raw": "Hello ",
"data": "Hello "
},
{
"type": "MustacheTag",
"start": 51,
"end": 57,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 52,
@ -47,9 +47,9 @@
}
},
{
"type": "Text",
"start": 57,
"end": 58,
"type": "Text",
"raw": "!",
"data": "!"
}
@ -147,4 +147,4 @@
"sourceType": "module"
}
}
}
}

@ -1,17 +1,17 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 6,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 6,
"type": "Element",
"name": "div",
"attributes": [],
"children": []
}
]
}
}
}

@ -1,13 +1,13 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 57,
"type": "Fragment",
"children": [
{
"type": "IfBlock",
"start": 0,
"end": 57,
"type": "IfBlock",
"expression": {
"type": "BinaryExpression",
"start": 5,
@ -59,21 +59,21 @@
},
"children": [
{
"start": 17,
"end": 51,
"type": "InlineComponent",
"name": "svelte:self",
"start": 17,
"end": 51,
"attributes": [
{
"type": "Attribute",
"start": 30,
"end": 49,
"type": "Attribute",
"name": "depth",
"value": [
{
"type": "MustacheTag",
"start": 37,
"end": 48,
"type": "MustacheTag",
"expression": {
"type": "BinaryExpression",
"start": 38,
@ -133,4 +133,4 @@
}
]
}
}
}

@ -1,26 +1,26 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 45,
"type": "Fragment",
"children": [
{
"type": "InlineComponent",
"start": 0,
"end": 45,
"type": "InlineComponent",
"name": "Component",
"attributes": [],
"children": [
{
"type": "Element",
"start": 11,
"end": 33,
"type": "Element",
"name": "div",
"attributes": [
{
"type": "Attribute",
"start": 16,
"end": 26,
"type": "Attribute",
"name": "slot",
"value": [
{
@ -39,4 +39,4 @@
}
]
}
}
}

@ -1,27 +1,27 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 24,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 24,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"type": "Text",
"start": 3,
"end": 4,
"type": "Text",
"raw": " ",
"data": " "
},
{
"type": "MustacheTag",
"start": 4,
"end": 7,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 5,
@ -40,16 +40,16 @@
}
},
{
"type": "Text",
"start": 7,
"end": 8,
"type": "Text",
"raw": " ",
"data": " "
},
{
"type": "MustacheTag",
"start": 8,
"end": 11,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 9,
@ -68,16 +68,16 @@
}
},
{
"type": "Text",
"start": 11,
"end": 14,
"type": "Text",
"raw": " : ",
"data": " : "
},
{
"type": "MustacheTag",
"start": 14,
"end": 17,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 15,
@ -96,9 +96,9 @@
}
},
{
"type": "Text",
"start": 17,
"end": 20,
"type": "Text",
"raw": " : ",
"data": " : "
}
@ -106,4 +106,4 @@
}
]
}
}
}

@ -1,19 +1,19 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 22,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 22,
"type": "Element",
"name": "div",
"attributes": [
{
"type": "Spread",
"start": 5,
"end": 15,
"type": "Spread",
"expression": {
"type": "Identifier",
"start": 9,
@ -36,4 +36,4 @@
}
]
}
}
}

@ -1,27 +1,27 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 42,
"type": "Fragment",
"children": [
{
"start": 0,
"end": 42,
"type": "Head",
"name": "svelte:head",
"start": 0,
"end": 42,
"attributes": [],
"children": [
{
"type": "Element",
"start": 13,
"end": 28,
"type": "Element",
"name": "style",
"attributes": [],
"children": [
{
"type": "Text",
"start": 20,
"end": 20,
"type": "Text",
"data": ""
}
]
@ -30,4 +30,4 @@
}
]
}
}
}

@ -1,13 +1,13 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 61,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 61,
"type": "Element",
"name": "textarea",
"attributes": [],
"children": [
@ -19,9 +19,9 @@
"data": "\n\t<p>not actually an element. "
},
{
"type": "MustacheTag",
"start": 40,
"end": 45,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 41,
@ -50,4 +50,4 @@
}
]
}
}
}

@ -1,13 +1,13 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 117,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 117,
"type": "Element",
"name": "textarea",
"attributes": [],
"children": [
@ -19,9 +19,9 @@
"data": "\n\t<p>not actu </textar ally an element. "
},
{
"type": "MustacheTag",
"start": 50,
"end": 55,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 51,
@ -50,4 +50,4 @@
}
]
}
}
}

@ -1,13 +1,13 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 27,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 27,
"type": "Element",
"name": "div",
"attributes": [
{
@ -23,9 +23,9 @@
],
"children": [
{
"type": "Text",
"start": 13,
"end": 21,
"type": "Text",
"raw": "fades in",
"data": "fades in"
}
@ -33,4 +33,4 @@
}
]
}
}
}

@ -1,13 +1,13 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 45,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 45,
"type": "Element",
"name": "div",
"attributes": [
{
@ -91,9 +91,9 @@
],
"children": [
{
"type": "Text",
"start": 31,
"end": 39,
"type": "Text",
"raw": "fades in",
"data": "fades in"
}
@ -101,4 +101,4 @@
}
]
}
}
}

@ -1,41 +1,25 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 41,
"type": "Fragment",
"children": [
{
"type": "EachBlock",
"start": 0,
"end": 41,
"type": "EachBlock",
"expression": {
"type": "Identifier",
"start": 7,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 13
}
},
"name": "things"
},
"children": [
{
"type": "Element",
"start": 22,
"end": 33,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"type": "MustacheTag",
"start": 25,
"end": 29,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 26,
@ -61,8 +45,24 @@
"name": "𐊧",
"start": 17,
"end": 19
},
"expression": {
"type": "Identifier",
"start": 7,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 13
}
},
"name": "things"
}
}
]
}
}
}

@ -1,34 +1,34 @@
{
"html": {
"type": "Fragment",
"start": 51,
"end": 73,
"type": "Fragment",
"children": [
{
"type": "Text",
"start": 49,
"end": 51,
"type": "Text",
"raw": "\n\n",
"data": "\n\n"
},
{
"type": "Element",
"start": 51,
"end": 73,
"type": "Element",
"name": "h1",
"attributes": [],
"children": [
{
"type": "Text",
"start": 55,
"end": 61,
"type": "Text",
"raw": "Hello ",
"data": "Hello "
},
{
"type": "MustacheTag",
"start": 61,
"end": 67,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 62,
@ -47,9 +47,9 @@
}
},
{
"type": "Text",
"start": 67,
"end": 68,
"type": "Text",
"raw": "!",
"data": "!"
}
@ -147,4 +147,4 @@
"sourceType": "module"
}
}
}
}

@ -1,29 +1,29 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 14,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 14,
"type": "Element",
"name": "div",
"attributes": [],
"children": [
{
"type": "Text",
"start": 5,
"end": 8,
"type": "Text",
"raw": "foo",
"data": "foo"
}
]
},
{
"type": "Text",
"start": 14,
"end": 16,
"type": "Text",
"raw": "\n\n",
"data": "\n\n"
}
@ -39,9 +39,13 @@
"type": "Rule",
"prelude": {
"type": "SelectorList",
"start": 25,
"end": 28,
"children": [
{
"type": "Selector",
"start": 25,
"end": 28,
"children": [
{
"type": "TypeSelector",
@ -49,27 +53,23 @@
"start": 25,
"end": 28
}
],
"start": 25,
"end": 28
]
}
],
"start": 25,
"end": 28
]
},
"block": {
"type": "Block",
"start": 29,
"end": 47,
"children": [
{
"type": "Declaration",
"property": "color",
"value": "red",
"start": 33,
"end": 43
"end": 43,
"property": "color",
"value": "red"
}
],
"start": 29,
"end": 47
]
},
"start": 25,
"end": 47
@ -81,4 +81,4 @@
"styles": "\n\tdiv {\n\t\tcolor: red;\n\t}\n"
}
}
}
}

@ -1,27 +1,27 @@
{
"html": {
"type": "Fragment",
"start": 6,
"end": 36,
"type": "Fragment",
"children": [
{
"type": "Text",
"start": 0,
"end": 6,
"type": "Text",
"raw": "\n\n\t\t\t\t",
"data": "\n\n\t\t\t\t"
},
{
"type": "Element",
"start": 6,
"end": 36,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"type": "Text",
"start": 9,
"end": 32,
"type": "Text",
"raw": "just chillin' over here",
"data": "just chillin' over here"
}
@ -29,4 +29,4 @@
}
]
}
}
}

@ -1,34 +1,34 @@
{
"html": {
"type": "Fragment",
"start": 0,
"end": 65,
"type": "Fragment",
"children": [
{
"type": "Element",
"start": 0,
"end": 65,
"type": "Element",
"name": "h1",
"attributes": [],
"children": [
{
"type": "Text",
"start": 4,
"end": 10,
"type": "Text",
"raw": "Hello ",
"data": "Hello "
},
{
"type": "Element",
"start": 10,
"end": 35,
"type": "Element",
"name": "strong",
"attributes": [],
"children": [
{
"type": "MustacheTag",
"start": 18,
"end": 24,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 19,
@ -47,25 +47,25 @@
}
},
{
"type": "Text",
"start": 24,
"end": 26,
"type": "Text",
"raw": "! ",
"data": "! "
}
]
},
{
"type": "Element",
"start": 35,
"end": 60,
"type": "Element",
"name": "span",
"attributes": [],
"children": [
{
"type": "Text",
"start": 41,
"end": 53,
"type": "Text",
"raw": "How are you?",
"data": "How are you?"
}
@ -75,4 +75,4 @@
}
]
}
}
}

@ -26,4 +26,4 @@ export default function Class_state_field_constructor_assignment($$anchor, $$pro
}
$.pop();
}
}

@ -9,7 +9,7 @@ export default function Function_prop_no_getter($$anchor, $$props) {
let count = $.source(0);
function onmouseup() {
$.set(count, $.get(count) + 2);
$.set(count, $.proxy($.get(count) + 2));
}
/* Init */
@ -17,7 +17,7 @@ export default function Function_prop_no_getter($$anchor, $$props) {
var node = $.child_frag(fragment);
Button(node, {
onmousedown: () => $.set(count, $.get(count) + 1),
onmousedown: () => $.set(count, $.proxy($.get(count) + 1)),
onmouseup,
children: ($$anchor, $$slotProps) => {
/* Init */
@ -31,4 +31,4 @@ export default function Function_prop_no_getter($$anchor, $$props) {
$.close_frag($$anchor, fragment);
$.pop();
}
}

@ -25,4 +25,4 @@ export default function Function_prop_no_getter($$payload, $$props) {
$$payload.out += `${anchor}`;
$.pop();
}
}

@ -14,4 +14,4 @@ export default function Svelte_element($$anchor, $$props) {
$.element(node, () => $.get(tag));
$.close_frag($$anchor, fragment);
$.pop();
}
}

@ -24,4 +24,4 @@ export default function Svelte_element($$payload, $$props) {
$$payload.out += `${anchor}`;
$.bind_props($$props, { tag });
$.pop();
}
}
Loading…
Cancel
Save