mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-16 22:41:24 +00:00
Add is_truthy, is_falsy
This commit is contained in:
@ -2299,6 +2299,16 @@ impl<'a> Context<'a> {
|
||||
format!("typeof({}) === 'string'", args[0])
|
||||
}
|
||||
|
||||
Intrinsic::IsTruthy => {
|
||||
assert_eq!(args.len(), 1);
|
||||
format!("!!{}", args[0])
|
||||
}
|
||||
|
||||
Intrinsic::IsFalsy => {
|
||||
assert_eq!(args.len(), 1);
|
||||
format!("!{}", args[0])
|
||||
}
|
||||
|
||||
Intrinsic::ObjectCloneRef => {
|
||||
assert_eq!(args.len(), 1);
|
||||
args[0].clone()
|
||||
|
Reference in New Issue
Block a user