Skip to main content

function_ctor

Function function_ctor 

Source
pub(crate) fn function_ctor(
    it: &mut Interp,
    _t: Value,
    a: &[Value],
) -> Result<Value, Value>
Expand description

new Function(arg1, ..., argN, body)(ES1)。動的にソースからコードを生成する定番 イディオム。(function anonymous(arg1,...,argN){ body }) という即時式へ組み立て直し、 既存の eval_source(常にグローバルスコープで実行する簡略実装)へ委譲する。