MCPcopy Create free account
hub / github.com/dop251/goja / arrayproto_flatMap

Method arrayproto_flatMap

builtin_array.go:1239–1250  ·  view source on GitHub ↗
(call FunctionCall)

Source from the content-addressed store, hash-verified

1237}
1238
1239func (r *Runtime) arrayproto_flatMap(call FunctionCall) Value {
1240 o := call.This.ToObject(r)
1241 l := toLength(o.self.getStr("length", nil))
1242 callbackFn := r.toCallable(call.Argument(0))
1243 thisArg := Undefined()
1244 if len(call.Arguments) > 1 {
1245 thisArg = call.Argument(1)
1246 }
1247 a := arraySpeciesCreate(o, 0)
1248 r.flattenIntoArray(a, o, l, 0, 1, callbackFn, thisArg)
1249 return a
1250}
1251
1252func (r *Runtime) arrayproto_with(call FunctionCall) Value {
1253 o := call.This.ToObject(r)

Callers

nothing calls this directly

Calls 8

toCallableMethod · 0.95
flattenIntoArrayMethod · 0.95
toLengthFunction · 0.85
UndefinedFunction · 0.85
arraySpeciesCreateFunction · 0.85
ToObjectMethod · 0.65
getStrMethod · 0.65
ArgumentMethod · 0.45

Tested by

no test coverage detected