deconflict with builtins (#3724)

pull/3770/head
Tan Li Hau 5 years ago committed by Conduitry
parent e3953b234c
commit fca35def53

@ -146,11 +146,13 @@ export default class Block {
if (!wrapper.var) continue;
let suffix = '';
if (dupes.has(wrapper.var.name)) {
const i = counts.get(wrapper.var.name) || 0;
counts.set(wrapper.var.name, i + 1);
wrapper.var.name = this.get_unique_name(wrapper.var.name + i).name;
suffix = i;
}
wrapper.var.name = this.get_unique_name(wrapper.var.name + suffix).name;
}
}

@ -60,7 +60,7 @@ function create_each_block(ctx) {
}
function create_fragment(ctx) {
let each_anchor;
let each_1_anchor;
let each_value = things;
let each_blocks = [];
@ -74,7 +74,7 @@ function create_fragment(ctx) {
each_blocks[i].c();
}
each_anchor = empty();
each_1_anchor = empty();
},
l: function claim(nodes) {
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
@ -84,7 +84,7 @@ function create_fragment(ctx) {
each_blocks[i].m(target, anchor);
}
insert_dev(target, each_anchor, anchor);
insert_dev(target, each_1_anchor, anchor);
},
p: function update(changed, ctx) {
if (changed.things) {
@ -99,7 +99,7 @@ function create_fragment(ctx) {
} else {
each_blocks[i] = create_each_block(child_ctx);
each_blocks[i].c();
each_blocks[i].m(each_anchor.parentNode, each_anchor);
each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor);
}
}
@ -114,7 +114,7 @@ function create_fragment(ctx) {
o: noop,
d: function destroy(detaching) {
destroy_each(each_blocks, detaching);
if (detaching) detach_dev(each_anchor);
if (detaching) detach_dev(each_1_anchor);
}
};

@ -43,7 +43,7 @@ function create_each_block(ctx) {
}
function create_fragment(ctx) {
let each_anchor;
let each_1_anchor;
let each_value = ctx.createElement;
let each_blocks = [];
@ -57,14 +57,14 @@ function create_fragment(ctx) {
each_blocks[i].c();
}
each_anchor = empty();
each_1_anchor = empty();
},
m(target, anchor) {
for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].m(target, anchor);
}
insert(target, each_anchor, anchor);
insert(target, each_1_anchor, anchor);
},
p(changed, ctx) {
if (changed.createElement) {
@ -79,7 +79,7 @@ function create_fragment(ctx) {
} else {
each_blocks[i] = create_each_block(child_ctx);
each_blocks[i].c();
each_blocks[i].m(each_anchor.parentNode, each_anchor);
each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor);
}
}
@ -94,7 +94,7 @@ function create_fragment(ctx) {
o: noop,
d(detaching) {
destroy_each(each_blocks, detaching);
if (detaching) detach(each_anchor);
if (detaching) detach(each_1_anchor);
}
};
}

@ -43,7 +43,7 @@ function create_each_block(ctx) {
}
function create_fragment(ctx) {
let each_anchor;
let each_1_anchor;
let each_value = [ctx.a, ctx.b, ctx.c, ctx.d, ctx.e];
let each_blocks = [];
@ -57,14 +57,14 @@ function create_fragment(ctx) {
each_blocks[i].c();
}
each_anchor = empty();
each_1_anchor = empty();
},
m(target, anchor) {
for (let i = 0; i < 5; i += 1) {
each_blocks[i].m(target, anchor);
}
insert(target, each_anchor, anchor);
insert(target, each_1_anchor, anchor);
},
p(changed, ctx) {
if (changed.a || changed.b || changed.c || changed.d || changed.e) {
@ -79,7 +79,7 @@ function create_fragment(ctx) {
} else {
each_blocks[i] = create_each_block(child_ctx);
each_blocks[i].c();
each_blocks[i].m(each_anchor.parentNode, each_anchor);
each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor);
}
}
@ -92,7 +92,7 @@ function create_fragment(ctx) {
o: noop,
d(detaching) {
destroy_each(each_blocks, detaching);
if (detaching) detach(each_anchor);
if (detaching) detach(each_1_anchor);
}
};
}

