pull/4923/head
pushkine 5 years ago
parent a34ac31558
commit 2b6e4dc963

@ -1,4 +1,3 @@
import { assign } from '../../runtime/internal/utils';
import Stats from '../Stats'; import Stats from '../Stats';
import parse from '../parse/index'; import parse from '../parse/index';
import render_dom from './render_dom/index'; import render_dom from './render_dom/index';
@ -68,7 +67,7 @@ function validate_options(options: CompileOptions, warnings: Warning[]) {
} }
export default function compile(source: string, options: CompileOptions = {}) { export default function compile(source: string, options: CompileOptions = {}) {
options = assign({ generate: 'dom', dev: false }, options); options = { generate: 'dom', dev: false, ...options };
const stats = new Stats(); const stats = new Stats();
const warnings = []; const warnings = [];

@ -267,7 +267,7 @@ export default function dom(
const insert = (reassigned || export_name) const insert = (reassigned || export_name)
? b`${`$$subscribe_${name}`}()` ? b`${`$$subscribe_${name}`}()`
: b`$$self.$$.on_destroy.push(@subscribe(${name}, #value => {$$invalidate(${i}, (${value} = #value));})`; : b`$$self.$$.on_destroy.push(@subscribe(${name}, #value => {$$invalidate(${i}, ${value} = #value);}))`;
if (component.compile_options.dev) { if (component.compile_options.dev) {
return b`@validate_store(${name}, '${name}'); ${insert}`; return b`@validate_store(${name}, '${name}'); ${insert}`;

Loading…
Cancel
Save