Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(es/minifier): Handle more indexing expression #8750

Merged
merged 80 commits into from
Jul 2, 2024
Merged
Changes from 1 commit
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
e926076
Initial commit: string literals
levi-nz Mar 15, 2024
e7122e1
WIP: array literals
levi-nz Mar 15, 2024
aaecdda
Correctly handle array indexing
levi-nz Mar 16, 2024
6c990d1
Update unit test
levi-nz Mar 17, 2024
0544208
Fix broken index logic
levi-nz Mar 17, 2024
dd4a564
Fix indexing `ObjectLit`s
levi-nz Mar 17, 2024
7916e48
Remove fraction check from `LiteralVisitor`
levi-nz Mar 18, 2024
2075a25
cargo fmt
levi-nz Mar 18, 2024
07f427d
Update test files
levi-nz Mar 18, 2024
ee8f34b
Handle `x['0']`
levi-nz Mar 31, 2024
7cfc984
Don't return `KnownOp::Len` if `obj` is an ObjectLiteral
levi-nz Mar 31, 2024
25fcd45
Handle `x['length']`
levi-nz Mar 31, 2024
ca089fb
Correctly handle builtin properties
levi-nz Mar 31, 2024
823ed75
Don't replace ArrayLiteral if doing so may have side effects
levi-nz Mar 31, 2024
0c8386e
Update unit test
levi-nz Mar 31, 2024
4b4d8ad
Update minifier test files
levi-nz Mar 31, 2024
a0997fb
cargo fmt
levi-nz Mar 31, 2024
c2cd898
Minifier shouldn't handle potential `pristine_globals` cases
levi-nz Apr 1, 2024
da150a2
cargo fmt
levi-nz Apr 1, 2024
e7f6670
Update test files
levi-nz Apr 1, 2024
c1a13e2
Don't add a dummy value if no side effects exist
levi-nz Apr 1, 2024
e50ab82
Update test files
levi-nz Apr 1, 2024
3f86a8f
Oops
levi-nz Apr 1, 2024
82c02aa
Update unit test
levi-nz Apr 1, 2024
a4a08e2
Add test case for side effects
levi-nz Apr 1, 2024
19bf289
Add compression for `MemberExpr`
levi-nz Jun 24, 2024
d96c998
cargo fmt
levi-nz Apr 1, 2024
3acffd1
String does not appear to inherit Function
levi-nz Apr 2, 2024
01d5b38
Array also does not inherit Function
levi-nz Apr 2, 2024
42bc03b
Remove comment
levi-nz Apr 2, 2024
15b42f1
`FUNCTION_SYMBOLS` is no longer required
levi-nz Apr 2, 2024
f59430d
Add unit test files
levi-nz Apr 2, 2024
13c0eed
Update test files
levi-nz Apr 2, 2024
9d1864e
Update test config
levi-nz Apr 3, 2024
f7e608b
Better test dir names
levi-nz Apr 3, 2024
0268ff6
Remove evil clone
levi-nz Apr 3, 2024
8d5ae30
I don't know why this changed, but it did.
levi-nz Apr 3, 2024
af09c01
Add array side effect unit test
levi-nz Apr 3, 2024
167e671
Don't optimize if inside left-hand side of AssignExpr
levi-nz Apr 3, 2024
194249e
Remove redundant import
levi-nz Apr 3, 2024
f82d615
Move call to end
levi-nz Apr 3, 2024
9bbedee
Cleanup iterator call
levi-nz Apr 3, 2024
8a9e2cf
Handle side effects and `__proto__` in object compression
levi-nz Apr 8, 2024
f462bfc
Remove redundant return statement
levi-nz Apr 8, 2024
3d0f354
cargo fmt
levi-nz Apr 8, 2024
7469da7
Remove redundant `Box::new` call
levi-nz Apr 8, 2024
eb0c7ee
Use `preserve_effects`
levi-nz Apr 8, 2024
02032cc
cargo fmt
levi-nz Apr 8, 2024
82e4b3e
Exclude `watch` and `unwatch`
levi-nz Apr 9, 2024
5ee31d3
UPDATE=1 cargo test --test projects --test tsc
levi-nz Apr 9, 2024
d6fa0e7
UPDATE=1 cargo test -p swc_ecma_minifier --features concurrent
levi-nz Apr 9, 2024
a691c25
Remove redundant import
levi-nz Apr 10, 2024
f3a2ff0
Fix `test_fold_array_lit_spread_get_elem`
levi-nz Apr 10, 2024
c2f2e1f
Fix `test_fold_get_elem1`
levi-nz Apr 10, 2024
570bb69
Add `self.changed = true;`
levi-nz Apr 10, 2024
38960d6
Use `ctx`
levi-nz Apr 22, 2024
9eb723f
Fix doc
levi-nz Apr 25, 2024
9be7be7
Handle SeqExpr in `optimize_member_expr`
levi-nz Apr 25, 2024
94d9db5
Remove dup `self.changed = true;`
levi-nz May 10, 2024
65ceb8d
Apply clippy suggestions
levi-nz May 10, 2024
fc27b52
Cleanup `optimize_member_expr`
levi-nz May 12, 2024
95a1784
Fix optimization tests
levi-nz May 12, 2024
e872c02
Fix optimization with `OptCall`
levi-nz May 25, 2024
68a4bb9
Move code into its own `eval` function
levi-nz May 25, 2024
2e96ce6
Fix error
levi-nz May 25, 2024
a7f8c7d
Remove redundant imports
levi-nz May 25, 2024
3e10aa6
Optimize imports
levi-nz May 25, 2024
84dab43
Update parserForStatement9.2.minified.js
levi-nz May 25, 2024
d910b1a
Cleanup simplify
levi-nz May 27, 2024
cefb0c0
Handle `__proto__` object when indexing known object keys
levi-nz May 30, 2024
7c7836e
cargo fmt
levi-nz May 30, 2024
6bc56e9
Remove `is_opt_call`
levi-nz Jun 2, 2024
cc0eabe
Manually fix some files
levi-nz Jun 24, 2024
b88a29d
Manually fix swc_ecma_minifier/Cargo.toml
levi-nz Jun 24, 2024
98f4eba
Update call to `nth_char`
levi-nz Jun 24, 2024
fb62635
Fix remaining `undefined` calls
levi-nz Jun 24, 2024
af081f2
Update unit test file
levi-nz Jun 24, 2024
f5a12fd
Update unit test files
levi-nz Jun 24, 2024
25fad28
Add `report_change` call
levi-nz Jun 24, 2024
6db7b18
`test_issue8747` -> `test_issue_8747`
levi-nz Jun 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Exclude watch and unwatch
  • Loading branch information
levi-nz committed Jun 24, 2024
commit 82e4b3e349a1d6cc68fc99470db4207fdbd334b3
3 changes: 3 additions & 0 deletions crates/swc_ecma_minifier/src/compress/pure/member_expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ static OBJECT_SYMBOLS: phf::Set<&str> = phf_set!(
"toLocaleString",
"toString",
"valueOf",
// removed, but kept in as these are often checked and polyfilled
"watch",
"unwatch"
);

fn is_object_symbol(sym: &str) -> bool {
Expand Down