@ -63,15 +63,15 @@ function create_each_block(key_1, ctx) {
function create_fragment(ctx) {
let each_blocks = [];
let each_lookup = new Map();
let each_anchor;
let each_1_lookup = new Map();
let each_1_anchor;
let each_value = ctx.things;
const get_key = ctx => ctx.thing.id;
for (let i = 0; i < each_value.length; i += 1) {
let child_ctx = get_each_context(ctx, each_value, i);
let key = get_key(child_ctx);
each_lookup.set(key, each_blocks[i] = create_each_block(key, child_ctx));
each_1_lookup.set(key, each_blocks[i] = create_each_block(key, child_ctx));
}
return {
@ -80,19 +80,19 @@ function create_fragment(ctx) {
each_blocks[i].c();
}
each_anchor = empty();
each_1_anchor = empty();
},
m(target, anchor) {
for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].m(target, anchor);
}
insert(target, each_anchor, anchor);
insert(target, each_1_anchor, anchor);
},
p(changed, ctx) {
const each_value = ctx.things;
for (let i = 0; i < each_blocks.length; i += 1) each_blocks[i].r();
each_blocks = update_keyed_each(each_blocks, changed, get_key, 1, ctx, each_value, each_lookup, each_anchor.parentNode, fix_and_destroy_block, create_each_block, each_anchor, get_each_context);
each_blocks = update_keyed_each(each_blocks, changed, get_key, 1, ctx, each_value, each_1_lookup, each_1_anchor.parentNode, fix_and_destroy_block, create_each_block, each_1_anchor, get_each_context);
for (let i = 0; i < each_blocks.length; i += 1) each_blocks[i].a();
},
i: noop,
@ -102,7 +102,7 @@ function create_fragment(ctx) {
each_blocks[i].d(detaching);
}
if (detaching) detach(each_anchor);
if (detaching) detach(each_1_anchor);
}
};
}

@ -48,15 +48,15 @@ function create_each_block(key_1, ctx) {
function create_fragment(ctx) {
let each_blocks = [];
let each_lookup = new Map();
let each_anchor;
let each_1_lookup = new Map();
let each_1_anchor;
let each_value = ctx.things;
const get_key = ctx => ctx.thing.id;
for (let i = 0; i < each_value.length; i += 1) {
let child_ctx = get_each_context(ctx, each_value, i);
let key = get_key(child_ctx);
each_lookup.set(key, each_blocks[i] = create_each_block(key, child_ctx));
each_1_lookup.set(key, each_blocks[i] = create_each_block(key, child_ctx));
}
return {
@ -65,18 +65,18 @@ function create_fragment(ctx) {
each_blocks[i].c();
}
each_anchor = empty();
each_1_anchor = empty();
},
m(target, anchor) {
for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].m(target, anchor);
}
insert(target, each_anchor, anchor);
insert(target, each_1_anchor, anchor);
},
p(changed, ctx) {
const each_value = ctx.things;
each_blocks = update_keyed_each(each_blocks, changed, get_key, 1, ctx, each_value, each_lookup, each_anchor.parentNode, destroy_block, create_each_block, each_anchor, get_each_context);
each_blocks = update_keyed_each(each_blocks, changed, get_key, 1, ctx, each_value, each_1_lookup, each_1_anchor.parentNode, destroy_block, create_each_block, each_1_anchor, get_each_context);
},
i: noop,
o: noop,
@ -85,7 +85,7 @@ function create_fragment(ctx) {
each_blocks[i].d(detaching);
}
if (detaching) detach(each_anchor);
if (detaching) detach(each_1_anchor);
}
};
}

@ -0,0 +1,4 @@
export default {
html: `<text>hello world</text>`,
preserveIdentifiers: true,
};

@ -0,0 +1,5 @@
<script>
let foo = 'hello world'
</script>
<text>{foo}</text>
Loading…
Cancel
Save