bindings for Function.prototype.bind()

This commit is contained in:
Alexander Kryvomaz
2018-07-01 15:44:36 +03:00
parent cf08aee341
commit f850a6fafc
2 changed files with 47 additions and 0 deletions

View File

@ -325,6 +325,13 @@ extern "C" {
#[wasm_bindgen(method)]
pub fn apply(this: &Function, context: &JsValue, args: &Array) -> Function;
/// The bind() method creates a new function that, when called, has its this keyword set to the provided value,
/// with a given sequence of arguments preceding any provided when the new function is called.
///
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind
#[wasm_bindgen(method)]
pub fn bind(this: &Function, context: &JsValue) -> Function;
/// The length property indicates the number of arguments expected by the function.
///
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/length