Skip to main content

define_method

Function define_method 

Source
pub fn define_method(
    target: &JsObject,
    name: &str,
    length: u32,
    func: NativeFn,
    interp: &Interp<'_>,
)
Expand description

Define name on target as a non-enumerable method, the way every built-in method is defined.

Non-enumerable matters: for (k in []) must not list a hundred method names, and JSON.stringify must not serialise them.