Commit graph

5346 commits

Author SHA1 Message Date
dalaoshu
2a43fa4efd
style(linter): introduce the writing style from PR #5491 and reduce the if nesting (#5512)
Related to #5491
2024-09-06 11:19:48 +08:00
Boshen
c3cfbfb480 chore: clippy::allow_attributes (#5521)
https://blog.rust-lang.org/2024/09/05/Rust-1.81.0.html#expectlint

https://rust-lang.github.io/rust-clippy/master/index.html#/allow_attributes
2024-09-06 03:07:02 +00:00
Cam McHenry
088733b3c8
fix(linter): handle loops in getter-return rule (#5517)
- Fixes https://github.com/oxc-project/oxc/issues/3935

Prior to this, it didn't seem like we were correctly continuing to
search the graph after we encountered a backedge (loop). Now, when
encountering a cycle, we will not automatically break or prune the
search.
2024-09-06 06:29:04 +03:30
overlookmotel
e8bdd12438 feat(allocator): add AsMut impl for Box (#5515) 2024-09-05 23:52:56 +00:00
Don Isaac
340b535715
test(linter/no-unused-vars): arrow functions in tagged templates (#5510)
Closes  #5391
2024-09-05 14:55:39 -04:00
IWANABETHATGUY
b96bea4f0d fix: add back lifetime (#5507)
closed #5506
2024-09-05 17:47:58 +00:00
renovate
d9a1b610a7 chore(deps): update dependency rust to v1.81.0 (#5502)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [rust](https://redirect.github.com/rust-lang/rust) | minor | `1.80.1` -> `1.81.0` |

---

### Release Notes

<details>
<summary>rust-lang/rust (rust)</summary>

### [`v1.81.0`](https://redirect.github.com/rust-lang/rust/blob/HEAD/RELEASES.md#Version-1810-2024-09-05)

[Compare Source](https://redirect.github.com/rust-lang/rust/compare/1.80.1...1.81.0)

\==========================

<a id="1.81.0-Language"></a>

## Language

-   [Abort on uncaught panics in `extern "C"` functions.](https://redirect.github.com/rust-lang/rust/pull/116088/)
-   [Fix ambiguous cases of multiple `&` in elided self lifetimes.](https://redirect.github.com/rust-lang/rust/pull/117967/)
-   [Stabilize `#[expect]` for lints (RFC 2383),](https://redirect.github.com/rust-lang/rust/pull/120924/) like `#[allow]` with a warning if the lint is *not* fulfilled.
-   [Change method resolution to constrain hidden types instead of rejecting method candidates.](https://redirect.github.com/rust-lang/rust/pull/123962/)
-   [Bump `elided_lifetimes_in_associated_constant` to deny.](https://redirect.github.com/rust-lang/rust/pull/124211/)
-   [`offset_from`: always allow pointers to point to the same address.](https://redirect.github.com/rust-lang/rust/pull/124921/)
-   [Allow constraining opaque types during subtyping in the trait system.](https://redirect.github.com/rust-lang/rust/pull/125447/)
-   [Allow constraining opaque types during various unsizing casts.](https://redirect.github.com/rust-lang/rust/pull/125610/)
-   [Deny keyword lifetimes pre-expansion.](https://redirect.github.com/rust-lang/rust/pull/126762/)

<a id="1.81.0-Compiler"></a>

## Compiler

-   [Make casts of pointers to trait objects stricter.](https://redirect.github.com/rust-lang/rust/pull/120248/)
-   [Check alias args for well-formedness even if they have escaping bound vars.](https://redirect.github.com/rust-lang/rust/pull/123737/)
-   [Deprecate no-op codegen option `-Cinline-threshold=...`.](https://redirect.github.com/rust-lang/rust/pull/124712/)
-   [Re-implement a type-size based limit.](https://redirect.github.com/rust-lang/rust/pull/125507/)
-   [Properly account for alignment in `transmute` size checks.](https://redirect.github.com/rust-lang/rust/pull/125740/)
-   [Remove the `box_pointers` lint.](https://redirect.github.com/rust-lang/rust/pull/126018/)
-   [Ensure the interpreter checks bool/char for validity when they are used in a cast.](https://redirect.github.com/rust-lang/rust/pull/126265/)
-   [Improve coverage instrumentation for functions containing nested items.](https://redirect.github.com/rust-lang/rust/pull/127199/)
-   Target changes:
    -   [Add Tier 3 `no_std` Xtensa targets:](https://redirect.github.com/rust-lang/rust/pull/125141/) `xtensa-esp32-none-elf`, `xtensa-esp32s2-none-elf`, `xtensa-esp32s3-none-elf`
    -   [Add Tier 3 `std` Xtensa targets:](https://redirect.github.com/rust-lang/rust/pull/126380/) `xtensa-esp32-espidf`, `xtensa-esp32s2-espidf`, `xtensa-esp32s3-espidf`
    -   [Add Tier 3 i686 Redox OS target:](https://redirect.github.com/rust-lang/rust/pull/126192/) `i686-unknown-redox`
    -   [Promote `arm64ec-pc-windows-msvc` to Tier 2.](https://redirect.github.com/rust-lang/rust/pull/126039/)
    -   [Promote `wasm32-wasip2` to Tier 2.](https://redirect.github.com/rust-lang/rust/pull/126967/)
    -   [Promote `loongarch64-unknown-linux-musl` to Tier 2 with host tools.](https://redirect.github.com/rust-lang/rust/pull/126298/)
    -   [Enable full tools and profiler for LoongArch Linux targets.](https://redirect.github.com/rust-lang/rust/pull/127078/)
    -   [Unconditionally warn on usage of `wasm32-wasi`.](https://redirect.github.com/rust-lang/rust/pull/126662/) (see compatibility note below)
    -   Refer to Rust's \[platform support page]\[platform-support-doc] for more information on Rust's tiered platform support.

<a id="1.81.0-Libraries"></a>

## Libraries

-   [Split core's `PanicInfo` and std's `PanicInfo`.](https://redirect.github.com/rust-lang/rust/pull/115974/) (see compatibility note below)
-   [Generalize `{Rc,Arc}::make_mut()` to unsized types.](https://redirect.github.com/rust-lang/rust/pull/116113/)
-   [Replace sort implementations with stable `driftsort` and unstable `ipnsort`.](https://redirect.github.com/rust-lang/rust/pull/124032/) All `slice::sort*` and `slice::select_nth*` methods are expected to see significant performance improvements. See the [research project](https://redirect.github.com/Voultapher/sort-research-rs) for more details.
-   [Document behavior of `create_dir_all` with respect to empty paths.](https://redirect.github.com/rust-lang/rust/pull/125112/)
-   [Fix interleaved output in the default panic hook when multiple threads panic simultaneously.](https://redirect.github.com/rust-lang/rust/pull/127397/)

<a id="1.81.0-Stabilized-APIs"></a>

## Stabilized APIs

-   [`core::error`](https://doc.rust-lang.org/stable/core/error/index.html)
-   [`hint::assert_unchecked`](https://doc.rust-lang.org/stable/core/hint/fn.assert_unchecked.html)
-   [`fs::exists`](https://doc.rust-lang.org/stable/std/fs/fn.exists.html)
-   [`AtomicBool::fetch_not`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicBool.html#method.fetch_not)
-   [`Duration::abs_diff`](https://doc.rust-lang.org/stable/core/time/struct.Duration.html#method.abs_diff)
-   [`IoSlice::advance`](https://doc.rust-lang.org/stable/std/io/struct.IoSlice.html#method.advance)
-   [`IoSlice::advance_slices`](https://doc.rust-lang.org/stable/std/io/struct.IoSlice.html#method.advance_slices)
-   [`IoSliceMut::advance`](https://doc.rust-lang.org/stable/std/io/struct.IoSliceMut.html#method.advance)
-   [`IoSliceMut::advance_slices`](https://doc.rust-lang.org/stable/std/io/struct.IoSliceMut.html#method.advance_slices)
-   [`PanicHookInfo`](https://doc.rust-lang.org/stable/std/panic/struct.PanicHookInfo.html)
-   [`PanicInfo::message`](https://doc.rust-lang.org/stable/core/panic/struct.PanicInfo.html#method.message)
-   [`PanicMessage`](https://doc.rust-lang.org/stable/core/panic/struct.PanicMessage.html)

These APIs are now stable in const contexts:

-   [`char::from_u32_unchecked`](https://doc.rust-lang.org/stable/core/char/fn.from_u32\_unchecked.html) (function)
-   [`char::from_u32_unchecked`](https://doc.rust-lang.org/stable/core/primitive.char.html#method.from_u32\_unchecked) (method)
-   [`CStr::count_bytes`](https://doc.rust-lang.org/stable/core/ffi/c_str/struct.CStr.html#method.count_bytes)
-   [`CStr::from_ptr`](https://doc.rust-lang.org/stable/core/ffi/c_str/struct.CStr.html#method.from_ptr)

<a id="1.81.0-Cargo"></a>

## Cargo

-   [Generated `.cargo_vcs_info.json` is always included, even when `--allow-dirty` is passed.](https://redirect.github.com/rust-lang/cargo/pull/13960/)
-   [Disallow `package.license-file` and `package.readme` pointing to non-existent files during packaging.](https://redirect.github.com/rust-lang/cargo/pull/13921/)
-   [Disallow passing `--release`/`--debug` flag along with the `--profile` flag.](https://redirect.github.com/rust-lang/cargo/pull/13971/)
-   [Remove `lib.plugin` key support in `Cargo.toml`. Rust plugin support has been deprecated for four years and was removed in 1.75.0.](https://redirect.github.com/rust-lang/cargo/pull/13902/)

<a id="1.81.0-Compatibility-Notes"></a>

## Compatibility Notes

-   Usage of the `wasm32-wasi` target will now issue a compiler warning and request users switch to the `wasm32-wasip1` target instead. Both targets are the same, `wasm32-wasi` is only being renamed, and this [change to the WASI target](https://blog.rust-lang.org/2024/04/09/updates-to-rusts-wasi-targets.html) is being done to enable removing `wasm32-wasi` in January 2025.

-   We have renamed `std::panic::PanicInfo` to `std::panic::PanicHookInfo`. The old name will continue to work as an alias, but will result in a deprecation warning starting in Rust 1.82.0.

    `core::panic::PanicInfo` will remain unchanged, however, as this is now a *different type*.

    The reason is that these types have different roles: `std::panic::PanicHookInfo` is the argument to the [panic hook](https://doc.rust-lang.org/stable/std/panic/fn.set_hook.html) in std context (where panics can have an arbitrary payload), while `core::panic::PanicInfo` is the argument to the [`#[panic_handler]`](https://doc.rust-lang.org/nomicon/panic-handler.html) in no_std context (where panics always carry a formatted *message*). Separating these types allows us to add more useful methods to these types, such as `std::panic::PanicHookInfo::payload_as_str()` and `core::panic::PanicInfo::message()`.

-   The new sort implementations may panic if a type's implementation of [`Ord`](https://doc.rust-lang.org/std/cmp/trait.Ord.html) (or the given comparison function) does not implement a [total order](https://en.wikipedia.org/wiki/Total_order) as the trait requires. `Ord`'s supertraits (`PartialOrd`, `Eq`, and `PartialEq`) must also be consistent. The previous implementations would not "notice" any problem, but the new implementations have a good chance of detecting inconsistencies, throwing a panic rather than returning knowingly unsorted data.

<a id="1.81.0-Internal-Changes"></a>

## Internal Changes

These changes do not affect any public interfaces of Rust, but they represent
significant improvements to the performance or internals of rustc and related
tools.

-   [Add a Rust-for Linux `auto` CI job to check kernel builds.](https://redirect.github.com/rust-lang/rust/pull/125209/)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/oxc-project/oxc).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC41OS4yIiwidXBkYXRlZEluVmVyIjoiMzguNTkuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
2024-09-05 16:57:47 +00:00
IWANABETHATGUY
cedf7a4daa feat(xtask): impl as_ast_kind method for each variant (#5491) 2024-09-05 16:17:08 +00:00
overlookmotel
a96866d951 refactor(transformer): re-order imports (#5499)
Style nit. Re-order imports to make it clearer what types are external/internal to crate.
2024-09-05 16:04:42 +00:00
overlookmotel
6abde0a69f refactor(transformer): clarify match in RegExp transform (#5498)
Refactor match on `Term` in RegExp transform.

This is personal taste, really. I prefer this style:

```rs
match enum {
    Enum::Variant(x) => x.is_something(),
    _ => false,
}
```

over:

```rs
match enum {
    Enum::Variant(x) if x.is_something() => true,
    _ => false,
}
```

because then you don't have to reason about what happens when the `if` is false and it "falls through" to the next match arm. The compiler *might* also find the former easier to optimize, though likely in most cases it can figure out that they're equivalent.

Also rename a couple of vars for clarity.
2024-09-05 16:04:42 +00:00
overlookmotel
09c522aa5b refactor(transformer): RegExp transform report pattern parsing errors (#5496)
If RegExp transform parses the regexp pattern and finds it to be invalid, output that error.
2024-09-05 16:04:42 +00:00
overlookmotel
8f9627d1a1 fix(transformer): RegExp transform do not transform invalid regexps (#5494)
Treat invalid regexps the same regardless of whether they have unsupported flags or not - don't transform them.
2024-09-05 16:04:42 +00:00
overlookmotel
dd198231dc refactor(transformer): RegExp transform do not take ownership of Pattern then reallocate it (#5492)
Previously `try_parse_pattern` took ownership of an existing pattern and then reallocated it back into arena, even if it wasn't changed.

Rust's borrow-checker makes it quite hard to avoid this. Only way I could find is to move some of the logic out of `try_parse_pattern`.
2024-09-05 16:04:41 +00:00
overlookmotel
64db1b4c40 docs(ast): clarify docs for RegExpPattern (#5497)
Make it clearer what difference between `RegExpPattern::Raw` and `RegExpPattern::Invalid` is.
2024-09-05 15:51:20 +00:00
overlookmotel
3f204a9af5 docs(span): update docs about ContentEq Vec comparison speed (#5478)
Update the docs for `impl ContentEq for Vec` to state in what circumstances `PartialEq` is faster. See https://github.com/oxc-project/oxc/pull/5427#discussion_r1744290058.
2024-09-05 15:34:17 +00:00
overlookmotel
94a6ac63cf refactor(span): use Hasher from std (#5476)
Use `std:#️⃣:Hasher` instead of `core:#️⃣:Hasher`.

I don't actually know if importing `core` as well as `std` has any compile time perf impact, but as we're using `std` anyway, we may as well use it for everything.

Import into the `auto_impl_content_hash` module to make the macro a little easier to read.
2024-09-05 14:18:01 +00:00
overlookmotel
bd820f9c16 refactor(semantic)!: remove SymbolTable::get_symbol_id_from_name and SymbolTable::get_scope_id_from_name (#5480)
Close #5456.
2024-09-05 13:57:55 +00:00
heygsc
7414190ada
docs(linter): update docs Example for linter rules (#5479)
fix: #5458

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-05 21:54:20 +08:00
overlookmotel
2060efc801 fix(transformer): RegExp transform don't transform all RegExps (#5486)
Previously `RegExp` transform would transform every `RegExp`, even if it had no unsupported flags/patterns.
2024-09-05 13:50:21 +00:00
Jelle van der Waa
a786acff41
feat(linter/import): add no-dynamic-require rule (#5389)
Rule Detail:

[link](https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-dynamic-require.md)
2024-09-05 09:39:25 -04:00
IWANABETHATGUY
979c16c486 refactor(linter): reduce nested if statements in eslint/no_this_before_super (#5485) 2024-09-05 13:21:18 +00:00
dalaoshu
bc7be70077
chore(linter/react_perf): improve docs for react_perf rules (#5481)
Please fill in the "why this is bad" section

_Originally posted by @DonIsaac in
https://github.com/oxc-project/oxc/pull/5360#discussion_r1739617907_
2024-09-05 09:20:55 -04:00
overlookmotel
bfab0914fa perf(transformer): store needed options only on RegExp (#5484)
#5482 makes most of the `RegExpOptions` not be needed outside `new` method. So only store the remaining options which are actually needed on `RegExp`. This reduces size of `RegExp`.

(this is micro-optimization, and unlikely to make a measurable difference, but why not?)
2024-09-05 12:47:36 +00:00
overlookmotel
b4765af82a perf(transformer): pre-calculate if unsupported patterns in RegExp transform (#5483)
Similar to #5482. Calculate whether any unsupported RegExp patterns at start, to make checking if need to check for patterns cheaper (a single comparison operation, rather than 3 comparisons and ORs).
2024-09-05 12:47:35 +00:00
overlookmotel
182ab91570 perf(transformer): pre-calculate unsupported flags in RegExp transform (#5482)
Calculate unsupported RegExp flags at start, to make checking flags on each RegExp during traversal cheaper (a single OR operation). i.e. do work once at the start, rather than over and over each time you find a `RegExp`.
2024-09-05 12:47:34 +00:00
Dunqing
2514cc92e5 refactor(transformer/react): move all entry points to implementation of Traverse trait (#5473) 2024-09-05 11:04:45 +00:00
Dunqing
c59d8b3c9b feat(transformer): support all /regex/ to new RegExp transforms (#5387)
related: #4754

The implementation port from [esbuild](332727499e/internal/js_parser/js_parser.go (L12820-L12840)). And cover all babel's regexp plugins

---

## The following description was generated by `Graphite` 😋

### TL;DR

Added support for transforming various RegExp features to ensure compatibility with older JavaScript environments.

### What changed?

- Implemented a new `RegExp` transformer to handle unsupported RegExp literal features
- Added options to control different RegExp transformations (e.g., sticky flag, unicode flag, dot-all flag, etc.)
- Updated the transformer to convert unsupported RegExp literals into `new RegExp()` constructor calls
- Added test cases for different RegExp transformations
- Integrated the new RegExp transformer into the existing transformation pipeline

### How to test?

1. Run the existing test suite to ensure no regressions
2. Execute the new RegExp-specific tests in the `tasks/transform_conformance/tests/esbuild-tests/test/fixtures/regexp/` directory
3. Try transforming code with various RegExp features using different target environments to verify correct transformations
2024-09-05 11:04:45 +00:00
Boshen
d9d29f8705
ci: fix pr.yml
closes #5477
2024-09-05 18:09:40 +08:00
Boshen
3cbf9ef70a
ci: add release to pr title check (#5475) 2024-09-05 17:10:12 +08:00
IWANABETHATGUY
91b39c4b82 feat(oxc_diagnostic): impl DerefMut for OxcDiagnostic (#5474)
1. Impl `DerefMut` for `OxcDiagnositc` so downstream user could move `OxcDiagnostic` rather clone it,
40ae24d597/crates/rolldown_ecmascript/src/ecma_compiler.rs (L36-L48)
2024-09-05 08:55:52 +00:00
rzvxa
9b984b31bd fix(regex): panic on displaying surrogated UnicodeEscape characters. (#5469)
fixes https://github.com/oxc-project/oxc/pull/5387#issuecomment-2330534180
2024-09-05 06:18:11 +00:00
rzvxa
0df1d9d97b fix(ast, codegen, linter): panics in fixers. (#5431)
Closes #5434

https://github.com/oxc-project/oxlint-ecosystem-ci/actions/runs/10685877915/job/29619941099
2024-09-05 05:59:22 +00:00
rzvxa
9f6e0ed099 refactor(ast): simplify ContentEq trait definition. (#5468)
Addresses the concerns brought up in #5427
2024-09-05 05:36:51 +00:00
rzvxa
ccc8a27e4f refactor(ast, ast_tools): use full method path for generated derives trait calls. (#5462)
As of now if we remove the implementation of a trait for a type and implement the method on that type directly it wouldn't break while it isn't the original trait anymore so that method might do something entirely different.
This change is more explicit on trait calls so we hit compile errors on these kinds of changes.
2024-09-05 05:36:50 +00:00
rzvxa
90facd3657 feat(ast): add ContentHash trait; remove noop Hash implementation from Span (#5451)
closes #5283

Also removes the noop Hash implementation on `Span` in favor of a real implementation.
2024-09-05 07:20:04 +03:30
mysteryven
5187f384cb fix(linter/tree-shaking): detect the correct export symbol resolution (#5467)
fixes: #5455
2024-09-05 03:05:46 +00:00
overlookmotel
cba93f52d0 feat(ast)!: add ThisExpression variants to JSXElementName and JSXMemberExpressionObject (#5466)
Close #5352.

Add to AST:

* `JSXElementName::ThisExpression` (`<this>`)
* `JSXMemberExpressionObject::ThisExpression` (`<this.foo>`, `<this.foo.bar>`)
2024-09-05 02:06:20 +00:00
overlookmotel
82c0a167c4 fix(linter): tree_shaking/no_side_effects_in_initialization handle JSX correctly (#5450)
#5223 altered `JSXElementName` so `JSXElementName::Identifier` is used only for non-reference JSX names (e.g. `<div>`). `JSXElementName::IdentifierReference` is used where the name is a reference (e.g. `<Foo>`). Similarly `JSXMemberExpressionObject`'s `object` is always an `IdentifierReference` now.

So, the net result is that `JSXIdentifier` is now never a reference, it's just the JSX equivalent of `IdentifierName`. So I don't think `JSXIdentifier` can ever have side-effects.

This PR:

1. Removes `impl ListenerMap for JSXIdentifier`
2. Adds `impl ListenerMap for JSXMemberExpression` and makes sure the root `IdentifierReference` (`Foo` in `<Foo.bar.qux>`) is visited.
2024-09-05 02:06:19 +00:00
Dunqing
e4ed41d4fa refactor(semantic): change the reference flag to ReferenceFlags::Type if it is used within a TSTypeQuery (#5444)
So far, the `ReferenceFlags::TSTypeQuery` only used indicates it is referenced by `TSTypeQuery` that we can confirm the reference should be regarded as a type reference, namely `ReferenceFlags::Type`.

This PR adds a `ReferenceFlags::ValueAsType` instead of `ReferenceFlags::TSTypeQuery`.  The new flag has the same behavior as the previous one. But it looks more general and is not only used in `TSTypeQuery`. But now it is a temporary flag. We use it to resolve the symbol correctly and replace `ReferenceFlags::ValueAsTyoe` with `ReferenceFlags::Type` after resolved.

Also, this change eliminates the inconsistency in behavior between the `Reference::is_type` and `ReferenceFlags::is_type` methods.
2024-09-05 01:50:20 +00:00
Dunqing
d8b9909bd8 fix(semantic): IdentifierReference within TSPropertySignature cannot reference type-only import binding (#5441)
close: #5435

The behavior of `IdentifierReference` in `TSPropertySignature` is the same as in `TSTypeQuery`, both allow only reference value bindings and type-only import bindings.

I still use `ReferenceFlags::TSTypeQuery` here because I want to avoid producing many changes unrelated to the bug in this PR. I will refactor it in the follow-up PR soon
2024-09-05 01:50:18 +00:00
DonIsaac
0f50b1ed6d feat(semantic): check for initializers in ambient VariableDeclarations (#5463) 2024-09-05 01:33:11 +00:00
DonIsaac
62f7fff88f feat(semantic): check for non-declared, non-abstract object accessors without bodies (#5461) 2024-09-05 01:33:10 +00:00
DonIsaac
540714393a feat(semantic): check for non-declared, non-abstract class accessors without bodies (#5460)
This should be causing more negative tests to fail than it actually is. This is
because our typescript coverage tests use the "declarations" option to change
the source type to `.d.ts`, which is incorrect. This setting enables `.d.ts`
emits, it does not mean that input files should be treated as `.d.ts`
themselves.
2024-09-05 01:33:09 +00:00
DonIsaac
052e94c94e feat(semantic): check for parameter properties in constructor overloads (#5459)
Adds checks for
```
A parameter property is only allowed in a constructor implementation.ts(2369)
```
2024-09-05 01:33:07 +00:00
overlookmotel
87c5df2226 refactor(ast)!: rename Expression::without_parentheses (#5448)
Rename `without_parenthesized` to `without_parentheses`. Both are hard-to-spell words, but "without parenthesized" does not make sense.
2024-09-05 01:25:00 +00:00
overlookmotel
a43e9512f3 refactor(ast): use loop instead of recursion (#5447)
Use loop instead of recursive function call. Loops are usually cheaper.
2024-09-05 01:24:59 +00:00
overlookmotel
6285a02274 fix(linter): eslint/radix rule correctly check for unbound symbols (#5446)
`SymbolTable::get_symbol_id_from_name(name).is_none()` is not always correct, because it will return `false` if there is a binding *anywhere* in the AST with that name, whereas what we actually want to know is whether *this* `IdentifierReference` is referring to a global or not.

Instead, look up whether this reference is resolved or not using `SymbolTable::is_global_reference`.

The 3 test cases added were not working prior to this change.
2024-09-05 01:18:24 +00:00
overlookmotel
2224cc4e62 refactor(ast): renumber JSXMemberExpressionObject discriminants (#5464)
Number discriminants starting at 0, not 1. This likely makes no difference, but starting numbering at 1 seems odd.
2024-09-04 22:59:53 +00:00
overlookmotel
a952c47265 refactor(ast): use loop not recursion (#5449)
`Expression::get_inner_expression` and `Expression::get_inner_expression_mut` use a loop rather than recursive function calls. Loops are usually cheaper.
2024-09-04 20:24:45 +00:00
overlookmotel
1d3e973f10 refactor(linter): simplify eslint/radix rule (#5445)
Refactor to remove duplicate logic.
2024-09-04 16:52:27 +00:00