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
Specify that returned Promises are created in the relevant realm
Note that these semantics differ from JavaScript async functions, which
create a Promise in the current Realm.
Verified in Chromium and Firefox that HTMLImageElement.decode and
CustomElementsRegistry.whenDefined return Promise instances from
the relevant realm.
(I'm not sure what's the preferred way to typeset "this", or if it would
be preferred to thread it explicitly through the algorithm. Also, it's
not quite necessary to use the relevant Promise.resolve function, since
resolve effectively uses the relevant realm of its receiver(!))
Resolves part of #135
Copy file name to clipboardExpand all lines: index.bs
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -7855,11 +7855,15 @@ objects.
7855
7855
An ECMAScript value |V| is [=converted to an IDL value|converted=]
7856
7856
to an IDL <a interface lt="Promise">Promise<var ignore>T</var></a> value as follows:
7857
7857
7858
-
1. Let |promise| be [=!=] <a abstract-op>Call</a>({{%Promise_resolve%}}, {{%Promise%}}, «|V|»).
7858
+
1. Let |realm| be the [=relevant Realm=] of the |this| value that led to the execution of this algorithm.
7859
+
1. Let |promise| be [=!=] <a abstract-op>Call</a>(|realm|.\[[Intrinsics]].[[{{%Promise_resolve%}}]], |realm|.\[[Intrinsics]].[[{{%Promise%}}]], «|V|»).
7859
7860
1. Return the IDL [=promise type=] value that is a reference to the
7860
7861
same object as |promise|.
7861
7862
</div>
7862
7863
7864
+
Issue: The relevant |this| value is not always well-defined; see
7865
+
<a href="https://github.com/heycam/webidl/issues/135">#135</a> for discussion.
7866
+
7863
7867
<p id="promise-to-es">
7864
7868
The result of [=converted to an ECMAScript value|converting=]
0 commit comments