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

Method newTemplatedArrayObject

object_template.go:361–378  ·  view source on GitHub ↗
(tmpl *objectTemplate, obj *Object)

Source from the content-addressed store, hash-verified

359}
360
361func (r *Runtime) newTemplatedArrayObject(tmpl *objectTemplate, obj *Object) *templatedArrayObject {
362 if obj == nil {
363 obj = &Object{runtime: r}
364 }
365 o := &templatedArrayObject{
366 templatedObject: templatedObject{
367 baseObject: baseObject{
368 class: classArray,
369 val: obj,
370 extensible: true,
371 },
372 tmpl: tmpl,
373 },
374 }
375 obj.self = o
376 o.init()
377 return o
378}
379
380func (a *templatedArrayObject) getLenProp() *valueProperty {
381 lenProp, _ := a.getOwnPropStr("length").(*valueProperty)

Callers 1

getArrayPrototypeMethod · 0.95

Calls 1

initMethod · 0.65

Tested by

no test coverage detected