Skip to content

Commit ef3cf34

Browse files
committed
tighten up a bit more
1 parent bd002f9 commit ef3cf34

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/generators/dom/visitors/EachBlock.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ function keyed(
160160
const last = block.getUniqueName(`${each_block}_last`);
161161
const expected = block.getUniqueName(`${each_block}_expected`);
162162

163-
block.addVariable(lookup, `Object.create(null)`);
163+
block.addVariable(lookup, `@blankObject()`);
164164
block.addVariable(head);
165165
block.addVariable(last);
166166

src/shared/index.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ export * from './dom.js';
44
export * from './transitions.js';
55
export * from './utils.js';
66

7+
export function blankObject() {
8+
return Object.create(null);
9+
}
10+
711
export function destroy(detach) {
812
this.destroy = noop;
913
this.fire('destroy');
@@ -63,13 +67,8 @@ export function get(key) {
6367
export function init(component, options) {
6468
component.options = options;
6569

66-
component._observers = {
67-
pre: Object.create(null),
68-
post: Object.create(null)
69-
};
70-
71-
component._handlers = Object.create(null);
72-
70+
component._observers = { pre: blankObject(), post: blankObject() };
71+
component._handlers = blankObject();
7372
component._root = options._root || component;
7473
component._yield = options._yield;
7574
component._bind = options._bind;

0 commit comments

Comments
 (0)