Adding case for super access of a module namespace TDZ binding#5000
Adding case for super access of a module namespace TDZ binding#5000
Conversation
nicolo-ribaudo
left a comment
There was a problem hiding this comment.
This test case looks good. It might be worth adding one that is the same but has a set foo(_) {} setter in the base class, and then it should not throw, right?
|
Just to double check that I'm understanding correctly. The ReferenceRecord for the lhs is:
In PutValue we call
I'm approving assuming that my understanding of why this test is like this is correct. |
Yes. Also, the call to |
Makes sense to add such case as well. |
This PR is adding a case where we have an access to a TDZ biding of a namespace module using
super.prop. The case here is that we should throw aReferenceErrorinstead of aTypeError, because OrdinarySet callsReceiver.[[GetOwnProperty]]before it tries to write into the object. It's important to notice thatReceiveris a namespace object, becausesuper()will changethisbiding beforesuper.foogets executed, andOrdinarySetgets executed becausesupercreates a reference record where[[Base]] == [[FunctionObject]].[[HomeObject]].It is related with #4980.