(call FunctionCall)
| 1191 | } |
| 1192 | |
| 1193 | func (r *Runtime) arrayproto_flat(call FunctionCall) Value { |
| 1194 | o := call.This.ToObject(r) |
| 1195 | l := toLength(o.self.getStr("length", nil)) |
| 1196 | depthNum := int64(1) |
| 1197 | if len(call.Arguments) > 0 { |
| 1198 | depthNum = call.Argument(0).ToInteger() |
| 1199 | } |
| 1200 | a := arraySpeciesCreate(o, 0) |
| 1201 | r.flattenIntoArray(a, o, l, 0, depthNum, nil, nil) |
| 1202 | return a |
| 1203 | } |
| 1204 | |
| 1205 | func (r *Runtime) flattenIntoArray(target, source *Object, sourceLen, start, depth int64, mapperFunction func(FunctionCall) Value, thisArg Value) int64 { |
| 1206 | targetIndex, sourceIndex := start, int64(0) |
nothing calls this directly
no test coverage detected