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

Method newArray

builtin_array.go:9–20  ·  view source on GitHub ↗
(prototype *Object)

Source from the content-addressed store, hash-verified

7)
8
9func (r *Runtime) newArray(prototype *Object) (a *arrayObject) {
10 v := &Object{runtime: r}
11
12 a = &arrayObject{}
13 a.class = classArray
14 a.val = v
15 a.extensible = true
16 v.self = a
17 a.prototype = prototype
18 a.init()
19 return
20}
21
22func (r *Runtime) newArrayObject() *arrayObject {
23 return r.newArray(r.getArrayPrototype())

Callers 3

newArrayObjectMethod · 0.95
builtin_newArrayMethod · 0.95
TestArray1Function · 0.95

Calls 1

initMethod · 0.65

Tested by 1

TestArray1Function · 0.76