- From: Domenic Denicola <notifications@github.com>
- Date: Thu, 01 Sep 2016 07:15:15 -0700
- To: w3c/webcomponents <webcomponents@noreply.github.com>
Received on Thursday, 1 September 2016 14:16:04 UTC
Yeah, so if it throws, we should rethrow. (That also matches ES.) But what if it returns a non-object? To match ES it should fall back to the [HTMLConstructor] currently executing, I think. Does that sound reasonable to implement? Following https://tc39.github.io/ecma262/#sec-getprototypefromconstructor exactly, the logic is: 1. Let _prototype_ be Get(NewTarget, "prototype"). Rethrow any exceptions. 1. If Type(_prototype_) is not Object, 1. Let _realm_ be GetFunctionRealm(NewTarget). 1. Set _prototype_ to the [interface prototype object] of _realm_ whose [interface] is the same as that of the [active function object]. (Using [] to denote links to spec terms in IDL/ES.) Note that in the last step _realm_ can be different from [the current Realm record], which is even more subtle fun. I'll be sure to write some test cases. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/w3c/webcomponents/issues/560#issuecomment-244092135
Received on Thursday, 1 September 2016 14:16:04 UTC