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

Field access should propagate the exception (Err(_)) #482

Closed
HalidOdat opened this issue Jun 12, 2020 · 1 comment · Fixed by #500
Closed

Field access should propagate the exception (Err(_)) #482

HalidOdat opened this issue Jun 12, 2020 · 1 comment · Fixed by #500
Labels
bug Something isn't working E-Easy Easy execution Issues or PRs related to code execution good first issue Good for newcomers
Milestone

Comments

@HalidOdat
Copy link
Member

When ToObject (to_object) throws an error the field accessors don't propagate the error in GetConstField and GetField nodes

GetConstField: https://github.com/boa-dev/boa/blob/master/boa/src/exec/field/mod.rs#L12-L13
GetField: https://github.com/boa-dev/boa/blob/master/boa/src/exec/field/mod.rs#L25-L26

To fix this we should change from .expect("failed to convert to object") to ? try operator.

@HalidOdat HalidOdat added bug Something isn't working good first issue Good for newcomers E-Easy Easy execution Issues or PRs related to code execution labels Jun 12, 2020
@Razican Razican changed the title Field access should propgate the exception (Err(_)) Field access should propagate the exception (Err(_)) Jun 12, 2020
@neeldug
Copy link
Contributor

neeldug commented Jun 16, 2020

Hi,

Would like to work on this issue.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working E-Easy Easy execution Issues or PRs related to code execution good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants