]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: typo fixes (#1546)
authorFelix Rilling <contact@rilling.dev>
Wed, 8 Jul 2020 10:32:42 +0000 (12:32 +0200)
committerGitHub <noreply@github.com>
Wed, 8 Jul 2020 10:32:42 +0000 (12:32 +0200)
* chore: fix typos in comments/JSDoc.

* chore: fix typo in internal function name.

* chore: fix typos in test comments/descriptions/variable names.

19 files changed:
packages/compiler-core/__tests__/transforms/transformExpressions.spec.ts
packages/compiler-core/src/codegen.ts
packages/compiler-core/src/options.ts
packages/compiler-core/src/transforms/hoistStatic.ts
packages/compiler-core/src/transforms/transformElement.ts
packages/compiler-sfc/__tests__/templateTransformSrcset.spec.ts
packages/compiler-ssr/src/transforms/ssrTransformComponent.ts
packages/compiler-ssr/src/transforms/ssrTransformElement.ts
packages/reactivity/src/ref.ts
packages/runtime-core/__tests__/componentEmits.spec.ts
packages/runtime-core/__tests__/helpers/scopeId.spec.ts
packages/runtime-core/__tests__/vnode.spec.ts
packages/runtime-core/src/apiDefineComponent.ts
packages/runtime-core/src/componentProxy.ts
packages/runtime-core/src/componentSlots.ts
packages/runtime-core/src/hydration.ts
packages/runtime-dom/__tests__/patchProps.spec.ts
packages/runtime-dom/src/modules/props.ts
packages/vue/__tests__/index.spec.ts

index 870024a4b9c7221d73a208b378913ed66b4cf558..9bddda9e792bcc211dde754ab7fe574e03058524 100644 (file)
@@ -412,7 +412,7 @@ describe('compiler: expression transform', () => {
       })
     })
 
