restore formatting changes

pull/7716/head
Ivan Hofer 4 years ago committed by tanhauhau
parent edd74df0a6
commit 4e9f1a6e7d

@ -138,7 +138,7 @@ export default class Component {
(typeof process !== 'undefined' (typeof process !== 'undefined'
? compile_options.filename ? compile_options.filename
.replace(process.cwd(), '') .replace(process.cwd(), '')
.replace(regex_leading_directory_separator, '') .replace(regex_leading_directory_separator, '')
: compile_options.filename); : compile_options.filename);
this.locate = getLocator(this.source, { offsetLine: 1 }); this.locate = getLocator(this.source, { offsetLine: 1 });
@ -1091,7 +1091,7 @@ export default class Component {
this.replace(b` this.replace(b`
${node.declarations.length ? node : null} ${node.declarations.length ? node : null}
${ props.length > 0 && b`let { ${ props } } = $$props;`} ${ props.length > 0 && b`let { ${props} } = $$props;`}
${inserts} ${inserts}
` as any); ` as any);
return this.skip(); return this.skip();
@ -1475,7 +1475,7 @@ function process_component_options(component: Component, nodes) {
const node = nodes.find(node => node.name === 'svelte:options'); const node = nodes.find(node => node.name === 'svelte:options');
function get_value(attribute, {code, message}) { function get_value(attribute, { code, message }) {
const { value } = attribute; const { value } = attribute;
const chunk = value[0]; const chunk = value[0];

@ -203,6 +203,8 @@ function is_valid_aria_attribute_value(schema: ARIAPropertyDefinition, value: st
} }
} }
const regex_any_repeated_whitespace = /[\s\n\t]+/g;
export default class Element extends Node { export default class Element extends Node {
type: 'Element'; type: 'Element';
name: string; name: string;
@ -1002,8 +1004,6 @@ export default class Element extends Node {
} }
} }
const regex_any_repeated_whitespace = /[\s\n\t]+/g;
const regex_starts_with_vovel = /^[aeiou]/; const regex_starts_with_vovel = /^[aeiou]/;
function should_have_attribute( function should_have_attribute(

@ -13,7 +13,7 @@ import { flatten } from '../../utils/flatten';
import check_enable_sourcemap from '../utils/check_enable_sourcemap'; import check_enable_sourcemap from '../utils/check_enable_sourcemap';
import { push_array } from '../../utils/push_array'; import { push_array } from '../../utils/push_array';
const regex_backslash = /\\/g; const regex_backslashes = /\\/g;
export default function dom( export default function dom(
component: Component, component: Component,
@ -532,7 +532,7 @@ export default function dom(
constructor(options) { constructor(options) {
super(); super();
${css.code && b`this.shadowRoot.innerHTML = \`<style>${css.code.replace(regex_backslash, '\\\\')}${css_sourcemap_enabled && options.dev ? `\n/*# sourceMappingURL=${css.map.toUrl()} */` : ''}</style>\`;`} ${css.code && b`this.shadowRoot.innerHTML = \`<style>${css.code.replace(regex_backslashes, '\\\\')}${css_sourcemap_enabled && options.dev ? `\n/*# sourceMappingURL=${css.map.toUrl()} */` : ''}</style>\`;`}
@init(this, { target: this.shadowRoot, props: ${init_props}, customElement: true }, ${definition}, ${has_create_fragment ? 'create_fragment' : 'null'}, ${not_equal}, ${prop_indexes}, null, ${dirty}); @init(this, { target: this.shadowRoot, props: ${init_props}, customElement: true }, ${definition}, ${has_create_fragment ? 'create_fragment' : 'null'}, ${not_equal}, ${prop_indexes}, null, ${dirty});

@ -322,19 +322,19 @@ export default class ElementWrapper extends Wrapper {
} }
} else if (${previous_tag}) { } else if (${previous_tag}) {
${ ${
has_transitions has_transitions
? b` ? b`
@group_outros(); @group_outros();
@transition_out(${this.var}, 1, 1, () => { @transition_out(${this.var}, 1, 1, () => {
${this.var} = null; ${this.var} = null;
}); });
@check_outros(); @check_outros();
` `
: b` : b`
${this.var}.d(1); ${this.var}.d(1);
${this.var} = null; ${this.var} = null;
` `
} }
} }
${previous_tag} = ${tag}; ${previous_tag} = ${tag};
`); `);
@ -676,9 +676,9 @@ export default class ElementWrapper extends Wrapper {
function ${handler}(${params}) { function ${handler}(${params}) {
${binding_group.bindings.map(b => b.handler.mutation)} ${binding_group.bindings.map(b => b.handler.mutation)}
${Array.from(dependencies) ${Array.from(dependencies)
.filter(dep => dep[0] !== '$') .filter(dep => dep[0] !== '$')
.filter(dep => !contextual_dependencies.has(dep)) .filter(dep => !contextual_dependencies.has(dep))
.map(dep => b`${this.renderer.invalidate(dep)};`)} .map(dep => b`${this.renderer.invalidate(dep)};`)}
} }
`); `);

Loading…
Cancel
Save