From: HcySunYang Date: Mon, 21 Oct 2019 14:00:23 +0000 (+0800) Subject: chore: rename & property missing (#335) X-Git-Tag: v3.0.0-alpha.0~364 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=71f3826f995867ffdcd94cbf0d7e5f4a391ca446;p=thirdparty%2Fvuejs%2Fcore.git chore: rename & property missing (#335) --- diff --git a/packages/compiler-core/__tests__/transform.spec.ts b/packages/compiler-core/__tests__/transform.spec.ts index a4fe1911d9..3119fa01b7 100644 --- a/packages/compiler-core/__tests__/transform.spec.ts +++ b/packages/compiler-core/__tests__/transform.spec.ts @@ -313,7 +313,7 @@ describe('compiler: transform', () => { }, { type: NodeTypes.JS_CALL_EXPRESSION, - // should wrap applyDirectives() around createBlock() + // should wrap withDirectives() around createBlock() callee: WITH_DIRECTIVES, arguments: [ { callee: CREATE_BLOCK }, diff --git a/packages/compiler-core/__tests__/transforms/vFor.spec.ts b/packages/compiler-core/__tests__/transforms/vFor.spec.ts index a5b81a8c67..39b34c532d 100644 --- a/packages/compiler-core/__tests__/transforms/vFor.spec.ts +++ b/packages/compiler-core/__tests__/transforms/vFor.spec.ts @@ -857,7 +857,7 @@ describe('compiler: v-for', () => { type: NodeTypes.JS_SEQUENCE_EXPRESSION, expressions: [ { callee: OPEN_BLOCK }, - // should wrap applyDirectives() around createBlock() + // should wrap withDirectives() around createBlock() { callee: WITH_DIRECTIVES, arguments: [ diff --git a/packages/compiler-core/src/ast.ts b/packages/compiler-core/src/ast.ts index e2faabc974..3d0fbd2a4c 100644 --- a/packages/compiler-core/src/ast.ts +++ b/packages/compiler-core/src/ast.ts @@ -396,7 +396,7 @@ export interface DynamicSlotFnProperty extends Property { value: SlotFunctionExpression } -// applyDirectives(createVNode(...), [ +// withDirectives(createVNode(...), [ // [_directive_foo, someValue], // [_directive_bar, someValue, "arg", { mod: true }] // ]) diff --git a/packages/compiler-core/src/parse.ts b/packages/compiler-core/src/parse.ts index 3fdc1fff0b..3d88f13f7b 100644 --- a/packages/compiler-core/src/parse.ts +++ b/packages/compiler-core/src/parse.ts @@ -97,6 +97,7 @@ export function parse(content: string, options: ParserOptions = {}): RootNode { components: [], directives: [], hoists: [], + cached: 0, codegenNode: undefined, loc: getSelection(context, start), cached: 0 diff --git a/packages/runtime-core/src/directives.ts b/packages/runtime-core/src/directives.ts index ea82606cff..a941b90d07 100644 --- a/packages/runtime-core/src/directives.ts +++ b/packages/runtime-core/src/directives.ts @@ -5,7 +5,7 @@ const comp = resolveComponent('comp') const foo = resolveDirective('foo') const bar = resolveDirective('bar') -return applyDirectives(h(comp), [ +return withDirectives(h(comp), [ [foo, this.x], [bar, this.y] ]) @@ -129,7 +129,7 @@ export function withDirectives(vnode: VNode, directives: DirectiveArguments) { applyDirective(vnode.props, instance, dir, value, arg, modifiers) } } else if (__DEV__) { - warn(`applyDirectives can only be used inside render functions.`) + warn(`withDirectives can only be used inside render functions.`) } return vnode }