From 730d329f794caf1ea2cc47628f8d74ef2d07f96e Mon Sep 17 00:00:00 2001 From: Evan You Date: Wed, 29 Jan 2020 12:16:58 -0500 Subject: [PATCH] fix(compiler-core): relax error on unknown entities close #663 --- .../__snapshots__/parse.spec.ts.snap | 69 ------------------- .../compiler-core/__tests__/parse.spec.ts | 11 --- packages/compiler-core/src/errors.ts | 2 - packages/compiler-core/src/parse.ts | 7 +- 4 files changed, 3 insertions(+), 86 deletions(-) diff --git a/packages/compiler-core/__tests__/__snapshots__/parse.spec.ts.snap b/packages/compiler-core/__tests__/__snapshots__/parse.spec.ts.snap index d2ec37c6..f6aa2ece 100644 --- a/packages/compiler-core/__tests__/__snapshots__/parse.spec.ts.snap +++ b/packages/compiler-core/__tests__/__snapshots__/parse.spec.ts.snap @@ -6956,75 +6956,6 @@ Object { } `; -exports[`compiler: parse Errors UNKNOWN_NAMED_CHARACTER_REFERENCE 1`] = ` -Object { - "cached": 0, - "children": Array [ - Object { - "children": Array [ - Object { - "content": "&unknown;", - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - "offset": 19, - }, - "source": "&unknown;", - "start": Object { - "column": 11, - "line": 1, - "offset": 10, - }, - }, - "type": 2, - }, - ], - "codegenNode": undefined, - "isSelfClosing": false, - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - "offset": 30, - }, - "source": "", - "start": Object { - "column": 1, - "line": 1, - "offset": 0, - }, - }, - "ns": 0, - "props": Array [], - "tag": "template", - "tagType": 3, - "type": 1, - }, - ], - "codegenNode": undefined, - "components": Array [], - "directives": Array [], - "helpers": Array [], - "hoists": Array [], - "imports": Array [], - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - "offset": 30, - }, - "source": "", - "start": Object { - "column": 1, - "line": 1, - "offset": 0, - }, - }, - "type": 0, -} -`; - exports[`compiler: parse Errors X_INVALID_END_TAG </div> 1`] = ` Object { "cached": 0, diff --git a/packages/compiler-core/__tests__/parse.spec.ts b/packages/compiler-core/__tests__/parse.spec.ts index 037e9377..53263f8d 100644 --- a/packages/compiler-core/__tests__/parse.spec.ts +++ b/packages/compiler-core/__tests__/parse.spec.ts @@ -2594,17 +2594,6 @@ foo ] } ], - UNKNOWN_NAMED_CHARACTER_REFERENCE: [ - { - code: '', - errors: [ - { - type: ErrorCodes.UNKNOWN_NAMED_CHARACTER_REFERENCE, - loc: { offset: 10, line: 1, column: 11 } - } - ] - } - ], X_INVALID_END_TAG: [ { code: '', diff --git a/packages/compiler-core/src/errors.ts b/packages/compiler-core/src/errors.ts index c62d12b9..e2fe090a 100644 --- a/packages/compiler-core/src/errors.ts +++ b/packages/compiler-core/src/errors.ts @@ -57,7 +57,6 @@ export const enum ErrorCodes { UNEXPECTED_NULL_CHARACTER, UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME, UNEXPECTED_SOLIDUS_IN_TAG, - UNKNOWN_NAMED_CHARACTER_REFERENCE, // Vue-specific parse errors X_INVALID_END_TAG, @@ -141,7 +140,6 @@ export const errorMessages: { [code: number]: string } = { [ErrorCodes.UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME]: "'