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

Method preventExtensions

proxy.go:347–360  ·  view source on GitHub ↗
(throw bool)

Source from the content-addressed store, hash-verified

345}
346
347func (p *proxyObject) preventExtensions(throw bool) bool {
348 target := p.target
349 if booleanTrapResult, ok := p.checkHandler().preventExtensions(target); ok {
350 if !booleanTrapResult {
351 p.val.runtime.typeErrorResult(throw, "'preventExtensions' on proxy: trap returned falsish")
352 return false
353 }
354 if target.self.isExtensible() {
355 panic(p.val.runtime.NewTypeError("'preventExtensions' on proxy: trap returned truish but the proxy target is extensible"))
356 }
357 }
358
359 return target.self.preventExtensions(throw)
360}
361
362func propToValueProp(v Value) *valueProperty {
363 if v == nil {

Callers

nothing calls this directly

Calls 5

checkHandlerMethod · 0.95
typeErrorResultMethod · 0.80
NewTypeErrorMethod · 0.80
preventExtensionsMethod · 0.65
isExtensibleMethod · 0.65

Tested by

no test coverage detected