mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-21 00:36:33 +00:00
Add Function
construtor to js-sys
This commit is contained in:
@ -722,6 +722,17 @@ extern "C" {
|
||||
#[derive(Clone, Debug)]
|
||||
pub type Function;
|
||||
|
||||
/// The `Function` constructor creates a new `Function` object. Calling the
|
||||
/// constructor directly can create functions dynamically, but suffers from
|
||||
/// security and similar (but far less significant) performance issues
|
||||
/// similar to `eval`. However, unlike `eval`, the `Function` constructor
|
||||
/// allows executing code in the global scope, prompting better programming
|
||||
/// habits and allowing for more efficient code minification.
|
||||
///
|
||||
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function
|
||||
#[wasm_bindgen(constructor)]
|
||||
pub fn new_no_args(body: &str) -> Function;
|
||||
|
||||
/// The apply() method calls a function with a given this value, and arguments provided as an array
|
||||
/// (or an array-like object).
|
||||
///
|
||||
|
Reference in New Issue
Block a user