Previously any instructions happening inside of the expression passed to
`export default` were invisible in the CFG.
Example:
```
// Uncommenting this line makes the call to bar() disappear from the
// CFG view of the program:
// export default
bar();
```
Follow-on after #7831.
Previously this code was:
1. Create a new empty `Vec` (in `move_vec` call).
2. Consume the old `Vec` and create a new `Vec<ArrayExpressionElement>`.
3. Push to the empty `Vec` created in step 1.
Instead:
1. Drain the old `Vec` and create a new `Vec<ArrayExpressionElement>`.
2. The old `Vec` is now empty, but still holds an allocation if it wasn't empty before.
3. Push to the old `Vec` (re-using the existing allocation).
i.e. We create 1 less `Vec`, and re-use an existing allocation if possible.
`#![allow(non_snake_case)]` was required in files using `#[derive(Tsify)]`, as a bug in Rust Analyser caused erroneous warnings. This appears to be fixed now, so we can remove these `#![allow]` attributes.
Follow-on after #7830. Refactor.
Use an exhaustive match in implementation of `From<Argument<'a>> for ArrayExpressionElement<'a>`.
At present this change makes no difference. But the reason I feel an exhaustive match is preferable here is that if we add a variant to `Argument` enum later, then this match will be missing an arm to handle that variant, and compiler will refuse to compile until we deal with it.
Whereas before this PR, compiler would not complain, but instead it'd be a runtime panic when `into_expression` discovers that the new `Argument` variant is not an `Expression`.
Simplify code by using `Expression::is_super` which was introduced in #7831.
Also remove a lifetime bound which is unnecessary and replace use of `bool::then` (which I always find hard to read) with more explicit code.
## [0.15.1] - 2024-12-13
### Features
- 38b1c2e editor: Create a command to apply all auto-fixes for the
current active text editor (#7672) (Nicholas Rayburn)
### Bug Fixes
- 2b187e5 linter: Fix configuration casing for
`typescript/no_this_alias` (#7836) (Boshen)
- 06e6d38 linter: Fix unicorn/prefer-query-selector to use the correct
replacement for getElementsByClassName (#7796) (Nicholas Rayburn)
- 7a83230 semantic: Missing reference when `export default` references a
type alias binding (#7813) (Dunqing)
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
Follow-on after #7811. Remove the panicking test. It *does* currently
cause a panic if replacement contains scopes (e.g. `() => 123`) but
that's a bug. So we shouldn't have a test saying that it *should* panic.
- Closes https://github.com/oxc-project/oxc/issues/7797
Removing span seems to work, but I'm not sure traversing all the time is
okay.
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Some refactoring works to update
https://github.com/oxc-project/oxc/issues/5068#issuecomment-2507272735
table.
- Implement `array::is_consisely_printed_array()` and use it
- This improved compat-rate a bit ✌🏻
- Align exported function names to align prettier's
- Split `format/mod.rs` into `js`, `jsx` and `typescript`
- Move `format/*.rs` to `format/print/*.rs`
Ref #7456
- Creates a custom action in the language server that applies all
auto-fixes for a given file.
- Updates VS Code to use the custom action with a command to apply fixes
for the currently active text editor.
> zizmor is a static analysis tool for GitHub Actions. It can find many
common security issues in typical GitHub Actions CI/CD setups.
https://woodruffw.github.io/zizmor/
EDIT: what is the right PR-syntax for this?
---------
Co-authored-by: Boshen <boshenc@gmail.com>
Write indentation faster. Previously was writing indentation to buffer with a call to `memset`, which is relatively expensive. Where indentation `<= 16` (common case), write 16 tabs with a single 16-byte XMM write, which is faster.