|
|
|
@ -1,5 +1,43 @@
|
|
|
|
|
use crate::{builtins::Value, exec, exec::Interpreter, forward, realm::Realm}; |
|
|
|
|
|
|
|
|
|
#[test] |
|
|
|
|
fn property_accessor_member_expression_dot_notation_on_string_literal() { |
|
|
|
|
let scenario = r#" |
|
|
|
|
typeof 'asd'.matchAll; |
|
|
|
|
"#; |
|
|
|
|
|
|
|
|
|
assert_eq!(&exec(scenario), "function"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#[test] |
|
|
|
|
fn property_accessor_member_expression_bracket_notation_on_string_literal() { |
|
|
|
|
let scenario = r#" |
|
|
|
|
typeof 'asd'['matchAll']; |
|
|
|
|
"#; |
|
|
|
|
|
|
|
|
|
assert_eq!(&exec(scenario), "function"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#[test] |
|
|
|
|
fn property_accessor_member_expression_dot_notation_on_function() { |
|
|
|
|
let scenario = r#" |
|
|
|
|
function asd () {}; |
|
|
|
|
asd.name; |
|
|
|
|
"#; |
|
|
|
|
|
|
|
|
|
assert_eq!(&exec(scenario), "asd"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#[test] |
|
|
|
|
fn property_accessor_member_expression_bracket_notation_on_function() { |
|
|
|
|
let scenario = r#" |
|
|
|
|
function asd () {}; |
|
|
|
|
asd['name']; |
|
|
|
|
"#; |
|
|
|
|
|
|
|
|
|
assert_eq!(&exec(scenario), "asd"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#[test] |
|
|
|
|
fn empty_let_decl_undefined() { |
|
|
|
|
let scenario = r#" |
|
|
|
|