mirror of https://github.com/boa-dev/boa.git
morrien
4 years ago
committed by
GitHub
6 changed files with 135 additions and 7 deletions
@ -0,0 +1,19 @@
|
||||
use crate::exec; |
||||
|
||||
#[test] |
||||
fn ordinary_has_instance_nonobject_prototype() { |
||||
let scenario = r#" |
||||
try { |
||||
function C() {} |
||||
C.prototype = 1 |
||||
String instanceof C |
||||
} catch (err) { |
||||
err.toString() |
||||
} |
||||
"#; |
||||
|
||||
assert_eq!( |
||||
&exec(scenario), |
||||
"\"TypeError: function has non-object prototype in instanceof check\"" |
||||
); |
||||
} |
Loading…
Reference in new issue