Skip to content

Commit

Permalink
Merge pull request #1210 from ekhaled/some_fixes
Browse files Browse the repository at this point in the history
fixes #1188, fixes #1201
  • Loading branch information
Rich-Harris authored Mar 6, 2018
2 parents 18d3313 + f9d606a commit 6ea1612
Show file tree
Hide file tree
Showing 69 changed files with 147 additions and 99 deletions.
4 changes: 2 additions & 2 deletions src/generators/dom/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ export default function dom(
this._fragment.c();
this._fragment.${block.hasIntroMethod ? 'i' : 'm'}(this.shadowRoot, null);
if (options.target) this._mount(options.target, options.anchor || null);
if (options.target) this._mount(options.target, options.anchor);
` : deindent`
if (options.target) {
${generator.hydratable
Expand All @@ -280,7 +280,7 @@ export default function dom(
${options.dev && `if (options.hydrate) throw new Error("options.hydrate only works if the component was compiled with the \`hydratable: true\` option");`}
this._fragment.c();
`}
this._fragment.${block.hasIntroMethod ? 'i' : 'm'}(options.target, options.anchor || null);
this._mount(options.target, options.anchor);
${(generator.hasComponents || generator.hasComplexBindings || templateProperties.oncreate || generator.hasIntroTransitions) && deindent`
${generator.hasComponents && `this._lock = true;`}
Expand Down
2 changes: 1 addition & 1 deletion src/shared/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export function callAll(fns) {
}

export function _mount(target, anchor) {
this._fragment.m(target, anchor);
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}

export function _unmount() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ function callAll(fns) {
}

function _mount(target, anchor) {
this._fragment.m(target, anchor);
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}

function _unmount() {
Expand Down Expand Up @@ -252,7 +252,7 @@ function SvelteComponent(options) {

if (options.target) {
this._fragment.c();
this._fragment.m(options.target, options.anchor || null);
this._mount(options.target, options.anchor);
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/collapses-text-around-comments/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function SvelteComponent(options) {

if (options.target) {
this._fragment.c();
this._fragment.m(options.target, options.anchor || null);
this._mount(options.target, options.anchor);
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/js/samples/component-static-immutable/expected-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ function callAll(fns) {
}

function _mount(target, anchor) {
this._fragment.m(target, anchor);
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}

function _unmount() {
Expand Down Expand Up @@ -219,7 +219,7 @@ function SvelteComponent(options) {

if (options.target) {
this._fragment.c();
this._fragment.m(options.target, options.anchor || null);
this._mount(options.target, options.anchor);

this._lock = true;
callAll(this._beforecreate);
Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/component-static-immutable/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function SvelteComponent(options) {

if (options.target) {
this._fragment.c();
this._fragment.m(options.target, options.anchor || null);
this._mount(options.target, options.anchor);

this._lock = true;
callAll(this._beforecreate);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ function callAll(fns) {
}

function _mount(target, anchor) {
this._fragment.m(target, anchor);
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}

function _unmount() {
Expand Down Expand Up @@ -219,7 +219,7 @@ function SvelteComponent(options) {

if (options.target) {
this._fragment.c();
this._fragment.m(options.target, options.anchor || null);
this._mount(options.target, options.anchor);

this._lock = true;
callAll(this._beforecreate);
Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/component-static-immutable2/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function SvelteComponent(options) {

if (options.target) {
this._fragment.c();
this._fragment.m(options.target, options.anchor || null);
this._mount(options.target, options.anchor);

this._lock = true;
callAll(this._beforecreate);
Expand Down
4 changes: 2 additions & 2 deletions test/js/samples/component-static/expected-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function callAll(fns) {
}

function _mount(target, anchor) {
this._fragment.m(target, anchor);
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}

function _unmount() {
Expand Down Expand Up @@ -215,7 +215,7 @@ function SvelteComponent(options) {

if (options.target) {
this._fragment.c();
this._fragment.m(options.target, options.anchor || null);
this._mount(options.target, options.anchor);

this._lock = true;
callAll(this._beforecreate);
Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/component-static/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function SvelteComponent(options) {

if (options.target) {
this._fragment.c();
this._fragment.m(options.target, options.anchor || null);
this._mount(options.target, options.anchor);

this._lock = true;
callAll(this._beforecreate);
Expand Down
4 changes: 2 additions & 2 deletions test/js/samples/computed-collapsed-if/expected-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function callAll(fns) {
}

function _mount(target, anchor) {
this._fragment.m(target, anchor);
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}

function _unmount() {
Expand Down Expand Up @@ -203,7 +203,7 @@ function SvelteComponent(options) {

if (options.target) {
this._fragment.c();
this._fragment.m(options.target, options.anchor || null);
this._mount(options.target, options.anchor);
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/computed-collapsed-if/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function SvelteComponent(options) {

if (options.target) {
this._fragment.c();
this._fragment.m(options.target, options.anchor || null);
this._mount(options.target, options.anchor);
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/js/samples/css-media-query/expected-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ function callAll(fns) {
}

function _mount(target, anchor) {
this._fragment.m(target, anchor);
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}

function _unmount() {
Expand Down Expand Up @@ -239,7 +239,7 @@ function SvelteComponent(options) {

if (options.target) {
this._fragment.c();
this._fragment.m(options.target, options.anchor || null);
this._mount(options.target, options.anchor);
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/css-media-query/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function SvelteComponent(options) {

if (options.target) {
this._fragment.c();
this._fragment.m(options.target, options.anchor || null);
this._mount(options.target, options.anchor);
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/js/samples/css-shadow-dom-keyframes/expected-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ function callAll(fns) {
}

function _mount(target, anchor) {
this._fragment.m(target, anchor);
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}

function _unmount() {
Expand Down Expand Up @@ -221,7 +221,7 @@ class SvelteComponent extends HTMLElement {
this._fragment.c();
this._fragment.m(this.shadowRoot, null);

if (options.target) this._mount(options.target, options.anchor || null);
if (options.target) this._mount(options.target, options.anchor);
}

static get observedAttributes() {
Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/css-shadow-dom-keyframes/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class SvelteComponent extends HTMLElement {
this._fragment.c();
this._fragment.m(this.shadowRoot, null);

if (options.target) this._mount(options.target, options.anchor || null);
if (options.target) this._mount(options.target, options.anchor);
}

static get observedAttributes() {
Expand Down
4 changes: 2 additions & 2 deletions test/js/samples/deconflict-globals/expected-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function callAll(fns) {
}

function _mount(target, anchor) {
this._fragment.m(target, anchor);
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}

function _unmount() {
Expand Down Expand Up @@ -211,7 +211,7 @@ function SvelteComponent(options) {

if (options.target) {
this._fragment.c();
this._fragment.m(options.target, options.anchor || null);
this._mount(options.target, options.anchor);

callAll(this._oncreate);
}
Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/deconflict-globals/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function SvelteComponent(options) {

if (options.target) {
this._fragment.c();
this._fragment.m(options.target, options.anchor || null);
this._mount(options.target, options.anchor);

callAll(this._oncreate);
}
Expand Down
4 changes: 2 additions & 2 deletions test/js/samples/do-use-dataset/expected-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ function callAll(fns) {
}

function _mount(target, anchor) {
this._fragment.m(target, anchor);
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}

function _unmount() {
Expand Down Expand Up @@ -233,7 +233,7 @@ function SvelteComponent(options) {

if (options.target) {
this._fragment.c();
this._fragment.m(options.target, options.anchor || null);
this._mount(options.target, options.anchor);
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/do-use-dataset/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function SvelteComponent(options) {

if (options.target) {
this._fragment.c();
this._fragment.m(options.target, options.anchor || null);
this._mount(options.target, options.anchor);
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/js/samples/dont-use-dataset-in-legacy/expected-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ function callAll(fns) {
}

function _mount(target, anchor) {
this._fragment.m(target, anchor);
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}

function _unmount() {
Expand Down Expand Up @@ -237,7 +237,7 @@ function SvelteComponent(options) {

if (options.target) {
this._fragment.c();
this._fragment.m(options.target, options.anchor || null);
this._mount(options.target, options.anchor);
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/dont-use-dataset-in-legacy/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function SvelteComponent(options) {

if (options.target) {
this._fragment.c();
this._fragment.m(options.target, options.anchor || null);
this._mount(options.target, options.anchor);
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/js/samples/dont-use-dataset-in-svg/expected-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ function callAll(fns) {
}

function _mount(target, anchor) {
this._fragment.m(target, anchor);
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}

function _unmount() {
Expand Down Expand Up @@ -235,7 +235,7 @@ function SvelteComponent(options) {

if (options.target) {
this._fragment.c();
this._fragment.m(options.target, options.anchor || null);
this._mount(options.target, options.anchor);
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/dont-use-dataset-in-svg/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function SvelteComponent(options) {

if (options.target) {
this._fragment.c();
this._fragment.m(options.target, options.anchor || null);
this._mount(options.target, options.anchor);
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/js/samples/each-block-changed-check/expected-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ function callAll(fns) {
}

function _mount(target, anchor) {
this._fragment.m(target, anchor);
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}

function _unmount() {
Expand Down Expand Up @@ -360,7 +360,7 @@ function SvelteComponent(options) {

if (options.target) {
this._fragment.c();
this._fragment.m(options.target, options.anchor || null);
this._mount(options.target, options.anchor);
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/each-block-changed-check/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ function SvelteComponent(options) {

if (options.target) {
this._fragment.c();
this._fragment.m(options.target, options.anchor || null);
this._mount(options.target, options.anchor);
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/js/samples/event-handlers-custom/expected-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ function callAll(fns) {
}

function _mount(target, anchor) {
this._fragment.m(target, anchor);
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}

function _unmount() {
Expand Down Expand Up @@ -233,7 +233,7 @@ function SvelteComponent(options) {

if (options.target) {
this._fragment.c();
this._fragment.m(options.target, options.anchor || null);
this._mount(options.target, options.anchor);
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/event-handlers-custom/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function SvelteComponent(options) {

if (options.target) {
this._fragment.c();
this._fragment.m(options.target, options.anchor || null);
this._mount(options.target, options.anchor);
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/js/samples/head-no-whitespace/expected-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ function callAll(fns) {
}

function _mount(target, anchor) {
this._fragment.m(target, anchor);
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}

function _unmount() {
Expand Down Expand Up @@ -224,7 +224,7 @@ function SvelteComponent(options) {

if (options.target) {
this._fragment.c();
this._fragment.m(options.target, options.anchor || null);
this._mount(options.target, options.anchor);
}
}

Expand Down
Loading

0 comments on commit 6ea1612

Please sign in to comment.