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

Clarify delegate targetting function-level block #177

Closed
wants to merge 2 commits into from

Conversation

aheejin
Copy link
Member

@aheejin aheejin commented Jul 16, 2021

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.

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.
Comment on lines 313 to 314
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
Copy link
Collaborator

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?

Copy link
Collaborator

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 (...)"

Copy link
Member Author

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.

Comment on lines 318 to 326
try $l1
try
call $foo
delegate 1 ;; delegate to the caller
catch
...
catch_all
...
end
Copy link
Collaborator

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@aheejin
Copy link
Member Author

aheejin commented Sep 7, 2021

Closing this because we have decided to change the spec for delegate in #176.

@aheejin aheejin closed this Sep 7, 2021
@aheejin aheejin deleted the clarify_delegate branch September 7, 2021 02:11
This pull request was closed.
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

Successfully merging this pull request may close these issues.

Inconsistency in documentation for try-delegate behavior for function body
2 participants