mirror of https://github.com/sveltejs/svelte
commit
4cf2077ecb
@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
'svelte': patch
|
|
||||||
---
|
|
||||||
|
|
||||||
fix: avoid mutation validation for invalidate_inner_signals
|
|
||||||
@ -1,10 +1,10 @@
|
|||||||
import type { Scope } from '../scope.js';
|
import type { Scope } from '../scope.js';
|
||||||
import type { SvelteNode, ValidatedModuleCompileOptions } from '#compiler';
|
import type { AST, ValidatedModuleCompileOptions } from '#compiler';
|
||||||
import type { Analysis } from '../types.js';
|
import type { Analysis } from '../types.js';
|
||||||
|
|
||||||
export interface TransformState {
|
export interface TransformState {
|
||||||
readonly analysis: Analysis;
|
readonly analysis: Analysis;
|
||||||
readonly options: ValidatedModuleCompileOptions;
|
readonly options: ValidatedModuleCompileOptions;
|
||||||
readonly scope: Scope;
|
readonly scope: Scope;
|
||||||
readonly scopes: Map<SvelteNode, Scope>;
|
readonly scopes: Map<AST.SvelteNode, Scope>;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,25 +0,0 @@
|
|||||||
import { DEV } from 'esm-env';
|
|
||||||
import { FILENAME } from '../../../constants.js';
|
|
||||||
import { dev_current_component_function } from '../runtime.js';
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {number} [line]
|
|
||||||
* @param {number} [column]
|
|
||||||
*/
|
|
||||||
export function get_location(line, column) {
|
|
||||||
if (!DEV || line === undefined) return undefined;
|
|
||||||
|
|
||||||
var filename = dev_current_component_function?.[FILENAME];
|
|
||||||
var location = filename && `${filename}:${line}:${column}`;
|
|
||||||
|
|
||||||
return sanitize_location(location);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Prevent devtools trying to make `location` a clickable link by inserting a zero-width space
|
|
||||||
* @param {string | undefined} location
|
|
||||||
*/
|
|
||||||
export function sanitize_location(location) {
|
|
||||||
return location?.replace(/\//g, '/\u200b');
|
|
||||||
}
|
|
||||||
@ -0,0 +1,180 @@
|
|||||||
|
/** @import { Derived, Reaction, Signal, Value } from '#client' */
|
||||||
|
import { UNINITIALIZED } from '../../../constants.js';
|
||||||
|
import { snapshot } from '../../shared/clone.js';
|
||||||
|
import { define_property } from '../../shared/utils.js';
|
||||||
|
import { DERIVED, STATE_SYMBOL } from '../constants.js';
|
||||||
|
import { effect_tracking } from '../reactivity/effects.js';
|
||||||
|
import { active_reaction, captured_signals, set_captured_signals, untrack } from '../runtime.js';
|
||||||
|
|
||||||
|
/** @type { any } */
|
||||||
|
export let tracing_expressions = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param { Value } signal
|
||||||
|
* @param { { read: Error[] } } [entry]
|
||||||
|
*/
|
||||||
|
function log_entry(signal, entry) {
|
||||||
|
const debug = signal.debug;
|
||||||
|
const value = signal.v;
|
||||||
|
|
||||||
|
if (value === UNINITIALIZED) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (debug) {
|
||||||
|
var previous_captured_signals = captured_signals;
|
||||||
|
var captured = new Set();
|
||||||
|
set_captured_signals(captured);
|
||||||
|
try {
|
||||||
|
untrack(() => {
|
||||||
|
debug();
|
||||||
|
});
|
||||||
|
} finally {
|
||||||
|
set_captured_signals(previous_captured_signals);
|
||||||
|
}
|
||||||
|
if (captured.size > 0) {
|
||||||
|
for (const dep of captured) {
|
||||||
|
log_entry(dep);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const type = (signal.f & DERIVED) !== 0 ? '$derived' : '$state';
|
||||||
|
const current_reaction = /** @type {Reaction} */ (active_reaction);
|
||||||
|
const status =
|
||||||
|
signal.version > current_reaction.version || current_reaction.version === 0 ? 'dirty' : 'clean';
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.groupCollapsed(
|
||||||
|
`%c${type}`,
|
||||||
|
status !== 'clean'
|
||||||
|
? 'color: CornflowerBlue; font-weight: bold'
|
||||||
|
: 'color: grey; font-weight: bold',
|
||||||
|
typeof value === 'object' && STATE_SYMBOL in value ? snapshot(value, true) : value
|
||||||
|
);
|
||||||
|
|
||||||
|
if (type === '$derived') {
|
||||||
|
const deps = new Set(/** @type {Derived} */ (signal).deps);
|
||||||
|
for (const dep of deps) {
|
||||||
|
log_entry(dep);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (signal.created) {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.log(signal.created);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (signal.updated) {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.log(signal.updated);
|
||||||
|
}
|
||||||
|
|
||||||
|
const read = entry?.read;
|
||||||
|
|
||||||
|
if (read && read.length > 0) {
|
||||||
|
for (var stack of read) {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.log(stack);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.groupEnd();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @template T
|
||||||
|
* @param {() => string} label
|
||||||
|
* @param {() => T} fn
|
||||||
|
*/
|
||||||
|
export function trace(label, fn) {
|
||||||
|
var previously_tracing_expressions = tracing_expressions;
|
||||||
|
try {
|
||||||
|
tracing_expressions = { entries: new Map(), reaction: active_reaction };
|
||||||
|
|
||||||
|
var start = performance.now();
|
||||||
|
var value = fn();
|
||||||
|
var time = (performance.now() - start).toFixed(2);
|
||||||
|
|
||||||
|
if (!effect_tracking()) {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.log(`${label()} %cran outside of an effect (${time}ms)`, 'color: grey');
|
||||||
|
} else if (tracing_expressions.entries.size === 0) {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.log(`${label()} %cno reactive dependencies (${time}ms)`, 'color: grey');
|
||||||
|
} else {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.group(`${label()} %c(${time}ms)`, 'color: grey');
|
||||||
|
|
||||||
|
var entries = tracing_expressions.entries;
|
||||||
|
|
||||||
|
tracing_expressions = null;
|
||||||
|
|
||||||
|
for (const [signal, entry] of entries) {
|
||||||
|
log_entry(signal, entry);
|
||||||
|
}
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.groupEnd();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (previously_tracing_expressions !== null) {
|
||||||
|
for (const [signal, entry] of tracing_expressions.entries) {
|
||||||
|
var prev_entry = previously_tracing_expressions.get(signal);
|
||||||
|
|
||||||
|
if (prev_entry === undefined) {
|
||||||
|
previously_tracing_expressions.set(signal, entry);
|
||||||
|
} else {
|
||||||
|
prev_entry.read.push(...entry.read);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
|
} finally {
|
||||||
|
tracing_expressions = previously_tracing_expressions;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} label
|
||||||
|
*/
|
||||||
|
export function get_stack(label) {
|
||||||
|
let error = Error();
|
||||||
|
const stack = error.stack;
|
||||||
|
|
||||||
|
if (stack) {
|
||||||
|
const lines = stack.split('\n');
|
||||||
|
const new_lines = ['\n'];
|
||||||
|
|
||||||
|
for (let i = 0; i < lines.length; i++) {
|
||||||
|
const line = lines[i];
|
||||||
|
|
||||||
|
if (line === 'Error') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (line.includes('validate_each_keys')) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (line.includes('svelte/src/internal')) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
new_lines.push(line);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (new_lines.length === 1) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
define_property(error, 'stack', {
|
||||||
|
value: new_lines.join('\n')
|
||||||
|
});
|
||||||
|
|
||||||
|
define_property(error, 'name', {
|
||||||
|
// 'Error' suffix is required for stack traces to be rendered properly
|
||||||
|
value: `${label}Error`
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return error;
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
snapshot(target) {
|
||||||
|
const script = target.querySelector('script');
|
||||||
|
|
||||||
|
return {
|
||||||
|
script
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
@ -0,0 +1 @@
|
|||||||
|
<!--[--><!----><script>{}<!----></script><!----><!--]-->
|
||||||
@ -0,0 +1 @@
|
|||||||
|
<svelte:element this={"script"}>{"{}"}</svelte:element>
|
||||||
@ -1 +1,3 @@
|
|||||||
<div class=foo></div>
|
<div class=foo></div>
|
||||||
|
<a href=/>home</a>
|
||||||
|
<a href=/foo>home</a>
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
{#if }
|
||||||
|
{:else if }
|
||||||
|
{:else }
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
{#each }
|
||||||
|
{/each}
|
||||||
|
|
||||||
|
{#snippet }
|
||||||
|
{/snippet}
|
||||||
|
|
||||||
|
{#snippet foo}
|
||||||
|
{/snippet}
|
||||||
@ -0,0 +1,107 @@
|
|||||||
|
{
|
||||||
|
"html": {
|
||||||
|
"type": "Fragment",
|
||||||
|
"start": 0,
|
||||||
|
"end": 102,
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"type": "IfBlock",
|
||||||
|
"start": 0,
|
||||||
|
"end": 33,
|
||||||
|
"expression": {
|
||||||
|
"type": "Identifier",
|
||||||
|
"start": 5,
|
||||||
|
"end": 5,
|
||||||
|
"name": ""
|
||||||
|
},
|
||||||
|
"children": [],
|
||||||
|
"else": {
|
||||||
|
"type": "ElseBlock",
|
||||||
|
"start": 18,
|
||||||
|
"end": 28,
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"type": "IfBlock",
|
||||||
|
"start": 18,
|
||||||
|
"end": 33,
|
||||||
|
"expression": {
|
||||||
|
"type": "Identifier",
|
||||||
|
"start": 17,
|
||||||
|
"end": 17,
|
||||||
|
"name": ""
|
||||||
|
},
|
||||||
|
"children": [],
|
||||||
|
"else": {
|
||||||
|
"type": "ElseBlock",
|
||||||
|
"start": 27,
|
||||||
|
"end": 28,
|
||||||
|
"children": []
|
||||||
|
},
|
||||||
|
"elseif": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Text",
|
||||||
|
"start": 33,
|
||||||
|
"end": 35,
|
||||||
|
"raw": "\n\n",
|
||||||
|
"data": "\n\n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "EachBlock",
|
||||||
|
"start": 35,
|
||||||
|
"end": 51,
|
||||||
|
"children": [],
|
||||||
|
"context": null,
|
||||||
|
"expression": {
|
||||||
|
"type": "Identifier",
|
||||||
|
"start": 42,
|
||||||
|
"end": 42,
|
||||||
|
"name": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Text",
|
||||||
|
"start": 51,
|
||||||
|
"end": 53,
|
||||||
|
"raw": "\n\n",
|
||||||
|
"data": "\n\n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "SnippetBlock",
|
||||||
|
"start": 53,
|
||||||
|
"end": 75,
|
||||||
|
"expression": {
|
||||||
|
"type": "Identifier",
|
||||||
|
"start": 63,
|
||||||
|
"end": 63,
|
||||||
|
"name": ""
|
||||||
|
},
|
||||||
|
"parameters": [],
|
||||||
|
"children": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Text",
|
||||||
|
"start": 75,
|
||||||
|
"end": 77,
|
||||||
|
"raw": "\n\n",
|
||||||
|
"data": "\n\n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "SnippetBlock",
|
||||||
|
"start": 77,
|
||||||
|
"end": 102,
|
||||||
|
"expression": {
|
||||||
|
"type": "Identifier",
|
||||||
|
"start": 87,
|
||||||
|
"end": 90,
|
||||||
|
"name": "foo"
|
||||||
|
},
|
||||||
|
"parameters": [],
|
||||||
|
"children": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
<div {}></div>
|
||||||
|
<div foo={}></div>
|
||||||
|
|
||||||
|
<div foo={a.}></div>
|
||||||
|
<div foo={'hi}'.}></div>
|
||||||
|
<Component onclick={() => x.} />
|
||||||
|
|
||||||
|
<input bind:value={a.} />
|
||||||
|
|
||||||
|
asd{a.}asd
|
||||||
|
{foo[bar.]}
|
||||||
@ -0,0 +1,242 @@
|
|||||||
|
{
|
||||||
|
"html": {
|
||||||
|
"type": "Fragment",
|
||||||
|
"start": 0,
|
||||||
|
"end": 164,
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"type": "Element",
|
||||||
|
"start": 0,
|
||||||
|
"end": 14,
|
||||||
|
"name": "div",
|
||||||
|
"attributes": [
|
||||||
|
{
|
||||||
|
"type": "Attribute",
|
||||||
|
"start": 5,
|
||||||
|
"end": 7,
|
||||||
|
"name": "",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"type": "AttributeShorthand",
|
||||||
|
"start": 6,
|
||||||
|
"end": 6,
|
||||||
|
"expression": {
|
||||||
|
"start": 6,
|
||||||
|
"end": 6,
|
||||||
|
"type": "Identifier",
|
||||||
|
"name": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"children": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Text",
|
||||||
|
"start": 14,
|
||||||
|
"end": 15,
|
||||||
|
"raw": "\n",
|
||||||
|
"data": "\n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Element",
|
||||||
|
"start": 15,
|
||||||
|
"end": 33,
|
||||||
|
"name": "div",
|
||||||
|
"attributes": [
|
||||||
|
{
|
||||||
|
"type": "Attribute",
|
||||||
|
"start": 20,
|
||||||
|
"end": 26,
|
||||||
|
"name": "foo",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"type": "MustacheTag",
|
||||||
|
"start": 24,
|
||||||
|
"end": 26,
|
||||||
|
"expression": {
|
||||||
|
"type": "Identifier",
|
||||||
|
"start": 25,
|
||||||
|
"end": 25,
|
||||||
|
"name": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"children": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Text",
|
||||||
|
"start": 33,
|
||||||
|
"end": 35,
|
||||||
|
"raw": "\n\n",
|
||||||
|
"data": "\n\n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Element",
|
||||||
|
"start": 35,
|
||||||
|
"end": 55,
|
||||||
|
"name": "div",
|
||||||
|
"attributes": [
|
||||||
|
{
|
||||||
|
"type": "Attribute",
|
||||||
|
"start": 40,
|
||||||
|
"end": 48,
|
||||||
|
"name": "foo",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"type": "MustacheTag",
|
||||||
|
"start": 44,
|
||||||
|
"end": 48,
|
||||||
|
"expression": {
|
||||||
|
"type": "Identifier",
|
||||||
|
"start": 45,
|
||||||
|
"end": 47,
|
||||||
|
"name": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"children": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Text",
|
||||||
|
"start": 55,
|
||||||
|
"end": 56,
|
||||||
|
"raw": "\n",
|
||||||
|
"data": "\n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Element",
|
||||||
|
"start": 56,
|
||||||
|
"end": 80,
|
||||||
|
"name": "div",
|
||||||
|
"attributes": [
|
||||||
|
{
|
||||||
|
"type": "Attribute",
|
||||||
|
"start": 61,
|
||||||
|
"end": 73,
|
||||||
|
"name": "foo",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"type": "MustacheTag",
|
||||||
|
"start": 65,
|
||||||
|
"end": 73,
|
||||||
|
"expression": {
|
||||||
|
"type": "Identifier",
|
||||||
|
"start": 66,
|
||||||
|
"end": 72,
|
||||||
|
"name": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"children": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Text",
|
||||||
|
"start": 80,
|
||||||
|
"end": 81,
|
||||||
|
"raw": "\n",
|
||||||
|
"data": "\n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "InlineComponent",
|
||||||
|
"start": 81,
|
||||||
|
"end": 113,
|
||||||
|
"name": "Component",
|
||||||
|
"attributes": [
|
||||||
|
{
|
||||||
|
"type": "Attribute",
|
||||||
|
"start": 92,
|
||||||
|
"end": 110,
|
||||||
|
"name": "onclick",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"type": "MustacheTag",
|
||||||
|
"start": 100,
|
||||||
|
"end": 110,
|
||||||
|
"expression": {
|
||||||
|
"type": "Identifier",
|
||||||
|
"start": 101,
|
||||||
|
"end": 109,
|
||||||
|
"name": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"children": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Text",
|
||||||
|
"start": 113,
|
||||||
|
"end": 115,
|
||||||
|
"raw": "\n\n",
|
||||||
|
"data": "\n\n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Element",
|
||||||
|
"start": 115,
|
||||||
|
"end": 140,
|
||||||
|
"name": "input",
|
||||||
|
"attributes": [
|
||||||
|
{
|
||||||
|
"start": 122,
|
||||||
|
"end": 137,
|
||||||
|
"type": "Binding",
|
||||||
|
"name": "value",
|
||||||
|
"expression": {
|
||||||
|
"type": "Identifier",
|
||||||
|
"start": 134,
|
||||||
|
"end": 136,
|
||||||
|
"name": ""
|
||||||
|
},
|
||||||
|
"modifiers": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"children": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Text",
|
||||||
|
"start": 140,
|
||||||
|
"end": 145,
|
||||||
|
"raw": "\n\nasd",
|
||||||
|
"data": "\n\nasd"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "MustacheTag",
|
||||||
|
"start": 145,
|
||||||
|
"end": 149,
|
||||||
|
"expression": {
|
||||||
|
"type": "Identifier",
|
||||||
|
"start": 146,
|
||||||
|
"end": 148,
|
||||||
|
"name": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Text",
|
||||||
|
"start": 149,
|
||||||
|
"end": 153,
|
||||||
|
"raw": "asd\n",
|
||||||
|
"data": "asd\n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "MustacheTag",
|
||||||
|
"start": 153,
|
||||||
|
"end": 164,
|
||||||
|
"expression": {
|
||||||
|
"type": "Identifier",
|
||||||
|
"start": 154,
|
||||||
|
"end": 163,
|
||||||
|
"name": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
<div>
|
||||||
|
{#if foo}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Comp>
|
||||||
|
{#key bar}
|
||||||
|
</Comp>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
{#if foo}
|
||||||
|
{#if bar}
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{#if foo}
|
||||||
|
{#key bar}
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
{#each x as y}
|
||||||
|
<p>hi</p>
|
||||||
@ -0,0 +1,276 @@
|
|||||||
|
{
|
||||||
|
"html": {
|
||||||
|
"type": "Fragment",
|
||||||
|
"start": 0,
|
||||||
|
"end": 150,
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"type": "Element",
|
||||||
|
"start": 0,
|
||||||
|
"end": 23,
|
||||||
|
"name": "div",
|
||||||
|
"attributes": [],
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"type": "Text",
|
||||||
|
"start": 5,
|
||||||
|
"end": 7,
|
||||||
|
"raw": "\n\t",
|
||||||
|
"data": "\n\t"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "IfBlock",
|
||||||
|
"start": 7,
|
||||||
|
"end": 17,
|
||||||
|
"expression": {
|
||||||
|
"type": "Identifier",
|
||||||
|
"start": 12,
|
||||||
|
"end": 15,
|
||||||
|
"loc": {
|
||||||
|
"start": {
|
||||||
|
"line": 2,
|
||||||
|
"column": 6
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 2,
|
||||||
|
"column": 9
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"name": "foo"
|
||||||
|
},
|
||||||
|
"children": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Text",
|
||||||
|
"start": 23,
|
||||||
|
"end": 25,
|
||||||
|
"raw": "\n\n",
|
||||||
|
"data": "\n\n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "InlineComponent",
|
||||||
|
"start": 25,
|
||||||
|
"end": 51,
|
||||||
|
"name": "Comp",
|
||||||
|
"attributes": [],
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"type": "Text",
|
||||||
|
"start": 31,
|
||||||
|
"end": 33,
|
||||||
|
"raw": "\n\t",
|
||||||
|
"data": "\n\t"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "KeyBlock",
|
||||||
|
"start": 33,
|
||||||
|
"end": 44,
|
||||||
|
"expression": {
|
||||||
|
"type": "Identifier",
|
||||||
|
"start": 39,
|
||||||
|
"end": 42,
|
||||||
|
"loc": {
|
||||||
|
"start": {
|
||||||
|
"line": 6,
|
||||||
|
"column": 7
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 6,
|
||||||
|
"column": 10
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"name": "bar"
|
||||||
|
},
|
||||||
|
"children": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Text",
|
||||||
|
"start": 51,
|
||||||
|
"end": 53,
|
||||||
|
"raw": "\n\n",
|
||||||
|
"data": "\n\n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Element",
|
||||||
|
"start": 53,
|
||||||
|
"end": 95,
|
||||||
|
"name": "div",
|
||||||
|
"attributes": [],
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"type": "Text",
|
||||||
|
"start": 58,
|
||||||
|
"end": 60,
|
||||||
|
"raw": "\n\t",
|
||||||
|
"data": "\n\t"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "IfBlock",
|
||||||
|
"start": 60,
|
||||||
|
"end": 89,
|
||||||
|
"expression": {
|
||||||
|
"type": "Identifier",
|
||||||
|
"start": 65,
|
||||||
|
"end": 68,
|
||||||
|
"loc": {
|
||||||
|
"start": {
|
||||||
|
"line": 10,
|
||||||
|
"column": 6
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 10,
|
||||||
|
"column": 9
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"name": "foo"
|
||||||
|
},
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"type": "IfBlock",
|
||||||
|
"start": 72,
|
||||||
|
"end": 88,
|
||||||
|
"expression": {
|
||||||
|
"type": "Identifier",
|
||||||
|
"start": 77,
|
||||||
|
"end": 80,
|
||||||
|
"loc": {
|
||||||
|
"start": {
|
||||||
|
"line": 11,
|
||||||
|
"column": 7
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 11,
|
||||||
|
"column": 10
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"name": "bar"
|
||||||
|
},
|
||||||
|
"children": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Text",
|
||||||
|
"start": 95,
|
||||||
|
"end": 97,
|
||||||
|
"raw": "\n\n",
|
||||||
|
"data": "\n\n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "IfBlock",
|
||||||
|
"start": 97,
|
||||||
|
"end": 124,
|
||||||
|
"expression": {
|
||||||
|
"type": "Identifier",
|
||||||
|
"start": 102,
|
||||||
|
"end": 105,
|
||||||
|
"loc": {
|
||||||
|
"start": {
|
||||||
|
"line": 15,
|
||||||
|
"column": 5
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 15,
|
||||||
|
"column": 8
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"name": "foo"
|
||||||
|
},
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"type": "KeyBlock",
|
||||||
|
"start": 108,
|
||||||
|
"end": 119,
|
||||||
|
"expression": {
|
||||||
|
"type": "Identifier",
|
||||||
|
"start": 114,
|
||||||
|
"end": 117,
|
||||||
|
"loc": {
|
||||||
|
"start": {
|
||||||
|
"line": 16,
|
||||||
|
"column": 7
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 16,
|
||||||
|
"column": 10
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"name": "bar"
|
||||||
|
},
|
||||||
|
"children": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Text",
|
||||||
|
"start": 124,
|
||||||
|
"end": 126,
|
||||||
|
"raw": "\n\n",
|
||||||
|
"data": "\n\n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "EachBlock",
|
||||||
|
"start": 126,
|
||||||
|
"end": 150,
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"type": "Element",
|
||||||
|
"start": 141,
|
||||||
|
"end": 150,
|
||||||
|
"name": "p",
|
||||||
|
"attributes": [],
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"type": "Text",
|
||||||
|
"start": 144,
|
||||||
|
"end": 146,
|
||||||
|
"raw": "hi",
|
||||||
|
"data": "hi"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"context": {
|
||||||
|
"type": "Identifier",
|
||||||
|
"name": "y",
|
||||||
|
"start": 138,
|
||||||
|
"loc": {
|
||||||
|
"start": {
|
||||||
|
"line": 19,
|
||||||
|
"column": 12,
|
||||||
|
"character": 138
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 19,
|
||||||
|
"column": 13,
|
||||||
|
"character": 139
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"end": 139
|
||||||
|
},
|
||||||
|
"expression": {
|
||||||
|
"type": "Identifier",
|
||||||
|
"start": 133,
|
||||||
|
"end": 134,
|
||||||
|
"loc": {
|
||||||
|
"start": {
|
||||||
|
"line": 19,
|
||||||
|
"column": 7
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 19,
|
||||||
|
"column": 8
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"name": "x"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue