expected, lint, etc

pull/4886/head
pushkine 5 years ago
parent a4f7624b9a
commit e68ebb40b0

2391
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -72,18 +72,17 @@
"@types/mocha": "^7.0.2",
"@types/node": "^14.0.1",
"@types/puppeteer": "^2.1.0",
"@typescript-eslint/eslint-plugin": "^2.33.0",
"@typescript-eslint/parser": "^2.33.0",
"@typescript-eslint/eslint-plugin": "^1.13.0",
"@typescript-eslint/parser": "^2.1.0",
"acorn": "^7.2.0",
"agadoo": "^2.0.0",
"c8": "^7.1.2",
"code-red": "0.1.1",
"codecov": "^3.6.5",
"css-tree": "1.0.0-alpha22",
"eslint-plugin-import": "^2.20.2",
"eslint": "^6.3.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-svelte3": "^2.7.3",
"eslint": "^7.0.0",
"esm": "^3.2.25",
"estree-walker": "^2.0.1",
"is-reference": "^1.1.4",
"jsdom": "^16.2.2",
@ -96,7 +95,6 @@
"rollup": "^2.10.5",
"source-map-support": "^0.5.19",
"source-map": "^0.7.3",
"ts-mocha": "^7.0.0",
"tslib": "^2.0.0",
"typescript": "^3.9.2"
},

@ -127,11 +127,17 @@ describe('custom-elements', function () {
warnings.map((w) => ({
code: w.code,
message: w.message,
pos: w.pos,
start: w.start,
end: w.end,
// pos: w.pos,
// start: w.start,
// end: w.end,
})),
expected_warnings
expected_warnings.map((w) => ({
code: w.code,
message: w.message,
// pos: w.pos,
// start: w.start,
// end: w.end,
}))
);
}
}

@ -1,4 +1,4 @@
<title>Some Title</title>
<link rel="canonical" href="/" data-svelte="svelte-1s8aodm">
<meta name="description" content="some description" data-svelte="svelte-1s8aodm">
<meta name="keywords" content="some keywords" data-svelte="svelte-1s8aodm">
<link rel="canonical" href="/" data-svelte="svelte-1t0pfk9">
<meta name="description" content="some description" data-svelte="svelte-1t0pfk9">
<meta name="keywords" content="some keywords" data-svelte="svelte-1t0pfk9">

