Fix decorator wrapper this-binding test gap and misdirecting warning#416
Conversation
…405) Tests: fix "decorator can replace method" to use an honest arrow wrapper (this-independent method), add "wrapper preserves call-site this" and "wrapper supports recursive self-call" using object-method shorthand. Docs: add "Writing wrappers" subsection to Decorators in language.md showing the object-method-shorthand pattern and why arrows/function expressions are unsuitable for this-capturing wrappers. Warning: update all four function/async-function parser warnings to suggest object-method shorthand alongside arrow functions, instead of recommending only arrows (which lose call-site this). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughUpdates documentation, parser warnings, and test coverage to address decorator wrapper issues with call-site Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Benchmark Results386 benchmarks Interpreted: 🟢 62 improved · 🔴 85 regressed · 239 unchanged · avg -0.5% arraybuffer.js — Interp: 🟢 1, 13 unch. · avg +0.8% · Bytecode: 🟢 11, 🔴 1, 2 unch. · avg +6.8%
arrays.js — Interp: 🟢 2, 🔴 1, 16 unch. · avg +0.7% · Bytecode: 🟢 17, 🔴 1, 1 unch. · avg +10.0%
async-await.js — Interp: 6 unch. · avg +2.9% · Bytecode: 🟢 4, 2 unch. · avg +7.8%
base64.js — Interp: 🟢 1, 🔴 1, 8 unch. · avg -0.3% · Bytecode: 🟢 10 · avg +11.0%
classes.js — Interp: 🟢 4, 🔴 1, 26 unch. · avg +0.3% · Bytecode: 🟢 17, 14 unch. · avg +5.9%
closures.js — Interp: 🔴 1, 10 unch. · avg -0.2% · Bytecode: 🟢 11 · avg +9.7%
collections.js — Interp: 🟢 1, 11 unch. · avg +1.1% · Bytecode: 🟢 12 · avg +12.6%
csv.js — Interp: 🟢 1, 12 unch. · avg +1.2% · Bytecode: 🟢 13 · avg +10.2%
destructuring.js — Interp: 🟢 2, 🔴 1, 19 unch. · avg +0.2% · Bytecode: 🟢 21, 1 unch. · avg +10.0%
fibonacci.js — Interp: 8 unch. · avg +0.3% · Bytecode: 🟢 7, 1 unch. · avg +9.2%
float16array.js — Interp: 🟢 3, 🔴 11, 18 unch. · avg -6.7% · Bytecode: 🟢 24, 🔴 4, 4 unch. · avg +3.9%
for-of.js — Interp: 🟢 6, 1 unch. · avg +3.6% · Bytecode: 🟢 7 · avg +13.2%
helpers/bench-module.js — Interp: 0 · Bytecode: 0
iterators.js — Interp: 🔴 30, 12 unch. · avg -3.4% · Bytecode: 🟢 32, 🔴 1, 9 unch. · avg +7.1%
json.js — Interp: 🟢 4, 🔴 2, 14 unch. · avg +0.7% · Bytecode: 🟢 20 · avg +10.1%
jsx.jsx — Interp: 🟢 14, 7 unch. · avg +3.2% · Bytecode: 🟢 18, 3 unch. · avg +5.8%
modules.js — Interp: 🟢 1, 8 unch. · avg +0.2% · Bytecode: 🟢 9 · avg +14.6%
numbers.js — Interp: 🟢 4, 7 unch. · avg +1.6% · Bytecode: 🟢 10, 1 unch. · avg +9.6%
objects.js — Interp: 7 unch. · avg +0.6% · Bytecode: 🟢 6, 1 unch. · avg +7.9%
promises.js — Interp: 🟢 1, 🔴 3, 8 unch. · avg -0.1% · Bytecode: 🟢 12 · avg +12.6%
regexp.js — Interp: 🟢 5, 🔴 3, 3 unch. · avg +3.4% · Bytecode: 🟢 10, 1 unch. · avg +5.5%
strings.js — Interp: 🟢 3, 🔴 8, 8 unch. · avg +5.6% · Bytecode: 🟢 10, 🔴 8, 1 unch. · avg -9.3%
tsv.js — Interp: 🟢 4, 5 unch. · avg +2.8% · Bytecode: 🟢 8, 1 unch. · avg +8.6%
typed-arrays.js — Interp: 🟢 2, 🔴 17, 3 unch. · avg -2.2% · Bytecode: 🟢 12, 🔴 8, 2 unch. · avg +0.9%
uint8array-encoding.js — Interp: 🟢 3, 🔴 6, 9 unch. · avg -8.2% · Bytecode: 🟢 12, 6 unch. · avg +17.2%
Measured on ubuntu-latest x64. Benchmark ranges compare cached main-branch min/max ops/sec with the PR run; overlapping ranges are treated as unchanged noise. Percentage deltas are secondary context. |
Suite Timing
Measured on ubuntu-latest x64. |
Summary
Closes #405.
language.mdshowing the object-method-shorthand pattern and why arrows/function expressions are unsuitable for this-capturing wrappers