pull/1364/head
Rich Harris 7 years ago
parent 991bd9dce8
commit 8643b7ac88

@ -232,9 +232,9 @@ export default function dom(
${hasInitHooks && deindent`
this.root._oncreate.push(() => {
${templateProperties.onstate && `%onstate.call(this, { changed: @makePropertyMap(this._state), current: this._state });`}
${templateProperties.onstate && `%onstate.call(this, { changed: @assignTrue({}, this._state), current: this._state });`}
${templateProperties.oncreate && `%oncreate.call(this);`}
this.fire("update", { changed: @makePropertyMap(this._state), current: this._state });
this.fire("update", { changed: @assignTrue({}, this._state), current: this._state });
});
`}

@ -5,10 +5,7 @@ export function assign(tar, src) {
return tar;
}
export function makePropertyMap(obj) {
const map = {};
for (const key in obj) {
map[key] = 1;
}
return map;
export function assignTrue(tar, src) {
for (var k in src) tar[k] = 1;
return tar;
}

@ -5,12 +5,9 @@ function assign(tar, src) {
return tar;
}
function makePropertyMap(obj) {
const map = {};
for (const key in obj) {
map[key] = 1;
}
return map;
function assignTrue(tar, src) {
for (var k in src) tar[k] = 1;
return tar;
}
function blankObject() {
@ -166,7 +163,7 @@ function SvelteComponent(options) {
this.root._oncreate.push(() => {
oncreate.call(this);
this.fire("update", { changed: makePropertyMap(this._state), current: this._state });
this.fire("update", { changed: assignTrue({}, this._state), current: this._state });
});
if (options.target) {

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { assign, callAll, init, makePropertyMap, noop, proto } from "svelte/shared.js";
import { assign, assignTrue, callAll, init, noop, proto } from "svelte/shared.js";
function data_1() {
return {
@ -38,7 +38,7 @@ function SvelteComponent(options) {
this.root._oncreate.push(() => {
oncreate.call(this);
this.fire("update", { changed: makePropertyMap(this._state), current: this._state });
this.fire("update", { changed: assignTrue({}, this._state), current: this._state });
});
if (options.target) {

Loading…
Cancel
Save