-
Notifications
You must be signed in to change notification settings - Fork 37
Expose the JavaScript Exception tag and allow importing it #269
Changes from 1 commit
587dafb
15a47cf
904a8fb
fe0d00e
ec302e1
fdf1b7c
997754d
a276636
4799452
f57cdb8
ccbee0f
4d08a58
74a92cb
b17459a
fa07dea
ea5217b
1c958c2
46de060
5b8380a
4d03423
d073cfe
b6a79f9
51338d7
dfdd0b9
a80e7b3
bc04bb4
6c05eaa
bece351
41b08cf
d3c3ab6
8834860
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -310,6 +310,8 @@ namespace WebAssembly { | |||||
|
|
||||||
| Promise<Instance> instantiate( | ||||||
| Module moduleObject, optional object importObject); | ||||||
|
|
||||||
| readonly attribute Tag JSTag; | ||||||
| }; | ||||||
| </pre> | ||||||
|
|
||||||
|
|
@@ -1063,6 +1065,9 @@ This slot holds a [=function address=] relative to the [=surrounding agent=]'s [ | |||||
| 1. Set the [=surrounding agent=]'s [=associated store=] to |store|. | ||||||
| 1. If |ret| is [=error=], throw an exception. This exception should be a WebAssembly {{RuntimeError}} exception, unless otherwise indicated by <a href="#errors">the WebAssembly error mapping</a>. | ||||||
| 1. If |ret| is exception |exntag| |payload| |opaqueData|, then | ||||||
| 1. If |exntag| is the [=JavaScript exception tag=], then | ||||||
| 1. Let « [=ref.extern=] |externaddr| » be |payload| | ||||||
| 1. Throw the result of [=retrieving an extern value=] from |externaddr|. | ||||||
| 1. If |opaqueData| is not [=ref.null=] [=externref=], | ||||||
| 1. Let « [=ref.extern=] |externaddr| » be |opaqueData|. | ||||||
| 1. Throw the result of [=retrieving an extern value=] from |externaddr|. | ||||||
|
|
@@ -1126,7 +1131,7 @@ Note: Exported Functions do not have a \[[Construct]] method and thus it is not | |||||
| 1. Let |payload| be |v|.\[[Payload]]. | ||||||
| 1. Otherwise, | ||||||
| 1. Let |type| be the [=JavaScript exception tag=]. | ||||||
| 1. Let |payload| be « ». | ||||||
| 1. Let |payload| be « [=ToWebAssemblyValue=](|v|, [=externref=]) ». | ||||||
| 1. Let |opaqueData| be [=ToWebAssemblyValue=](|v|, [=externref=]) | ||||||
| 1. [=WebAssembly/Throw=] with |type|, |payload| and |opaqueData|. | ||||||
| 1. Otherwise, return |result|.\[[Value]]. | ||||||
|
|
@@ -1383,10 +1388,14 @@ The <dfn attribute for="Exception">stack</dfn> getter steps are: | |||||
| <h4 id="js-exceptions">JavaScript exceptions</h4> | ||||||
|
|
||||||
| The <dfn>JavaScript exception tag</dfn> is a [=tag address=] reserved by this | ||||||
| specification to distinguish exceptions originating from JavaScript. | ||||||
| specification to distinguish exceptions originating from JavaScript. It is exposed | ||||||
| to JavaScript code via {{WebAssembly}}.{{JSTag}} a global pre-initailized (TODO: what's ths spec-y way to say this?) | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Not sure about more spec-y way to say this though. |
||||||
| Tag object [=create a Tag object|created=] from the JavaScript exception tag address. | ||||||
|
|
||||||
|
|
||||||
| For any [=associated store=] |store|, the result of | ||||||
| [=tag_parameters=](|store|, [=JavaScript exception tag=]) must be « ». | ||||||
| [=tag_parameters=](|store|, [=JavaScript exception tag=]) must be « [=externref=] ». | ||||||
|
|
||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think what we should be doing (as the "spec-y" thing, and in order to preerve abstraction boundaries) is to invoke Btw, I think the embedding spec should also provide a |
||||||
|
|
||||||
| <div algorithm> | ||||||
|
|
||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.