I added Call because I had a lot of steps that were trying to call user functions that might throw an exception, and it was verbose to repeat those steps over and over.
It's not great though; it probably doesn't belong as a delta in the completion record section, at the very least.
I couldn't think of a more generic and useful abstraction for the spec, e.g. a parallel to Get, since what I really want is to ignore the return value unless it's an exception. So I should at the very least not squat on the name "Call."
Probably the best thing to do here is just suck it up and inline those lines?
I could also reduce the repetition a little bit by introducing a Call that parallels the other abstract ops, reducing
Let result be the result of calling the [[Call]] internal method of function with undefined as thisArgument and a list containing argument as argumentsList.
ReturnIfAbrupt(result).
to
Let result be the result of calling Call(function, undefined, (argument)).
ReturnIfAbrupt(result).
This would presumably be useful all over the spec.
I added Call because I had a lot of steps that were trying to call user functions that might throw an exception, and it was verbose to repeat those steps over and over.
It's not great though; it probably doesn't belong as a delta in the completion record section, at the very least.
I couldn't think of a more generic and useful abstraction for the spec, e.g. a parallel to Get, since what I really want is to ignore the return value unless it's an exception. So I should at the very least not squat on the name "Call."
Probably the best thing to do here is just suck it up and inline those lines?
I could also reduce the repetition a little bit by introducing a Call that parallels the other abstract ops, reducing
to
This would presumably be useful all over the spec.