Пример #1
0
// Execute the script
func (s *Script) ExecuteIn(cx *Context) *Value {
	var result *Value

	cx.rt.Use(func() {
		var rval C.jsval
		if C.JS_ExecuteScript(cx.jscx, cx.jsglobal, s.obj, &rval) == C.JS_TRUE {
			result = newValue(cx, rval)
		}
	})

	return result
}
Пример #2
0
// Execute the script
func (s *Script) Execute() *Value {
	var result *Value

	s.cx.rt.Use(func() {
		var rval C.jsval
		if C.JS_ExecuteScript(s.cx.jscx, s.cx.jsglobal, s.obj, &rval) == C.JS_TRUE {
			result = newValue(s.cx, rval)
		}
	})

	return result
}