Closed linusg closed 9 months ago
cc @caridy @rwaldron can you take a look on this? Thanks!
I think the assumption is correct that in this case the Completion Record
of type return
produced by the function [Call
]() is already processed in OrdinaryWrappedFunctionCall
(step 10) by GetWrappedValue
, which can only produce completion record typed with normal
or throw
.
@legendecas that was my assumption as well when writing that.
@caridy sorry I may not be clear. I'm suggesting we should fix this spec issue. Is that what you are suggesting too?
The linked PR fixed absolutely nothing described here, @leobalter please reopen.
ping @leobalter
@ptomato can you take a look at this?
I'm specifically concerned about these three steps from https://tc39.es/proposal-shadowrealm/#sec-wrapped-function-exotic-objects-call-thisargument-argumentslist:
Given https://tc39.es/ecma262/#sec-implicit-normal-completion and https://tc39.es/ecma262/#sec-returnifabrupt-shorthands, I don't think
OrdinaryWrappedFunctionCall
(which producesresult
) would ever return areturn
completion; onlynormal
orthrow
as a simpleN. Return foo.
does not create a return completion. Downstream of that, neitherGetWrappedValue
norWrappedFunctionCreate
look like they could create return completions according to the linked spec sections.