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

Method arrayproto_reverse

builtin_array.go:982–996  ·  view source on GitHub ↗
(call FunctionCall)

Source from the content-addressed store, hash-verified

980}
981
982func (r *Runtime) arrayproto_reverse(call FunctionCall) Value {
983 o := call.This.ToObject(r)
984 if a := r.checkStdArrayObj(o); a != nil {
985 l := len(a.values)
986 middle := l / 2
987 for lower := 0; lower != middle; lower++ {
988 upper := l - lower - 1
989 a.values[lower], a.values[upper] = a.values[upper], a.values[lower]
990 }
991 //TODO: go arrays
992 } else {
993 r.arrayproto_reverse_generic(o, 0)
994 }
995 return o
996}
997
998func (r *Runtime) arrayproto_shift(call FunctionCall) Value {
999 o := call.This.ToObject(r)

Callers

nothing calls this directly

Calls 3

checkStdArrayObjMethod · 0.95
ToObjectMethod · 0.65

Tested by

no test coverage detected