[P2] Compiler: indirect toSorted calls ignore arguments.length
メンテナーはふだん 1 日以内に返信
関連するプルリクエストがすでにマージされています。
- #3552 @nickna による — マージ済み
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 68/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- csharp, typescript
- 領域
- compilers
調査の方向性
Start by comparing the compiled indirect Array.prototype.toSorted.apply(args, []) path with the inline .call(args) path and the descriptor-aware generic helper mentioned in the issue. Run the unchecked classic JavaScript reproducer with --no-tsconfig --noLib and compare its output with Node v22.23.2. Done means the compiled indirect call reads the JavaScript length property once and produces 2 1.
索引モデルが issue の本文から書いたものです。
説明
Compiled dynamic Array.prototype.toSorted calls use the backing arguments storage count instead of the JavaScript length property.
function f(a, b) {
const args = arguments;
let reads = 0;
Object.defineProperty(args, "length", { get() { reads++; return 1; } });
const sortCopy = Array.prototype.toSorted;
console.log(sortCopy.apply(args, []).join(","), reads);
}
f(2, 1);
Node v22.23.2 prints 2 1. The compiled standalone outputs on clean main at cabb41636 and #3510 at 66d78c4ff both print 1,2 0. Both assemblies passed full saved IL verification. Run the source as an unchecked classic .js file with --no-tsconfig --noLib.
The indirect apply path differs from the inline Array.prototype.toSorted.call(args) path, which uses the descriptor-aware generic helper in #3510. Found while auditing related length checks in #3533.
- 主要言語
- C#
- スター
- 156
- フォーク
- 4
- 平均マージ
- 15時間 35分
- マージ済み PR(30日)
- 43
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nickna/SharpTS のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 57/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
メンテナーはふだん 1 日以内に返信
-
Compiled strict async function declarations lack the throwing callee accessor対応中かも @nickna が今日担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 69/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
Assert.That on a null non-generic IEnumerable throws ArgumentNullException, so IsNull() cannot passオープンbug P2
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
area/automation area/sdk kind/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
unoplatform/uno.templates#2406 ·
メンテナーはふだん 1 日以内に返信
-
bug frontend ui
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
agentic-workflows
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
documentation trivial
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信