tighten up a bit more

pull/855/head
Rich Harris 7 years ago
parent bd002f94bc
commit ef3cf34367

@ -160,7 +160,7 @@ function keyed(
const last = block.getUniqueName(`${each_block}_last`); const last = block.getUniqueName(`${each_block}_last`);
const expected = block.getUniqueName(`${each_block}_expected`); const expected = block.getUniqueName(`${each_block}_expected`);
block.addVariable(lookup, `Object.create(null)`); block.addVariable(lookup, `@blankObject()`);
block.addVariable(head); block.addVariable(head);
block.addVariable(last); block.addVariable(last);

@ -4,6 +4,10 @@ export * from './dom.js';
export * from './transitions.js'; export * from './transitions.js';
export * from './utils.js'; export * from './utils.js';
export function blankObject() {
return Object.create(null);
}
export function destroy(detach) { export function destroy(detach) {
this.destroy = noop; this.destroy = noop;
this.fire('destroy'); this.fire('destroy');
@ -63,13 +67,8 @@ export function get(key) {
export function init(component, options) { export function init(component, options) {
component.options = options; component.options = options;
component._observers = { component._observers = { pre: blankObject(), post: blankObject() };
pre: Object.create(null), component._handlers = blankObject();
post: Object.create(null)
};
component._handlers = Object.create(null);
component._root = options._root || component; component._root = options._root || component;
component._yield = options._yield; component._yield = options._yield;
component._bind = options._bind; component._bind = options._bind;

Loading…
Cancel
Save