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

Harmonize exception throwing #515

Merged

Conversation

lahma
Copy link
Collaborator

@lahma lahma commented Jun 19, 2018

This is mostly about cleanup and making exception throwing consistent. Now there's ExceptionHelper that does most of the throwing. This will also add possibility for JIT to inline better as there are no throw statements in function bodies.

@lahma lahma force-pushed the perf/harmonize-exception-throwing branch from 8293b1a to d1557cc Compare June 19, 2018 07:39
@lahma lahma force-pushed the perf/harmonize-exception-throwing branch from d1557cc to cb5c8da Compare June 20, 2018 17:19
@@ -717,13 +722,7 @@ public void PutValue(Reference reference, JsValue value)
else
{
var baseValue = reference.GetBase();
if (!(baseValue is EnvironmentRecord record))
Copy link
Owner

Choose a reason for hiding this comment

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

I assume that if there is this test it's because it was in the spec. Maybe there is not code path for it, but I wouldn't remove it, unless you found out it could never be true.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

But as you can see the code right after it does forced cast so the invariant is present. It just changes from ambiguous ArgumentNullException to maybe even better InvalidCastException?

Copy link
Owner

Choose a reason for hiding this comment

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

Sorry, I thought it was throwing a JS exception. It's just dotnet one.

@sebastienros sebastienros merged commit e63a022 into sebastienros:dev Jun 21, 2018
maximburyak pushed a commit to maximburyak/jint that referenced this pull request Jul 11, 2018
@lahma lahma deleted the perf/harmonize-exception-throwing branch July 12, 2018 06:54
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.

None yet

2 participants