Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## v0.5.1171 — fix(dayjs): `arguments` in sequence exprs + computed Date-method dispatch (#5133)

`compilePackages: dayjs` threw `ReferenceError: arguments is not defined`, and once that was resolved `.add()`/`.date(n)` silently no-op'd. Two distinct, general root causes:

1. **`arguments` hidden inside a sequence expression.** Minified dayjs builds the wrapper as `O=function(t,e){...return n.date=t,n.args=arguments,new _(n)}` — the `arguments` reference lives inside a comma/sequence expression in the `return`. The synthetic-arguments pre-scan `expr_uses_arguments` (`crates/perry-hir/src/lower_decl/helpers.rs`) had no `Expr::Seq` arm, fell through its `_ => false` catch-all, so the enclosing function never synthesized its hidden raw-`arguments` param. Fix: descend into `Expr::Seq`, plus the other operand-bearing forms the catch-all skipped — `Await`, `Yield`, `OptChain`, computed `SuperProp`, `TaggedTpl`.

2. **Computed/dynamic Date-method calls dropped to generic dispatch.** dayjs mutates dates via `this.$d[l]($)` (e.g. `date["setDate"](44)`). A `DateCell` is a NaN-boxed pointer but not an `ObjectHeader`; `js_native_call_method` special-cased only `toString` for date receivers, so every other computed/dynamic call fell through to generic object dispatch, returned `[object Object]` and dropped the mutation. Fix: route any method on a date receiver through `Date.prototype` (where all getter/setter/`toISOString`/`toJSON` thunks are installed and read `IMPLICIT_THIS`), with `this` bound to the cell.

Known residual: a SIGSEGV in dayjs's month arithmetic (`.endOf('month')` / `.set('month', …)` — a number-as-pointer deref in `js_object_get_field_by_name`, unrelated to either fix here) is left for a follow-up.

## v0.5.1170 — fix(codegen): register rest/`arguments` metadata for renamed-export value wrappers (#5134)

`.apply()`/`.call()` on a cross-module **default**-exported (or otherwise
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co

Perry is a native TypeScript compiler written in Rust that compiles TypeScript source code directly to native executables. It uses SWC for TypeScript parsing and LLVM for code generation.

**Current Version:** 0.5.1170
**Current Version:** 0.5.1171


## TypeScript Parity Status
Expand Down
Loading