mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-04-11 14:46:04 +00:00
Fix noUnusedParameters warning
This commit is contained in:
parent
5fe842e9bd
commit
97957d98f1
@ -166,6 +166,7 @@ impl Project {
|
|||||||
.arg("--strictNullChecks")
|
.arg("--strictNullChecks")
|
||||||
.arg("--strictFunctionTypes")
|
.arg("--strictFunctionTypes")
|
||||||
.arg("--noUnusedLocals")
|
.arg("--noUnusedLocals")
|
||||||
|
.arg("--noUnusedParameters")
|
||||||
.arg("--noImplicitReturns")
|
.arg("--noImplicitReturns")
|
||||||
.arg("--lib")
|
.arg("--lib")
|
||||||
.arg("es6");
|
.arg("es6");
|
||||||
|
@ -311,7 +311,7 @@ impl Js {
|
|||||||
}
|
}
|
||||||
ts_dst.push_str("\n");
|
ts_dst.push_str("\n");
|
||||||
dst.push_str(" {\n");
|
dst.push_str(" {\n");
|
||||||
dst.push_str(&format!("return imports.{}({});\n}}", import.name, invocation));
|
dst.push_str(&format!("return _imports.{}({});\n}}", import.name, invocation));
|
||||||
|
|
||||||
self.imports.push((import.name.clone(), dst, ts_dst));
|
self.imports.push((import.name.clone(), dst, ts_dst));
|
||||||
}
|
}
|
||||||
@ -368,6 +368,10 @@ impl Js {
|
|||||||
if self.wasm_exports_bound.contains(export) {
|
if self.wasm_exports_bound.contains(export) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
// this is a special case, ignore it for now
|
||||||
|
if export == "memory" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
if extra_exports_interface.len() == 0 {
|
if extra_exports_interface.len() == 0 {
|
||||||
extra_exports_interface.push_str("interface ExtraExports {\n");
|
extra_exports_interface.push_str("interface ExtraExports {\n");
|
||||||
@ -422,7 +426,7 @@ impl Js {
|
|||||||
}
|
}
|
||||||
imports_object.push_str(import);
|
imports_object.push_str(import);
|
||||||
imports_object.push_str(":");
|
imports_object.push_str(":");
|
||||||
imports_object.push_str("imports.env.");
|
imports_object.push_str("_imports.env.");
|
||||||
imports_object.push_str(import);
|
imports_object.push_str(import);
|
||||||
imports_object.push_str(",\n");
|
imports_object.push_str(",\n");
|
||||||
extra_imports_interface.push_str(typescript);
|
extra_imports_interface.push_str(typescript);
|
||||||
@ -507,7 +511,7 @@ impl Js {
|
|||||||
{writes}
|
{writes}
|
||||||
return {exports};
|
return {exports};
|
||||||
}}
|
}}
|
||||||
export function instantiate(bytes: any, imports: Imports): Promise<Exports> {{
|
export function instantiate(bytes: any, _imports: Imports): Promise<Exports> {{
|
||||||
let wasm_imports: WasmImportsTop = {{
|
let wasm_imports: WasmImportsTop = {{
|
||||||
env: {{
|
env: {{
|
||||||
{imports_object}
|
{imports_object}
|
||||||
@ -623,6 +627,11 @@ impl Js {
|
|||||||
for export in exports.entries() {
|
for export in exports.entries() {
|
||||||
let fn_idx = match *export.internal() {
|
let fn_idx = match *export.internal() {
|
||||||
Internal::Function(i) => i as usize,
|
Internal::Function(i) => i as usize,
|
||||||
|
Internal::Memory(_) => {
|
||||||
|
map.insert(export.field().to_string(),
|
||||||
|
format!("{}: WebAssembly.Memory;", export.field()));
|
||||||
|
continue
|
||||||
|
}
|
||||||
_ => continue,
|
_ => continue,
|
||||||
};
|
};
|
||||||
assert!(fn_idx >= imported_functions);
|
assert!(fn_idx >= imported_functions);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user