Merge pull request #1638 from ThomasdenH/master

Add is_truthy, is_falsy
This commit is contained in:
Alex Crichton
2019-08-08 12:35:01 -05:00
committed by GitHub
5 changed files with 54 additions and 0 deletions

View File

@ -2464,6 +2464,11 @@ impl<'a> Context<'a> {
format!("typeof({}) === 'string'", args[0])
}
Intrinsic::IsFalsy => {
assert_eq!(args.len(), 1);
format!("!{}", args[0])
}
Intrinsic::ObjectCloneRef => {
assert_eq!(args.len(), 1);
args[0].clone()