Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add [Exposed=*] to expose on all globals #526

Merged
merged 3 commits into from
Nov 2, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 40 additions & 6 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -7002,6 +7002,17 @@ which form (or forms) it is in:
<code>[Exposed=(Window,Worker)]</code>
</td>
</tr>
<tr>
<td>
<emu-nt><a href="#prod-ExtendedAttributeWildcard">ExtendedAttributeWildcard</a></emu-nt>
</td>
<td>
<dfn id="dfn-xattr-wildcard" for="extended attribute" export>takes a wildcard</dfn>
</td>
<td>
<code>[Exposed=*]</code>
</td>
</tr>

</table>

Expand Down Expand Up @@ -7063,6 +7074,7 @@ five forms are allowed.
"="
"&gt;"
"?"
"*"
"ByteString"
"DOMString"
"FrozenArray"
Expand Down Expand Up @@ -7127,6 +7139,11 @@ five forms are allowed.
identifier "=" identifier
</pre>

<pre class="grammar" id="prod-ExtendedAttributeWildcard">
ExtendedAttributeWildcard :
identifier "=" "*"
</pre>

<pre class="grammar" id="prod-ExtendedAttributeIdentList">
ExtendedAttributeIdentList :
identifier "=" "(" IdentifierList ")"
Expand Down Expand Up @@ -9588,14 +9605,31 @@ it indicates that the construct is exposed
on that particular set of global interfaces.

The [{{Exposed}}] [=extended attribute=] must either
[=takes an identifier|take an identifier=] or
[=takes an identifier list|take an identifier list=].
Each of the identifiers mentioned must be a [=global name=] and be unique.
This list of identifiers is known as the construct's
<dfn>own exposure set</dfn>.
[=takes an identifier|take an identifier=],
[=takes an identifier list|take an identifier list=] or
[=takes a wildcard|take a wildcard=].
Each of the identifiers mentioned must be a [=global name=] of some [=interface=] and be unique.

<div algorithm>
The <dfn>own exposure set</dfn> is the [=/set=] of identifiers defined as follows:

<dl class="switch">
: If the [{{Exposed}}] [=extended attribute=] [=takes an identifier=] |I|
:: The [=own exposure set=] is the [=/set=] « |I| ».
: If the [{{Exposed}}] [=extended attribute=] [=takes an identifier list=] |I|
:: The [=own exposure set=] is the [=/set=] |I|.
: If the [{{Exposed}}] [=extended attribute=] [=takes a wildcard=]
:: The [=own exposure set=] is the [=/set=] of [=global names=] of [=interfaces=] which have the
[{{Global}}] [=extended attribute=].
Ms2ger marked this conversation as resolved.
Show resolved Hide resolved
</dl>

<p class="advisement">
<code>[Exposed=*]</code> is to be used with care.
It is only appropriate when an API does not expose significant new capabilities.
If the API might be restricted or disabled in some environments,
it is preferred to list the globals explicitly.
</p>

<div algorithm>
To get the <dfn id="dfn-exposure-set" export>exposure set</dfn> of a construct |C|,
run the following steps:

Expand Down