mirror of
https://github.com/sveltejs/svelte.git
synced 2024-12-01 17:30:59 +01:00
tighten up a bit more
This commit is contained in:
parent
bd002f94bc
commit
ef3cf34367
@ -160,7 +160,7 @@ function keyed(
|
||||
const last = block.getUniqueName(`${each_block}_last`);
|
||||
const expected = block.getUniqueName(`${each_block}_expected`);
|
||||
|
||||
block.addVariable(lookup, `Object.create(null)`);
|
||||
block.addVariable(lookup, `@blankObject()`);
|
||||
block.addVariable(head);
|
||||
block.addVariable(last);
|
||||
|
||||
|
@ -4,6 +4,10 @@ export * from './dom.js';
|
||||
export * from './transitions.js';
|
||||
export * from './utils.js';
|
||||
|
||||
export function blankObject() {
|
||||
return Object.create(null);
|
||||
}
|
||||
|
||||
export function destroy(detach) {
|
||||
this.destroy = noop;
|
||||
this.fire('destroy');
|
||||
@ -63,13 +67,8 @@ export function get(key) {
|
||||
export function init(component, options) {
|
||||
component.options = options;
|
||||
|
||||
component._observers = {
|
||||
pre: Object.create(null),
|
||||
post: Object.create(null)
|
||||
};
|
||||
|
||||
component._handlers = Object.create(null);
|
||||
|
||||
component._observers = { pre: blankObject(), post: blankObject() };
|
||||
component._handlers = blankObject();
|
||||
component._root = options._root || component;
|
||||
component._yield = options._yield;
|
||||
component._bind = options._bind;
|
||||
|
Loading…
Reference in New Issue
Block a user