archives

« Bugzilla Issues Index

#3675 — 8.1.1.3.1 BindThisValue: Change assertion to if+throw


8.1.1.3.1 BindThisValue(V)

Step 1 needs to change from an assertion to:
---
If this environment record’s [[thisInitializationState]] is true, throw a TypeError.
---


Is there an actual path you found where a BindThisValue wasn't property guarded by a IsThisInitialized predicate.

I found one, the argument list evaluation in 12.3.5.1 for
SuperCall : super Arguments

But I fixed that by moving the IsThisInitialzed test after the arguments evaluation.


(In reply to Allen Wirfs-Brock from comment #1)
> Is there an actual path you found where a BindThisValue wasn't property
> guarded by a IsThisInitialized predicate.
>
> I found one, the argument list evaluation in 12.3.5.1 for
> SuperCall : super Arguments
>
> But I fixed that by moving the IsThisInitialzed test after the arguments
> evaluation.


super() calls in arrow functions are also problematic:

---
class Base {
constructor(f) {
f && f();
}
}
class Derived extends Base {
constructor() {
super(() => {
super();
});
}
}
new Derived;
---


fixed in rev32 editor's draft

moved test into BindThisValue


fixed in rev32 draft