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

Add support for >>>= #711

Merged
merged 2 commits into from
Sep 24, 2020
Merged

Add support for >>>= #711

merged 2 commits into from
Sep 24, 2020

Conversation

arpit-saxena
Copy link
Contributor

This Pull Request fixes #621

It changes the following:

  • Adds support for unsigned right shift assignment operator (>>>=)
  • Adds a test for the operator

@arpit-saxena
Copy link
Contributor Author

boa/boa/src/exec/tests.rs

Lines 1302 to 1316 in 3f6a8ef

#[test]
#[ignore]
fn multicharacter_bitwise_assignment_to_non_assignable() {
let mut engine = Context::new();
// Disabled - awaiting implementation.
let test_cases = ["3 >>>= 5", "3 &&= 5", "3 ||= 5", "3 ??= 5"];
for case in test_cases.iter() {
let string = dbg!(forward(&mut engine, case));
assert!(string.starts_with("Uncaught \"SyntaxError\": "));
assert!(string.contains("1:3"));
}
}

This test was ignored due to >>>= being unimplemented. It looks like it is outdated though given the error messages are a bit different than what it looks for. The error messages all begin with Uncaught "TypeError": , should I add this to the test?

@HalidOdat HalidOdat added enhancement New feature or request execution Issues or PRs related to code execution parser Issues surrounding the parser labels Sep 23, 2020
@HalidOdat HalidOdat added this to the v0.10.0 milestone Sep 23, 2020
@HalidOdat
Copy link
Member

This test was ignored due to >>>= being unimplemented. It looks like it is outdated though given the error messages are a bit different than what it looks for. The error messages all begin with Uncaught "TypeError": , should I add this to the test?

This test is for invalid assign operations like 2 += 2 this should generate a syntax error but since we don't have all the operators implemented we ignore it for now. we should have a test for >>>= execution like:

let x = -1000;
x >>>= 1;

and asserting that x equals 2147483148 or something like this.

@arpit-saxena
Copy link
Contributor Author

we should have a test for >>>= execution like:

let x = -1000;
x >>>= 1;

and asserting that x equals 2147483148 or something like this.

I can add that but if I do that, I think there should tests similar to this for other operators too, like >>=, and I can't find any of them currently. Is there a need to add tests for all the operators?

@HalidOdat
Copy link
Member

I can add that but if I do that, I think there should tests similar to this for other operators too, like >>=, and I can't find any of them currently. Is there a need to add tests for all the operators?

There should be some tests for some operators in value/tests.rs and in exec/tests.rs.

Is there a need to add tests for all the operators?

More tests is always nice to have.

@HalidOdat HalidOdat merged commit ad7cd4c into boa-dev:master Sep 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request execution Issues or PRs related to code execution parser Issues surrounding the parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parse error for unsigned right shift assignment
2 participants