Skip to content

Commit 6ea1612

Browse files
authored
Merge pull request #1210 from ekhaled/some_fixes
fixes #1188, fixes #1201
2 parents 18d3313 + f9d606a commit 6ea1612

File tree

69 files changed

+147
-99
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+147
-99
lines changed

src/generators/dom/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ export default function dom(
267267
this._fragment.c();
268268
this._fragment.${block.hasIntroMethod ? 'i' : 'm'}(this.shadowRoot, null);
269269
270-
if (options.target) this._mount(options.target, options.anchor || null);
270+
if (options.target) this._mount(options.target, options.anchor);
271271
` : deindent`
272272
if (options.target) {
273273
${generator.hydratable
@@ -280,7 +280,7 @@ export default function dom(
280280
${options.dev && `if (options.hydrate) throw new Error("options.hydrate only works if the component was compiled with the \`hydratable: true\` option");`}
281281
this._fragment.c();
282282
`}
283-
this._fragment.${block.hasIntroMethod ? 'i' : 'm'}(options.target, options.anchor || null);
283+
this._mount(options.target, options.anchor);
284284
285285
${(generator.hasComponents || generator.hasComplexBindings || templateProperties.oncreate || generator.hasIntroTransitions) && deindent`
286286
${generator.hasComponents && `this._lock = true;`}

src/shared/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ export function callAll(fns) {
185185
}
186186

187187
export function _mount(target, anchor) {
188-
this._fragment.m(target, anchor);
188+
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
189189
}
190190

191191
export function _unmount() {

test/js/samples/collapses-text-around-comments/expected-bundle.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ function callAll(fns) {
171171
}
172172

173173
function _mount(target, anchor) {
174-
this._fragment.m(target, anchor);
174+
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
175175
}
176176

177177
function _unmount() {
@@ -252,7 +252,7 @@ function SvelteComponent(options) {
252252

253253
if (options.target) {
254254
this._fragment.c();
255-
this._fragment.m(options.target, options.anchor || null);
255+
this._mount(options.target, options.anchor);
256256
}
257257
}
258258

test/js/samples/collapses-text-around-comments/expected.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function SvelteComponent(options) {
5959

6060
if (options.target) {
6161
this._fragment.c();
62-
this._fragment.m(options.target, options.anchor || null);
62+
this._mount(options.target, options.anchor);
6363
}
6464
}
6565

test/js/samples/component-static-immutable/expected-bundle.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ function callAll(fns) {
151151
}
152152

153153
function _mount(target, anchor) {
154-
this._fragment.m(target, anchor);
154+
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
155155
}
156156

157157
function _unmount() {
@@ -219,7 +219,7 @@ function SvelteComponent(options) {
219219

220220
if (options.target) {
221221
this._fragment.c();
222-
this._fragment.m(options.target, options.anchor || null);
222+
this._mount(options.target, options.anchor);
223223

224224
this._lock = true;
225225
callAll(this._beforecreate);

test/js/samples/component-static-immutable/expected.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function SvelteComponent(options) {
4545

4646
if (options.target) {
4747
this._fragment.c();
48-
this._fragment.m(options.target, options.anchor || null);
48+
this._mount(options.target, options.anchor);
4949

5050
this._lock = true;
5151
callAll(this._beforecreate);

test/js/samples/component-static-immutable2/expected-bundle.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ function callAll(fns) {
151151
}
152152

153153
function _mount(target, anchor) {
154-
this._fragment.m(target, anchor);
154+
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
155155
}
156156

157157
function _unmount() {
@@ -219,7 +219,7 @@ function SvelteComponent(options) {
219219

220220
if (options.target) {
221221
this._fragment.c();
222-
this._fragment.m(options.target, options.anchor || null);
222+
this._mount(options.target, options.anchor);
223223

224224
this._lock = true;
225225
callAll(this._beforecreate);

test/js/samples/component-static-immutable2/expected.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function SvelteComponent(options) {
4545

4646
if (options.target) {
4747
this._fragment.c();
48-
this._fragment.m(options.target, options.anchor || null);
48+
this._mount(options.target, options.anchor);
4949

5050
this._lock = true;
5151
callAll(this._beforecreate);

test/js/samples/component-static/expected-bundle.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ function callAll(fns) {
147147
}
148148

149149
function _mount(target, anchor) {
150-
this._fragment.m(target, anchor);
150+
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
151151
}
152152

153153
function _unmount() {
@@ -215,7 +215,7 @@ function SvelteComponent(options) {
215215

216216
if (options.target) {
217217
this._fragment.c();
218-
this._fragment.m(options.target, options.anchor || null);
218+
this._mount(options.target, options.anchor);
219219

220220
this._lock = true;
221221
callAll(this._beforecreate);

test/js/samples/component-static/expected.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function SvelteComponent(options) {
4545

4646
if (options.target) {
4747
this._fragment.c();
48-
this._fragment.m(options.target, options.anchor || null);
48+
this._mount(options.target, options.anchor);
4949

5050
this._lock = true;
5151
callAll(this._beforecreate);

test/js/samples/computed-collapsed-if/expected-bundle.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ function callAll(fns) {
147147
}
148148

149149
function _mount(target, anchor) {
150-
this._fragment.m(target, anchor);
150+
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
151151
}
152152

153153
function _unmount() {
@@ -203,7 +203,7 @@ function SvelteComponent(options) {
203203

204204
if (options.target) {
205205
this._fragment.c();
206-
this._fragment.m(options.target, options.anchor || null);
206+
this._mount(options.target, options.anchor);
207207
}
208208
}
209209

test/js/samples/computed-collapsed-if/expected.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function SvelteComponent(options) {
3333

3434
if (options.target) {
3535
this._fragment.c();
36-
this._fragment.m(options.target, options.anchor || null);
36+
this._mount(options.target, options.anchor);
3737
}
3838
}
3939

test/js/samples/css-media-query/expected-bundle.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ function callAll(fns) {
167167
}
168168

169169
function _mount(target, anchor) {
170-
this._fragment.m(target, anchor);
170+
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
171171
}
172172

173173
function _unmount() {
@@ -239,7 +239,7 @@ function SvelteComponent(options) {
239239

240240
if (options.target) {
241241
this._fragment.c();
242-
this._fragment.m(options.target, options.anchor || null);
242+
this._mount(options.target, options.anchor);
243243
}
244244
}
245245

test/js/samples/css-media-query/expected.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function SvelteComponent(options) {
4949

5050
if (options.target) {
5151
this._fragment.c();
52-
this._fragment.m(options.target, options.anchor || null);
52+
this._mount(options.target, options.anchor);
5353
}
5454
}
5555

test/js/samples/css-shadow-dom-keyframes/expected-bundle.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ function callAll(fns) {
159159
}
160160

161161
function _mount(target, anchor) {
162-
this._fragment.m(target, anchor);
162+
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
163163
}
164164

165165
function _unmount() {
@@ -221,7 +221,7 @@ class SvelteComponent extends HTMLElement {
221221
this._fragment.c();
222222
this._fragment.m(this.shadowRoot, null);
223223

224-
if (options.target) this._mount(options.target, options.anchor || null);
224+
if (options.target) this._mount(options.target, options.anchor);
225225
}
226226

227227
static get observedAttributes() {

test/js/samples/css-shadow-dom-keyframes/expected.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class SvelteComponent extends HTMLElement {
3939
this._fragment.c();
4040
this._fragment.m(this.shadowRoot, null);
4141

42-
if (options.target) this._mount(options.target, options.anchor || null);
42+
if (options.target) this._mount(options.target, options.anchor);
4343
}
4444

4545
static get observedAttributes() {

test/js/samples/deconflict-globals/expected-bundle.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ function callAll(fns) {
147147
}
148148

149149
function _mount(target, anchor) {
150-
this._fragment.m(target, anchor);
150+
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
151151
}
152152

153153
function _unmount() {
@@ -211,7 +211,7 @@ function SvelteComponent(options) {
211211

212212
if (options.target) {
213213
this._fragment.c();
214-
this._fragment.m(options.target, options.anchor || null);
214+
this._mount(options.target, options.anchor);
215215

216216
callAll(this._oncreate);
217217
}

test/js/samples/deconflict-globals/expected.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function SvelteComponent(options) {
4242

4343
if (options.target) {
4444
this._fragment.c();
45-
this._fragment.m(options.target, options.anchor || null);
45+
this._mount(options.target, options.anchor);
4646

4747
callAll(this._oncreate);
4848
}

test/js/samples/do-use-dataset/expected-bundle.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ function callAll(fns) {
163163
}
164164

165165
function _mount(target, anchor) {
166-
this._fragment.m(target, anchor);
166+
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
167167
}
168168

169169
function _unmount() {
@@ -233,7 +233,7 @@ function SvelteComponent(options) {
233233

234234
if (options.target) {
235235
this._fragment.c();
236-
this._fragment.m(options.target, options.anchor || null);
236+
this._mount(options.target, options.anchor);
237237
}
238238
}
239239

test/js/samples/do-use-dataset/expected.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function SvelteComponent(options) {
4747

4848
if (options.target) {
4949
this._fragment.c();
50-
this._fragment.m(options.target, options.anchor || null);
50+
this._mount(options.target, options.anchor);
5151
}
5252
}
5353

test/js/samples/dont-use-dataset-in-legacy/expected-bundle.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ function callAll(fns) {
167167
}
168168

169169
function _mount(target, anchor) {
170-
this._fragment.m(target, anchor);
170+
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
171171
}
172172

173173
function _unmount() {
@@ -237,7 +237,7 @@ function SvelteComponent(options) {
237237

238238
if (options.target) {
239239
this._fragment.c();
240-
this._fragment.m(options.target, options.anchor || null);
240+
this._mount(options.target, options.anchor);
241241
}
242242
}
243243

test/js/samples/dont-use-dataset-in-legacy/expected.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function SvelteComponent(options) {
4747

4848
if (options.target) {
4949
this._fragment.c();
50-
this._fragment.m(options.target, options.anchor || null);
50+
this._mount(options.target, options.anchor);
5151
}
5252
}
5353

test/js/samples/dont-use-dataset-in-svg/expected-bundle.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ function callAll(fns) {
167167
}
168168

169169
function _mount(target, anchor) {
170-
this._fragment.m(target, anchor);
170+
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
171171
}
172172

173173
function _unmount() {
@@ -235,7 +235,7 @@ function SvelteComponent(options) {
235235

236236
if (options.target) {
237237
this._fragment.c();
238-
this._fragment.m(options.target, options.anchor || null);
238+
this._mount(options.target, options.anchor);
239239
}
240240
}
241241

test/js/samples/dont-use-dataset-in-svg/expected.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function SvelteComponent(options) {
4545

4646
if (options.target) {
4747
this._fragment.c();
48-
this._fragment.m(options.target, options.anchor || null);
48+
this._mount(options.target, options.anchor);
4949
}
5050
}
5151

test/js/samples/each-block-changed-check/expected-bundle.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ function callAll(fns) {
179179
}
180180

181181
function _mount(target, anchor) {
182-
this._fragment.m(target, anchor);
182+
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
183183
}
184184

185185
function _unmount() {
@@ -360,7 +360,7 @@ function SvelteComponent(options) {
360360

361361
if (options.target) {
362362
this._fragment.c();
363-
this._fragment.m(options.target, options.anchor || null);
363+
this._mount(options.target, options.anchor);
364364
}
365365
}
366366

test/js/samples/each-block-changed-check/expected.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ function SvelteComponent(options) {
158158

159159
if (options.target) {
160160
this._fragment.c();
161-
this._fragment.m(options.target, options.anchor || null);
161+
this._mount(options.target, options.anchor);
162162
}
163163
}
164164

test/js/samples/event-handlers-custom/expected-bundle.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ function callAll(fns) {
159159
}
160160

161161
function _mount(target, anchor) {
162-
this._fragment.m(target, anchor);
162+
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
163163
}
164164

165165
function _unmount() {
@@ -233,7 +233,7 @@ function SvelteComponent(options) {
233233

234234
if (options.target) {
235235
this._fragment.c();
236-
this._fragment.m(options.target, options.anchor || null);
236+
this._mount(options.target, options.anchor);
237237
}
238238
}
239239

test/js/samples/event-handlers-custom/expected.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function SvelteComponent(options) {
5252

5353
if (options.target) {
5454
this._fragment.c();
55-
this._fragment.m(options.target, options.anchor || null);
55+
this._mount(options.target, options.anchor);
5656
}
5757
}
5858

test/js/samples/head-no-whitespace/expected-bundle.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ function callAll(fns) {
159159
}
160160

161161
function _mount(target, anchor) {
162-
this._fragment.m(target, anchor);
162+
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
163163
}
164164

165165
function _unmount() {
@@ -224,7 +224,7 @@ function SvelteComponent(options) {
224224

225225
if (options.target) {
226226
this._fragment.c();
227-
this._fragment.m(options.target, options.anchor || null);
227+
this._mount(options.target, options.anchor);
228228
}
229229
}
230230

0 commit comments

Comments
 (0)