Commit graph

31 commits

Author SHA1 Message Date
Dunqing
350cd9158a
fix(parser): should parser error when function declaration has no name (#3461)
https://oxc-project.github.io/oxc/playground/?code=3YCAAICNgICAgICAgICzncl%2FKeF7k4Y7upgY2l43c79%2FYxaAgA%3D%3D
2024-05-30 19:58:50 +08:00
Boshen
e818fba21c refactor(parser): improve parse_simple_arrow_function_expression (#3349) 2024-05-19 06:05:39 +00:00
Boshen
0742081921 refactor(parser): improve is_parenthesized_arrow_function_expression (#3343) 2024-05-18 16:39:51 +00:00
Boshen
530455849b chore(tasks): add commit sha to snapshots to make sure submodules are not outdated (#3267)
If submodules are outdated, it'll panic with the following message

```
Repository is outdated, please run `just submodules` to update it.
```

For us maintainers, we'll need the env `UPDATE_SNAPSHOT` to force an update.
2024-05-14 10:18:00 +00:00
Boshen
09f34fc942
refactor(semantic): unify diagnostic in checker 2024-05-12 01:07:28 +08:00
Boshen
8a73d18fcf
chore(parser): make sure all span.end >= span.start (#2681)
closes #2679
2024-03-11 19:49:51 +08:00
Boshen
265b2fb640
feat: miette v7 (#2465) 2024-03-08 15:50:00 +08:00
Boshen
e2d2ce3369
feat(parser): parse decorators properly (#2603)
closes #2562
2024-03-04 19:30:41 +08:00
Boshen
650f6c942f
refactor: use our forked version of miette::Reporter for tests (#2266) 2024-02-02 16:15:31 +08:00
Tzvi Melamed
73ccf8a4da
fix(oxc_semantic): proper traversal of try statements (#2250)
Closes #2227
2024-02-01 20:46:38 +08:00
Dunqing
f59e87f9c4
refactor(semantic): checking label in ContinueStatement based on LabelBuilder (#2202) 2024-01-29 18:24:42 +08:00
Dunqing
56adfb1a86
refactor(semantic): use LabelBuilder instead of UnusedLabeled (#2184)
I think `UnusedLabeled` can do more than that.

1. Collect unused label
2. Support check duplication label
3. Support check label in `BreakStatement`
4. Support check label in `ContinueStatement` (Not yet)

But then the `UnusedLabeled` name wouldn't fit, so I renamed it
`LabelBuilder` and moved it to `label.rs`
2024-01-29 15:15:07 +08:00
Boshen
ad133ba647
chore: update snapshots 2024-01-22 19:16:09 +08:00
Boshen
a69b76ab77
chore: update snapshots 2024-01-15 21:13:05 +08:00
Boshen
08438e04ba
refactor(parser): remove TokenValue::RegExp from Token (#1926)
This PR is part of #1880.

`Token` size is reduced from 48 to 40 bytes.

To reconstruct the regex pattern and flags within the parser , the regex
string is
re-parsed from the end by reading all valid flags.

In order to make things work nicely, the lexer will no longer recover
from a invalid regex.
2024-01-08 13:48:52 +08:00
Dunqing
dae5f628b0
perf(semantic): check duplicate parameters in Binder of FormalParameters (#1840) 2024-01-03 12:57:03 +08:00
Dunqing
c3090c2c70
fix(parser): terminate parsing if an EmptyParenthesizedExpression error occurs (#1874)
close: https://github.com/oxc-project/oxc/issues/1870#issue-2061901976
2024-01-03 11:34:14 +08:00
Dunqing
9c9d882d93
fix(semantic): remove duplicate errors in ModuleDeclaration::ImportDeclaration (#1846)
<img width="653" alt="image"
src="https://github.com/oxc-project/oxc/assets/29533304/7a3ca98e-6c6e-4170-8b79-e9c63b6b9153">
2023-12-28 10:44:53 +08:00
Dunqing
d63c50a5ca
refactor(semantic): improve check private identifier implementation (#1794)
The regression case in typescript is as expected since we don't
currently store `AccessorProperty` in `ClassTable`.

The following code is one of those cases

```ts
class C1 {
    accessor #a: any;
    accessor #b = 1;
    static accessor #c: any;
    static accessor #d = 2;

    constructor() {
        this.#a = 3;
        this.#b = 4;
    }

    static {
        this.#c = 5;
        this.#d = 6;
    }
}
```

But there was an error

```shell
Expect to Parse: "conformance/classes/propertyMemberDeclarations/autoAccessor2.ts"
  × Private field 'a' must be declared in an enclosing class
    ╭─[conformance/classes/propertyMemberDeclarations/autoAccessor2.ts:9:1]
  9 │     constructor() {
 10 │         this.#a = 3;
    ·              ──
 11 │         this.#b = 4;
    ╰────
```

Let's leave it alone for now. Because of the `AccessorProperty` I
haven't seen it in any repo.
2023-12-26 20:39:22 +08:00
Boshen
7fca9504d2
chore: update snapshots 2023-11-28 16:27:10 +08:00
magic-akari
9ff0ffcc6f
feat(ast): implement new proposal-import-attributes (#1476)
- [Import Attributes](https://tc39.es/proposal-import-attributes)
2023-11-25 15:56:09 +08:00
magic-akari
9c0aafcd1c
fix(parser): Disallow ReservedWord in NamedExports (#1230)
- fix: #1222

---------

Co-authored-by: Boshen <boshenc@gmail.com>
2023-11-12 10:52:02 +00:00
Boshen
d5fb3d43ab
chore(coverage): remove regex-v-flag feature from parser tests (#975)
A regex parser is required to implement this.

Relates #385
2023-10-11 06:18:22 +08:00
Boshen
b46f34e096
chore: bump submodules and snapshots 2023-10-06 16:15:35 +13:00
Cameron
5b1e1e5408
feat(parser): TypeScript 5.2 (#811)
- adds support for [Using
Declarations](https://devblogs.microsoft.com/typescript/announcing-typescript-5-2/#using-declarations-and-explicit-resource-management)

Closes #786
2023-10-05 12:52:14 +13:00
Boshen
c5402c1cae
feat(linter): implement no-import-assign (nursery) 2023-07-01 11:20:31 +08:00
Boshen
bad8bfcf16
ci: run conformance tests and bail if there are outdated snapshots (#444) 2023-06-14 21:44:10 +08:00
Boshen
1ed8df2d83
feat(parser): parse const type parameter from TypeScript v5.0 (#416) 2023-06-08 22:26:35 +08:00
Boshen
895d26ebf9
chore(coverage): update snapshot 2023-06-01 14:28:00 +08:00
Boshen
c613583544
chore(coverage): bump coverage status 2023-05-25 18:46:48 +08:00
Boshen
fc7a374e7c
feat(coverage): add a directory for tests
closes #363
2023-05-20 23:02:30 +08:00
Renamed from tasks/coverage/test262.snap (Browse further)