-
Notifications
You must be signed in to change notification settings - Fork 650
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: improve parse error locations and aggregate errors
- Loading branch information
1 parent
c9473f7
commit 6cf4978
Showing
12 changed files
with
189 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
"marko": patch | ||
"@marko/compiler": patch | ||
"@marko/runtime-tags": patch | ||
"@marko/translator-interop-class-tags": patch | ||
--- | ||
|
||
Support aggregate errors when final error is a HTMLJS parser error. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"marko": patch | ||
--- | ||
|
||
Fix invalid sourcemapping of parse errors in a class block. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...untime-class/test/translator/fixtures/error-class-syntax/snapshots/cjs-error-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
CompileErrors: | ||
at __tests__/template.marko:7:9 | ||
5 | }}; | ||
6 | | ||
> 7 | this.hello = { | ||
| ^ Unexpected token | ||
8 | world: true | ||
9 | }; | ||
10 | } | ||
|
||
at __tests__/template.marko:11:3 | ||
9 | }; | ||
10 | } | ||
> 11 | onFoo() { | ||
| ^ Line has extra indentation at the beginning | ||
12 | console.log("bar") | ||
13 | } | ||
14 | } |
18 changes: 18 additions & 0 deletions
18
...-class/test/translator/fixtures/error-class-syntax/snapshots/generated-error-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
CompileErrors: | ||
at __tests__/template.marko:7:9 | ||
5 | }}; | ||
6 | | ||
> 7 | this.hello = { | ||
| ^ Unexpected token | ||
8 | world: true | ||
9 | }; | ||
10 | } | ||
|
||
at __tests__/template.marko:11:3 | ||
9 | }; | ||
10 | } | ||
> 11 | onFoo() { | ||
| ^ Line has extra indentation at the beginning | ||
12 | console.log("bar") | ||
13 | } | ||
14 | } |
18 changes: 18 additions & 0 deletions
18
...ntime-class/test/translator/fixtures/error-class-syntax/snapshots/html-error-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
CompileErrors: | ||
at __tests__/template.marko:7:9 | ||
5 | }}; | ||
6 | | ||
> 7 | this.hello = { | ||
| ^ Unexpected token | ||
8 | world: true | ||
9 | }; | ||
10 | } | ||
|
||
at __tests__/template.marko:11:3 | ||
9 | }; | ||
10 | } | ||
> 11 | onFoo() { | ||
| ^ Line has extra indentation at the beginning | ||
12 | console.log("bar") | ||
13 | } | ||
14 | } |
18 changes: 18 additions & 0 deletions
18
...s/test/translator/fixtures/error-class-syntax/snapshots/htmlProduction-error-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
CompileErrors: | ||
at __tests__/template.marko:7:9 | ||
5 | }}; | ||
6 | | ||
> 7 | this.hello = { | ||
| ^ Unexpected token | ||
8 | world: true | ||
9 | }; | ||
10 | } | ||
|
||
at __tests__/template.marko:11:3 | ||
9 | }; | ||
10 | } | ||
> 11 | onFoo() { | ||
| ^ Line has extra indentation at the beginning | ||
12 | console.log("bar") | ||
13 | } | ||
14 | } |
18 changes: 18 additions & 0 deletions
18
...me-class/test/translator/fixtures/error-class-syntax/snapshots/hydrate-error-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
CompileErrors: | ||
at __tests__/template.marko:7:9 | ||
5 | }}; | ||
6 | | ||
> 7 | this.hello = { | ||
| ^ Unexpected token | ||
8 | world: true | ||
9 | }; | ||
10 | } | ||
|
||
at __tests__/template.marko:11:3 | ||
9 | }; | ||
10 | } | ||
> 11 | onFoo() { | ||
| ^ Line has extra indentation at the beginning | ||
12 | console.log("bar") | ||
13 | } | ||
14 | } |
18 changes: 18 additions & 0 deletions
18
...ntime-class/test/translator/fixtures/error-class-syntax/snapshots/vdom-error-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
CompileErrors: | ||
at __tests__/template.marko:7:9 | ||
5 | }}; | ||
6 | | ||
> 7 | this.hello = { | ||
| ^ Unexpected token | ||
8 | world: true | ||
9 | }; | ||
10 | } | ||
|
||
at __tests__/template.marko:11:3 | ||
9 | }; | ||
10 | } | ||
> 11 | onFoo() { | ||
| ^ Line has extra indentation at the beginning | ||
12 | console.log("bar") | ||
13 | } | ||
14 | } |
18 changes: 18 additions & 0 deletions
18
...s/test/translator/fixtures/error-class-syntax/snapshots/vdomProduction-error-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
CompileErrors: | ||
at __tests__/template.marko:7:9 | ||
5 | }}; | ||
6 | | ||
> 7 | this.hello = { | ||
| ^ Unexpected token | ||
8 | world: true | ||
9 | }; | ||
10 | } | ||
|
||
at __tests__/template.marko:11:3 | ||
9 | }; | ||
10 | } | ||
> 11 | onFoo() { | ||
| ^ Line has extra indentation at the beginning | ||
12 | console.log("bar") | ||
13 | } | ||
14 | } |
16 changes: 16 additions & 0 deletions
16
packages/runtime-class/test/translator/fixtures/error-class-syntax/template.marko
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
class { | ||
onCreate() { | ||
this.state = { | ||
v : null | ||
}}; | ||
this.hello = { | ||
world: true | ||
}; | ||
} | ||
onFoo() { | ||
console.log("bar") | ||
} | ||
} | ||
|
||
<div/> |