mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-26 11:34:22 +03:00
Fix some JS == → === and != → !== occurrences
These are the ones my linter complained about in particular
This commit is contained in:
parent
02b7021053
commit
930219fc53
@ -203,7 +203,7 @@ let slab = [];
|
||||
let slab_next = 0;
|
||||
|
||||
function addHeapObject(obj) {
|
||||
if (slab_next == slab.length)
|
||||
if (slab_next === slab.length)
|
||||
slab.push(slab.length + 1);
|
||||
const idx = slab_next;
|
||||
const next = slab[idx];
|
||||
|
@ -148,7 +148,7 @@ impl<'a> Context<'a> {
|
||||
bind("__wbindgen_boolean_new", &|me| {
|
||||
me.expose_add_heap_object();
|
||||
String::from("function(v) {
|
||||
return addHeapObject(v == 1);
|
||||
return addHeapObject(v === 1);
|
||||
}")
|
||||
});
|
||||
|
||||
@ -156,7 +156,7 @@ impl<'a> Context<'a> {
|
||||
me.expose_get_object();
|
||||
String::from("function(i) {
|
||||
let v = getObject(i);
|
||||
if (typeof(v) == 'boolean') {
|
||||
if (typeof(v) === 'boolean') {
|
||||
return v ? 1 : 0;
|
||||
} else {
|
||||
return 2;
|
||||
@ -182,7 +182,7 @@ impl<'a> Context<'a> {
|
||||
bind("__wbindgen_is_symbol", &|me| {
|
||||
me.expose_get_object();
|
||||
String::from("function(i) {
|
||||
return typeof(getObject(i)) == 'symbol' ? 1 : 0;
|
||||
return typeof(getObject(i)) === 'symbol' ? 1 : 0;
|
||||
}")
|
||||
});
|
||||
|
||||
@ -924,7 +924,7 @@ impl<'a> Context<'a> {
|
||||
};
|
||||
self.globals.push_str(&format!("
|
||||
function addHeapObject(obj) {{
|
||||
if (slab_next == slab.length)
|
||||
if (slab_next === slab.length)
|
||||
slab.push(slab.length + 1);
|
||||
const idx = slab_next;
|
||||
const next = slab[idx];
|
||||
@ -1227,7 +1227,7 @@ impl<'a, 'b> SubContext<'a, 'b> {
|
||||
}
|
||||
Some(shared::TYPE_BOOLEAN) => {
|
||||
dst_ts.push_str(": boolean");
|
||||
format!("return ret != 0;")
|
||||
format!("return ret !== 0;")
|
||||
}
|
||||
Some(shared::TYPE_JS_OWNED) => {
|
||||
dst_ts.push_str(": any");
|
||||
@ -1351,7 +1351,7 @@ impl<'a, 'b> SubContext<'a, 'b> {
|
||||
abi_args.push(format!("arg{}", i));
|
||||
}
|
||||
shared::TYPE_BOOLEAN => {
|
||||
invoc_args.push(format!("arg{} != 0", i));
|
||||
invoc_args.push(format!("arg{} !== 0", i));
|
||||
abi_args.push(format!("arg{}", i));
|
||||
}
|
||||
shared::TYPE_BORROWED_STR |
|
||||
|
Loading…
Reference in New Issue
Block a user