Revert "get rid of `blank_object`"

This reverts commit 9e51c8612d.
pull/7703/head
Ivan Hofer 4 years ago
parent 590bee83da
commit 52489e05c3

@ -1,6 +1,6 @@
import { add_render_callback, flush, schedule_update, dirty_components } from './scheduler'; import { add_render_callback, flush, schedule_update, dirty_components } from './scheduler';
import { current_component, set_current_component } from './lifecycle'; import { current_component, set_current_component } from './lifecycle';
import { is_empty, is_function, run, run_all, noop } from './utils'; import { blank_object, is_empty, is_function, run, run_all, noop } from './utils';
import { children, detach, start_hydrating, end_hydrating } from './dom'; import { children, detach, start_hydrating, end_hydrating } from './dom';
import { transition_in } from './transitions'; import { transition_in } from './transitions';
@ -116,7 +116,7 @@ export function init(component, options, instance, create_fragment, not_equal, p
props, props,
update: noop, update: noop,
not_equal, not_equal,
bound: {}, bound: blank_object(),
// lifecycle // lifecycle
on_mount: [], on_mount: [],
@ -127,7 +127,7 @@ export function init(component, options, instance, create_fragment, not_equal, p
context: new Map(options.context || (parent_component ? parent_component.$$.context : [])), context: new Map(options.context || (parent_component ? parent_component.$$.context : [])),
// everything else // everything else
callbacks: {}, callbacks: blank_object(),
dirty, dirty,
skip_bound: false, skip_bound: false,
root: options.target || parent_component.$$.root root: options.target || parent_component.$$.root

@ -1,5 +1,5 @@
import { set_current_component, current_component } from './lifecycle'; import { set_current_component, current_component } from './lifecycle';
import { run_all } from './utils'; import { run_all, blank_object } from './utils';
import { boolean_attributes } from '../../shared/boolean_attributes'; import { boolean_attributes } from '../../shared/boolean_attributes';
export { is_void } from '../../shared/utils/names'; export { is_void } from '../../shared/utils/names';
@ -150,7 +150,7 @@ export function create_ssr_component(fn) {
on_mount: [], on_mount: [],
before_update: [], before_update: [],
after_update: [], after_update: [],
callbacks: {} callbacks: blank_object()
}; };
set_current_component({ $$ }); set_current_component({ $$ });

@ -24,6 +24,10 @@ export function run(fn) {
return fn(); return fn();
} }
export function blank_object() {
return Object.create(null);
}
export function run_all(fns: Function[]) { export function run_all(fns: Function[]) {
fns.forEach(run); fns.forEach(run);
} }

Loading…
Cancel
Save