MCPcopy Create free account
hub / github.com/buke/quickjs-go / StaticPropertyValue

Method StaticPropertyValue

class.go:266–279  ·  view source on GitHub ↗

StaticPropertyValue adds a data property spec to the class constructor.

(name string, spec ValueSpec, flags ...int)

Source from the content-addressed store, hash-verified

264
265// StaticPropertyValue adds a data property spec to the class constructor.
266func (cb *ClassBuilder) StaticPropertyValue(name string, spec ValueSpec, flags ...int) *ClassBuilder {
267 propFlags := PropertyDefault
268 if len(flags) > 0 {
269 propFlags = flags[0]
270 }
271
272 cb.properties = append(cb.properties, PropertyEntry{
273 Name: name,
274 Spec: spec,
275 Static: true, // Static property
276 Flags: propFlags,
277 })
278 return cb
279}
280
281// StaticPropertyLiteral adds a literal data property to the class constructor.
282func (cb *ClassBuilder) StaticPropertyLiteral(name string, value interface{}, flags ...int) *ClassBuilder {

Callers 3

StaticPropertyMethod · 0.95
StaticPropertyLiteralMethod · 0.95

Calls

no outgoing calls

Tested by 1