Merge pull request #389 from alexcrichton/fix-unused

Fix some eslint warnings about unused variables
This commit is contained in:
Sendil Kumar N 2018-07-04 22:24:03 +02:00 committed by GitHub
commit 1662668b42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 29 deletions

View File

@ -24,8 +24,10 @@ module.exports = {
'always'
],
'no-console': 0,
'no-undef':
'warn',
'no-unused-vars': 'warn'
'no-undef': 'warn'
},
globals: {
BigInt64Array: true,
BigUint64Array: true
}
};

View File

@ -410,7 +410,9 @@ impl<'a> Context<'a> {
.unwrap_or("wasm_bindgen"),
)
} else {
let import_wasm = if self.config.nodejs {
let import_wasm = if self.globals.len() == 0 {
String::new()
} else if self.config.nodejs {
self.footer
.push_str(&format!("wasm = require('./{}_bg');", module_name));
format!("var wasm;")
@ -956,7 +958,6 @@ impl<'a> Context<'a> {
return Ok(());
}
self.require_internal_export("__wbindgen_malloc")?;
self.expose_uint64_memory();
self.global(&format!(
"
function {}(arg) {{
@ -1059,7 +1060,7 @@ impl<'a> Context<'a> {
if !self.exposed_globals.insert("get_array_js_value_from_wasm") {
return;
}
self.expose_get_array_u32_from_wasm();
self.expose_uint32_memory();
self.expose_take_object();
self.global(
"
@ -1807,8 +1808,8 @@ impl<'a, 'b> SubContext<'a, 'b> {
let target = if let Some(g) = getter {
if import.structural {
format!(
"function(y) {{
return this.{};
"function() {{
return this.{};
}}",
g
)