Example #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)),
	))
}
Example #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))))
}
Example #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)),
	))
}