Refactor creation of functions in the backend

This commit refactors the lowest-level primitive for creating functions into a
new `create_one_function` function. This doesn't take into account overloading
but is suitable for things like `create_{getter,setter}`. Eventually the
overloading will be implemented in terms of this function.
This commit is contained in:
Alex Crichton
2018-08-29 10:28:04 -07:00
parent 0a38e44f1f
commit 4f76a00024
3 changed files with 147 additions and 132 deletions

View File

@ -118,7 +118,7 @@ fn mixin() {
#[wasm_bindgen_test]
fn overload_naming() {
let o = Overloads::new().unwrap();
o.foo();
o.foo_with_arg("x");
o.foo_with_arg_and_a("x", 3);
// o.foo();
// o.foo_with_arg("x");
// o.foo_with_arg_and_a("x", 3);
}