I propose to extend FunctionDeclarationInstantiation with:
9.2.10 FunctionDeclarationInstantiation ( func, argumentsList )
- If argumentsObjectNeeded is true, then
- Call env.InitializeBinding("arguments", ao).
This would add a non‑enumerable
callerGlobal property to the
arguments object, which refers to the
An option would be to only do that if
func has the
[[CaptureCallerGlobal]] internal slot set to
true, which would be done by the
@captureCallerGlobal built‑in decorator.