Exemplo n.º 1
0
//object
func (object_ *Object) SetProperty(key string, value *Value) bool {
	//keyPtr := unsafe.Pointer((*reflect.StringHeader)(unsafe.Pointer(&key)).Data)
	keyPtr := StringToPointer(key)
	return C.V8_Object_SetProperty(
		object_.self, (*C.char)(keyPtr), C.int(len(key)), value.self,
	) == 1
}
Exemplo n.º 2
0
func (o *Object) SetProperty(key string, value *Value, attribs PropertyAttribute) bool {
	keyPtr := unsafe.Pointer((*reflect.StringHeader)(unsafe.Pointer(&key)).Data)
	return C.V8_Object_SetProperty(
		o.self, (*C.char)(keyPtr), C.int(len(key)), value.self, C.int(attribs),
	) == 1
}