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

Method Build

class.go:291–293  ·  view source on GitHub ↗

Build creates and registers the JavaScript class in the given context Returns the constructor function and classID for NewInstance ValueSpec entries are captured by shallow snapshot. Do not mutate pointer-based ValueSpec implementations after Build, or later constructor calls may observe changes. Do

(ctx *Context)

Source from the content-addressed store, hash-verified

289// ValueSpec implementations after Build, or later constructor calls may observe changes.
290// Do not modify the state of passed spec objects after Build.
291func (cb *ClassBuilder) Build(ctx *Context) (*Value, uint32) {
292 return createClass(ctx, cb)
293}
294
295// =============================================================================
296// CLASS CREATION IMPLEMENTATION - MODIFIED FOR SCHEME C

Calls 1

createClassFunction · 0.85