-
Notifications
You must be signed in to change notification settings - Fork 36
Clarify delegate targetting function-level block #177
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
Conversation
This clarifies that `delegate` can target the function-level block, which means the exception is thrown to the caller. Also added a few more examples. AFAIK this is consistent with the current implementations in the toolchain, V8, and Spidermonkey. Fixes WebAssembly#176.
If `delegate`'s immediate argument is the depth of block-like structures | ||
(blocks, loops, and trys) + 1, i.e., the function-level block, it is considered |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand what you mean by: "the depth of block-like structures (...) + 1" and how this is related to the function-level block case. Or did you mean that in this case the depth is not a block-like structure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand what you meant now. What do you think about this phrasing: "the depth of the outermost block + 1, i.e. the function-level block (...)"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Also added that it will be considered as a catchless try.
try $l1 | ||
try | ||
call $foo | ||
delegate 1 ;; delegate to the caller | ||
catch | ||
... | ||
catch_all | ||
... | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make the example complete I think it should be wrapped in a function, otherwise it is ambiguous what the outer scope is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Closing this because we have decided to change the spec for |
This clarifies that
delegate
can target the function-level block,which means the exception is thrown to the caller. Also added a few more
examples.
AFAIK this is consistent with the current implementations in the
toolchain, V8, and Spidermonkey.
Fixes #176.