Browse Source

adding test for #273 (#313)

pull/316/head
Jason Williams 5 years ago committed by GitHub
parent
commit
a0db788ed6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      boa/src/syntax/parser/tests.rs

18
boa/src/syntax/parser/tests.rs

@ -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![],
)],
)
}

Loading…
Cancel
Save