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

Method PropertyValue

class.go:234–247  ·  view source on GitHub ↗

PropertyValue adds a data property spec to the class instance.

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

Source from the content-addressed store, hash-verified

232
233// PropertyValue adds a data property spec to the class instance.
234func (cb *ClassBuilder) PropertyValue(name string, spec ValueSpec, flags ...int) *ClassBuilder {
235 propFlags := PropertyDefault
236 if len(flags) > 0 {
237 propFlags = flags[0]
238 }
239
240 cb.properties = append(cb.properties, PropertyEntry{
241 Name: name,
242 Spec: spec,
243 Static: false, // Instance property
244 Flags: propFlags,
245 })
246 return cb
247}
248
249// PropertyLiteral adds a literal data property to the class instance.
250func (cb *ClassBuilder) PropertyLiteral(name string, value interface{}, flags ...int) *ClassBuilder {

Callers 3

PropertyMethod · 0.95
PropertyLiteralMethod · 0.95

Calls

no outgoing calls

Tested by 1