// save Vue in a separate variable to avoid collision
push(`const _Vue = Vue\n`)
// in "with" mode, helpers are declared inside the with block to avoid
- // has check cost, but hosits are lifted out of the function - we need
+ // has check cost, but hoists are lifted out of the function - we need
// to provide the helper here.
if (ast.hoists.length) {
push(`const _${CREATE_VNODE} = Vue.createVNode\n`)
'Interpolation end sign was not found.',
[ErrorCodes.X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END]:
'End bracket for dynamic directive argument was not found. ' +
- 'Note that dynamic directive argument connot contain spaces.',
+ 'Note that dynamic directive argument cannot contain spaces.',
// transform errors
[ErrorCodes.X_IF_NO_EXPRESSION]: `v-if/v-else-if is missing expression.`,
node.name = `_ctx.${node.name}`
ids.push(node)
} else if (!isStaticPropertyKey(node, parent)) {
- // also generate sub-expressioms for other identifiers for better
+ // also generate sub-expressions for other identifiers for better
// source map support. (except for property keys which are static)
ids.push(node)
}
enter(child, parent) {
if (
child.type === 'Identifier' &&
- // do not record as scope variable if is a destrcuture key
+ // do not record as scope variable if is a destructured key
!isStaticPropertyKey(child, parent) &&
// do not record if this is a default value
// assignment of a destructured variable
}
})
- // We break up the coumpound expression into an array of strings and sub
+ // We break up the compound expression into an array of strings and sub
// expressions (for identifiers that have been prefixed). In codegen, if
// an ExpressionNode has the `.children` property, it will be used instead of
// `.content`.
}
} else if (isTemplate) {
// <template v-for="...">
- // should genereate a fragment block for each loop
+ // should generate a fragment block for each loop
childBlock = createBlockExpression(
[
helper(FRAGMENT),
// handler processing
if (dir.exp) {
- // exp is guarunteed to be a simple expression here because v-on w/ arg is
+ // exp is guaranteed to be a simple expression here because v-on w/ arg is
// skipped by transformExpression as a special case.
let exp: ExpressionNode = dir.exp as SimpleExpressionNode
const isInlineStatement = !(
-// compiler should normlaize class + :class bindings on the same element
+// compiler should normalize class + :class bindings on the same element
// into a single binding ['staticClass', dynamic]
export function patchClass(el: Element, value: string, isSVG: boolean) {
let _getNow: () => number = Date.now
// Determine what event timestamp the browser is using. Annoyingly, the
-// timestamp can either be hi-res ( relative to poge load) or low-res
+// timestamp can either be hi-res ( relative to page load) or low-res
// (relative to UNIX epoch), so in order to compare time we have to use the
// same timestamp type when saving the flush timestamp.
if (
}
// To avoid the overhead of repeatedly calling performance.now(), we cache
-// and use the same timestamp for all event listners attached in the same tick.
+// and use the same timestamp for all event listeners attached in the same tick.
let cachedNow: number = 0
const p = Promise.resolve()
const reset = () => {
// const flag = TEXT | CLASS
// if (flag & TEXT) { ... }
//
-// Check the `patchElement` function in './createRednerer.ts' to see how the
+// Check the `patchElement` function in './createRenderer.ts' to see how the
// flags are handled during diff.
export const enum PatchFlags {
// Indicates an element that only needs non-props patching, e.g. ref or
// directives (vnodeXXX hooks). It simply marks the vnode as "need patch",
- // since every pathced vnode checks for refs and vnodeXXX hooks.
+ // since every patched vnode checks for refs and vnodeXXX hooks.
// This flag is never directly matched against, it simply serves as a non-zero
// value.
NEED_PATCH = 1 << 5,