The main reason is using Atom to remove the lifetime for convenience.
And after removing the lifetime of these nodes, the `Program<'a>`
doesn't rely on `&'a source` anymore, which allows us to [specify more
accurate
lifetimes](https://github.com/web-infra-dev/oxc/discussions/700).
A test harness for checking results of semantic analysis.
I got tired of writing ad-hoc test cases when finding bugs in semantic
analysis, so I made this.
related: #688 .
There are some unfinished things that need to be finalised by Boshen.
1. Official icon and description for the package.
2. Publishing strategy ( It's probably not a good idea to use
`package.json` as a probe to publish extension, as there's too much
vscode configuration coupled to it, a git tag like `vscode_v0.0.x` might
be worth considering ).
3. License for the extension.
Closes#685
Intend to use this in the following ways in #672.
```rs
let node = ctx.nodes().get_node(reference.node_id());
if !self.type_of && has_typeof_operator(node, ctx) {
return;
}
```
Found a behaviour mismatch: when an array is provided in exports field,
enhanced-resolve will try to read the file and try the next one if it
fails. But in the spec, the path is not read, it's only tested against
"invalid package target".
```
For each item targetValue in target, do
1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions), continuing the loop on any Invalid Package Target error.
2. If resolved is undefined, continue the loop.
3. Return resolved.
```
I tested against node.js and verifies node.js conforms to the spec.
Fixes 11 TS conformance tests and 18 babel tests.
Adds types to the symbol table functionally conformant to TS behavior
but symbol flags implemented slightly differently.
Symbol redeclaration check is also not entirely conformant but fixing
this seems like a separate PR.
For testing purposes - consistent-export-type was also implemented
(WIP).
Adds `AstKind::debug_name()`, which returns the name of an AstKind
struct with a few minor details as applicable. I intentionally did not
make `AstKind` implement `Display`, as this method returns minimal
information. Additionally, this method only exists in debug builds. I've
hidden it behind a `#[cfg(debug_assertions)]`, so it won't affect
release builds.
This code was extracted from #642, where it as created while debugging
iteration over ancestor nodes. I figured it belonged in its own PR and
may be useful to other devs.
No need to needlessly duplicate code.
**Future work:**
1. remove any breakout function that calls getspan...
2. maybe: make every type that can implement span (why don't we already)
Reduces mallocs via `clones()` (particularly of `Atom`s), and vec
allocations.
Affects the following rules:
- [x] eslint/no-dupe-keys
- [x] eslint/no-global-assign
- [x] eslint/no-loss-of-precision _(only partially optimized, needs more
work later)_
~- [ ] typescript-eslint/ajacent-overload-signatures~ (_will be
addressed in following pr_)