From d3201a11af7ac6d2430c502245e69d11cbac7b18 Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Wed, 27 Jun 2018 14:58:53 -0700 Subject: [PATCH] guide: Add note about `static_method_of` attribute to design doc --- guide/src/design.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/guide/src/design.md b/guide/src/design.md index 62026dc5..4ebe657a 100644 --- a/guide/src/design.md +++ b/guide/src/design.md @@ -706,6 +706,9 @@ let's go through one-by-one: this function must be a bare type, like `Bar`. * `#[wasm_bindgen(js_namespace = Bar)]` - this attribute indicates that the function declaration is namespaced through the `Bar` class in JS. +* `#[wasm_bindgen(static_method_of = SomeJsClass)]` - this attribute is similar + to `js_namespace`, but instead of producing a free function, produces a static + method of `SomeJsClass`. * `#[wasm_bindgen(method)]` - and finally, this attribute indicates that a method call is going to happen. The first argument must be a JS struct, like `Bar`, and the call in JS looks like `Bar.prototype.set.call(...)`.