Skip to content

Commit 0891495

Browse files
committedMay 26, 2019
code style
1 parent 5e3ee4e commit 0891495

File tree

7 files changed

+20
-20
lines changed

7 files changed

+20
-20
lines changed
 

‎src/compile/render-dom/index.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -394,12 +394,12 @@ export default function dom(
394394
return $name;
395395
});
396396

397-
let unknownPropsCheck;
397+
let unknown_props_check;
398398
if (component.compile_options.dev && writable_props.length) {
399-
unknownPropsCheck = deindent`
400-
const writableProps = [${writable_props.map(prop => `'${prop.export_name}'`).join(', ')}];
399+
unknown_props_check = deindent`
400+
const writable_props = [${writable_props.map(prop => `'${prop.export_name}'`).join(', ')}];
401401
Object.keys($$props).forEach(key => {
402-
if (!writableProps.includes(key)) console.warn(\`<${component.tag}> was created with unknown attribute '\${key}'\`);
402+
if (!writable_props.includes(key)) console.warn(\`<${component.tag}> was created with unknown prop '\${key}'\`);
403403
});
404404
`;
405405
}
@@ -413,8 +413,8 @@ export default function dom(
413413
${resubscribable_reactive_store_unsubscribers}
414414
415415
${component.javascript}
416-
417-
${unknownPropsCheck}
416+
417+
${unknown_props_check}
418418
419419
${component.slots.size && `let { $$slots = {}, $$scope } = $$props;`}
420420

‎test/js/samples/bind-open/expected.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,4 @@ class Component extends SvelteComponent {
6666
}
6767
}
6868

69-
export default Component;
69+
export default Component;

‎test/js/samples/debug-empty/expected.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ function create_fragment(ctx) {
6565
function instance($$self, $$props, $$invalidate) {
6666
let { name } = $$props;
6767

68-
const writableProps = ['name'];
68+
const writable_props = ['name'];
6969
Object.keys($$props).forEach(key => {
70-
if (!writableProps.includes(key)) console.warn(`<Component> was created with unknown attribute '${key}'`);
70+
if (!writable_props.includes(key)) console.warn(`<Component> was created with unknown prop '${key}'`);
7171
});
7272

7373
$$self.$set = $$props => {
@@ -98,4 +98,4 @@ class Component extends SvelteComponentDev {
9898
}
9999
}
100100

101-
export default Component;
101+
export default Component;

‎test/js/samples/debug-foo-bar-baz-things/expected.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ function create_fragment(ctx) {
151151
function instance($$self, $$props, $$invalidate) {
152152
let { things, foo, bar, baz } = $$props;
153153

154-
const writableProps = ['things', 'foo', 'bar', 'baz'];
154+
const writable_props = ['things', 'foo', 'bar', 'baz'];
155155
Object.keys($$props).forEach(key => {
156-
if (!writableProps.includes(key)) console.warn(`<Component> was created with unknown attribute '${key}'`);
156+
if (!writable_props.includes(key)) console.warn(`<Component> was created with unknown prop '${key}'`);
157157
});
158158

159159
$$self.$set = $$props => {
@@ -220,4 +220,4 @@ class Component extends SvelteComponentDev {
220220
}
221221
}
222222

223-
export default Component;
223+
export default Component;

‎test/js/samples/debug-foo/expected.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ function create_fragment(ctx) {
151151
function instance($$self, $$props, $$invalidate) {
152152
let { things, foo } = $$props;
153153

154-
const writableProps = ['things', 'foo'];
154+
const writable_props = ['things', 'foo'];
155155
Object.keys($$props).forEach(key => {
156-
if (!writableProps.includes(key)) console.warn(`<Component> was created with unknown attribute '${key}'`);
156+
if (!writable_props.includes(key)) console.warn(`<Component> was created with unknown prop '${key}'`);
157157
});
158158

159159
$$self.$set = $$props => {
@@ -196,4 +196,4 @@ class Component extends SvelteComponentDev {
196196
}
197197
}
198198

199-
export default Component;
199+
export default Component;

‎test/js/samples/dev-warning-missing-data-computed/expected.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ function instance($$self, $$props, $$invalidate) {
6565

6666
let bar;
6767

68-
const writableProps = ['foo'];
68+
const writable_props = ['foo'];
6969
Object.keys($$props).forEach(key => {
70-
if (!writableProps.includes(key)) console.warn(`<Component> was created with unknown attribute '${key}'`);
70+
if (!writable_props.includes(key)) console.warn(`<Component> was created with unknown prop '${key}'`);
7171
});
7272

7373
$$self.$set = $$props => {
@@ -102,4 +102,4 @@ class Component extends SvelteComponentDev {
102102
}
103103
}
104104

105-
export default Component;
105+
export default Component;

‎test/runtime/samples/dev-warning-unknown-props/_config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ export default {
44
},
55

66
warnings: [
7-
`<Foo> was created with unknown attribute 'fo'`
7+
`<Foo> was created with unknown prop 'fo'`
88
]
99
};

0 commit comments

Comments
 (0)