Exemple #1
0
func (e *Engine) NewInstanceOf(ot *ObjectTemplate) *Value {
	ot.Lock()
	defer ot.Unlock()

	if ot.engine == nil {
		return nil
	}

	return newValue(e, C.V8_ObjectTemplate_NewInstance(e.self, ot.self))
}
Exemple #2
0
/*
TODO::
func (ot *ObjectTemplate) Dispose() {
	ot.Lock()
	defer ot.Unlock()

	if ot.id > 0 {
		delete(ot.engine.objectTemplates, ot.id)
		ot.id = 0
		ot.engine = nil
		C.V8_ObjectTemplate_Dispose(ot.self)
	}
}
*/
func (otmp_ *ObjectTemplate) NewInstanceOf(ot *ObjectTemplate) *Value {
	otmp_.Lock()
	defer otmp_.Unlock()

	if otmp_.engine == nil {
		return nil
	}
	engine_ := otmp_.engine
	return NewValue(engine_, C.V8_ObjectTemplate_NewInstance(engine_.self, otmp_.self))
}