Skip to content

Emit event algorithm should not mention Protocol bindings #251

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

Closed
relu91 opened this issue Aug 25, 2020 · 0 comments
Closed

Emit event algorithm should not mention Protocol bindings #251

relu91 opened this issue Aug 25, 2020 · 0 comments

Comments

@relu91
Copy link
Member

relu91 commented Aug 25, 2020

The emit event algorithm in the last point says:

  1. Make a request to the underlying platform to emit an Event with data, using the Protocol Bindings

However, the underlying platform is already in charge to pack the data according to Protocol Bindings. It is specified in the section above (see lines 2723-2724):

wot-scripting-api/index.html

Lines 2691 to 2734 in c2068c1

<section> <h3>Handling <a>Events</a></h3>
<div>
When an <a>Event</a> with name |name| is emitted with
|data:InteractionInput| either by the underlying platform or by the
<a href="#the-emitevent-method">emitEvent()</a> method, run the
following steps:
<ol>
<li>
Let |interaction| be the value of ||td||'s |events|'s
|name|.
</li>
<li>
If |data| is not defined or `null`,
<ol>
<li>
Let |eventHandler| be the value of the ||eventHandler||
<a>internal slot</a> of |interaction|.
</li>
<li>
If |eventHandler| is failure, abort these steps.
</li>
<li>
Let |data| be the result of awaiting to resolve the invocation
of |eventHandler|. If it rejects, abort these steps.
</li>
</ol>
</li>
<li>
For each |subscriber| in the <a>internal listener list</a> of
|interaction|, run the following sub-steps:
<ol>
<li>
Create an <a>Event</a> notification |response| according to the
<a>Protocol Bindings</a> from |data| and |subscriber|, including
its |options|.
</li>
<li>
Send |response| to the subscriber identified by |subscriber|.
</li>
</ol>
</li>
</ol>
</div>
</section>

I think we can improve a bit the text there, removing using the Protocol Binding. It feels a little bit confusing to me.

@zolkis zolkis closed this as completed in 48526d8 Sep 14, 2020
zolkis added a commit that referenced this issue Sep 14, 2020
Fix #251: improve the emitEvent() algorithm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant