func (ctx *Context) NewRegExpFromValues(parameters []*Value) (*Object, error) { errVal := ctx.newErrorValue() ret := C.JSObjectMakeRegExp(ctx.ref, C.size_t(len(parameters)), ¶meters[0].ref, &errVal.ref) if errVal.ref != nil { return nil, errVal } return ctx.newObject(ret), nil }
func (ctx *Context) NewRegExp(regex string) (*Object, error) { errVal := ctx.newErrorValue() param := ctx.NewStringValue(regex) ret := C.JSObjectMakeRegExp(ctx.ref, C.size_t(1), ¶m.ref, &errVal.ref) if errVal.ref != nil { return nil, errVal } return ctx.newObject(ret), nil }