(args []Value, newTarget *Object)
| 306 | } |
| 307 | |
| 308 | func (f *classFuncObject) createInstance(args []Value, newTarget *Object) (instance *Object) { |
| 309 | if f.derived { |
| 310 | if ctor := f.prototype.self.assertConstructor(); ctor != nil { |
| 311 | instance = ctor(args, newTarget) |
| 312 | } else { |
| 313 | panic(f.val.runtime.NewTypeError("Super constructor is not a constructor")) |
| 314 | } |
| 315 | } else { |
| 316 | instance = f.baseFuncObject.createInstance(newTarget) |
| 317 | } |
| 318 | return |
| 319 | } |
| 320 | |
| 321 | func (f *classFuncObject) _initFields(instance *Object) { |
| 322 | if f.privateEnvType != nil { |
no test coverage detected