Implement PartialEq for JsValue (#217)

Dispatch to JS's `===` operator internally
This commit is contained in:
Alex Crichton
2018-06-01 16:47:45 -05:00
committed by GitHub
parent cb1e5cf136
commit 659583b40d
3 changed files with 56 additions and 0 deletions

View File

@ -300,6 +300,15 @@ impl<'a> Context<'a> {
"))
})?;
self.bind("__wbindgen_jsval_eq", &|me| {
me.expose_get_object();
Ok(String::from("
function(a, b) {
return getObject(a) === getObject(b) ? 1 : 0;
}
"))
})?;
self.unexport_unused_internal_exports();
self.gc()?;