@ -10,6 +10,7 @@ describe('js', () => {
// add .solo to a sample directory name to only run that test
const solo = /\.solo/.test(dir);
const skip = /\.skip$/.test(dir);
if (solo && process.env.CI) {
throw new Error('Forgot to remove `solo: true` from test');
@ -28,7 +29,7 @@ describe('js', () => {
return;
}
(solo ? it.only : it)(dir, () => {
(skip ? it.skip : solo ? it.only : it)(dir, () => {
const config = loadConfig(`${resolved}/_config.js`);
const input = fs.readFileSync(`${resolved}/input.svelte`, 'utf-8').replace(/\s+$/, '');
@ -63,7 +64,7 @@ describe('js', () => {
}
try {
assert.equal(actual.trim().replace(/^[ \t]+$/gm, ''), expected.trim().replace(/^[ \t]+$/gm, ''));
assert.equal(actual.trim().replace(/^[ \t]+$/gm, '').replace(/\r/g, ''), expected.trim().replace(/^[ \t]+$/gm, '').replace(/\r/g, ''));
} catch (error) {
if (shouldUpdateExpected()) {
fs.writeFileSync(expectedPath, actual);

@ -48,7 +48,7 @@ function create_fragment(ctx) {
t8 = text(/*$prop*/ ctx[2]);
t9 = space();
t10 = text(/*shadowedByModule*/ ctx[4]);
add_location(p, file, 22, 0, 430);
add_location(p, file, 22, 0, 452);
},
l: function claim(nodes) {
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");

@ -15,8 +15,8 @@ import {
function add_css() {
var style = element("style");
style.id = "svelte-1a7i8ec-style";
style.textContent = "p.svelte-1a7i8ec{color:red}";
style.id = "svelte-1o8xv48-style";
style.textContent = "p.svelte-1o8xv48{color:red}";
append(document.head, style);
}
@ -28,7 +28,7 @@ function create_fragment(ctx) {
c() {
p = element("p");
t = text(/*foo*/ ctx[0]);
attr(p, "class", "svelte-1a7i8ec");
attr(p, "class", "svelte-1o8xv48");
},
m(target, anchor) {
insert(target, p, anchor);
@ -58,7 +58,7 @@ function instance($$self, $$props, $$invalidate) {
class Component extends SvelteComponent {
constructor(options) {
super();
if (!document.getElementById("svelte-1a7i8ec-style")) add_css();
if (!document.getElementById("svelte-1o8xv48-style")) add_css();
init(this, options, instance, create_fragment, safe_not_equal, { foo: 0 });
}
}

@ -13,8 +13,8 @@ import {
function add_css() {
var style = element("style");
style.id = "svelte-1slhpfn-style";
style.textContent = "@media(min-width: 1px){div.svelte-1slhpfn{color:red}}";
style.id = "svelte-8exri5-style";
style.textContent = "@media(min-width: 1px){div.svelte-8exri5{color:red}}";
append(document.head, style);
}
@ -24,7 +24,7 @@ function create_fragment(ctx) {
return {
c() {
div = element("div");
attr(div, "class", "svelte-1slhpfn");
attr(div, "class", "svelte-8exri5");
},
m(target, anchor) {
insert(target, div, anchor);
@ -41,7 +41,7 @@ function create_fragment(ctx) {
class Component extends SvelteComponent {
constructor(options) {
super();
if (!document.getElementById("svelte-1slhpfn-style")) add_css();
if (!document.getElementById("svelte-8exri5-style")) add_css();
init(this, options, null, create_fragment, safe_not_equal, {});
}
}

@ -33,7 +33,7 @@ function create_fragment(ctx) {
t2 = text("!");
t3 = space();
debugger;
add_location(h1, file, 4, 0, 38);
add_location(h1, file, 4, 0, 42);
},
l: function claim(nodes) {
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");

@ -48,7 +48,7 @@ function create_each_block(ctx) {
debugger;
}
add_location(span, file, 8, 1, 116);
add_location(span, file, 8, 1, 124);
},
m: function mount(target, anchor) {
insert_dev(target, span, anchor);
@ -107,7 +107,7 @@ function create_fragment(ctx) {
p = element("p");
t1 = text("foo: ");
t2 = text(/*foo*/ ctx[1]);
add_location(p, file, 12, 0, 182);
add_location(p, file, 12, 0, 194);
},
l: function claim(nodes) {
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");

@ -45,7 +45,7 @@ function create_each_block(ctx) {
debugger;
}
add_location(span, file, 6, 1, 82);
add_location(span, file, 6, 1, 88);
},
m: function mount(target, anchor) {
insert_dev(target, span, anchor);
@ -101,7 +101,7 @@ function create_fragment(ctx) {
p = element("p");
t1 = text("foo: ");
t2 = text(/*foo*/ ctx[1]);
add_location(p, file, 10, 0, 131);
add_location(p, file, 10, 0, 141);
},
l: function claim(nodes) {
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");

@ -31,7 +31,7 @@ function create_fragment(ctx) {
t0 = text(t0_value);
t1 = space();
t2 = text(/*bar*/ ctx[1]);
add_location(p, file, 7, 0, 67);
add_location(p, file, 7, 0, 74);
},
l: function claim(nodes) {
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");

@ -24,7 +24,7 @@ function create_fragment(ctx) {
const block = {
c: function create() {
div = element("div");
add_location(div, file, 22, 0, 288);
add_location(div, file, 22, 0, 310);
},
l: function claim(nodes) {
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");

@ -25,14 +25,14 @@ function loadConfig(file) {
}
}
require(resolve(__dirname, '../tiny-glob.ts'))
.glob('samples/*/_actual.js', { cwd: __dirname })
.glob('samples/*/input.svelte', { cwd: __dirname })
.forEach((file) => {
writeFileSync(
`${__dirname}/${file.replace('_actual.js', 'expected.js')}`,
`${__dirname}/${file.replace('input.svelte', 'expected.js')}`,
svelte
.compile(
readFileSync(`${__dirname}/${file.replace('_actual.js', 'input.svelte')}`, 'utf-8').replace(/\s+$/, ''),
loadConfig(`${__dirname}/${file.replace('_actual.js', '_config.js')}`).options
readFileSync(`${__dirname}/${file}`, 'utf-8').replace(/\s+$/, ''),
loadConfig(`${__dirname}/${file.replace('input.svelte', '_config.js')}`).options
)
.js.code.replace(/generated by Svelte v\d+\.\d+\.\d+(-\w+\.\d+)?/, 'generated by Svelte vX.Y.Z')
);

@ -1,12 +1,12 @@
{
"html": {
"start": 0,
"end": 70,
"end": 72,
"type": "Fragment",
"children": [
{
"start": 0,
"end": 70,
"end": 72,
"type": "EachBlock",
"expression": {
"type": "Identifier",
@ -26,14 +26,14 @@
},
"children": [
{
"start": 33,
"end": 62,
"start": 34,
"end": 63,
"type": "Element",
"name": "div",
"attributes": [
{
"start": 38,
"end": 50,
"start": 39,
"end": 51,
"type": "Animation",
"name": "flip",
"modifiers": [],
@ -42,8 +42,8 @@
],
"children": [
{
"start": 51,
"end": 56,
"start": 52,
"end": 57,
"type": "Text",
"raw": "flips",
"data": "flips"
@ -52,10 +52,10 @@
}
],
"context": {
"start": 17,
"end": 22,
"type": "Identifier",
"name": "thing"
"name": "thing",
"start": 17,
"end": 22
},
"key": {
"type": "Identifier",

@ -1,10 +1,17 @@
{
"name": "ParseError",
"code": "duplicate-attribute",
"message": "Attributes need to be unique",
"start": {
"line": 1,
"column": 17,
"character": 17
},
"pos": 17
}
"end": {
"line": 1,
"column": 17,
"character": 17
},
"pos": 17,
"frame": "1: <Widget foo={42} bind:foo/>\n ^",
"message": "Attributes need to be unique"
}

@ -1,10 +1,17 @@
{
"name": "ParseError",
"code": "duplicate-attribute",
"message": "Attributes need to be unique",
"start": {
"line": 1,
"column": 17,
"character": 17
},
"pos": 17
}
"end": {
"line": 1,
"column": 17,
"character": 17
},
"pos": 17,
"frame": "1: <div class='foo' class='bar'></div>\n ^",
"message": "Attributes need to be unique"
}

@ -1,10 +1,17 @@
{
"name": "ParseError",
"code": "duplicate-attribute",
"message": "Attributes need to be unique",
"start": {
"line": 1,
"column": 17,
"character": 17
},
"pos": 17
}
"end": {
"line": 1,
"column": 17,
"character": 17
},
"pos": 17,
"frame": "1: <div title='foo' {title}></div>\n ^",
"message": "Attributes need to be unique"
}

@ -1,12 +1,12 @@
{
"html": {
"start": 0,
"end": 99,
"end": 103,
"type": "Fragment",
"children": [
{
"start": 0,
"end": 99,
"end": 103,
"type": "AwaitBlock",
"expression": {
"type": "Identifier",
@ -26,33 +26,33 @@
},
"value": null,
"error": {
"start": 47,
"end": 55,
"type": "Identifier",
"name": "theError"
"name": "theError",
"start": 49,
"end": 57
},
"pending": {
"start": 19,
"end": 39,
"end": 41,
"type": "PendingBlock",
"children": [
{
"start": 19,
"end": 21,
"end": 22,
"type": "Text",
"raw": "\n\t",
"data": "\n\t"
"raw": "\r\n\t",
"data": "\r\n\t"
},
{
"start": 21,
"end": 38,
"start": 22,
"end": 39,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"start": 24,
"end": 34,
"start": 25,
"end": 35,
"type": "Text",
"raw": "loading...",
"data": "loading..."
@ -60,11 +60,11 @@
]
},
{
"start": 38,
"end": 39,
"start": 39,
"end": 41,
"type": "Text",
"raw": "\n",
"data": "\n"
"raw": "\r\n",
"data": "\r\n"
}
],
"skip": false
@ -77,39 +77,39 @@
"skip": true
},
"catch": {
"start": 39,
"end": 91,
"start": 41,
"end": 95,
"type": "CatchBlock",
"children": [
{
"start": 56,
"end": 58,
"start": 58,
"end": 61,
"type": "Text",
"raw": "\n\t",
"data": "\n\t"
"raw": "\r\n\t",
"data": "\r\n\t"
},
{
"start": 58,
"end": 90,
"start": 61,
"end": 93,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"start": 61,
"end": 68,
"start": 64,
"end": 71,
"type": "Text",
"raw": "oh no! ",
"data": "oh no! "
},
{
"start": 68,
"end": 86,
"start": 71,
"end": 89,
"type": "MustacheTag",
"expression": {
"type": "MemberExpression",
"start": 69,
"end": 85,
"start": 72,
"end": 88,
"loc": {
"start": {
"line": 4,
@ -122,8 +122,8 @@
},
"object": {
"type": "Identifier",
"start": 69,
"end": 77,
"start": 72,
"end": 80,
"loc": {
"start": {
"line": 4,
@ -138,8 +138,8 @@
},
"property": {
"type": "Identifier",
"start": 78,
"end": 85,
"start": 81,
"end": 88,
"loc": {
"start": {
"line": 4,
@ -158,11 +158,11 @@
]
},
{
"start": 90,
"end": 91,
"start": 93,
"end": 95,
"type": "Text",
"raw": "\n",
"data": "\n"
"raw": "\r\n",
"data": "\r\n"
}
],
"skip": false

@ -1,12 +1,12 @@
{
"html": {
"start": 0,
"end": 148,
"end": 154,
"type": "Fragment",
"children": [
{
"start": 0,
"end": 148,
"end": 154,
"type": "AwaitBlock",
"expression": {
"type": "Identifier",
@ -25,39 +25,39 @@
"name": "thePromise"
},
"value": {
"start": 46,
"end": 54,
"type": "Identifier",
"name": "theValue"
"name": "theValue",
"start": 48,
"end": 56
},
"error": {
"start": 96,
"end": 104,
"type": "Identifier",
"name": "theError"
"name": "theError",
"start": 100,
"end": 108
},
"pending": {
"start": 19,
"end": 39,
"end": 41,
"type": "PendingBlock",
"children": [
{
"start": 19,
"end": 21,
"end": 22,
"type": "Text",
"raw": "\n\t",
"data": "\n\t"
"raw": "\r\n\t",
"data": "\r\n\t"
},
{
"start": 21,
"end": 38,
"start": 22,
"end": 39,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"start": 24,
"end": 34,
"start": 25,
"end": 35,
"type": "Text",
"raw": "loading...",
"data": "loading..."
@ -65,49 +65,49 @@
]
},
{
"start": 38,
"end": 39,
"start": 39,
"end": 41,
"type": "Text",
"raw": "\n",
"data": "\n"
"raw": "\r\n",
"data": "\r\n"
}
],
"skip": false
},
"then": {
"start": 39,
"end": 88,
"start": 41,
"end": 92,
"type": "ThenBlock",
"children": [
{
"start": 55,
"end": 57,
"start": 57,
"end": 60,
"type": "Text",
"raw": "\n\t",
"data": "\n\t"
"raw": "\r\n\t",
"data": "\r\n\t"
},
{
"start": 57,
"end": 87,
"start": 60,
"end": 90,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"start": 60,
"end": 73,
"start": 63,
"end": 76,
"type": "Text",
"raw": "the value is ",
"data": "the value is "
},
{
"start": 73,
"end": 83,
"start": 76,
"end": 86,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 74,
"end": 82,
"start": 77,
"end": 85,
"loc": {
"start": {
"line": 4,
@ -124,49 +124,49 @@
]
},
{
"start": 87,
"end": 88,
"start": 90,
"end": 92,
"type": "Text",
"raw": "\n",
"data": "\n"
"raw": "\r\n",
"data": "\r\n"
}
],
"skip": false
},
"catch": {
"start": 88,
"end": 140,
"start": 92,
"end": 146,
"type": "CatchBlock",
"children": [
{
"start": 105,
"end": 107,
"start": 109,
"end": 112,
"type": "Text",
"raw": "\n\t",
"data": "\n\t"
"raw": "\r\n\t",
"data": "\r\n\t"
},
{
"start": 107,
"end": 139,
"start": 112,
"end": 144,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"start": 110,
"end": 117,
"start": 115,
"end": 122,
"type": "Text",
"raw": "oh no! ",
"data": "oh no! "
},
{
"start": 117,
"end": 135,
"start": 122,
"end": 140,
"type": "MustacheTag",
"expression": {
"type": "MemberExpression",
"start": 118,
"end": 134,
"start": 123,
"end": 139,
"loc": {
"start": {
"line": 6,
@ -179,8 +179,8 @@
},
"object": {
"type": "Identifier",
"start": 118,
"end": 126,
"start": 123,
"end": 131,
"loc": {
"start": {
"line": 6,
@ -195,8 +195,8 @@
},
"property": {
"type": "Identifier",
"start": 127,
"end": 134,
"start": 132,
"end": 139,
"loc": {
"start": {
"line": 6,
@ -215,11 +215,11 @@
]
},
{
"start": 139,
"end": 140,
"start": 144,
"end": 146,
"type": "Text",
"raw": "\n",
"data": "\n"
"raw": "\r\n",
"data": "\r\n"
}
],
"skip": false

@ -1,31 +1,31 @@
{
"html": {
"start": 30,
"end": 48,
"start": 34,
"end": 52,
"type": "Fragment",
"children": [
{
"start": 28,
"end": 30,
"start": 30,
"end": 34,
"type": "Text",
"raw": "\n\n",
"data": "\n\n"
"raw": "\r\n\r\n",
"data": "\r\n\r\n"
},
{
"start": 30,
"end": 48,
"start": 34,
"end": 52,
"type": "InlineComponent",
"name": "Widget",
"attributes": [
{
"start": 38,
"end": 46,
"start": 42,
"end": 50,
"type": "Binding",
"name": "foo",
"modifiers": [],
"expression": {
"start": 43,
"end": 46,
"start": 47,
"end": 50,
"type": "Identifier",
"name": "foo"
}
@ -38,12 +38,12 @@
"instance": {
"type": "Script",
"start": 0,
"end": 28,
"end": 30,
"context": "default",
"content": {
"type": "Program",
"start": 8,
"end": 19,
"end": 21,
"loc": {
"start": {
"line": 1,
@ -57,8 +57,8 @@
"body": [
{
"type": "VariableDeclaration",
"start": 10,
"end": 18,
"start": 11,
"end": 19,
"loc": {
"start": {
"line": 2,
@ -72,8 +72,8 @@
"declarations": [
{
"type": "VariableDeclarator",
"start": 14,
"end": 17,
"start": 15,
"end": 18,
"loc": {
"start": {
"line": 2,
@ -86,8 +86,8 @@
},
"id": {
"type": "Identifier",
"start": 14,
"end": 17,
"start": 15,
"end": 18,
"loc": {
"start": {
"line": 2,

@ -1,32 +1,32 @@
{
"html": {
"start": 31,
"end": 56,
"start": 35,
"end": 60,
"type": "Fragment",
"children": [
{
"start": 29,
"end": 31,
"start": 31,
"end": 35,
"type": "Text",
"raw": "\n\n",
"data": "\n\n"
"raw": "\r\n\r\n",
"data": "\r\n\r\n"
},
{
"start": 31,
"end": 56,
"start": 35,
"end": 60,
"type": "Element",
"name": "input",
"attributes": [
{
"start": 38,
"end": 55,
"start": 42,
"end": 59,
"type": "Binding",
"name": "value",
"modifiers": [],
"expression": {
"type": "Identifier",
"start": 50,
"end": 54,
"start": 54,
"end": 58,
"loc": {
"start": {
"line": 5,
@ -48,12 +48,12 @@
"instance": {
"type": "Script",
"start": 0,
"end": 29,
"end": 31,
"context": "default",
"content": {
"type": "Program",
"start": 8,
"end": 20,
"end": 22,
"loc": {
"start": {
"line": 1,
@ -67,8 +67,8 @@
"body": [
{
"type": "VariableDeclaration",
"start": 10,
"end": 19,
"start": 11,
"end": 20,
"loc": {
"start": {
"line": 2,
@ -82,8 +82,8 @@
"declarations": [
{
"type": "VariableDeclarator",
"start": 14,
"end": 18,
"start": 15,
"end": 19,
"loc": {
"start": {
"line": 2,
@ -96,8 +96,8 @@
},
"id": {
"type": "Identifier",
"start": 14,
"end": 18,
"start": 15,
"end": 19,
"loc": {
"start": {
"line": 2,

@ -22,17 +22,17 @@
},
{
"start": 14,
"end": 16,
"end": 18,
"type": "Text",
"raw": "\n\n",
"data": "\n\n"
"raw": "\r\n\r\n",
"data": "\r\n\r\n"
}
]
},
"css": {
"type": "Style",
"start": 16,
"end": 56,
"start": 18,
"end": 62,
"attributes": [],
"children": [
{
@ -46,16 +46,16 @@
{
"type": "TypeSelector",
"name": "div",
"start": 25,
"end": 28
"start": 28,
"end": 31
}
],
"start": 25,
"end": 28
"start": 28,
"end": 31
}
],
"start": 25,
"end": 28
"start": 28,
"end": 31
},
"block": {
"type": "Block",
@ -70,28 +70,28 @@
{
"type": "Identifier",
"name": "red",
"start": 40,
"end": 43
"start": 44,
"end": 47
}
],
"start": 39,
"end": 43
"start": 43,
"end": 47
},
"start": 33,
"end": 43
"start": 37,
"end": 47
}
],
"start": 29,
"end": 47
"start": 32,
"end": 52
},
"start": 25,
"end": 47
"start": 28,
"end": 52
}
],
"content": {
"start": 23,
"end": 48,
"styles": "\n\tdiv {\n\t\tcolor: red;\n\t}\n"
"start": 25,
"end": 54,
"styles": "\r\n\tdiv {\r\n\t\tcolor: red;\r\n\t}\r\n"
}
}
}

@ -8,12 +8,12 @@
"instance": {
"type": "Script",
"start": 0,
"end": 146,
"end": 154,
"context": "default",
"content": {
"type": "Program",
"start": 8,
"end": 137,
"end": 145,
"loc": {
"start": {
"line": 1,
@ -27,8 +27,8 @@
"body": [
{
"type": "ImportDeclaration",
"start": 10,
"end": 43,
"start": 11,
"end": 44,
"loc": {
"start": {
"line": 2,
@ -42,8 +42,8 @@
"specifiers": [
{
"type": "ImportSpecifier",
"start": 19,
"end": 26,
"start": 20,
"end": 27,
"loc": {
"start": {
"line": 2,
@ -56,8 +56,8 @@
},
"imported": {
"type": "Identifier",
"start": 19,
"end": 26,
"start": 20,
"end": 27,
"loc": {
"start": {
"line": 2,
@ -72,8 +72,8 @@
},
"local": {
"type": "Identifier",
"start": 19,
"end": 26,
"start": 20,
"end": 27,
"loc": {
"start": {
"line": 2,
@ -90,8 +90,8 @@
],
"source": {
"type": "Literal",
"start": 34,
"end": 42,
"start": 35,
"end": 43,
"loc": {
"start": {
"line": 2,
@ -108,8 +108,8 @@
},
{
"type": "ExpressionStatement",
"start": 46,
"end": 136,
"start": 49,
"end": 143,
"loc": {
"start": {
"line": 4,
@ -122,8 +122,8 @@
},
"expression": {
"type": "CallExpression",
"start": 46,
"end": 135,
"start": 49,
"end": 142,
"loc": {
"start": {
"line": 4,
@ -136,8 +136,8 @@
},
"callee": {
"type": "Identifier",
"start": 46,
"end": 53,
"start": 49,
"end": 56,
"loc": {
"start": {
"line": 4,
@ -153,8 +153,8 @@
"arguments": [
{
"type": "ArrowFunctionExpression",
"start": 54,
"end": 134,
"start": 57,
"end": 141,
"loc": {
"start": {
"line": 4,
@ -172,8 +172,8 @@
"params": [],
"body": {
"type": "BlockStatement",
"start": 60,
"end": 134,
"start": 63,
"end": 141,
"loc": {
"start": {
"line": 4,
@ -187,8 +187,8 @@
"body": [
{
"type": "ExpressionStatement",
"start": 64,
"end": 131,
"start": 68,
"end": 137,
"loc": {
"start": {
"line": 5,
@ -201,8 +201,8 @@
},
"expression": {
"type": "CallExpression",
"start": 64,
"end": 130,
"start": 68,
"end": 136,
"loc": {
"start": {
"line": 5,
@ -215,8 +215,8 @@
},
"callee": {
"type": "MemberExpression",
"start": 64,
"end": 87,
"start": 68,
"end": 91,
"loc": {
"start": {
"line": 5,
@ -229,8 +229,8 @@
},
"object": {
"type": "ImportExpression",
"start": 64,
"end": 82,
"start": 68,
"end": 86,
"loc": {
"start": {
"line": 5,
@ -243,8 +243,8 @@
},
"source": {
"type": "Literal",
"start": 71,
"end": 81,
"start": 75,
"end": 85,
"loc": {
"start": {
"line": 5,
@ -261,8 +261,8 @@
},
"property": {
"type": "Identifier",
"start": 83,
"end": 87,
"start": 87,
"end": 91,
"loc": {
"start": {
"line": 5,
@ -280,8 +280,8 @@
"arguments": [
{
"type": "ArrowFunctionExpression",
"start": 88,
"end": 129,
"start": 92,
"end": 135,
"loc": {
"start": {
"line": 5,
@ -299,8 +299,8 @@
"params": [
{
"type": "Identifier",
"start": 88,
"end": 91,
"start": 92,
"end": 95,
"loc": {
"start": {
"line": 5,
@ -316,8 +316,8 @@
],
"body": {
"type": "BlockStatement",
"start": 95,
"end": 129,
"start": 99,
"end": 135,
"loc": {
"start": {
"line": 5,
@ -331,8 +331,8 @@
"body": [
{
"type": "ExpressionStatement",
"start": 100,
"end": 125,
"start": 105,
"end": 130,
"loc": {
"start": {
"line": 6,
@ -345,8 +345,8 @@
},
"expression": {
"type": "CallExpression",
"start": 100,
"end": 124,
"start": 105,
"end": 129,
"loc": {
"start": {
"line": 6,
@ -359,8 +359,8 @@
},
"callee": {
"type": "MemberExpression",
"start": 100,
"end": 111,
"start": 105,
"end": 116,
"loc": {
"start": {
"line": 6,
@ -373,8 +373,8 @@
},
"object": {
"type": "Identifier",
"start": 100,
"end": 107,
"start": 105,
"end": 112,
"loc": {
"start": {
"line": 6,
@ -389,8 +389,8 @@
},
"property": {
"type": "Identifier",
"start": 108,
"end": 111,
"start": 113,
"end": 116,
"loc": {
"start": {
"line": 6,
@ -408,8 +408,8 @@
"arguments": [
{
"type": "MemberExpression",
"start": 112,
"end": 123,
"start": 117,
"end": 128,
"loc": {
"start": {
"line": 6,
@ -422,8 +422,8 @@
},
"object": {
"type": "Identifier",
"start": 112,
"end": 115,
"start": 117,
"end": 120,
"loc": {
"start": {
"line": 6,
@ -438,8 +438,8 @@
},
"property": {
"type": "Identifier",
"start": 116,
"end": 123,
"start": 121,
"end": 128,
"loc": {
"start": {
"line": 6,

@ -1,24 +1,24 @@
{
"html": {
"start": 41,
"end": 112,
"start": 45,
"end": 118,
"type": "Fragment",
"children": [
{
"start": 39,
"end": 41,
"start": 41,
"end": 45,
"type": "Text",
"raw": "\n\n",
"data": "\n\n"
"raw": "\r\n\r\n",
"data": "\r\n\r\n"
},
{
"start": 41,
"end": 112,
"start": 45,
"end": 118,
"type": "EachBlock",
"expression": {
"type": "Identifier",
"start": 48,
"end": 55,
"start": 52,
"end": 59,
"loc": {
"start": {
"line": 5,
@ -33,20 +33,20 @@
},
"children": [
{
"start": 83,
"end": 104,
"start": 88,
"end": 109,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"start": 86,
"end": 91,
"start": 91,
"end": 96,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 87,
"end": 90,
"start": 92,
"end": 95,
"loc": {
"start": {
"line": 6,
@ -61,20 +61,20 @@
}
},
{
"start": 91,
"end": 93,
"start": 96,
"end": 98,
"type": "Text",
"raw": ": ",
"data": ": "
},
{
"start": 93,
"end": 100,
"start": 98,
"end": 105,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 94,
"end": 99,
"start": 99,
"end": 104,
"loc": {
"start": {
"line": 6,
@ -93,8 +93,8 @@
],
"context": {
"type": "ArrayPattern",
"start": 59,
"end": 80,
"start": 63,
"end": 84,
"loc": {
"start": {
"line": 5,
@ -108,8 +108,8 @@
"elements": [
{
"type": "Identifier",
"start": 60,
"end": 63,
"start": 64,
"end": 67,
"loc": {
"start": {
"line": 5,
@ -124,8 +124,8 @@
},
{
"type": "Identifier",
"start": 65,
"end": 70,
"start": 69,
"end": 74,
"loc": {
"start": {
"line": 5,
@ -140,8 +140,8 @@
},
{
"type": "RestElement",
"start": 72,
"end": 79,
"start": 76,
"end": 83,
"loc": {
"start": {
"line": 5,
@ -154,8 +154,8 @@
},
"argument": {
"type": "Identifier",
"start": 75,
"end": 79,
"start": 79,
"end": 83,
"loc": {
"start": {
"line": 5,
@ -177,12 +177,12 @@
"instance": {
"type": "Script",
"start": 0,
"end": 39,
"end": 41,
"context": "default",
"content": {
"type": "Program",
"start": 8,
"end": 30,
"end": 32,
"loc": {
"start": {
"line": 1,
@ -196,8 +196,8 @@
"body": [
{
"type": "ExportNamedDeclaration",
"start": 10,
"end": 29,
"start": 11,
"end": 30,
"loc": {
"start": {
"line": 2,
@ -210,8 +210,8 @@
},
"declaration": {
"type": "VariableDeclaration",
"start": 17,
"end": 29,
"start": 18,
"end": 30,
"loc": {
"start": {
"line": 2,
@ -225,8 +225,8 @@
"declarations": [
{
"type": "VariableDeclarator",
"start": 21,
"end": 28,
"start": 22,
"end": 29,
"loc": {
"start": {
"line": 2,
@ -239,8 +239,8 @@
},
"id": {
"type": "Identifier",
"start": 21,
"end": 28,
"start": 22,
"end": 29,
"loc": {
"start": {
"line": 2,

@ -1,12 +1,12 @@
{
"html": {
"start": 0,
"end": 77,
"end": 81,
"type": "Fragment",
"children": [
{
"start": 0,
"end": 77,
"end": 81,
"type": "EachBlock",
"expression": {
"type": "Identifier",
@ -26,20 +26,20 @@
},
"children": [
{
"start": 27,
"end": 42,
"start": 28,
"end": 43,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"start": 30,
"end": 38,
"start": 31,
"end": 39,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 31,
"end": 37,
"start": 32,
"end": 38,
"loc": {
"start": {
"line": 2,
@ -57,26 +57,26 @@
}
],
"context": {
"start": 18,
"end": 24,
"type": "Identifier",
"name": "animal"
"name": "animal",
"start": 18,
"end": 24
},
"else": {
"start": 50,
"end": 70,
"start": 52,
"end": 74,
"type": "ElseBlock",
"children": [
{
"start": 52,
"end": 69,
"start": 55,
"end": 72,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"start": 55,
"end": 65,
"start": 58,
"end": 68,
"type": "Text",
"raw": "no animals",
"data": "no animals"

@ -1,12 +1,12 @@
{
"html": {
"start": 0,
"end": 58,
"end": 60,
"type": "Fragment",
"children": [
{
"start": 0,
"end": 58,
"end": 60,
"type": "EachBlock",
"expression": {
"type": "Identifier",
@ -26,20 +26,20 @@
},
"children": [
{
"start": 30,
"end": 50,
"start": 31,
"end": 51,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"start": 33,
"end": 36,
"start": 34,
"end": 37,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 34,
"end": 35,
"start": 35,
"end": 36,
"loc": {
"start": {
"line": 2,
@ -54,20 +54,20 @@
}
},
{
"start": 36,
"end": 38,
"start": 37,
"end": 39,
"type": "Text",
"raw": ": ",
"data": ": "
},
{
"start": 38,
"end": 46,
"start": 39,
"end": 47,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 39,
"end": 45,
"start": 40,
"end": 46,
"loc": {
"start": {
"line": 2,
@ -85,10 +85,10 @@
}
],
"context": {
"start": 18,
"end": 24,
"type": "Identifier",
"name": "animal"
"name": "animal",
"start": 18,
"end": 24
},
"index": "i"
}

@ -1,12 +1,12 @@
{
"html": {
"start": 0,
"end": 54,
"end": 56,
"type": "Fragment",
"children": [
{
"start": 0,
"end": 54,
"end": 56,
"type": "EachBlock",
"expression": {
"type": "Identifier",
@ -26,20 +26,20 @@
},
"children": [
{
"start": 33,
"end": 46,
"start": 34,
"end": 47,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"start": 36,
"end": 42,
"start": 37,
"end": 43,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 37,
"end": 41,
"start": 38,
"end": 42,
"loc": {
"start": {
"line": 2,
@ -57,10 +57,10 @@
}
],
"context": {
"start": 16,
"end": 20,
"type": "Identifier",
"name": "todo"
"name": "todo",
"start": 16,
"end": 20
},
"key": {
"type": "MemberExpression",

@ -1,12 +1,12 @@
{
"html": {
"start": 0,
"end": 50,
"end": 52,
"type": "Fragment",
"children": [
{
"start": 0,
"end": 50,
"end": 52,
"type": "EachBlock",
"expression": {
"type": "Identifier",
@ -26,20 +26,20 @@
},
"children": [
{
"start": 27,
"end": 42,
"start": 28,
"end": 43,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"start": 30,
"end": 38,
"start": 31,
"end": 39,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 31,
"end": 37,
"start": 32,
"end": 38,
"loc": {
"start": {
"line": 2,
@ -57,10 +57,10 @@
}
],
"context": {
"start": 18,
"end": 24,
"type": "Identifier",
"name": "animal"
"name": "animal",
"start": 18,
"end": 24
}
}
]

@ -1,6 +1,17 @@
{
"name": "ParseError",
"code": "invalid-catch-placement",
"message": "Expected to close {#each} block before seeing {:catch} block",
"start": { "line": 3, "column": 7, "character": 41 },
"pos": 41
}
"start": {
"line": 3,
"column": 7,
"character": 43
},
"end": {
"line": 3,
"column": 7,
"character": 43
},
"pos": 43,
"frame": "1: {#await true}\r\n2: {#each foo as bar}\r\n3: {:catch f}\r\n ^\n4: {/await}",
"message": "Expected to close {#each} block before seeing {:catch} block"
}

@ -1,10 +1,17 @@
{
"name": "ParseError",
"code": "invalid-catch-placement",
"message": "Cannot have an {:catch} block outside an {#await ...} block",
"start": {
"line": 1,
"column": 7,
"character": 7
},
"pos": 7
}
"end": {
"line": 1,
"column": 7,
"character": 7
},
"pos": 7,
"frame": "1: {:catch theValue}\n ^",
"message": "Cannot have an {:catch} block outside an {#await ...} block"
}

@ -1,10 +1,17 @@
{
"name": "ParseError",
"code": "unexpected-eof",
"message": "comment was left open, expected -->",
"start": {
"line": 1,
"column": 24,
"character": 24
},
"pos": 24
}
"end": {
"line": 1,
"column": 24,
"character": 24
},
"pos": 24,
"frame": "1: <!-- an unclosed comment\n ^",
"message": "comment was left open, expected -->"
}

@ -1,10 +1,17 @@
{
"name": "ParseError",
"code": "css-syntax-error",
"message": "LeftCurlyBracket is expected",
"start": {
"line": 2,
"column": 16,
"character": 24
"character": 25
},
"pos": 24
}
"end": {
"line": 2,
"column": 16,
"character": 25
},
"pos": 25,
"frame": "1: <style>\r\n2: this is not css\r\n ^\n3: </style>",
"message": "LeftCurlyBracket is expected"
}

@ -1,6 +1,17 @@
{
"name": "ParseError",
"code": "invalid-else-placement",
"message": "Expected to close {#await} block before seeing {:else} block",
"start": { "line": 3, "column": 6, "character": 29 },
"pos": 29
}
"start": {
"line": 3,
"column": 6,
"character": 31
},
"end": {
"line": 3,
"column": 6,
"character": 31
},
"pos": 31,
"frame": "1: {#if true}\r\n2: {#await p}\r\n3: {:else}\r\n ^\n4: {/if}",
"message": "Expected to close {#await} block before seeing {:else} block"
}

@ -1,6 +1,17 @@
{
"name": "ParseError",
"code": "invalid-else-placement",
"message": "Cannot have an {:else} block outside an {#if ...} or {#each ...} block",
"start": { "line": 2, "column": 6, "character": 11 },
"pos": 11
}
"start": {
"line": 2,
"column": 6,
"character": 12
},
"end": {
"line": 2,
"column": 6,
"character": 12
},
"pos": 12,
"frame": "1: <li>\r\n2: {:else}\n ^",
"message": "Cannot have an {:else} block outside an {#if ...} or {#each ...} block"
}

@ -1,6 +1,17 @@
{
"name": "ParseError",
"code": "invalid-else-placement",
"message": "Expected to close <li> tag before seeing {:else} block",
"start": { "line": 3, "column": 6, "character": 23 },
"pos": 23
}
"start": {
"line": 3,
"column": 6,
"character": 25
},
"end": {
"line": 3,
"column": 6,
"character": 25
},
"pos": 25,
"frame": "1: {#if true}\r\n2: <li>\r\n3: {:else}\r\n ^\n4: {/if}",
"message": "Expected to close <li> tag before seeing {:else} block"
}

@ -1,6 +1,17 @@
{
"name": "ParseError",
"code": "invalid-elseif-placement",
"message": "Expected to close <p> tag before seeing {:else if ...} block",
"start": { "line": 3, "column": 9, "character": 25 },
"pos": 25
}
"start": {
"line": 3,
"column": 9,
"character": 27
},
"end": {
"line": 3,
"column": 9,
"character": 27
},
"pos": 27,
"frame": "1: {#if true}\r\n2: <p>\r\n3: {:else if false}\r\n ^\n4: {/if}",
"message": "Expected to close <p> tag before seeing {:else if ...} block"
}

@ -1,6 +1,17 @@
{
"name": "ParseError",
"code": "invalid-elseif-placement",
"message": "Expected to close {#await} block before seeing {:else if ...} block",
"start": { "line": 3, "column": 9, "character": 34 },
"pos": 34
}
"start": {
"line": 3,
"column": 9,
"character": 36
},
"end": {
"line": 3,
"column": 9,
"character": 36
},
"pos": 36,
"frame": "1: {#if true}\r\n2: {#await foo}\r\n3: {:else if false}\r\n ^\n4: {/if}",
"message": "Expected to close {#await} block before seeing {:else if ...} block"
}

@ -1,6 +1,17 @@
{
"name": "ParseError",
"code": "invalid-elseif-placement",
"message": "Cannot have an {:else if ...} block outside an {#if ...} block",
"start": { "line": 3, "column": 10, "character": 35 },
"pos": 35
}
"start": {
"line": 3,
"column": 10,
"character": 37
},
"end": {
"line": 3,
"column": 10,
"character": 37
},
"pos": 37,
"frame": "1: {#await foo}\r\n2: {:then bar}\r\n3: {:else if}\r\n ^\n4: {/await}",
"message": "Cannot have an {:else if ...} block outside an {#if ...} block"
}

@ -1,10 +1,17 @@
{
"name": "ParseError",
"code": "parse-error",
"message": "Assigning to rvalue",
"start": {
"line": 1,
"column": 1,
"character": 1
},
"pos": 1
}
"end": {
"line": 1,
"column": 1,
"character": 1
},
"pos": 1,
"frame": "1: {42 = nope}\n ^",
"message": "Assigning to rvalue"
}

@ -1,10 +1,17 @@
{
"name": "ParseError",
"code": "duplicate-style",
"message": "You can only have one top-level <style> tag per component",
"start": {
"line": 9,
"column": 0,
"character": 58
"character": 66
},
"pos": 58
}
"end": {
"line": 9,
"column": 0,
"character": 66
},
"pos": 66,
"frame": " 7: </style>\r\n 8: \r\n 9: <style>\r\n ^\n10: div {\r\n11: color: blue;\r",
"message": "You can only have one top-level <style> tag per component"
}

@ -1,10 +1,17 @@
{
"name": "ParseError",
"code": "unclosed-script",
"message": "<script> must have a closing tag",
"start": {
"line": 3,
"column": 8,
"character": 32
"character": 34
},
"pos": 32
"end": {
"line": 3,
"column": 8,
"character": 34
},
"pos": 34,
"frame": "1: <h1>Hello {name}!</h1>\r\n2: \r\n3: <script>\n ^",
"message": "<script> must have a closing tag"
}

@ -1,10 +1,17 @@
{
"name": "ParseError",
"code": "invalid-self-placement",
"message": "<svelte:self> components can only exist inside {#if} blocks, {#each} blocks, or slots passed to components",
"start": {
"line": 1,
"column": 1,
"character": 1
},
"pos": 1
"end": {
"line": 1,
"column": 1,
"character": 1
},
"pos": 1,
"frame": "1: <svelte:self/>\n ^",
"message": "<svelte:self> components can only exist inside {#if} blocks, {#each} blocks, or slots passed to components"
}

@ -1,10 +1,17 @@
{
"name": "ParseError",
"code": "invalid-tag-name",
"message": "Valid <svelte:...> tag names are svelte:head, svelte:options, svelte:window, svelte:body, svelte:self or svelte:component",
"pos": 10,
"start": {
"character": 10,
"line": 2,
"column": 2
}
}
"column": 2,
"character": 11
},
"end": {
"line": 2,
"column": 2,
"character": 11
},
"pos": 11,
"frame": "1: {#if x}\r\n2: <svelte:selfdestructive x=\"{x - 1}\"/>\r\n ^\n3: {/if}",
"message": "Valid <svelte:...> tag names are svelte:head, svelte:options, svelte:window, svelte:body, svelte:self or svelte:component"
}

@ -1,6 +1,17 @@
{
"name": "ParseError",
"code": "invalid-then-placement",
"message": "Expected to close <li> tag before seeing {:then} block",
"start": { "line": 3, "column": 6, "character": 26 },
"pos": 26
}
"start": {
"line": 3,
"column": 6,
"character": 28
},
"end": {
"line": 3,
"column": 6,
"character": 28
},
"pos": 28,
"frame": "1: {#await true}\r\n2: <li>\r\n3: {:then f}\r\n ^\n4: {/await}",
"message": "Expected to close <li> tag before seeing {:then} block"
}

@ -1,10 +1,17 @@
{
"name": "ParseError",
"code": "invalid-then-placement",
"message": "Cannot have an {:then} block outside an {#await ...} block",
"start": {
"line": 1,
"column": 6,
"character": 6
},
"pos": 6
}
"end": {
"line": 1,
"column": 6,
"character": 6
},
"pos": 6,
"frame": "1: {:then theValue}\n ^",
"message": "Cannot have an {:then} block outside an {#await ...} block"
}

@ -1,10 +1,17 @@
{
"name": "ParseError",
"code": "unexpected-eof",
"message": "Unexpected end of input",
"start": {
"line": 1,
"column": 2,
"character": 2
},
"pos": 2
}
"end": {
"line": 1,
"column": 2,
"character": 2
},
"pos": 2,
"frame": "1: <d\n ^",
"message": "Unexpected end of input"
}

@ -1,10 +1,17 @@
{
"name": "ParseError",
"code": "unexpected-eof",
"message": "Unexpected end of input",
"start": {
"line": 1,
"column": 1,
"character": 1
},
"pos": 1
}
"end": {
"line": 1,
"column": 1,
"character": 1
},
"pos": 1,
"frame": "1: <\n ^",
"message": "Unexpected end of input"
}

@ -1,10 +1,17 @@
{
"name": "ParseError",
"code": "unclosed-block",
"message": "Block was left open",
"start": {
"line": 1,
"column": 0,
"character": 0
},
"pos": 0
}
"end": {
"line": 1,
"column": 0,
"character": 0
},
"pos": 0,
"frame": "1: {#if foo}\r\n ^\n2: <p>foo</p>",
"message": "Block was left open"
}

@ -1,10 +1,17 @@
{
"name": "ParseError",
"code": "unclosed-element",
"message": "<div> was left open",
"start": {
"line": 1,
"column": 0,
"character": 0
},
"pos": 0
}
"end": {
"line": 1,
"column": 0,
"character": 0
},
"pos": 0,
"frame": "1: <div>\n ^",
"message": "<div> was left open"
}

@ -1,10 +1,17 @@
{
"name": "ParseError",
"code": "invalid-closing-tag",
"message": "</div> attempted to close an element that was not open",
"start": {
"line": 1,
"column": 0,
"character": 0
},
"pos": 0
}
"end": {
"line": 1,
"column": 0,
"character": 0
},
"pos": 0,
"frame": "1: </div>\n ^",
"message": "</div> attempted to close an element that was not open"
}

@ -1,10 +1,17 @@
{
"name": "ParseError",
"code": "invalid-void-content",
"message": "<input> is a void element and cannot have children, or a closing tag",
"start": {
"line": 1,
"column": 23,
"character": 23
},
"pos": 23
}
"end": {
"line": 1,
"column": 23,
"character": 23
},
"pos": 23,
"frame": "1: <input>this is illegal!</input>\n ^",
"message": "<input> is a void element and cannot have children, or a closing tag"
}

@ -1,10 +1,17 @@
{
"name": "ParseError",
"code": "invalid-window-content",
"message": "<svelte:window> cannot have children",
"start": {
"line": 1,
"column": 15,
"character": 15
},
"pos": 15
"end": {
"line": 1,
"column": 15,
"character": 15
},
"pos": 15,
"frame": "1: <svelte:window>contents</svelte:window>\n ^",
"message": "<svelte:window> cannot have children"
}

@ -1,10 +1,17 @@
{
"name": "ParseError",
"code": "duplicate-window",
"message": "A component can only have one <svelte:window> tag",
"start": {
"line": 2,
"column": 0,
"character": 17
"character": 18
},
"pos": 17
"end": {
"line": 2,
"column": 0,
"character": 18
},
"pos": 18,
"frame": "1: <svelte:window/>\r\n2: <svelte:window/>\n ^",
"message": "A component can only have one <svelte:window> tag"
}

@ -1,10 +1,17 @@
{
"name": "ParseError",
"code": "invalid-window-placement",
"message": "<svelte:window> tags cannot be inside elements or blocks",
"start": {
"line": 2,
"column": 1,
"character": 11
"character": 12
},
"pos": 11
"end": {
"line": 2,
"column": 1,
"character": 12
},
"pos": 12,
"frame": "1: {#if foo}\r\n2: <svelte:window/>\r\n ^\n3: {/if}",
"message": "<svelte:window> tags cannot be inside elements or blocks"
}

@ -1,10 +1,17 @@
{
"name": "ParseError",
"code": "invalid-window-placement",
"message": "<svelte:window> tags cannot be inside elements or blocks",
"start": {
"line": 2,
"column": 1,
"character": 7
"character": 8
},
"pos": 7
"end": {
"line": 2,
"column": 1,
"character": 8
},
"pos": 8,
"frame": "1: <div>\r\n2: <svelte:window/>\r\n ^\n3: </div>",
"message": "<svelte:window> tags cannot be inside elements or blocks"
}

@ -1,7 +1,7 @@
{
"html": {
"start": 0,
"end": 97,
"end": 101,
"type": "Fragment",
"children": [
{
@ -115,19 +115,19 @@
},
{
"start": 61,
"end": 63,
"end": 65,
"type": "Text",
"raw": "\n\n",
"data": "\n\n"
"raw": "\r\n\r\n",
"data": "\r\n\r\n"
},
{
"start": 63,
"end": 97,
"start": 65,
"end": 101,
"type": "IfBlock",
"expression": {
"type": "Identifier",
"start": 68,
"end": 75,
"start": 70,
"end": 77,
"loc": {
"start": {
"line": 3,
@ -142,15 +142,15 @@
},
"children": [
{
"start": 78,
"end": 91,
"start": 81,
"end": 94,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"start": 81,
"end": 87,
"start": 84,
"end": 90,
"type": "Text",
"raw": "hello!",
"data": "hello!"

@ -1,12 +1,12 @@
{
"html": {
"start": 0,
"end": 51,
"end": 55,
"type": "Fragment",
"children": [
{
"start": 0,
"end": 51,
"end": 55,
"type": "IfBlock",
"expression": {
"type": "Identifier",
@ -26,15 +26,15 @@
},
"children": [
{
"start": 11,
"end": 21,
"start": 12,
"end": 22,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"start": 14,
"end": 17,
"start": 15,
"end": 18,
"type": "Text",
"raw": "foo",
"data": "foo"
@ -43,20 +43,20 @@
}
],
"else": {
"start": 29,
"end": 46,
"start": 31,
"end": 50,
"type": "ElseBlock",
"children": [
{
"start": 31,
"end": 45,
"start": 34,
"end": 48,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"start": 34,
"end": 41,
"start": 37,
"end": 44,
"type": "Text",
"raw": "not foo",
"data": "not foo"

@ -1,12 +1,12 @@
{
"html": {
"start": 0,
"end": 89,
"end": 93,
"type": "Fragment",
"children": [
{
"start": 0,
"end": 89,
"end": 93,
"type": "IfBlock",
"expression": {
"type": "BinaryExpression",
@ -59,15 +59,15 @@
},
"children": [
{
"start": 14,
"end": 41,
"start": 15,
"end": 42,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"start": 17,
"end": 37,
"start": 18,
"end": 38,
"type": "Text",
"raw": "x is greater than 10",
"data": "x is greater than 10"
@ -76,19 +76,19 @@
}
],
"else": {
"start": 58,
"end": 84,
"start": 60,
"end": 88,
"type": "ElseBlock",
"children": [
{
"start": 58,
"end": 89,
"start": 60,
"end": 93,
"type": "IfBlock",
"elseif": true,
"expression": {
"type": "BinaryExpression",
"start": 52,
"end": 57,
"start": 54,
"end": 59,
"loc": {
"start": {
"line": 3,
@ -101,8 +101,8 @@
},
"left": {
"type": "Identifier",
"start": 52,
"end": 53,
"start": 54,
"end": 55,
"loc": {
"start": {
"line": 3,
@ -118,8 +118,8 @@
"operator": "<",
"right": {
"type": "Literal",
"start": 56,
"end": 57,
"start": 58,
"end": 59,
"loc": {
"start": {
"line": 3,
@ -136,15 +136,15 @@
},
"children": [
{
"start": 60,
"end": 83,
"start": 63,
"end": 86,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"start": 63,
"end": 79,
"start": 66,
"end": 82,
"type": "Text",
"raw": "x is less than 5",
"data": "x is less than 5"

@ -1,45 +1,45 @@
{
"html": {
"start": 0,
"end": 51,
"end": 57,
"type": "Fragment",
"children": [
{
"start": 0,
"end": 51,
"end": 57,
"type": "Element",
"name": "ul",
"attributes": [],
"children": [
{
"start": 4,
"end": 6,
"end": 7,
"type": "Text",
"raw": "\n\t",
"data": "\n\t"
"raw": "\r\n\t",
"data": "\r\n\t"
},
{
"start": 6,
"end": 40,
"start": 7,
"end": 45,
"type": "Element",
"name": "li",
"attributes": [],
"children": [
{
"start": 10,
"end": 13,
"start": 11,
"end": 15,
"type": "Text",
"raw": "a\n\t",
"data": "a\n\t"
"raw": "a\r\n\t",
"data": "a\r\n\t"
},
{
"start": 13,
"end": 38,
"start": 15,
"end": 42,
"type": "IfBlock",
"expression": {
"type": "Literal",
"start": 18,
"end": 22,
"start": 20,
"end": 24,
"loc": {
"start": {
"line": 3,
@ -55,45 +55,45 @@
},
"children": [
{
"start": 26,
"end": 33,
"start": 29,
"end": 37,
"type": "Element",
"name": "li",
"attributes": [],
"children": [
{
"start": 30,
"end": 33,
"start": 33,
"end": 37,
"type": "Text",
"raw": "b\n\t",
"data": "b\n\t"
"raw": "b\r\n\t",
"data": "b\r\n\t"
}
]
}
]
},
{
"start": 38,
"end": 40,
"start": 42,
"end": 45,
"type": "Text",
"raw": "\n\t",
"data": "\n\t"
"raw": "\r\n\t",
"data": "\r\n\t"
}
]
},
{
"start": 40,
"end": 46,
"start": 45,
"end": 52,
"type": "Element",
"name": "li",
"attributes": [],
"children": [
{
"start": 44,
"end": 46,
"start": 49,
"end": 52,
"type": "Text",
"raw": "c\n",
"data": "c\n"
"raw": "c\r\n",
"data": "c\r\n"
}
]
}

@ -1,68 +1,68 @@
{
"html": {
"start": 0,
"end": 31,
"end": 35,
"type": "Fragment",
"children": [
{
"start": 0,
"end": 31,
"end": 35,
"type": "Element",
"name": "ul",
"attributes": [],
"children": [
{
"start": 4,
"end": 6,
"end": 7,
"type": "Text",
"raw": "\n\t",
"data": "\n\t"
"raw": "\r\n\t",
"data": "\r\n\t"
},
{
"start": 6,
"end": 13,
"start": 7,
"end": 15,
"type": "Element",
"name": "li",
"attributes": [],
"children": [
{
"start": 10,
"end": 13,
"start": 11,
"end": 15,
"type": "Text",
"raw": "a\n\t",
"data": "a\n\t"
"raw": "a\r\n\t",
"data": "a\r\n\t"
}
]
},
{
"start": 13,
"end": 20,
"start": 15,
"end": 23,
"type": "Element",
"name": "li",
"attributes": [],
"children": [
{
"start": 17,
"end": 20,
"start": 19,
"end": 23,
"type": "Text",
"raw": "b\n\t",
"data": "b\n\t"
"raw": "b\r\n\t",
"data": "b\r\n\t"
}
]
},
{
"start": 20,
"end": 26,
"start": 23,
"end": 30,
"type": "Element",
"name": "li",
"attributes": [],
"children": [
{
"start": 24,
"end": 26,
"start": 27,
"end": 30,
"type": "Text",
"raw": "c\n",
"data": "c\n"
"raw": "c\r\n",
"data": "c\r\n"
}
]
}

@ -1,12 +1,12 @@
{
"html": {
"start": 0,
"end": 148,
"end": 166,
"type": "Fragment",
"children": [
{
"start": 0,
"end": 33,
"end": 36,
"type": "IfBlock",
"expression": {
"type": "Literal",
@ -27,8 +27,8 @@
},
"children": [
{
"start": 12,
"end": 19,
"start": 13,
"end": 20,
"type": "Element",
"name": "input",
"attributes": [],
@ -36,27 +36,27 @@
}
],
"else": {
"start": 27,
"end": 28,
"start": 29,
"end": 31,
"type": "ElseBlock",
"children": []
}
},
{
"start": 33,
"end": 35,
"start": 36,
"end": 40,
"type": "Text",
"raw": "\n\n",
"data": "\n\n"
"raw": "\r\n\r\n",
"data": "\r\n\r\n"
},
{
"start": 35,
"end": 65,
"start": 40,
"end": 73,
"type": "IfBlock",
"expression": {
"type": "Literal",
"start": 40,
"end": 44,
"start": 45,
"end": 49,
"loc": {
"start": {
"line": 6,
@ -72,8 +72,8 @@
},
"children": [
{
"start": 47,
"end": 51,
"start": 53,
"end": 57,
"type": "Element",
"name": "br",
"attributes": [],
@ -81,27 +81,27 @@
}
],
"else": {
"start": 59,
"end": 60,
"start": 66,
"end": 68,
"type": "ElseBlock",
"children": []
}
},
{
"start": 65,
"end": 67,
"start": 73,
"end": 77,
"type": "Text",
"raw": "\n\n",
"data": "\n\n"
"raw": "\r\n\r\n",
"data": "\r\n\r\n"
},
{
"start": 67,
"end": 108,
"start": 77,
"end": 121,
"type": "AwaitBlock",
"expression": {
"type": "Literal",
"start": 75,
"end": 79,
"start": 85,
"end": 89,
"loc": {
"start": {
"line": 11,
@ -116,53 +116,53 @@
"raw": "true"
},
"value": {
"start": 97,
"end": 98,
"type": "Identifier",
"name": "f"
"name": "f",
"start": 109,
"end": 110
},
"error": null,
"pending": {
"start": 80,
"end": 90,
"start": 90,
"end": 102,
"type": "PendingBlock",
"children": [
{
"start": 80,
"end": 82,
"start": 90,
"end": 93,
"type": "Text",
"raw": "\n\t",
"data": "\n\t"
"raw": "\r\n\t",
"data": "\r\n\t"
},
{
"start": 82,
"end": 89,
"start": 93,
"end": 100,
"type": "Element",
"name": "input",
"attributes": [],
"children": []
},
{
"start": 89,
"end": 90,
"start": 100,
"end": 102,
"type": "Text",
"raw": "\n",
"data": "\n"
"raw": "\r\n",
"data": "\r\n"
}
],
"skip": false
},
"then": {
"start": 90,
"end": 100,
"start": 102,
"end": 113,
"type": "ThenBlock",
"children": [
{
"start": 99,
"end": 100,
"start": 111,
"end": 113,
"type": "Text",
"raw": "\n",
"data": "\n"
"raw": "\r\n",
"data": "\r\n"
}
],
"skip": false
@ -176,20 +176,20 @@
}
},
{
"start": 108,
"end": 110,
"start": 121,
"end": 125,
"type": "Text",
"raw": "\n\n",
"data": "\n\n"
"raw": "\r\n\r\n",
"data": "\r\n\r\n"
},
{
"start": 110,
"end": 148,
"start": 125,
"end": 166,
"type": "AwaitBlock",
"expression": {
"type": "Literal",
"start": 118,
"end": 122,
"start": 133,
"end": 137,
"loc": {
"start": {
"line": 16,
@ -204,53 +204,53 @@
"raw": "true"
},
"value": {
"start": 137,
"end": 138,
"type": "Identifier",
"name": "f"
"name": "f",
"start": 154,
"end": 155
},
"error": null,
"pending": {
"start": 123,
"end": 130,
"start": 138,
"end": 147,
"type": "PendingBlock",
"children": [
{
"start": 123,
"end": 125,
"start": 138,
"end": 141,
"type": "Text",
"raw": "\n\t",
"data": "\n\t"
"raw": "\r\n\t",
"data": "\r\n\t"
},
{
"start": 125,
"end": 129,
"start": 141,
"end": 145,
"type": "Element",
"name": "br",
"attributes": [],
"children": []
},
{
"start": 129,
"end": 130,
"start": 145,
"end": 147,
"type": "Text",
"raw": "\n",
"data": "\n"
"raw": "\r\n",
"data": "\r\n"
}
],
"skip": false
},
"then": {
"start": 130,
"end": 140,
"start": 147,
"end": 158,
"type": "ThenBlock",
"children": [
{
"start": 139,
"end": 140,
"start": 156,
"end": 158,
"type": "Text",
"raw": "\n",
"data": "\n"
"raw": "\r\n",
"data": "\r\n"
}
],
"skip": false

@ -1,10 +1,17 @@
{
"name": "ParseError",
"code": "missing-whitespace",
"message": "Expected whitespace",
"start": {
"line": 1,
"column": 6,
"character": 6
},
"pos": 6
}
"end": {
"line": 1,
"column": 6,
"character": 6
},
"pos": 6,
"frame": "1: {@htmlfoo}\n ^",
"message": "Expected whitespace"
}

@ -1,32 +1,32 @@
{
"html": {
"start": 30,
"end": 63,
"start": 34,
"end": 67,
"type": "Fragment",
"children": [
{
"start": 28,
"end": 30,
"start": 30,
"end": 34,
"type": "Text",
"raw": "\n\n",
"data": "\n\n"
"raw": "\r\n\r\n",
"data": "\r\n\r\n"
},
{
"start": 30,
"end": 63,
"start": 34,
"end": 67,
"type": "Element",
"name": "canvas",
"attributes": [
{
"start": 38,
"end": 53,
"start": 42,
"end": 57,
"type": "Binding",
"name": "this",
"modifiers": [],
"expression": {
"type": "Identifier",
"start": 49,
"end": 52,
"start": 53,
"end": 56,
"loc": {
"start": {
"line": 5,
@ -48,12 +48,12 @@
"instance": {
"type": "Script",
"start": 0,
"end": 28,
"end": 30,
"context": "default",
"content": {
"type": "Program",
"start": 8,
"end": 19,
"end": 21,
"loc": {
"start": {
"line": 1,
@ -67,8 +67,8 @@
"body": [
{
"type": "VariableDeclaration",
"start": 10,
"end": 18,
"start": 11,
"end": 19,
"loc": {
"start": {
"line": 2,
@ -82,8 +82,8 @@
"declarations": [
{
"type": "VariableDeclarator",
"start": 14,
"end": 17,
"start": 15,
"end": 18,
"loc": {
"start": {
"line": 2,
@ -96,8 +96,8 @@
},
"id": {
"type": "Identifier",
"start": 14,
"end": 17,
"start": 15,
"end": 18,
"loc": {
"start": {
"line": 2,

@ -1,19 +1,19 @@
{
"html": {
"start": 45,
"end": 56,
"start": 49,
"end": 60,
"type": "Fragment",
"children": [
{
"start": 43,
"end": 45,
"start": 45,
"end": 49,
"type": "Text",
"raw": "\n\n",
"data": "\n\n"
"raw": "\r\n\r\n",
"data": "\r\n\r\n"
},
{
"start": 45,
"end": 56,
"start": 49,
"end": 60,
"type": "Element",
"name": "div",
"attributes": [],
@ -24,12 +24,12 @@
"instance": {
"type": "Script",
"start": 0,
"end": 43,
"end": 45,
"context": "default",
"content": {
"type": "Program",
"start": 8,
"end": 34,
"end": 36,
"loc": {
"start": {
"line": 1,
@ -46,8 +46,8 @@
{
"type": "Line",
"value": " TODO write some code",
"start": 10,
"end": 33
"start": 11,
"end": 34
}
]
}

@ -1,38 +1,38 @@
{
"html": {
"start": 79,
"end": 101,
"start": 87,
"end": 109,
"type": "Fragment",
"children": [
{
"start": 77,
"end": 79,
"start": 83,
"end": 87,
"type": "Text",
"raw": "\n\n",
"data": "\n\n"
"raw": "\r\n\r\n",
"data": "\r\n\r\n"
},
{
"start": 79,
"end": 101,
"start": 87,
"end": 109,
"type": "Element",
"name": "h1",
"attributes": [],
"children": [
{
"start": 83,
"end": 89,
"start": 91,
"end": 97,
"type": "Text",
"raw": "Hello ",
"data": "Hello "
},
{
"start": 89,
"end": 95,
"start": 97,
"end": 103,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 90,
"end": 94,
"start": 98,
"end": 102,
"loc": {
"start": {
"line": 9,
@ -47,8 +47,8 @@
}
},
{
"start": 95,
"end": 96,
"start": 103,
"end": 104,
"type": "Text",
"raw": "!",
"data": "!"
@ -60,12 +60,12 @@
"instance": {
"type": "Script",
"start": 0,
"end": 77,
"end": 83,
"context": "default",
"content": {
"type": "Program",
"start": 8,
"end": 68,
"end": 74,
"loc": {
"start": {
"line": 1,
@ -79,8 +79,8 @@
"body": [
{
"type": "VariableDeclaration",
"start": 10,
"end": 29,
"start": 11,
"end": 30,
"loc": {
"start": {
"line": 2,
@ -94,8 +94,8 @@
"declarations": [
{
"type": "VariableDeclarator",
"start": 14,
"end": 28,
"start": 15,
"end": 29,
"loc": {
"start": {
"line": 2,
@ -108,8 +108,8 @@
},
"id": {
"type": "Identifier",
"start": 14,
"end": 18,
"start": 15,
"end": 19,
"loc": {
"start": {
"line": 2,
@ -124,8 +124,8 @@
},
"init": {
"type": "Literal",
"start": 21,
"end": 28,
"start": 22,
"end": 29,
"loc": {
"start": {
"line": 2,
@ -148,9 +148,9 @@
"trailingComments": [
{
"type": "Block",
"value": "\n\ttrailing multiline comment\n",
"start": 32,
"end": 67
"value": "\r\n\ttrailing multiline comment\r\n",
"start": 35,
"end": 72
}
]
}

@ -1,38 +1,38 @@
{
"html": {
"start": 68,
"end": 90,
"start": 74,
"end": 96,
"type": "Fragment",
"children": [
{
"start": 66,
"end": 68,
"start": 70,
"end": 74,
"type": "Text",
"raw": "\n\n",
"data": "\n\n"
"raw": "\r\n\r\n",
"data": "\r\n\r\n"
},
{
"start": 68,
"end": 90,
"start": 74,
"end": 96,
"type": "Element",
"name": "h1",
"attributes": [],
"children": [
{
"start": 72,
"end": 78,
"start": 78,
"end": 84,
"type": "Text",
"raw": "Hello ",
"data": "Hello "
},
{
"start": 78,
"end": 84,
"start": 84,
"end": 90,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 79,
"end": 83,
"start": 85,
"end": 89,
"loc": {
"start": {
"line": 7,
@ -47,8 +47,8 @@
}
},
{
"start": 84,
"end": 85,
"start": 90,
"end": 91,
"type": "Text",
"raw": "!",
"data": "!"
@ -60,12 +60,12 @@
"instance": {
"type": "Script",
"start": 0,
"end": 66,
"end": 70,
"context": "default",
"content": {
"type": "Program",
"start": 8,
"end": 57,
"end": 61,
"loc": {
"start": {
"line": 1,
@ -79,8 +79,8 @@
"body": [
{
"type": "VariableDeclaration",
"start": 10,
"end": 29,
"start": 11,
"end": 30,
"loc": {
"start": {
"line": 2,
@ -94,8 +94,8 @@
"declarations": [
{
"type": "VariableDeclarator",
"start": 14,
"end": 28,
"start": 15,
"end": 29,
"loc": {
"start": {
"line": 2,
@ -108,8 +108,8 @@
},
"id": {
"type": "Identifier",
"start": 14,
"end": 18,
"start": 15,
"end": 19,
"loc": {
"start": {
"line": 2,
@ -124,8 +124,8 @@
},
"init": {
"type": "Literal",
"start": 21,
"end": 28,
"start": 22,
"end": 29,
"loc": {
"start": {
"line": 2,
@ -149,8 +149,8 @@
{
"type": "Line",
"value": " trailing line comment",
"start": 32,
"end": 56
"start": 35,
"end": 59
}
]
}

@ -1,38 +1,38 @@
{
"html": {
"start": 41,
"end": 63,
"start": 45,
"end": 67,
"type": "Fragment",
"children": [
{
"start": 39,
"end": 41,
"start": 41,
"end": 45,
"type": "Text",
"raw": "\n\n",
"data": "\n\n"
"raw": "\r\n\r\n",
"data": "\r\n\r\n"
},
{
"start": 41,
"end": 63,
"start": 45,
"end": 67,
"type": "Element",
"name": "h1",
"attributes": [],
"children": [
{
"start": 45,
"end": 51,
"start": 49,
"end": 55,
"type": "Text",
"raw": "Hello ",
"data": "Hello "
},
{
"start": 51,
"end": 57,
"start": 55,
"end": 61,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 52,
"end": 56,
"start": 56,
"end": 60,
"loc": {
"start": {
"line": 5,
@ -47,8 +47,8 @@
}
},
{
"start": 57,
"end": 58,
"start": 61,
"end": 62,
"type": "Text",
"raw": "!",
"data": "!"
@ -60,12 +60,12 @@
"instance": {
"type": "Script",
"start": 0,
"end": 39,
"end": 41,
"context": "default",
"content": {
"type": "Program",
"start": 8,
"end": 30,
"end": 32,
"loc": {
"start": {
"line": 1,
@ -79,8 +79,8 @@
"body": [
{
"type": "VariableDeclaration",
"start": 10,
"end": 29,
"start": 11,
"end": 30,
"loc": {
"start": {
"line": 2,
@ -94,8 +94,8 @@
"declarations": [
{
"type": "VariableDeclarator",
"start": 14,
"end": 28,
"start": 15,
"end": 29,
"loc": {
"start": {
"line": 2,
@ -108,8 +108,8 @@
},
"id": {
"type": "Identifier",
"start": 14,
"end": 18,
"start": 15,
"end": 19,
"loc": {
"start": {
"line": 2,
@ -124,8 +124,8 @@
},
"init": {
"type": "Literal",
"start": 21,
"end": 28,
"start": 22,
"end": 29,
"loc": {
"start": {
"line": 2,

@ -1,12 +1,12 @@
{
"html": {
"start": 0,
"end": 57,
"end": 59,
"type": "Fragment",
"children": [
{
"start": 0,
"end": 57,
"end": 59,
"type": "IfBlock",
"expression": {
"type": "BinaryExpression",
@ -59,25 +59,25 @@
},
"children": [
{
"start": 17,
"end": 51,
"start": 18,
"end": 52,
"type": "InlineComponent",
"name": "svelte:self",
"attributes": [
{
"start": 30,
"end": 49,
"start": 31,
"end": 50,
"type": "Attribute",
"name": "depth",
"value": [
{
"start": 37,
"end": 48,
"start": 38,
"end": 49,
"type": "MustacheTag",
"expression": {
"type": "BinaryExpression",
"start": 38,
"end": 47,
"start": 39,
"end": 48,
"loc": {
"start": {
"line": 2,
@ -90,8 +90,8 @@
},
"left": {
"type": "Identifier",
"start": 38,
"end": 43,
"start": 39,
"end": 44,
"loc": {
"start": {
"line": 2,
@ -107,8 +107,8 @@
"operator": "-",
"right": {
"type": "Literal",
"start": 46,
"end": 47,
"start": 47,
"end": 48,
"loc": {
"start": {
"line": 2,

@ -1,12 +1,12 @@
{
"html": {
"start": 0,
"end": 61,
"end": 63,
"type": "Fragment",
"children": [
{
"start": 0,
"end": 61,
"end": 63,
"type": "Element",
"name": "textarea",
"attributes": [
@ -16,19 +16,19 @@
"value": [
{
"start": 10,
"end": 41,
"end": 42,
"type": "Text",
"raw": "\n\t<p>not actually an element. ",
"data": "\n\t<p>not actually an element. "
"raw": "\r\n\t<p>not actually an element. ",
"data": "\r\n\t<p>not actually an element. "
},
{
"start": 40,
"end": 45,
"start": 41,
"end": 46,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 41,
"end": 44,
"start": 42,
"end": 45,
"loc": {
"start": {
"line": 2,
@ -43,11 +43,11 @@
}
},
{
"start": 45,
"end": 50,
"start": 46,
"end": 52,
"type": "Text",
"raw": "</p>\n",
"data": "</p>\n"
"raw": "</p>\r\n",
"data": "</p>\r\n"
}
]
}

@ -1,12 +1,12 @@
{
"html": {
"start": 0,
"end": 41,
"end": 43,
"type": "Fragment",
"children": [
{
"start": 0,
"end": 41,
"end": 43,
"type": "EachBlock",
"expression": {
"type": "Identifier",
@ -26,20 +26,20 @@
},
"children": [
{
"start": 22,
"end": 33,
"start": 23,
"end": 34,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"start": 25,
"end": 29,
"start": 26,
"end": 30,
"type": "MustacheTag",
"expression": {
"type": "Identifier",
"start": 26,
"end": 28,
"start": 27,
"end": 29,
"loc": {
"start": {
"line": 2,
@ -57,10 +57,10 @@
}
],
"context": {
"start": 17,
"end": 19,
"type": "Identifier",
"name": "𐊧"
"name": "𐊧",
"start": 17,
"end": 19
}
}
]

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

@ -1,40 +1,39 @@
export default {
html: `<div class=" svelte-x1o6ra"></div>`,
test({ assert, component, target }) {
const div = target.querySelector('div');
component.testName = null;
assert.equal(div.className, ' svelte-x1o6ra');
const startsWith = (str) => assert.ok(div.className.startsWith(str));
startsWith(' svelte-');
component.testName = undefined;
assert.equal(div.className, ' svelte-x1o6ra');
startsWith(' svelte-');
component.testName = undefined + '';
assert.equal(div.className, 'undefined svelte-x1o6ra');
startsWith('undefined svelte-');
component.testName = null + '';
assert.equal(div.className, 'null svelte-x1o6ra');
startsWith('null svelte-');
component.testName = 1;
assert.equal(div.className, '1 svelte-x1o6ra');
startsWith('1 svelte-');
component.testName = 0;
assert.equal(div.className, '0 svelte-x1o6ra');
startsWith('0 svelte-');
component.testName = false;
assert.equal(div.className, 'false svelte-x1o6ra');
startsWith('false svelte-');
component.testName = true;
assert.equal(div.className, 'true svelte-x1o6ra');
startsWith('true svelte-');
component.testName = {};
assert.equal(div.className, '[object Object] svelte-x1o6ra');
startsWith('[object Object] svelte-');
component.testName = '';
assert.equal(div.className, ' svelte-x1o6ra');
startsWith(' svelte-');
component.testName = 'testClassName';
assert.equal(div.className, 'testClassName svelte-x1o6ra');
}
startsWith('testClassName svelte-');
},
};

@ -1,45 +1,43 @@
export default {
props: {
testName1: "test1",
testName2: "test2",
testName1: 'test1',
testName2: 'test2',
},
html: `<div class="test1test2 svelte-x1o6ra"></div>`,
test({ assert, component, target }) {
const div = target.querySelector('div');
assert.equal(div.className, 'test1test2 svelte-x1o6ra');
const startsWith = (str) => assert.ok(div.className.startsWith(str + ' svelte-'));
startsWith('test1test2');
component.testName1 = null;
component.testName2 = null;
assert.equal(div.className, '0 svelte-x1o6ra');
startsWith('0');
component.testName1 = null;
component.testName2 = "test";
assert.equal(div.className, 'nulltest svelte-x1o6ra');
component.testName2 = 'test';
startsWith('nulltest');
component.testName1 = undefined;
component.testName2 = "test";
assert.equal(div.className, 'undefinedtest svelte-x1o6ra');
component.testName2 = 'test';
startsWith('undefinedtest');
component.testName1 = undefined;
component.testName2 = undefined;
assert.equal(div.className, 'NaN svelte-x1o6ra');
startsWith('NaN');
component.testName1 = null;
component.testName2 = 1;
assert.equal(div.className, '1 svelte-x1o6ra');
startsWith('1');
component.testName1 = undefined;
component.testName2 = 1;
assert.equal(div.className, 'NaN svelte-x1o6ra');
startsWith('NaN');
component.testName1 = null;
component.testName2 = 0;
assert.equal(div.className, '0 svelte-x1o6ra');
startsWith('0');
component.testName1 = undefined;
component.testName2 = 0;
assert.equal(div.className, 'NaN svelte-x1o6ra');
}
startsWith('NaN');
},
};

@ -1,42 +1,40 @@
export default {
props: {
testName: "testClassName"
testName: 'testClassName',
},
html: `<div class="testClassName svelte-x1o6ra"></div>`,
test({ assert, component, target }) {
const div = target.querySelector('div');
assert.equal(div.className, 'testClassName svelte-x1o6ra');
const startsWith = (str) => assert.ok(div.className.startsWith(str + ' svelte-'));
startsWith('testClassName');
component.testName = null;
assert.equal(div.className, ' svelte-x1o6ra');
startsWith('');
component.testName = undefined;
assert.equal(div.className, ' svelte-x1o6ra');
startsWith('');
component.testName = undefined + '';
assert.equal(div.className, 'undefined svelte-x1o6ra');
startsWith('undefined');
component.testName = null + '';
assert.equal(div.className, 'null svelte-x1o6ra');
startsWith('null');
component.testName = 1;
assert.equal(div.className, '1 svelte-x1o6ra');
startsWith('1');
component.testName = 0;
assert.equal(div.className, '0 svelte-x1o6ra');
startsWith('0');
component.testName = false;
assert.equal(div.className, 'false svelte-x1o6ra');
startsWith('false');
component.testName = true;
assert.equal(div.className, 'true svelte-x1o6ra');
startsWith('true');
component.testName = {};
assert.equal(div.className, '[object Object] svelte-x1o6ra');
startsWith('[object Object]');
component.testName = '';
assert.equal(div.className, ' svelte-x1o6ra');
}
startsWith('');
},
};

@ -1,45 +1,43 @@
export default {
props: {
testName1: "test1",
testName2: "test2",
testName1: 'test1',
testName2: 'test2',
},
html: `<div class="test1test2 svelte-x1o6ra"></div>`,
test({ assert, component, target }) {
const div = target.querySelector('div');
assert.equal(div.className, 'test1test2 svelte-x1o6ra');
const startsWith = (str) => assert.ok(div.className.startsWith(str + ' svelte-'));
startsWith('test1test2');
component.testName1 = null;
component.testName2 = null;
assert.equal(div.className, '0 svelte-x1o6ra');
startsWith('0');
component.testName1 = null;
component.testName2 = "test";
assert.equal(div.className, 'nulltest svelte-x1o6ra');
component.testName2 = 'test';
startsWith('nulltest');
component.testName1 = undefined;
component.testName2 = "test";
assert.equal(div.className, 'undefinedtest svelte-x1o6ra');
component.testName2 = 'test';
startsWith('undefinedtest');
component.testName1 = undefined;
component.testName2 = undefined;
assert.equal(div.className, 'NaN svelte-x1o6ra');
startsWith('NaN');
component.testName1 = null;
component.testName2 = 1;
assert.equal(div.className, '1 svelte-x1o6ra');
startsWith('1');
component.testName1 = undefined;
component.testName2 = 1;
assert.equal(div.className, 'NaN svelte-x1o6ra');
startsWith('NaN');
component.testName1 = null;
component.testName2 = 0;
assert.equal(div.className, '0 svelte-x1o6ra');
startsWith('0');
component.testName1 = undefined;
component.testName2 = 0;
assert.equal(div.className, 'NaN svelte-x1o6ra');
}
startsWith('NaN');
},
};

@ -13,14 +13,14 @@ export default {
file: path.relative(process.cwd(), path.resolve(__dirname, 'main.svelte')),
line: 4,
column: 0,
char: 53
char: 57
});
assert.deepEqual(p.__svelte_meta.loc, {
file: path.relative(process.cwd(), path.resolve(__dirname, 'Foo.svelte')),
line: 1,
column: 1,
char: 7
char: 8
});
}
};

@ -1,6 +1,6 @@
export default {
html: `
<p class="svelte-y94hdy" style="color: red !important; font-size: 20px !important; opacity: 1;">red</p>
<p class="svelte-7m7nuf" style="color: red !important; font-size: 20px !important; opacity: 1;">red</p>
`,
test({ assert, component, target, window }) {

@ -1,7 +1,7 @@
export default {
html: `
<div class="foo svelte-xg5rbo">red</div>
<div class="qux svelte-xg5rbo">red</div>
<div class="bar svelte-xg5rbo">red and bold</div>
<div class="foo svelte-1553ulx">red</div>
<div class="qux svelte-1553ulx">red</div>
<div class="bar svelte-1553ulx">red and bold</div>
`
};

@ -5,9 +5,9 @@ export default {
html: `
<svg>
<circle class="svelte-i03x00" cx=50 cy=50 r=50 />
<circle class="foo svelte-i03x00" cx=150 cy=50 r=50 />
<circle class="bar svelte-i03x00" cx=250 cy=50 r=50 />
<circle class="svelte-1h4oike" cx=50 cy=50 r=50 />
<circle class="foo svelte-1h4oike" cx=150 cy=50 r=50 />
<circle class="bar svelte-1h4oike" cx=250 cy=50 r=50 />
</svg>
`
};

@ -88,7 +88,7 @@ describe('ssr', () => {
}
try {
assert.equal(css.code.replace(/^\s+/gm, ''), expectedCss.replace(/^\s+/gm, ''));
assert.equal(css.code.replace(/^\s+/gm, '').replace(/[\r\n]/, ''), expectedCss.replace(/^\s+/gm, '').replace(/[\r\n]/, ''));
} catch (error) {
if (shouldUpdateExpected()) {
fs.writeFileSync(`${dir}/_expected.css`, css.code);

@ -1,4 +1,4 @@
<title>Some Title</title>
<link rel="canonical" href="/" data-svelte="svelte-1s8aodm">
<meta name="description" content="some description" data-svelte="svelte-1s8aodm">
<meta name="keywords" content="some keywords" data-svelte="svelte-1s8aodm">
<link rel="canonical" href="/" data-svelte="svelte-1t0pfk9">
<meta name="description" content="some description" data-svelte="svelte-1t0pfk9">
<meta name="keywords" content="some keywords" data-svelte="svelte-1t0pfk9">

@ -1,2 +1,2 @@
div.svelte-bzh57p{color:red}
div.svelte-4yw8vx{color:green}
div.svelte-awisl7{color:red}
div.svelte-1us38kz{color:green}

@ -1,8 +1,6 @@
<div class="svelte-bzh57p">red</div>
<div class="svelte-4yw8vx">green: foo</div>
<div class="svelte-awisl7">red</div>
<div class="svelte-1us38kz">green: foo</div>
<div class="svelte-4yw8vx">green: bar</div>
<div class="svelte-1us38kz">green: bar</div>

@ -1 +1 @@
div.svelte-bzh57p{color:red}
div.svelte-awisl7{color:red}

@ -1 +1 @@
<div class="svelte-bzh57p">red</div>
<div class="svelte-awisl7">red</div>

@ -7,41 +7,42 @@ require('source-map-support').install();
process.env.TEST = true;
// require.extensions['.js'] = function (module, filename) {
// const exports = [];
// let code = readFileSync(filename, 'utf-8')
// .replace(/^import \* as (\w+) from ['"]([^'"]+)['"];?/gm, 'var $1 = require("$2");')
// .replace(/^import (\w+) from ['"]([^'"]+)['"];?/gm, 'var {default: $1} = require("$2");')
// .replace(/^import {([^}]+)} from ['"](.+)['"];?/gm, 'var {$1} = require("$2");')
// .replace(/^export default /gm, 'exports.default = ')
// .replace(/^export (const|let|var|class|function) (\w+)/gm, (_match, type, name) => {
// exports.push(name);
// return `${type} ${name}`;
// })
// .replace(/^export \{([^}]+)\}(?: from ['"]([^'"]+)['"];?)?/gm, (_match, names, source) => {
// names
// .split(',')
// .filter(Boolean)
// .forEach((name) => {
// exports.push(name);
// });
// return source ? `const { ${names} } = require("${source}");` : '';
// })
// .replace(/^export function (\w+)/gm, 'exports.$1 = function $1');
// exports.forEach((name) => {
// code += `\nexports.${name} = ${name};`;
// });
// try {
// return module._compile(code, filename);
// } catch (err) {
// console.log(code);
// throw err;
// }
// };
import { readFileSync } from 'fs';
require.extensions['.js'] = function (module, filename) {
const exports = [];
let code = readFileSync(filename, 'utf-8')
.replace(/^import \* as (\w+) from ['"]([^'"]+)['"];?/gm, 'var $1 = require("$2");')
.replace(/^import (\w+) from ['"]([^'"]+)['"];?/gm, 'var {default: $1} = require("$2");')
.replace(/^import {([^}]+)} from ['"](.+)['"];?/gm, 'var {$1} = require("$2");')
.replace(/^export default /gm, 'exports.default = ')
.replace(/^export (const|let|var|class|function) (\w+)/gm, (_match, type, name) => {
exports.push(name);
return `${type} ${name}`;
})
.replace(/^export \{([^}]+)\}(?: from ['"]([^'"]+)['"];?)?/gm, (_match, names, source) => {
names
.split(',')
.filter(Boolean)
.forEach((name) => {
exports.push(name);
});
return source ? `const { ${names} } = require("${source}");` : '';
})
.replace(/^export function (\w+)/gm, 'exports.$1 = function $1');
exports.forEach((name) => {
code += `\nexports.${name} = ${name};`;
});
try {
return module._compile(code, filename);
} catch (err) {
console.log(code);
throw err;
}
};
import './helpers';
import '../internal';
console.clear();

@ -79,7 +79,8 @@ function globrex(glob, { extended = false, globstar = false, strict = false, fil
}
}
const escaped = (condition, str = c) => add(condition ? str : `//${c}`);
let c, n;
let c;
let n;
for (let i = 0; i < glob.length; i++) {
c = glob[i];
n = glob[i + 1];
@ -224,11 +225,14 @@ function walk(output, prefix, lexer, filesOnly, dot, cwd, dirname = '', level =
const rgx = lexer.segments[level];
const dir = join(cwd, prefix, dirname);
const files = readdirSync(dir);
let i = 0,
file;
let i = 0;
let file;
const len = files.length;
let fullpath, relpath, stats, isMatch;
let fullpath;
let relpath;
let stats;
let isMatch;
for (; i < len; i++) {
fullpath = join(dir, (file = files[i]));
relpath = dirname ? join(dirname, file) : file;

Loading…
Cancel
Save