-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Move re-throw of exception out of catch #5497
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
Merged
chakrabot
merged 1 commit into
chakra-core:release/1.10
from
IrinaYatsenko:StackOverflow
Jul 27, 2018
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
It still seem wrong though to not propagate the stack overflow in this case. The rest of the change looks fine. #Closed
Uh oh!
There was an error while loading. Please reload this page.
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.
maybe we should propagate instead of swallow, exceptions other than the script exceptions we explicitly swallow. #Resolved
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.
Propagating it now and added a test for it.
In reply to: 204181201 [](ancestors = 204181201)
Uh oh!
There was an error while loading. Please reload this page.
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.
per http://es-discourse.com/t/why-typeof-is-no-longer-safe/15 it seems that the general expectation for "typeof" to not throw so I'm going to keep it as is (I couldn't find it in the spec though)
In reply to: 204187371 [](ancestors = 204187371)
Uh oh!
There was an error while loading. Please reload this page.
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.
From my reading of the spec, I think that we should throw. The spec says that first you evaluate the expression, then you
set val to ? GetValue(val).GetValuechecks ifvalis an "abrupt completion", which includes a throw, and returns it if so, and the? expressionsyntax means that you should do the same; if the expression returns an abrupt completion, then return that abrupt completion.If I've parsed that out right, then
typeof(expressionThatThrows)should have the exception propagate.@zenparsing does that sound correct? #Resolved
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.
If typeof operator isn't supposed to be safe, why do we have BEGIN_TYPEOF_ERROR_HANDLER and END_TYPEOF_ERROR_HANDLER macros at all? Are there any exceptions that must be swallowed?
In reply to: 204924632 [](ancestors = 204924632)
Uh oh!
There was an error while loading. Please reload this page.
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.
It looks to me like some reference errors (or more specifically, some circumstances which would result in a reference error) should be swallowed. There is some subtlety, since if
xhas not been declared or assigned to, thentypeof(x)should return undefined, buttypeof((() => x)())should throwReferenceError: x is not defined#ResolvedThere 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.
Jimmy, could you please take a look at the tests I've added for typeof? Anything missing? Currently only the test for throwing getter is failing.
In reply to: 205165507 [](ancestors = 205165507)