-    test('nullish colescing', () => {
+    test('nullish coalescing', () => {
       const node = parseWithExpressionTransform(
         `{{ a ?? b }}`
       ) as InterpolationNode
index cb1636fd17e3d8e90200221106c36b80c3405936..323a540fc1bfa6e7e7df90f0e8e9efd14c10c254 100644 (file)
@@ -333,7 +333,7 @@ function genFunctionPreamble(ast: RootNode, context: CodegenContext) {
   }
   // generate variables for ssr helpers
   if (!__BROWSER__ && ast.ssrHelpers && ast.ssrHelpers.length) {
-    // ssr guaruntees prefixIdentifier: true
+    // ssr guarantees prefixIdentifier: true
     push(
       `const { ${ast.ssrHelpers
         .map(aliasHelper)
@@ -372,7 +372,7 @@ function genModulePreamble(
       // when bundled with webpack with code-split, calling an import binding
       // as a function leads to it being wrapped with `Object(a.b)` or `(0,a.b)`,
       // incurring both payload size increase and potential perf overhead.
-      // therefore we assign the imports to vairables (which is a constant ~50b
+      // therefore we assign the imports to variables (which is a constant ~50b
       // cost per-component instead of scaling with template size)
       push(
         `import { ${ast.helpers
@@ -446,7 +446,7 @@ function genHoists(hoists: (JSChildNode | null)[], context: CodegenContext) {
   const genScopeId = !__BROWSER__ && scopeId != null && mode !== 'function'
   newline()
 
-  // push scope Id before initilaizing hoisted vnodes so that these vnodes
+  // push scope Id before initializing hoisted vnodes so that these vnodes
   // get the proper scopeId as well.
   if (genScopeId) {
     push(`${helper(PUSH_SCOPE_ID)}("${scopeId}")`)
index 621fe93b2258ddfb99a4866ef86f9c815a4d1942..ee07818cca69138cec265134b723719bcac45d78 100644 (file)
@@ -59,7 +59,7 @@ export type HoistTransform = (
 
 export interface TransformOptions {
   /**
-   * An array of node trasnforms to be applied to every AST node.
+   * An array of node transforms to be applied to every AST node.
    */
   nodeTransforms?: NodeTransform[]
   /**
@@ -118,7 +118,7 @@ export interface TransformOptions {
   scopeId?: string | null
   /**
    * Generate SSR-optimized render functions instead.
-   * The resulting funciton must be attached to the component via the
+   * The resulting function must be attached to the component via the
    * `ssrRender` option instead of `render`.
    */
   ssr?: boolean
index d584ca74094aca136ab2c4753a5a3c4f203571cb..baf1a2afce418df6d5c252222222bfcc250397e2 100644 (file)
@@ -51,7 +51,7 @@ function walk(
   doNotHoistNode: boolean = false
 ) {
   let hasHoistedNode = false
-  // Some transforms, e.g. trasnformAssetUrls from @vue/compiler-sfc, replaces
+  // Some transforms, e.g. transformAssetUrls from @vue/compiler-sfc, replaces
   // static bindings with expressions. These expressions are guaranteed to be
   // constant so they are still eligible for hoisting, but they are only
   // available at runtime and therefore cannot be evaluated ahead of time.
index 4daf7a0600bcc0605bd2974d1d994c2db847f478..78f024818b30e4bb926e2676f050c24e5897a9ae 100644 (file)
@@ -280,7 +280,7 @@ export function buildProps(
       if (
         !isComponent &&
         isOn(name) &&
-        // omit the flag for click handlers becaues hydration gives click
+        // omit the flag for click handlers because hydration gives click
         // dedicated fast path.
         name.toLowerCase() !== 'onclick' &&
         // omit v-model handlers
index 9d55dc870ee42217f6206b4985b54661d0ed86cd..0874d31199ebcb2d10cecc4664b961b22a967e5a 100644 (file)
@@ -12,11 +12,11 @@ import {
 
 function compileWithSrcset(template: string, options?: AssetURLOptions) {
   const ast = baseParse(template)
-  const srcsetTrasnform = options
+  const srcsetTransform = options
     ? createSrcsetTransformWithOptions(normalizeOptions(options))
     : transformSrcset
   transform(ast, {
-    nodeTransforms: [srcsetTrasnform, transformElement],
+    nodeTransforms: [srcsetTransform, transformElement],
     directiveTransforms: {
       bind: transformBind
     }
index 4b3b10ff96486101b25210f8b5afcdbd9da749e3..69bf0662fe2c9381f5125cbe3a0f3c503a199036 100644 (file)
@@ -142,7 +142,7 @@ export const ssrTransformComponent: NodeTransform = (node, context) => {
 
     if (typeof component !== 'string') {
       // dynamic component that resolved to a `resolveDynamicComponent` call
-      // expression - since the reoslved result may be a plain element (string)
+      // expression - since the resolved result may be a plain element (string)
       // or a VNode, handle it with `renderVNode`.
       node.ssrCodegenNode = createCallExpression(
         context.helper(SSR_RENDER_VNODE),
index 21c231e85fca184944f2f5e186de01044c3c2343..cb4201fbaf2c189e3aa66c346f22ab4e5a162c9e 100644 (file)
@@ -64,7 +64,7 @@ export const ssrTransformElement: NodeTransform = (node, context) => {
     // element
     // generate the template literal representing the open tag.
     const openTag: TemplateLiteral['elements'] = [`<${node.tag}`]
-    // some tags need to be pasesd to runtime for special checks
+    // some tags need to be passed to runtime for special checks
     const needTagForRuntime =
       node.tag === 'textarea' || node.tag.indexOf('-') > 0
 
index 57bf5755b5c375bf5361240aa0c1f3176055ef7e..cf217c3db39fc531cf79a8bb72f8fd73b981b344 100644 (file)
@@ -150,7 +150,7 @@ type BaseTypes = string | number | boolean
  * }
  * ```
  *
- * Note that api-extractor somehow refuses to include `decalre module`
+ * Note that api-extractor somehow refuses to include `declare module`
  * augmentations in its generated d.ts, so we have to manually append them
  * to the final generated d.ts in our build process.
  */
index 2af0691ff2138e763220349edc4924df2e29009d..17bde516036c76cb135e71c96bf354da61ea087d 100644 (file)
@@ -26,13 +26,13 @@ describe('component: emit', () => {
     render(h(Comp), nodeOps.createElement('div'))
 
     expect(onfoo).not.toHaveBeenCalled()
-    // only capitalized or special chars are considerd event listeners
+    // only capitalized or special chars are considered event listeners
     expect(onBar).toHaveBeenCalled()
     expect(onBaz).toHaveBeenCalled()
   })
 
   // for v-model:foo-bar usage in DOM templates
-  test('trigger hyphendated events for update:xxx events', () => {
+  test('trigger hyphenated events for update:xxx events', () => {
     const Foo = defineComponent({
       render() {},
       created() {
index c943ef9705469203eef65ad32acebbf7ffc400d8..07ecfc7f6e8947b76c56775391de9ac28f041ef1 100644 (file)
@@ -45,10 +45,10 @@ describe('scopeId runtime support', () => {
         return h('div', this.$slots.default())
       })
     }
-    const withChil2Id = withScopeId('child2')
+    const withChild2Id = withScopeId('child2')
     const Child2 = {
       __scopeId: 'child2',
-      render: withChil2Id(() => h('span'))
+      render: withChild2Id(() => h('span'))
     }
     const App = {
       __scopeId: 'parent',
index dedd0f90e90d40a1b7c55e543d863bae4c3af620..fbab2604a0df07b0e8fcbb619343375b65bd0b09 100644 (file)
@@ -254,7 +254,7 @@ describe('vnode', () => {
 
     // cloning with new ref, but with same context instance
     const cloned5 = cloneVNode(original, { ref: 'bar' })
-    // new ref should use current context instance and overwrite orgiinal
+    // new ref should use current context instance and overwrite original
     expect(cloned5.ref).toEqual([mockInstance2, 'bar'])
 
     // cloning and adding ref to original that has no ref
index 46a5aef4ae0ec524c563c3e798200aeda75b1c7c..6561c1c76067f5fd57df78cfd44410b714ae0010 100644 (file)
@@ -121,7 +121,7 @@ export function defineComponent<
     EE
   >
 ): ComponentPublicInstanceConstructor<
-  // array props technically doesn't place any contraints on props in TSX before,
+  // array props technically doesn't place any constraints on props in TSX before,
   // but now we can export array props in TSX
   CreateComponentPublicInstance<
     Readonly<{ [key in PropNames]?: any }>,
index 5e3d5d1ac85e838b0c9ac762652a3126df887e70..9ea672aa2b5725d5a7d1356ab9a3890cb6053ad8 100644 (file)
@@ -210,7 +210,7 @@ export const PublicInstanceProxyHandlers: ProxyHandler<any> = {
       appContext
     } = instance
 
-    // let @vue/reatvitiy know it should never observe Vue public instances.
+    // let @vue/reactivity know it should never observe Vue public instances.
     if (key === ReactiveFlags.SKIP) {
       return true
     }
index 1ab6a0c27200838fdb028706375d30af8f0cd3e5..cdee341ba66db9fc61bcac098a0e1fee66609b78 100644 (file)
@@ -38,7 +38,7 @@ export type RawSlots = {
   // internal, indicates compiler generated slots
   // we use a reserved property instead of a vnode patchFlag because the slots
   // object may be directly passed down to a child component in a manual
-  // render funciton, and the optimization hint need to be on the slot object
+  // render function, and the optimization hint need to be on the slot object
   // itself to be preserved.
   _?: 1
 }
index 62d9e6f0a09f5a2740f549f959467f845b2e3b13..81b1587988739b3f8d4b81346325e1e634bad65f 100644 (file)
@@ -80,7 +80,7 @@ export function createHydrationFunctions(
   ): Node | null => {
     const isFragmentStart = isComment(node) && node.data === '['
     const onMismatch = () =>
-      handleMismtach(
+      handleMismatch(
         node,
         vnode,
         parentComponent,
@@ -397,7 +397,7 @@ export function createHydrationFunctions(
     }
   }
 
-  const handleMismtach = (
+  const handleMismatch = (
     node: Node,
     vnode: VNode,
     parentComponent: ComponentInternalInstance | null,
index 6ffa6845ceaedb518e8e4d09583445163e2754cb..402950b4352d0e8ac7b88bcc993c8ff672dac7e0 100644 (file)
@@ -88,12 +88,12 @@ describe('runtime-dom: props patching', () => {
     // anyway, here we just want to make sure Vue doesn't set non-string props
     // to an empty string on nullish values - it should reset to its default
     // value.
-    const intiialValue = el.srcObject
+    const initialValue = el.srcObject
     const fakeObject = {}
     patchProp(el, 'srcObject', null, fakeObject)
     expect(el.srcObject).not.toBe(fakeObject)
     patchProp(el, 'srcObject', null, null)
-    expect(el.srcObject).toBe(intiialValue)
+    expect(el.srcObject).toBe(initialValue)
   })
 
   test('catch and warn prop set TypeError', () => {
index fed5c6c90e5a01a73aa9e6bf2bae5a1144b3c3dc..988cbb4ead756fe0988f710228428cb8139e8480 100644 (file)
@@ -4,7 +4,7 @@
 
 import { warn } from '@vue/runtime-core'
 
-// functions. The user is reponsible for using them with only trusted content.
+// functions. The user is responsible for using them with only trusted content.
 export function patchDOMProp(
   el: any,
   key: string,
index 692a759bf2ca6d5959605026e7d6fad203ec968d..6303c157c8d5160fe1e62ee48092356d4a3e0d72 100644 (file)
@@ -117,7 +117,7 @@ describe('compiler + runtime integration', () => {
     document.querySelector = origin
   })
 
-  it('should warn when template is not avaiable', () => {
+  it('should warn when template is not available', () => {
     const app = createApp({
       template: {}
     })