Skip to main content

arr_flat

Function arr_flat 

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

Array.prototype.flat(depth = 1)。以前は depth 引数を完全に無視して常に1段だけ 展開する実装になっており、arr.flat(2) や、深いネスト解除の定番イディオムである arr.flat(Infinity) が仕様どおりに動かない(1段しか展開されない)バグだった。