use snake_case for method names

pull/5639/head
Ivan Hofer 5 years ago
parent 6d85265858
commit b6e9574805

@ -45,7 +45,7 @@ export default function dom(
if (should_add_css) { if (should_add_css) {
body.push(b` body.push(b`
function ${add_css}(target) { function ${add_css}(target) {
@appendStyleIfNotPresent(target, "${component.stylesheet.id.replace('svelte-', '')}", "${styles}"); @append_style_if_not_present(target, "${component.stylesheet.id.replace('svelte-', '')}", "${styles}");
} }
`); `);
} }
@ -529,7 +529,7 @@ export default function dom(
constructor(options) { constructor(options) {
super(${options.dev && 'options'}); super(${options.dev && 'options'});
${should_add_css && b`@addCssToComponent(this, ${add_css}, options);`} ${should_add_css && b`@add_css_to_component(this, ${add_css}, options);`}
@init(this, options, ${definition}, ${has_create_fragment ? 'create_fragment' : 'null'}, ${not_equal}, ${prop_indexes}, ${dirty}); @init(this, options, ${definition}, ${has_create_fragment ? 'create_fragment' : 'null'}, ${not_equal}, ${prop_indexes}, ${dirty});
${options.dev && b`@dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "${name.name}", options, id: create_fragment.name });`} ${options.dev && b`@dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "${name.name}", options, id: create_fragment.name });`}

@ -98,7 +98,7 @@ function make_dirty(component, i) {
} }
export function addCssToComponent(component, add_css, options) { export function add_css_to_component(component, add_css, options) {
component.$$ = { component.$$ = {
customStyleTag: options.customStyleTag || current_component && current_component.$$.customStyleTag customStyleTag: options.customStyleTag || current_component && current_component.$$.customStyleTag
}; };

@ -1,6 +1,6 @@
import { has_prop } from './utils'; import { has_prop } from './utils';
export function appendStyleIfNotPresent( export function append_style_if_not_present(
target: Element, target: Element,
styleSheetId: string, styleSheetId: string,
styles: string, styles: string,

@ -1,9 +1,9 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { import {
SvelteComponent, SvelteComponent,
addCssToComponent, add_css_to_component,
append, append,
appendStyleIfNotPresent, append_style_if_not_present,
attr, attr,
detach, detach,
element, element,
@ -15,8 +15,8 @@ import {
text text
} from "svelte/internal"; } from "svelte/internal";
function add_css(customStyleTag) { function add_css(target) {
appendStyleIfNotPresent(customStyleTag, "1a7i8ec", "p.svelte-1a7i8ec{color:red}"); append_style_if_not_present(target, "1a7i8ec", "p.svelte-1a7i8ec{color:red}");
} }
function create_fragment(ctx) { function create_fragment(ctx) {
@ -57,7 +57,7 @@ function instance($$self, $$props, $$invalidate) {
class Component extends SvelteComponent { class Component extends SvelteComponent {
constructor(options) { constructor(options) {
super(); super();
addCssToComponent(this, add_css, options); add_css_to_component(this, add_css, options);
init(this, options, instance, create_fragment, safe_not_equal, { foo: 0 }); init(this, options, instance, create_fragment, safe_not_equal, { foo: 0 });
} }
} }

@ -1,8 +1,8 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { import {
SvelteComponent, SvelteComponent,
addCssToComponent, add_css_to_component,
appendStyleIfNotPresent, append_style_if_not_present,
attr, attr,
detach, detach,
element, element,
@ -12,8 +12,8 @@ import {
safe_not_equal safe_not_equal
} from "svelte/internal"; } from "svelte/internal";
function add_css(customStyleTag) { function add_css(target) {
appendStyleIfNotPresent(customStyleTag, "1slhpfn", "@media(min-width: 1px){div.svelte-1slhpfn{color:red}}"); append_style_if_not_present(target, "1slhpfn", "@media(min-width: 1px){div.svelte-1slhpfn{color:red}}");
} }
function create_fragment(ctx) { function create_fragment(ctx) {
@ -39,7 +39,7 @@ function create_fragment(ctx) {
class Component extends SvelteComponent { class Component extends SvelteComponent {
constructor(options) { constructor(options) {
super(); super();
addCssToComponent(this, add_css, options); add_css_to_component(this, add_css, options);
init(this, options, null, create_fragment, safe_not_equal, {}); init(this, options, null, create_fragment, safe_not_equal, {});
} }
} }

Loading…
Cancel
Save