From: Jeff Yang Date: Wed, 29 Nov 2023 12:54:45 +0000 (+0800) Subject: chore: fix typo in compiler-vapor (#10) X-Git-Tag: v3.6.0-alpha.1~16^2~793 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ff307988a04eb51280d056b27e786e1b1938cce;p=thirdparty%2Fvuejs%2Fcore.git chore: fix typo in compiler-vapor (#10) --- diff --git a/packages/compiler-vapor/src/transform.ts b/packages/compiler-vapor/src/transform.ts index 03ff5b4f71..97c105d19d 100644 --- a/packages/compiler-vapor/src/transform.ts +++ b/packages/compiler-vapor/src/transform.ts @@ -37,10 +37,10 @@ export interface TransformContext { once: boolean reference(): number - incraseId(): number + increaseId(): number registerTemplate(): number registerEffect(expr: string, operation: OperationNode): void - registerOpration(...oprations: OperationNode[]): void + registerOperation(...operations: OperationNode[]): void helper(name: string): string } @@ -61,15 +61,15 @@ function createRootContext( dynamic: ir.dynamic, once: false, - incraseId: () => globalId++, + increaseId: () => globalId++, reference() { if (this.dynamic.id !== null) return this.dynamic.id this.dynamic.referenced = true - return (this.dynamic.id = this.incraseId()) + return (this.dynamic.id = this.increaseId()) }, registerEffect(expr, operation) { if (this.once) { - return this.registerOpration(operation) + return this.registerOperation(operation) } if (!effect[expr]) effect[expr] = [] effect[expr].push(operation) @@ -93,7 +93,7 @@ function createRootContext( }) return ir.template.length - 1 }, - registerOpration(...node) { + registerOperation(...node) { operation.push(...node) }, // TODO not used yet @@ -194,9 +194,9 @@ function transformChildren( if (prevChildren.length) if (hasStatic) { childrenTemplate[index - prevChildren.length] = `` - const anchor = (prevChildren[0].placeholder = ctx.incraseId()) + const anchor = (prevChildren[0].placeholder = ctx.increaseId()) - ctx.registerOpration({ + ctx.registerOperation({ type: IRNodeTypes.INSERT_NODE, loc: ctx.node.loc, element: prevChildren.map((child) => child.id!), @@ -204,7 +204,7 @@ function transformChildren( anchor, }) } else { - ctx.registerOpration({ + ctx.registerOperation({ type: IRNodeTypes.PREPEND_NODE, loc: ctx.node.loc, elements: prevChildren.map((child) => child.id!), @@ -219,7 +219,7 @@ function transformChildren( prevChildren.push(child) if (index === children.length - 1) { - ctx.registerOpration({ + ctx.registerOperation({ type: IRNodeTypes.APPEND_NODE, loc: ctx.node.loc, elements: prevChildren.map((child) => child.id!), @@ -324,7 +324,7 @@ function transformInterpolation( } else { const id = ctx.reference() ctx.dynamic.ghost = true - ctx.registerOpration({ + ctx.registerOperation({ type: IRNodeTypes.CREATE_TEXT_NODE, loc: node.loc, id,