Skip to main content

this_items

Function this_items 

Source
pub(crate) fn this_items(this: &Value) -> Vec<Value>
Expand description

配列プロトタイプメソッドのほぼ全てがこのヘルパ経由で this の要素を読む。以前は Proxy を素通しできず(ObjKind::Array に一致しない)、Array.prototype.map.call( new Proxy([1,2,3],{}), f) のように Proxy をラップした配列へ直接メソッド呼出しすると 常に空配列扱いになるバグだった(for...of/スプレッドは別経路で既に対応済みだったが、 メソッド呼出し経由はこのヘルパ止まりで漏れていた)。