From d3201603d9fa142e66912359932115fff8a00db7 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Mon, 28 May 2018 19:07:12 -0400 Subject: [PATCH] change __svelte_meta to __svelte_meta.loc --- src/shared/utils.js | 4 +++- test/cli/samples/dev/expected/Main.js | 4 +++- .../dev-warning-missing-data-computed/expected-bundle.js | 4 +++- test/runtime/samples/element-source-location/_config.js | 4 ++-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/shared/utils.js b/src/shared/utils.js index 61a68f2f19..436782dcf6 100644 --- a/src/shared/utils.js +++ b/src/shared/utils.js @@ -21,5 +21,7 @@ export function callAfter(fn, i) { } export function addLoc(element, file, line, column, char) { - element.__svelte_meta = { file, line, column, char }; + element.__svelte_meta = { + loc: { file, line, column, char } + }; } \ No newline at end of file diff --git a/test/cli/samples/dev/expected/Main.js b/test/cli/samples/dev/expected/Main.js index 88f6fddfe0..1e9d5b083a 100644 --- a/test/cli/samples/dev/expected/Main.js +++ b/test/cli/samples/dev/expected/Main.js @@ -68,7 +68,9 @@ function createText(data) { } function addLoc(element, file, line, column, char) { - element.__svelte_meta = { file, line, column, char }; + element.__svelte_meta = { + loc: { file, line, column, char } + }; } function insertNode(node, target, anchor) { diff --git a/test/js/samples/dev-warning-missing-data-computed/expected-bundle.js b/test/js/samples/dev-warning-missing-data-computed/expected-bundle.js index dd0f7b2640..0e9722426a 100644 --- a/test/js/samples/dev-warning-missing-data-computed/expected-bundle.js +++ b/test/js/samples/dev-warning-missing-data-computed/expected-bundle.js @@ -6,7 +6,9 @@ function assign(tar, src) { } function addLoc(element, file, line, column, char) { - element.__svelte_meta = { file, line, column, char }; + element.__svelte_meta = { + loc: { file, line, column, char } + }; } function appendNode(node, target) { diff --git a/test/runtime/samples/element-source-location/_config.js b/test/runtime/samples/element-source-location/_config.js index f99ee5ef77..47ae986cbb 100644 --- a/test/runtime/samples/element-source-location/_config.js +++ b/test/runtime/samples/element-source-location/_config.js @@ -7,14 +7,14 @@ export default { const h1 = target.querySelector('h1'); const p = target.querySelector('p'); - assert.deepEqual(h1.__svelte_meta, { + assert.deepEqual(h1.__svelte_meta.loc, { file: path.relative(process.cwd(), path.resolve(__dirname, 'main.html')), line: 0, column: 0, char: 0 }); - assert.deepEqual(p.__svelte_meta, { + assert.deepEqual(p.__svelte_meta.loc, { file: path.relative(process.cwd(), path.resolve(__dirname, 'Foo.html')), line: 1, column: 1,