Ejemplo n.º 1
0
func (cs ContextScope) NewString(value string) *Value {
	valPtr := unsafe.Pointer((*reflect.StringHeader)(unsafe.Pointer(&value)).Data)
	return newValue(C.V8_NewString(
		cs.context.self, (*C.char)(valPtr), C.int(len(value)),
	))
}
Ejemplo n.º 2
0
func (engine_ *Engine) NewString(value string) *Value {
	valPtr := StringToPointer(value)
	return NewValue(engine_, C.V8_NewString(engine_.self, (*C.char)(valPtr), C.int(len(value))))
}
Ejemplo n.º 3
0
func (e *Engine) NewString(value string) *Value {
	valPtr := unsafe.Pointer((*reflect.StringHeader)(unsafe.Pointer(&value)).Data)
	return newValue(e, C.V8_NewString(
		e.self, (*C.char)(valPtr), C.int(len(value)),
	))
}