Skip to content

Commit

Permalink
adding test for #273 (#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonwilliams authored Apr 13, 2020
1 parent 0274858 commit a0db788
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions boa/src/syntax/parser/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -709,3 +709,21 @@ fn check_function_declarations() {
)],
);
}

#[test]
/// Should be parsed as `new Class().method()` instead of `new (Class().method())`
fn check_construct_call_precedence() {
check_parser(
"new Date().getTime()",
&[Node::Call(
Box::new(Node::GetConstField(
Box::new(Node::New(Box::new(Node::Call(
Box::new(Node::Local(String::from("Date"))),
vec![],
)))),
String::from("getTime"),
)),
vec![],
)],
)
}

0 comments on commit a0db788

Please sign in to comment.