feat(compiler): hoist static trees

This commit is contained in:
Evan You
2019-10-03 23:30:25 -04:00
parent 2e2b6924da
commit 095f5edf8d
11 changed files with 149 additions and 21 deletions

View File

@@ -3,7 +3,8 @@ import {
transform,
CompilerOptions,
ElementNode,
NodeTypes
NodeTypes,
CallExpression
} from '@vue/compiler-core'
import { transformBind } from '../../../compiler-core/src/transforms/vBind'
import { transformElement } from '../../../compiler-core/src/transforms/transformElement'
@@ -59,7 +60,7 @@ describe('compiler: style transform', () => {
bind: transformBind
}
})
expect(node.codegenNode!.arguments[1]).toMatchObject({
expect((node.codegenNode as CallExpression).arguments[1]).toMatchObject({
type: NodeTypes.JS_OBJECT_EXPRESSION,
properties: [
{