From 6f808febb02b87c605f33475a231a72c39bbabcf Mon Sep 17 00:00:00 2001 From: Lioness100 Date: Mon, 6 Feb 2023 19:39:49 -0500 Subject: [PATCH 1/2] docs: fix typos --- CHANGELOG.md | 2 +- src/compiler/compile/compiler_errors.ts | 2 +- src/compiler/compile/nodes/Binding.ts | 2 +- src/compiler/compile/nodes/Element.ts | 4 ++-- test/js/samples/capture-inject-state/expected.js | 6 +++--- test/js/samples/capture-inject-state/input.svelte | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fba777ad9c7e..e8b4979fdee2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1043,7 +1043,7 @@ Also: ## 3.5.1 -* Accommodate webpack idiosyncracies +* Accommodate webpack idiosyncrasies ## 3.5.0 diff --git a/src/compiler/compile/compiler_errors.ts b/src/compiler/compile/compiler_errors.ts index e4d4ffddadc2..b0c836681c1e 100644 --- a/src/compiler/compile/compiler_errors.ts +++ b/src/compiler/compile/compiler_errors.ts @@ -44,7 +44,7 @@ export default { code: 'invalid-binding', message: 'Cannot bind to a variable declared with {@const ...}' }, - invalid_binding_writibale: { + invalid_binding_writable: { code: 'invalid-binding', message: 'Cannot bind to a variable which is not writable' }, diff --git a/src/compiler/compile/nodes/Binding.ts b/src/compiler/compile/nodes/Binding.ts index f826df482850..46112a03a3c0 100644 --- a/src/compiler/compile/nodes/Binding.ts +++ b/src/compiler/compile/nodes/Binding.ts @@ -80,7 +80,7 @@ export default class Binding extends Node { variable[this.expression.node.type === 'MemberExpression' ? 'mutated' : 'reassigned'] = true; if (info.expression.type === 'Identifier' && !variable.writable) { - component.error(this.expression.node as any, compiler_errors.invalid_binding_writibale); + component.error(this.expression.node as any, compiler_errors.invalid_binding_writable); return; } } diff --git a/src/compiler/compile/nodes/Element.ts b/src/compiler/compile/nodes/Element.ts index 0d3e8a01bd44..cb3d8c718f8a 100644 --- a/src/compiler/compile/nodes/Element.ts +++ b/src/compiler/compile/nodes/Element.ts @@ -1034,14 +1034,14 @@ export default class Element extends Node { } } -const regex_starts_with_vovel = /^[aeiou]/; +const regex_starts_with_vowel = /^[aeiou]/; function should_have_attribute( node, attributes: string[], name = node.name ) { - const article = regex_starts_with_vovel.test(attributes[0]) ? 'an' : 'a'; + const article = regex_starts_with_vowel.test(attributes[0]) ? 'an' : 'a'; const sequence = attributes.length > 1 ? attributes.slice(0, -1).join(', ') + ` or ${attributes[attributes.length - 1]}` : attributes[0]; diff --git a/test/js/samples/capture-inject-state/expected.js b/test/js/samples/capture-inject-state/expected.js index 882b3e9cf600..d47ea51e8ee3 100644 --- a/test/js/samples/capture-inject-state/expected.js +++ b/test/js/samples/capture-inject-state/expected.js @@ -91,7 +91,7 @@ function create_fragment(ctx) { } let moduleLiveBinding; -const moduleContantProps = 4; +const moduleConstantProps = 4; let moduleLet; const moduleConst = 2; let shadowedByModule; @@ -137,7 +137,7 @@ function instance($$self, $$props, $$invalidate) { $$self.$capture_state = () => ({ moduleLiveBinding, - moduleContantProps, + moduleConstantProps, moduleLet, moduleConst, shadowedByModule, @@ -197,4 +197,4 @@ class Component extends SvelteComponentDev { } export default Component; -export { moduleLiveBinding, moduleContantProps }; \ No newline at end of file +export { moduleLiveBinding, moduleConstantProps }; \ No newline at end of file diff --git a/test/js/samples/capture-inject-state/input.svelte b/test/js/samples/capture-inject-state/input.svelte index a1051bc1470c..a80fecf00fce 100644 --- a/test/js/samples/capture-inject-state/input.svelte +++ b/test/js/samples/capture-inject-state/input.svelte @@ -1,6 +1,6 @@