deconflict with implicit props - fixes #1957

pull/1961/head
Richard Harris 6 years ago
parent dcad65b118
commit 423e4e6cbc

@ -170,6 +170,7 @@ export default class Component {
const props = [...this.template_references]; const props = [...this.template_references];
this.declarations.push(...props); this.declarations.push(...props);
addToSet(this.writable_declarations, this.template_references); addToSet(this.writable_declarations, this.template_references);
addToSet(this.userVars, this.template_references);
this.props = props.map(name => ({ this.props = props.map(name => ({
name, name,

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { SvelteComponent as SvelteComponent_1, append, createComment, createElement, createText, destroyEach, detachNode, flush, init, insert, run, safe_not_equal, setData } from "svelte/internal"; import { SvelteComponent as SvelteComponent_1, append, createComment, createElement as createElement_1, createText, destroyEach, detachNode, flush, init, insert, run, safe_not_equal, setData } from "svelte/internal";
function get_each_context(ctx, list, i) { function get_each_context(ctx, list, i) {
const child_ctx = Object.create(ctx); const child_ctx = Object.create(ctx);
@ -13,7 +13,7 @@ function create_each_block($$, ctx) {
return { return {
c() { c() {
span = createElement("span"); span = createElement_1("span");
text = createText(text_value); text = createText(text_value);
}, },

@ -2,7 +2,7 @@
import { SvelteComponent as SvelteComponent_1, append, createElement, detachNode, flush, init, insert, run, safe_not_equal } from "svelte/internal"; import { SvelteComponent as SvelteComponent_1, append, createElement, detachNode, flush, init, insert, run, safe_not_equal } from "svelte/internal";
function create_fragment($$, ctx) { function create_fragment($$, ctx) {
var select, option0, option1, select_value_value, current; var select, option0, option1, select_value_value, current_1;
return { return {
c() { c() {
@ -32,7 +32,7 @@ function create_fragment($$, ctx) {
} }
} }
current = true; current_1 = true;
}, },
p(changed, ctx) { p(changed, ctx) {
@ -49,7 +49,7 @@ function create_fragment($$, ctx) {
}, },
i(target, anchor) { i(target, anchor) {
if (current) return; if (current_1) return;
this.m(target, anchor); this.m(target, anchor);
}, },

@ -0,0 +1,11 @@
export default {
preserveIdentifiers: true,
props: {
click_handler: 'x'
},
html: `
<button>x</button>
`
};

@ -0,0 +1 @@
<button on:click="{() => foo()}">{click_handler}</button>
Loading…
Cancel
Save