feat(compiler): basic transform implementation

This commit is contained in:
Evan You
2019-09-17 19:08:47 -04:00
parent a5c1b3283d
commit bbb57c26a2
11 changed files with 1889 additions and 1500 deletions

View File

@@ -3,7 +3,7 @@ import {
NodeTypes,
ElementNode,
TextNode,
ParserErrorTypes,
ErrorCodes,
ExpressionNode,
ElementTypes
} from '@vue/compiler-core'
@@ -134,7 +134,8 @@ describe('DOM parser', () => {
ns: DOMNamespaces.HTML,
tag: 'img',
tagType: ElementTypes.ELEMENT,
props: [],
attrs: [],
directives: [],
isSelfClosing: false,
children: [],
loc: {
@@ -150,9 +151,9 @@ describe('DOM parser', () => {
'<textarea>hello</textarea</textarea0></texTArea a="<>">',
{
...parserOptions,
onError: type => {
if (type !== ParserErrorTypes.END_TAG_WITH_ATTRIBUTES) {
throw new Error(String(type))
onError: err => {
if (err.code !== ErrorCodes.END_TAG_WITH_ATTRIBUTES) {
throw err
}
}
}