Browse Source

Test: Add test case for [object Object]

pull/737/head
RageKnify 4 years ago
parent
commit
05f076c2eb
  1. 2
      boa/src/builtins/object/tests.rs

2
boa/src/builtins/object/tests.rs

@ -156,6 +156,7 @@ fn object_to_string() {
Date.prototype.toString = Object.prototype.toString; Date.prototype.toString = Object.prototype.toString;
let re = /boa/; let re = /boa/;
RegExp.prototype.toString = Object.prototype.toString; RegExp.prototype.toString = Object.prototype.toString;
let o = Object();
"#; "#;
eprintln!("{}", forward(&mut ctx, init)); eprintln!("{}", forward(&mut ctx, init));
// TODO: need Function.prototype.call to be implemented // TODO: need Function.prototype.call to be implemented
@ -174,4 +175,5 @@ fn object_to_string() {
assert_eq!(forward(&mut ctx, "s.toString()"), "\"[object String]\""); assert_eq!(forward(&mut ctx, "s.toString()"), "\"[object String]\"");
assert_eq!(forward(&mut ctx, "d.toString()"), "\"[object Date]\""); assert_eq!(forward(&mut ctx, "d.toString()"), "\"[object Date]\"");
assert_eq!(forward(&mut ctx, "re.toString()"), "\"[object RegExp]\""); assert_eq!(forward(&mut ctx, "re.toString()"), "\"[object RegExp]\"");
assert_eq!(forward(&mut ctx, "o.toString()"), "\"[object Object]\"");
} }

Loading…
Cancel
Save