From d386efdb0d151475b51627442deff32d5ef0adb7 Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Tue, 17 Sep 2019 20:36:45 -0400 Subject: [PATCH] fix filename var --- src/compiler/compile/render_dom/index.ts | 6 +++--- test/runtime/index.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/compiler/compile/render_dom/index.ts b/src/compiler/compile/render_dom/index.ts index 066a30563e..2abfc1a308 100644 --- a/src/compiler/compile/render_dom/index.ts +++ b/src/compiler/compile/render_dom/index.ts @@ -26,8 +26,8 @@ export default function dom( const body = []; - if (component.compile_options.dev) { - body.push(b`const ${renderer.file_var} = ${component.file && stringify(component.file, { only_escape_at_symbol: true })};`); + if (component.compile_options.dev && component.file) { + body.push(b`const ${renderer.file_var} = "${component.file}";`); } const css = component.stylesheet.render(options.filename, !options.customElement); @@ -364,7 +364,7 @@ export default function dom( let unknown_props_check; if (component.compile_options.dev && !component.var_lookup.has('$$props') && writable_props.length) { unknown_props_check = b` - const writable_props = [${writable_props.map(prop => `'${prop.export_name}'`)}]; + const writable_props = [${writable_props.map(prop => x`'${prop.export_name}'`)}]; @_Object.keys($$props).forEach(key => { if (!writable_props.includes(key) && !key.startsWith('$$')) @_console.warn(\`<${component.tag}> was created with unknown prop '\${key}'\`); }); diff --git a/test/runtime/index.js b/test/runtime/index.js index c3583ddccf..28ef9e4d78 100644 --- a/test/runtime/index.js +++ b/test/runtime/index.js @@ -3,7 +3,7 @@ import * as path from "path"; import * as fs from "fs"; import { rollup } from 'rollup'; import * as virtual from 'rollup-plugin-virtual'; -import { clear_loops, flush, set_now, set_raf, component_subscribe } from "../../internal"; +import { clear_loops, flush, set_now, set_raf } from "../../internal"; import { showOutput, @@ -229,7 +229,7 @@ describe.only("runtime", () => { }), { name: 'svelte-packages', - resolveId: (importee, importer) => { + resolveId: (importee) => { if (importee.startsWith('svelte/')) { return importee.replace('svelte', process.cwd()) + '/index.mjs'; }