]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: fix typos (#1090)
authorHiiTea <luohaojing@gmail.com>
Fri, 1 May 2020 13:42:58 +0000 (21:42 +0800)
committerGitHub <noreply@github.com>
Fri, 1 May 2020 13:42:58 +0000 (09:42 -0400)
25 files changed:
packages/compiler-core/__tests__/transforms/__snapshots__/vModel.spec.ts.snap
packages/compiler-core/__tests__/transforms/vModel.spec.ts
packages/compiler-core/src/parse.ts
packages/compiler-core/src/transforms/hoistStatic.ts
packages/compiler-dom/__tests__/transforms/stringifyStatic.spec.ts
packages/compiler-ssr/src/transforms/ssrVFor.ts
packages/compiler-ssr/src/transforms/ssrVIf.ts
packages/reactivity/__tests__/effect.spec.ts
packages/reactivity/__tests__/reactiveArray.spec.ts
packages/runtime-core/__tests__/components/BaseTransition.spec.ts
packages/runtime-core/__tests__/hmr.spec.ts
packages/runtime-core/__tests__/hydration.spec.ts
packages/runtime-core/__tests__/scheduler.spec.ts
packages/runtime-core/__tests__/vnode.spec.ts
packages/runtime-core/src/apiDefineComponent.ts
packages/runtime-core/src/componentProps.ts
packages/runtime-core/src/components/BaseTransition.ts
packages/runtime-core/src/components/Suspense.ts
packages/runtime-dom/__tests__/customizedBuiltIn.spec.ts
packages/runtime-dom/__tests__/directives/vModel.spec.ts
packages/runtime-dom/src/modules/attrs.ts
packages/server-renderer/__tests__/renderToString.spec.ts
packages/server-renderer/__tests__/ssrRenderAttrs.spec.ts
packages/shared/src/patchFlags.ts
packages/vue/__tests__/svgNamespace.spec.ts

index 7331320c7e667c07cb8a1028980d126ee78b4992..2a4f8d0d9c41927dff39e930bc723beff5251a54 100644 (file)
@@ -26,7 +26,7 @@ return function render(_ctx, _cache) {
 }"
 `;
 
-exports[`compiler: transform v-model simple exprssion (with prefixIdentifiers) 1`] = `
+exports[`compiler: transform v-model simple expression (with prefixIdentifiers) 1`] = `
 "import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \\"vue\\"
 
 export function render(_ctx, _cache) {
@@ -37,7 +37,7 @@ export function render(_ctx, _cache) {
 }"
 `;
 
-exports[`compiler: transform v-model simple exprssion 1`] = `
+exports[`compiler: transform v-model simple expression 1`] = `
 "const _Vue = Vue
 
 return function render(_ctx, _cache) {
index dfce61f382d93c328a5c591bf35822763d39ae7a..ce51602ef8dd20fa6f51fcf9c91e8ae434894b47 100644 (file)
@@ -39,7 +39,7 @@ function parseWithVModel(template: string, options: CompilerOptions = {}) {
 }
 
 describe('compiler: transform v-model', () => {
-  test('simple exprssion', () => {
+  test('simple expression', () => {
     const root = parseWithVModel('<input v-model="model" />')
     const node = root.children[0] as ElementNode
     const props = ((node.codegenNode as VNodeCall).props as ObjectExpression)
@@ -76,7 +76,7 @@ describe('compiler: transform v-model', () => {
     expect(generate(root).code).toMatchSnapshot()
   })
 
-  test('simple exprssion (with prefixIdentifiers)', () => {
+  test('simple expression (with prefixIdentifiers)', () => {
     const root = parseWithVModel('<input v-model="model" />', {
       prefixIdentifiers: true
     })
@@ -377,7 +377,7 @@ describe('compiler: transform v-model', () => {
     expect(codegen.dynamicProps).toBe(`["modelValue", "onUpdate:modelValue"]`)
   })
 
-  test('should generate modelModifers for component v-model', () => {
+  test('should generate modelModifiers for component v-model', () => {
     const root = parseWithVModel('<Comp v-model.trim.bar-baz="foo" />', {
       prefixIdentifiers: true
     })
@@ -399,7 +399,7 @@ describe('compiler: transform v-model', () => {
     expect(vnodeCall.dynamicProps).toBe(`["modelValue", "onUpdate:modelValue"]`)
   })
 
-  test('should generate modelModifers for component v-model with arguments', () => {
+  test('should generate modelModifiers for component v-model with arguments', () => {
     const root = parseWithVModel(
       '<Comp v-model:foo.trim="foo" v-model:bar.number="bar" />',
       {
index 9d0dae204cc77774e9e9bc8f6e6c09e76b64784f..14059a0cd9afff756b8b96a8a24ef36bdf1bfd63 100644 (file)
@@ -31,7 +31,7 @@ type MergedParserOptions = Omit<Required<ParserOptions>, OptionalOptions> &
   Pick<ParserOptions, OptionalOptions>
 
 // The default decoder only provides escapes for characters reserved as part of
-// the tempalte syntax, and is only used if the custom renderer did not provide
+// the template syntax, and is only used if the custom renderer did not provide
 // a platform-specific decoder.
 const decodeRE = /&(gt|lt|amp|apos|quot);/g
 const decodeMap: Record<string, string> = {
index 3d2afb6caa429952148f5c2b913c4c896c0b1e23..0393e9717b8534fa12e5bac74796f8ed9f69f005 100644 (file)
@@ -19,7 +19,7 @@ export function hoistStatic(root: RootNode, context: TransformContext) {
     root.children,
     context,
     new Map(),
-    // Root node is unfortuantely non-hoistable due to potential parent
+    // Root node is unfortunately non-hoistable due to potential parent
     // fallthrough attributes.
     isSingleElementRoot(root, root.children[0])
   )
index cc8b53f245d32d8f29d1e6c4468fd71bf3c567b5..5e942c17af7fb12fbf8b3069e659dd6e3bdcbdac 100644 (file)
@@ -75,7 +75,7 @@ describe('stringify static html', () => {
     })
   })
 
-  test('serliazing constant bindings', () => {
+  test('serializing constant bindings', () => {
     const { ast } = compileWithStringify(
       `<div><div :style="{ color: 'red' }">${repeat(
         `<span :class="[{ foo: true }, { bar: true }]">{{ 1 }} + {{ false }}</span>`,
index 9a87ca86b78b5288889907220e744142068755b3..0dd8b858eb204d783bc527ea210d5debcaea7f83 100644 (file)
@@ -19,7 +19,7 @@ export const ssrTransformFor = createStructuralDirectiveTransform(
   processFor
 )
 
-// This is called during the 2nd transform pass to construct the SSR-sepcific
+// This is called during the 2nd transform pass to construct the SSR-specific
 // codegen nodes.
 export function ssrProcessFor(node: ForNode, context: SSRTransformContext) {
   const needFragmentWrapper =
index aad7ad14d98b00579251a9d15ef452faf40ce575..9eea340b70e062024a99daa71c5e3eb24a06663b 100644 (file)
@@ -20,7 +20,7 @@ export const ssrTransformIf = createStructuralDirectiveTransform(
   processIf
 )
 
-// This is called during the 2nd transform pass to construct the SSR-sepcific
+// This is called during the 2nd transform pass to construct the SSR-specific
 // codegen nodes.
 export function ssrProcessIf(node: IfNode, context: SSRTransformContext) {
   const [rootBranch] = node.branches
index f8a016b47dbec549fc8d31dca7aee09cc497fe58..4e49a146d230435e212b5089813d4857d001fbd2 100644 (file)
@@ -759,7 +759,7 @@ describe('reactivity/effect', () => {
     expect(fnSpy).toHaveBeenCalledTimes(1)
   })
 
-  it('should trigger all effects when array lenght is set 0', () => {
+  it('should trigger all effects when array length is set 0', () => {
     const observed: any = reactive([1])
     let dummy, record
     effect(() => {
index 54218c1978018ae653199116e242b12f51c8d64a..415e1a5119389378458585ecb636475f99da5930 100644 (file)
@@ -121,7 +121,7 @@ describe('reactivity/reactive/Array', () => {
       expect(isRef(raw[1])).toBe(true)
     })
 
-    test('read + indentity', () => {
+    test('read + identity', () => {
       const ref = original[1]
       expect(ref).toBe(toRaw(original)[1])
       expect(original.indexOf(ref)).toBe(1)
index dc0d1e0aae4455a087c0167766cc54669d2a33a0..a1dfa4d61ea3e28413caeaef75e86ed5b12c69d3 100644 (file)
@@ -664,7 +664,7 @@ describe('BaseTransition', () => {
       expect(props.onAfterEnter).toHaveBeenCalledTimes(1)
       assertCalledWithEl(props.onAfterEnter, falseSerialized)
 
-      // toggele again
+      // toggle again
       toggle.value = true
       await nextTick()
       expect(serializeInner(root)).toBe(`${falseSerialized}<!---->`)
@@ -740,7 +740,7 @@ describe('BaseTransition', () => {
       await nextTick()
       // expected behavior: the previous true branch is preserved,
       // and a placeholder is injected for the replacement.
-      // the leaving node is repalced with the replace node (of the same branch)
+      // the leaving node is replaced with the replace node (of the same branch)
       // when it finishes leaving
       expect(serializeInner(root)).toBe(`${trueSerialized}<!---->`)
       // enter hooks should never be called (for neither branch)
index ee67a557e731235dbb81a96a76bd874621e6b99d..f48c2bb5f5d4973603804cf150f4cbb0f8f31a1e 100644 (file)
@@ -112,7 +112,7 @@ describe('hot module replacement', () => {
   test('reload', async () => {
     const root = nodeOps.createElement('div')
     const childId = 'test3-child'
-    const unmoutSpy = jest.fn()
+    const unmountSpy = jest.fn()
     const mountSpy = jest.fn()
 
     const Child: ComponentOptions = {
@@ -120,7 +120,7 @@ describe('hot module replacement', () => {
       data() {
         return { count: 0 }
       },
-      unmounted: unmoutSpy,
+      unmounted: unmountSpy,
       render: compileToFunction(`<div @click="count++">{{ count }}</div>`)
     }
     createRecord(childId, Child)
@@ -142,7 +142,7 @@ describe('hot module replacement', () => {
     })
     await nextTick()
     expect(serializeInner(root)).toBe(`<div>1</div>`)
-    expect(unmoutSpy).toHaveBeenCalledTimes(1)
+    expect(unmountSpy).toHaveBeenCalledTimes(1)
     expect(mountSpy).toHaveBeenCalledTimes(1)
   })
 })
index ea9a8a27774b105196625f97d08c71272f1fe6b3..e39ecfdb88ebddfe7d1c92d1f6c014ec043718ee 100644 (file)
@@ -653,7 +653,7 @@ describe('SSR hydration', () => {
       // fragment ends early and attempts to hydrate the extra <div>bar</div>
       // as 2nd fragment child.
       expect(`Hydration text content mismatch`).toHaveBeenWarned()
-      // exccesive children removal
+      // excessive children removal
       expect(`Hydration children mismatch`).toHaveBeenWarned()
     })
   })
index a4554325aaaa03428ff1828f80258725154a76a9..9d8f4193507b7d34250f5d0cbfddf73138d52a78 100644 (file)
@@ -62,7 +62,7 @@ describe('scheduler', () => {
       const calls: string[] = []
       const job1 = () => {
         calls.push('job1')
-        // job2 will be excuted after job1 at the same tick
+        // job2 will be executed after job1 at the same tick
         queueJob(job2)
       }
       const job2 = () => {
@@ -123,7 +123,7 @@ describe('scheduler', () => {
       const calls: string[] = []
       const cb1 = () => {
         calls.push('cb1')
-        // cb2 will be excuted after cb1 at the same tick
+        // cb2 will be executed after cb1 at the same tick
         queuePostFlushCb(cb2)
       }
       const cb2 = () => {
index 3396ed3e52fd5b115e9bcea82d7509b102bd368e..2d8dd80410b7191dd3fc5317303aa41adbf18fca 100644 (file)
@@ -199,7 +199,7 @@ describe('vnode', () => {
     expect(cloneVNode(node2)).toEqual(node2)
     expect(cloneVNode(node2)).toEqual(cloned2)
 
-    // #1041 should use reoslved key/ref
+    // #1041 should use resolved key/ref
     expect(cloneVNode(createVNode('div', { key: 1 })).key).toBe(1)
     expect(cloneVNode(createVNode('div', { key: 1 }), { key: 2 }).key).toBe(2)
     expect(cloneVNode(createVNode('div'), { key: 2 }).key).toBe(2)
@@ -260,15 +260,15 @@ describe('vnode', () => {
     })
 
     test('handlers', () => {
-      let clickHander1 = function() {}
-      let clickHander2 = function() {}
-      let focusHander2 = function() {}
+      let clickHandler1 = function() {}
+      let clickHandler2 = function() {}
+      let focusHandler2 = function() {}
 
-      let props1: Data = { onClick: clickHander1 }
-      let props2: Data = { onClick: clickHander2, onFocus: focusHander2 }
+      let props1: Data = { onClick: clickHandler1 }
+      let props2: Data = { onClick: clickHandler2, onFocus: focusHandler2 }
       expect(mergeProps(props1, props2)).toMatchObject({
-        onClick: [clickHander1, clickHander2],
-        onFocus: focusHander2
+        onClick: [clickHandler1, clickHandler2],
+        onFocus: focusHandler2
       })
     })
 
@@ -359,7 +359,7 @@ describe('vnode', () => {
     // #1039
     // <component :is="foo">{{ bar }}</component>
     // - content is compiled as slot
-    // - dynamic component reoslves to plain element, but as a block
+    // - dynamic component resolves to plain element, but as a block
     // - block creation disables its own tracking, accidentally causing the
     //   slot content (called during the block node creation) to be missed
     test('element block should track normalized slot children', () => {
index c235e30c3880473afb2f9b7ce738396616d4ada5..cdde1ffb780f37aa200e3199144c1956221ff399 100644 (file)
@@ -14,7 +14,7 @@ import { VNodeProps } from './vnode'
 
 // defineComponent is a utility that is primarily used for type inference
 // when declaring components. Type inference is provided in the component
-// options (provided as the argument). The returned value has artifical types
+// options (provided as the argument). The returned value has artificial types
 // for TSX / manual render function / IDE support.
 
 // overload 1: direct setup function
@@ -83,7 +83,7 @@ export function defineComponent<
     EE
   >
 ): {
-  // array props technically doesn't place any contraints on props in TSX
+  // array props technically doesn't place any constraints on props in TSX
   new (): ComponentPublicInstance<VNodeProps, RawBindings, D, C, M, E>
 } & ComponentOptionsWithArrayProps<PropNames, RawBindings, D, C, M, E, EE>
 
index bf40b50ce57d997fac51a2e33fff913796a6352f..d1989b5c65bf41060bd20271edd93b2d72586ba2 100644 (file)
@@ -48,7 +48,7 @@ type PropConstructor<T = any> =
   | PropMethod<T>
 
 type PropMethod<T> = T extends (...args: any) => any // if is function with args
-  ? { new (): T; (): T; readonly proptotype: Function } // Create Function like contructor
+  ? { new (): T; (): T; readonly proptotype: Function } // Create Function like constructor
   : never
 
 type RequiredKeys<T, MakeDefaultRequired> = {
index f643487e8bc2441dba8df3b51509f03c0c9b4939..865432ab10996fe1cd74635dc4d5c2aa83ca4d1a 100644 (file)
@@ -75,7 +75,7 @@ export interface TransitionState {
 
 export interface TransitionElement {
   // in persisted mode (e.g. v-show), the same element is toggled, so the
-  // pending enter/leave callbacks may need to cancalled if the state is toggled
+  // pending enter/leave callbacks may need to be cancelled if the state is toggled
   // before it finishes.
   _enterCb?: PendingCallback
   _leaveCb?: PendingCallback
index cf0e281a646bfa58b1c71382db69097a399fa8ab..eb6a8c08397db18dd480b1bed18ab5c4195f5049 100644 (file)
@@ -432,7 +432,7 @@ function createSuspenseBoundary(
           handleSetupResult(instance, asyncSetupResult, false)
           if (hydratedEl) {
             // vnode may have been replaced if an update happened before the
-            // async dep is reoslved.
+            // async dep is resolved.
             vnode.el = hydratedEl
           }
           setupRenderEffect(
index 4d957affe70f6aa290eddf5b15be1a97ff06e848..34c1c366c924c6042b7b751758cd1514df2ddb6c 100644 (file)
@@ -1,6 +1,6 @@
 import { render, h } from '@vue/runtime-dom'
 
-describe('customimized built-in elements support', () => {
+describe('customized built-in elements support', () => {
   let createElement: jest.SpyInstance
   afterEach(() => {
     createElement.mockRestore()
index 771a1ef3a70c36b5eb2f0ff876424d84aaf9761c..339f96690c6ed0a8ea30dba8348c9af1adf75809 100644 (file)
@@ -114,7 +114,7 @@ describe('vModel', () => {
     await nextTick()
     expect(spy1).toHaveBeenCalledWith('foo')
 
-    // udpate listener
+    // update listener
     toggle.value = false
     await nextTick()
 
index b9bba846b0d3a0aae069d4abc1c3427cde6deab4..3a33d713aa7428abdae210fb9fa49b31484a96a8 100644 (file)
@@ -16,7 +16,7 @@ export function patchAttr(
     }
   } else {
     // note we are only checking boolean attributes that don't have a
-    // correspoding dom prop of the same name here.
+    // corresponding dom prop of the same name here.
     const isBoolean = isSpecialBooleanAttr(key)
     if (value == null || (isBoolean && value === false)) {
       el.removeAttribute(key)
index 2a3ab7e0056fcbf6e1d7fb64e66d198749e7b90e..f0ee6961f7c381488b8b5bbc663fac9e40a96aae 100644 (file)
@@ -370,7 +370,7 @@ describe('ssr: renderToString', () => {
 
     test('async components', async () => {
       const Child = {
-        // should wait for resovled render context from setup()
+        // should wait for resolved render context from setup()
         async setup() {
           return {
             msg: 'hello'
index 38ca843c4db37dcc71bbba905ab782eb4fdeabde..bf5c2b53e868e1e89c29e0acbf3369840bbde953 100644 (file)
@@ -61,7 +61,7 @@ describe('ssr: renderAttrs', () => {
     ).toBe(` foo="false"`) // non boolean should render `false` as is
   })
 
-  test('ingore non-renderable values', () => {
+  test('ignore non-renderable values', () => {
     expect(
       ssrRenderAttrs({
         foo: {},
index 9e499abf71fce2c61f869328e19306c7ac7bd602..c541b2aba62c565c52d1f9843161a46234d5bf55 100644 (file)
@@ -68,7 +68,7 @@ export const enum PatchFlags {
 
   // Special flags are negative integers. They are never matched against using
   // bitwise operators (bitwise matching should only happen in branches where
-  // patchFlag > 0), and are mutually exclusive. When checking for a speical
+  // patchFlag > 0), and are mutually exclusive. When checking for a special
   // flag, simply check patchFlag === FLAG.
 
   // Indicates a hoisted static vnode. This is a hint for hydration to skip
index 8644d399c91c6a6b747464b45f53568fd039f434..433e8d36d4ce18a843adff993b1c1e44fdc66fa4 100644 (file)
@@ -3,7 +3,7 @@
 // the renderer and compiler implementations.
 // Related files:
 // - runtime-core/src/renderer.ts
-// - compiler-core/src/transoforms/transformElement.ts
+// - compiler-core/src/transforms/transformElement.ts
 
 import { render, h, ref, nextTick } from '../src'