You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Any time we do "a new Thing" or implicitly create a new object (like "return a TypeError" or "reject promise with...") from "in parallel" steps, steps queued against another task source, or timeline, then we absolutely need to specify the realm. Examples in the current spec where that isn't done include:
createContext() - ".. .then queue an ML task with global to reject promise with a "NotSupportedError" DOMException ..."
build() - "... then queue an ML task with global to reject promise with an "OperationError" DOMException ..."
I'm less clear about instances where an exception is thrown or promise is rejected with a new exception during synchronous steps of a method. e.g. in Web IDL it says "When an algorithm says to throw a SomethingError then this means to construct a new JavaScript SomethingError object in the current realm and to throw it, just as the algorithms in ECMA-262 do."
That implies that we can infer the realm in simple cases. Certainly, lots and lots of specs use realms sparingly, even when they do use them for more interesting cases. Perhaps that's just a lack of rigor, though. We should ask around.
From #787 (comment). For example, we need to do this everywhere:
The text was updated successfully, but these errors were encountered: