improve output size by refactoring blank_object() to {]

pull/5702/head
Ivan Hofer 5 years ago
parent 67dea941bb
commit 0d9a3b7209

@ -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 { blank_object, is_empty, is_function, run, run_all, noop } from './utils'; import { is_empty, is_function, run, run_all, noop } from './utils';
import { children, detach } from './dom'; import { children, detach } from './dom';
import { transition_in } from './transitions'; import { transition_in } from './transitions';
@ -110,7 +110,7 @@ export function init(component, options, instance, create_fragment, not_equal, p
props, props,
update: noop, update: noop,
not_equal, not_equal,
bound: blank_object(), bound: {},
// lifecycle // lifecycle
on_mount: [], on_mount: [],
@ -120,7 +120,7 @@ export function init(component, options, instance, create_fragment, not_equal, p
context: new Map(parent_component ? parent_component.$$.context : []), context: new Map(parent_component ? parent_component.$$.context : []),
// everything else // everything else
callbacks: blank_object(), callbacks: {},
dirty, dirty,
skip_bound: false skip_bound: false
}; };

@ -1,5 +1,5 @@
import { set_current_component, current_component } from './lifecycle'; import { set_current_component, current_component } from './lifecycle';
import { run_all, blank_object } from './utils'; import { run_all } from './utils';
import { boolean_attributes } from '../../compiler/compile/render_ssr/handlers/shared/boolean_attributes'; import { boolean_attributes } from '../../compiler/compile/render_ssr/handlers/shared/boolean_attributes';
export const invalid_attribute_name_character = /[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u; export const invalid_attribute_name_character = /[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u;
@ -85,7 +85,7 @@ export function create_ssr_component(fn) {
on_mount: [], on_mount: [],
before_update: [], before_update: [],
after_update: [], after_update: [],
callbacks: blank_object() callbacks: {}
}; };
set_current_component({ $$ }); set_current_component({ $$ });

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

Loading…
Cancel
Save