Commit 6f5475dd authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Store exception value in script_ctx_t instead of passing it everywhere.

parent 19f951e8
......@@ -139,7 +139,7 @@ static IUnknown *create_activex_object(script_ctx_t *ctx, const WCHAR *progid)
}
static HRESULT ActiveXObject_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r, jsexcept_t *ei)
jsval_t *r)
{
IDispatch *disp;
IUnknown *obj;
......@@ -164,14 +164,14 @@ static HRESULT ActiveXObject_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flag
return E_NOTIMPL;
}
hres = to_string(ctx, argv[0], ei, &progid);
hres = to_string(ctx, argv[0], &progid);
if(FAILED(hres))
return hres;
obj = create_activex_object(ctx, progid);
SysFreeString(progid);
if(!obj)
return throw_generic_error(ctx, ei, JS_E_CANNOT_CREATE_OBJ, NULL);
return throw_generic_error(ctx, JS_E_CANNOT_CREATE_OBJ, NULL);
hres = IUnknown_QueryInterface(obj, &IID_IDispatch, (void**)&disp);
IUnknown_Release(obj);
......
......@@ -38,8 +38,7 @@ static inline BoolInstance *bool_this(vdisp_t *jsthis)
}
/* ECMA-262 3rd Edition 15.6.4.2 */
static HRESULT Bool_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r, jsexcept_t *ei)
static HRESULT Bool_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
{
BoolInstance *bool;
......@@ -49,7 +48,7 @@ static HRESULT Bool_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, uns
TRACE("\n");
if(!(bool = bool_this(jsthis)))
return throw_type_error(ctx, ei, JS_E_BOOLEAN_EXPECTED, NULL);
return throw_type_error(ctx, JS_E_BOOLEAN_EXPECTED, NULL);
if(r) {
BSTR val;
......@@ -67,15 +66,14 @@ static HRESULT Bool_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, uns
}
/* ECMA-262 3rd Edition 15.6.4.3 */
static HRESULT Bool_valueOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r, jsexcept_t *ei)
static HRESULT Bool_valueOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
{
BoolInstance *bool;
TRACE("\n");
if(!(bool = bool_this(jsthis)))
return throw_type_error(ctx, ei, JS_E_BOOLEAN_EXPECTED, NULL);
return throw_type_error(ctx, JS_E_BOOLEAN_EXPECTED, NULL);
if(r)
*r = jsval_bool(bool->val);
......@@ -83,13 +81,13 @@ static HRESULT Bool_valueOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsi
}
static HRESULT Bool_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r, jsexcept_t *ei)
jsval_t *r)
{
TRACE("\n");
switch(flags) {
case INVOKE_FUNC:
return throw_type_error(ctx, ei, JS_E_FUNCTION_EXPECTED, NULL);
return throw_type_error(ctx, JS_E_FUNCTION_EXPECTED, NULL);
default:
FIXME("unimplemented flags %x\n", flags);
return E_NOTIMPL;
......@@ -122,7 +120,7 @@ static const builtin_info_t BoolInst_info = {
};
static HRESULT BoolConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r, jsexcept_t *ei)
jsval_t *r)
{
BOOL value = FALSE;
HRESULT hres;
......
......@@ -246,7 +246,7 @@ static inline void exec_addref(exec_ctx_t *ctx)
void exec_release(exec_ctx_t*) DECLSPEC_HIDDEN;
HRESULT create_exec_ctx(script_ctx_t*,IDispatch*,jsdisp_t*,scope_chain_t*,BOOL,exec_ctx_t**) DECLSPEC_HIDDEN;
HRESULT exec_source(exec_ctx_t*,bytecode_t*,function_code_t*,BOOL,jsexcept_t*,jsval_t*) DECLSPEC_HIDDEN;
HRESULT exec_source(exec_ctx_t*,bytecode_t*,function_code_t*,BOOL,jsval_t*) DECLSPEC_HIDDEN;
HRESULT create_source_function(script_ctx_t*,bytecode_t*,function_code_t*,scope_chain_t*,jsdisp_t**) DECLSPEC_HIDDEN;
typedef enum {
......
......@@ -68,6 +68,7 @@ void script_release(script_ctx_t *ctx)
if(--ctx->ref)
return;
clear_ei(ctx);
if(ctx->cc)
release_cc(ctx->cc);
jsheap_free(&ctx->tmp_heap);
......@@ -99,7 +100,6 @@ static inline BOOL is_started(script_ctx_t *ctx)
static HRESULT exec_global_code(JScript *This, bytecode_t *code)
{
exec_ctx_t *exec_ctx;
jsexcept_t jsexcept;
HRESULT hres;
hres = create_exec_ctx(This->ctx, NULL, This->ctx->global, NULL, TRUE, &exec_ctx);
......@@ -108,9 +108,8 @@ static HRESULT exec_global_code(JScript *This, bytecode_t *code)
IActiveScriptSite_OnEnterScript(This->site);
memset(&jsexcept, 0, sizeof(jsexcept));
hres = exec_source(exec_ctx, code, &code->global_code, FALSE, &jsexcept, NULL);
jsval_release(jsexcept.val);
clear_ei(This->ctx);
hres = exec_source(exec_ctx, code, &code->global_code, FALSE, NULL);
exec_release(exec_ctx);
IActiveScriptSite_OnLeaveScript(This->site);
......@@ -716,6 +715,7 @@ static HRESULT WINAPI JScriptParse_InitNew(IActiveScriptParse *iface)
ctx->active_script = &This->IActiveScript_iface;
ctx->safeopt = This->safeopt;
ctx->version = This->version;
ctx->ei.val = jsval_undefined();
jsheap_init(&ctx->tmp_heap);
hres = create_jscaller(ctx);
......
......@@ -149,7 +149,7 @@ static inline jsdisp_t *get_jsdisp(vdisp_t *vdisp)
return is_jsdisp(vdisp) ? vdisp->u.jsdisp : NULL;
}
typedef HRESULT (*builtin_invoke_t)(script_ctx_t*,vdisp_t*,WORD,unsigned,jsval_t*,jsval_t*,jsexcept_t*);
typedef HRESULT (*builtin_invoke_t)(script_ctx_t*,vdisp_t*,WORD,unsigned,jsval_t*,jsval_t*);
typedef struct {
const WCHAR *name;
......@@ -204,20 +204,20 @@ HRESULT create_dispex(script_ctx_t*,const builtin_info_t*,jsdisp_t*,jsdisp_t**)
HRESULT init_dispex(jsdisp_t*,script_ctx_t*,const builtin_info_t*,jsdisp_t*) DECLSPEC_HIDDEN;
HRESULT init_dispex_from_constr(jsdisp_t*,script_ctx_t*,const builtin_info_t*,jsdisp_t*) DECLSPEC_HIDDEN;
HRESULT disp_call(script_ctx_t*,IDispatch*,DISPID,WORD,unsigned,jsval_t*,jsval_t*,jsexcept_t*) DECLSPEC_HIDDEN;
HRESULT disp_call_value(script_ctx_t*,IDispatch*,IDispatch*,WORD,unsigned,jsval_t*,jsval_t*,jsexcept_t*) DECLSPEC_HIDDEN;
HRESULT jsdisp_call_value(jsdisp_t*,IDispatch*,WORD,unsigned,jsval_t*,jsval_t*,jsexcept_t*) DECLSPEC_HIDDEN;
HRESULT jsdisp_call(jsdisp_t*,DISPID,WORD,unsigned,jsval_t*,jsval_t*,jsexcept_t*) DECLSPEC_HIDDEN;
HRESULT jsdisp_call_name(jsdisp_t*,const WCHAR*,WORD,unsigned,jsval_t*,jsval_t*,jsexcept_t*) DECLSPEC_HIDDEN;
HRESULT disp_propget(script_ctx_t*,IDispatch*,DISPID,jsval_t*,jsexcept_t*) DECLSPEC_HIDDEN;
HRESULT disp_propput(script_ctx_t*,IDispatch*,DISPID,jsval_t,jsexcept_t*) DECLSPEC_HIDDEN;
HRESULT jsdisp_propget(jsdisp_t*,DISPID,jsval_t*,jsexcept_t*) DECLSPEC_HIDDEN;
HRESULT jsdisp_propput_name(jsdisp_t*,const WCHAR*,jsval_t,jsexcept_t*) DECLSPEC_HIDDEN;
HRESULT disp_call(script_ctx_t*,IDispatch*,DISPID,WORD,unsigned,jsval_t*,jsval_t*) DECLSPEC_HIDDEN;
HRESULT disp_call_value(script_ctx_t*,IDispatch*,IDispatch*,WORD,unsigned,jsval_t*,jsval_t*) DECLSPEC_HIDDEN;
HRESULT jsdisp_call_value(jsdisp_t*,IDispatch*,WORD,unsigned,jsval_t*,jsval_t*) DECLSPEC_HIDDEN;
HRESULT jsdisp_call(jsdisp_t*,DISPID,WORD,unsigned,jsval_t*,jsval_t*) DECLSPEC_HIDDEN;
HRESULT jsdisp_call_name(jsdisp_t*,const WCHAR*,WORD,unsigned,jsval_t*,jsval_t*) DECLSPEC_HIDDEN;
HRESULT disp_propget(script_ctx_t*,IDispatch*,DISPID,jsval_t*) DECLSPEC_HIDDEN;
HRESULT disp_propput(script_ctx_t*,IDispatch*,DISPID,jsval_t) DECLSPEC_HIDDEN;
HRESULT jsdisp_propget(jsdisp_t*,DISPID,jsval_t*) DECLSPEC_HIDDEN;
HRESULT jsdisp_propput_name(jsdisp_t*,const WCHAR*,jsval_t) DECLSPEC_HIDDEN;
HRESULT jsdisp_propput_const(jsdisp_t*,const WCHAR*,jsval_t) DECLSPEC_HIDDEN;
HRESULT jsdisp_propput_dontenum(jsdisp_t*,const WCHAR*,jsval_t) DECLSPEC_HIDDEN;
HRESULT jsdisp_propput_idx(jsdisp_t*,DWORD,jsval_t,jsexcept_t*) DECLSPEC_HIDDEN;
HRESULT jsdisp_propget_name(jsdisp_t*,LPCWSTR,jsval_t*,jsexcept_t*) DECLSPEC_HIDDEN;
HRESULT jsdisp_get_idx(jsdisp_t*,DWORD,jsval_t*,jsexcept_t*) DECLSPEC_HIDDEN;
HRESULT jsdisp_propput_idx(jsdisp_t*,DWORD,jsval_t) DECLSPEC_HIDDEN;
HRESULT jsdisp_propget_name(jsdisp_t*,LPCWSTR,jsval_t*) DECLSPEC_HIDDEN;
HRESULT jsdisp_get_idx(jsdisp_t*,DWORD,jsval_t*) DECLSPEC_HIDDEN;
HRESULT jsdisp_get_id(jsdisp_t*,const WCHAR*,DWORD,DISPID*) DECLSPEC_HIDDEN;
HRESULT jsdisp_delete_idx(jsdisp_t*,DWORD) DECLSPEC_HIDDEN;
HRESULT jsdisp_is_own_prop(jsdisp_t*,BSTR,BOOL*) DECLSPEC_HIDDEN;
......@@ -226,17 +226,17 @@ HRESULT create_builtin_function(script_ctx_t*,builtin_invoke_t,const WCHAR*,cons
jsdisp_t*,jsdisp_t**) DECLSPEC_HIDDEN;
HRESULT create_builtin_constructor(script_ctx_t*,builtin_invoke_t,const WCHAR*,const builtin_info_t*,DWORD,
jsdisp_t*,jsdisp_t**) DECLSPEC_HIDDEN;
HRESULT Function_value(script_ctx_t*,vdisp_t*,WORD,unsigned,jsval_t*,jsval_t*,jsexcept_t*) DECLSPEC_HIDDEN;
HRESULT Function_invoke(jsdisp_t*,IDispatch*,WORD,unsigned,jsval_t*,jsval_t*,jsexcept_t*) DECLSPEC_HIDDEN;
HRESULT throw_eval_error(script_ctx_t*,jsexcept_t*,HRESULT,const WCHAR*) DECLSPEC_HIDDEN;
HRESULT throw_generic_error(script_ctx_t*,jsexcept_t*,HRESULT,const WCHAR*) DECLSPEC_HIDDEN;
HRESULT throw_range_error(script_ctx_t*,jsexcept_t*,HRESULT,const WCHAR*) DECLSPEC_HIDDEN;
HRESULT throw_reference_error(script_ctx_t*,jsexcept_t*,HRESULT,const WCHAR*) DECLSPEC_HIDDEN;
HRESULT throw_regexp_error(script_ctx_t*,jsexcept_t*,HRESULT,const WCHAR*) DECLSPEC_HIDDEN;
HRESULT throw_syntax_error(script_ctx_t*,jsexcept_t*,HRESULT,const WCHAR*) DECLSPEC_HIDDEN;
HRESULT throw_type_error(script_ctx_t*,jsexcept_t*,HRESULT,const WCHAR*) DECLSPEC_HIDDEN;
HRESULT throw_uri_error(script_ctx_t*,jsexcept_t*,HRESULT,const WCHAR*) DECLSPEC_HIDDEN;
HRESULT Function_value(script_ctx_t*,vdisp_t*,WORD,unsigned,jsval_t*,jsval_t*) DECLSPEC_HIDDEN;
HRESULT Function_invoke(jsdisp_t*,IDispatch*,WORD,unsigned,jsval_t*,jsval_t*) DECLSPEC_HIDDEN;
HRESULT throw_eval_error(script_ctx_t*,HRESULT,const WCHAR*) DECLSPEC_HIDDEN;
HRESULT throw_generic_error(script_ctx_t*,HRESULT,const WCHAR*) DECLSPEC_HIDDEN;
HRESULT throw_range_error(script_ctx_t*,HRESULT,const WCHAR*) DECLSPEC_HIDDEN;
HRESULT throw_reference_error(script_ctx_t*,HRESULT,const WCHAR*) DECLSPEC_HIDDEN;
HRESULT throw_regexp_error(script_ctx_t*,HRESULT,const WCHAR*) DECLSPEC_HIDDEN;
HRESULT throw_syntax_error(script_ctx_t*,HRESULT,const WCHAR*) DECLSPEC_HIDDEN;
HRESULT throw_type_error(script_ctx_t*,HRESULT,const WCHAR*) DECLSPEC_HIDDEN;
HRESULT throw_uri_error(script_ctx_t*,HRESULT,const WCHAR*) DECLSPEC_HIDDEN;
HRESULT create_object(script_ctx_t*,jsdisp_t*,jsdisp_t**) DECLSPEC_HIDDEN;
HRESULT create_math(script_ctx_t*,jsdisp_t**) DECLSPEC_HIDDEN;
......@@ -254,13 +254,13 @@ typedef enum {
HINT_NUMBER
} hint_t;
HRESULT to_primitive(script_ctx_t*,jsval_t,jsexcept_t*,jsval_t*, hint_t) DECLSPEC_HIDDEN;
HRESULT to_primitive(script_ctx_t*,jsval_t,jsval_t*, hint_t) DECLSPEC_HIDDEN;
HRESULT to_boolean(jsval_t,BOOL*) DECLSPEC_HIDDEN;
HRESULT to_number(script_ctx_t*,jsval_t,jsexcept_t*,double*) DECLSPEC_HIDDEN;
HRESULT to_integer(script_ctx_t*,jsval_t,jsexcept_t*,double*) DECLSPEC_HIDDEN;
HRESULT to_int32(script_ctx_t*,jsval_t,jsexcept_t*,INT*) DECLSPEC_HIDDEN;
HRESULT to_uint32(script_ctx_t*,jsval_t,jsexcept_t*,DWORD*) DECLSPEC_HIDDEN;
HRESULT to_string(script_ctx_t*,jsval_t,jsexcept_t*,BSTR*) DECLSPEC_HIDDEN;
HRESULT to_number(script_ctx_t*,jsval_t,double*) DECLSPEC_HIDDEN;
HRESULT to_integer(script_ctx_t*,jsval_t,double*) DECLSPEC_HIDDEN;
HRESULT to_int32(script_ctx_t*,jsval_t,INT*) DECLSPEC_HIDDEN;
HRESULT to_uint32(script_ctx_t*,jsval_t,DWORD*) DECLSPEC_HIDDEN;
HRESULT to_string(script_ctx_t*,jsval_t,BSTR*) DECLSPEC_HIDDEN;
HRESULT to_object(script_ctx_t*,jsval_t,IDispatch**) DECLSPEC_HIDDEN;
HRESULT variant_change_type(script_ctx_t*,VARIANT*,VARIANT*,VARTYPE) DECLSPEC_HIDDEN;
......@@ -293,6 +293,13 @@ typedef struct {
script_ctx_t *ctx;
} JSCaller;
#include "jsval.h"
struct _jsexcept_t {
EXCEPINFO ei;
jsval_t val;
};
struct _script_ctx_t {
LONG ref;
......@@ -308,6 +315,7 @@ struct _script_ctx_t {
LCID lcid;
cc_ctx_t *cc;
JSCaller *jscaller;
jsexcept_t ei;
jsheap_t tmp_heap;
......@@ -339,6 +347,7 @@ struct _script_ctx_t {
};
void script_release(script_ctx_t*) DECLSPEC_HIDDEN;
void clear_ei(script_ctx_t*) DECLSPEC_HIDDEN;
static inline void script_addref(script_ctx_t *ctx)
{
......@@ -375,7 +384,7 @@ HRESULT regexp_match_next(script_ctx_t*,jsdisp_t*,DWORD,const WCHAR*,DWORD,const
DWORD*,DWORD*,match_result_t*) DECLSPEC_HIDDEN;
HRESULT regexp_match(script_ctx_t*,jsdisp_t*,const WCHAR*,DWORD,BOOL,match_result_t**,DWORD*) DECLSPEC_HIDDEN;
HRESULT parse_regexp_flags(const WCHAR*,DWORD,DWORD*) DECLSPEC_HIDDEN;
HRESULT regexp_string_match(script_ctx_t*,jsdisp_t*,BSTR,jsval_t*,jsexcept_t*) DECLSPEC_HIDDEN;
HRESULT regexp_string_match(script_ctx_t*,jsdisp_t*,BSTR,jsval_t*) DECLSPEC_HIDDEN;
static inline BOOL is_class(jsdisp_t *jsdisp, jsclass_t class)
{
......@@ -502,10 +511,3 @@ static inline LPWSTR heap_strdupW(LPCWSTR str)
return ret;
}
#include "jsval.h"
struct _jsexcept_t {
EXCEPINFO ei;
jsval_t val;
};
......@@ -380,7 +380,7 @@ HRESULT jsval_to_variant(jsval_t val, VARIANT *retv)
}
/* ECMA-262 3rd Edition 9.1 */
HRESULT to_primitive(script_ctx_t *ctx, jsval_t val, jsexcept_t *ei, jsval_t *ret, hint_t hint)
HRESULT to_primitive(script_ctx_t *ctx, jsval_t val, jsval_t *ret, hint_t hint)
{
if(is_object_instance(val)) {
jsdisp_t *jsdisp;
......@@ -398,7 +398,7 @@ HRESULT to_primitive(script_ctx_t *ctx, jsval_t val, jsexcept_t *ei, jsval_t *re
jsdisp = iface_to_jsdisp((IUnknown*)get_object(val));
if(!jsdisp)
return disp_propget(ctx, get_object(val), DISPID_VALUE, ret, ei);
return disp_propget(ctx, get_object(val), DISPID_VALUE, ret);
if(hint == NO_HINT)
hint = is_class(jsdisp, JSCLASS_DATE) ? HINT_STRING : HINT_NUMBER;
......@@ -407,7 +407,7 @@ HRESULT to_primitive(script_ctx_t *ctx, jsval_t val, jsexcept_t *ei, jsval_t *re
hres = jsdisp_get_id(jsdisp, hint == HINT_STRING ? toStringW : valueOfW, 0, &id);
if(SUCCEEDED(hres)) {
hres = jsdisp_call(jsdisp, id, DISPATCH_METHOD, 0, NULL, &prim, ei);
hres = jsdisp_call(jsdisp, id, DISPATCH_METHOD, 0, NULL, &prim);
if(FAILED(hres)) {
WARN("call error - forwarding exception\n");
jsdisp_release(jsdisp);
......@@ -423,7 +423,7 @@ HRESULT to_primitive(script_ctx_t *ctx, jsval_t val, jsexcept_t *ei, jsval_t *re
hres = jsdisp_get_id(jsdisp, hint == HINT_STRING ? valueOfW : toStringW, 0, &id);
if(SUCCEEDED(hres)) {
hres = jsdisp_call(jsdisp, id, DISPATCH_METHOD, 0, NULL, &prim, ei);
hres = jsdisp_call(jsdisp, id, DISPATCH_METHOD, 0, NULL, &prim);
if(FAILED(hres)) {
WARN("call error - forwarding exception\n");
jsdisp_release(jsdisp);
......@@ -440,7 +440,7 @@ HRESULT to_primitive(script_ctx_t *ctx, jsval_t val, jsexcept_t *ei, jsval_t *re
jsdisp_release(jsdisp);
WARN("failed\n");
return throw_type_error(ctx, ei, JS_E_TO_PRIMITIVE, NULL);
return throw_type_error(ctx, JS_E_TO_PRIMITIVE, NULL);
}
return jsval_copy(val, ret);
......@@ -586,7 +586,7 @@ static HRESULT str_to_number(BSTR str, double *ret)
}
/* ECMA-262 3rd Edition 9.3 */
HRESULT to_number(script_ctx_t *ctx, jsval_t val, jsexcept_t *ei, double *ret)
HRESULT to_number(script_ctx_t *ctx, jsval_t val, double *ret)
{
switch(jsval_type(val)) {
case JSV_UNDEFINED:
......@@ -604,11 +604,11 @@ HRESULT to_number(script_ctx_t *ctx, jsval_t val, jsexcept_t *ei, double *ret)
jsval_t prim;
HRESULT hres;
hres = to_primitive(ctx, val, ei, &prim, HINT_NUMBER);
hres = to_primitive(ctx, val, &prim, HINT_NUMBER);
if(FAILED(hres))
return hres;
hres = to_number(ctx, prim, ei, ret);
hres = to_number(ctx, prim, ret);
jsval_release(prim);
return hres;
}
......@@ -625,12 +625,12 @@ HRESULT to_number(script_ctx_t *ctx, jsval_t val, jsexcept_t *ei, double *ret)
}
/* ECMA-262 3rd Edition 9.4 */
HRESULT to_integer(script_ctx_t *ctx, jsval_t v, jsexcept_t *ei, double *ret)
HRESULT to_integer(script_ctx_t *ctx, jsval_t v, double *ret)
{
double n;
HRESULT hres;
hres = to_number(ctx, v, ei, &n);
hres = to_number(ctx, v, &n);
if(FAILED(hres))
return hres;
......@@ -642,12 +642,12 @@ HRESULT to_integer(script_ctx_t *ctx, jsval_t v, jsexcept_t *ei, double *ret)
}
/* ECMA-262 3rd Edition 9.5 */
HRESULT to_int32(script_ctx_t *ctx, jsval_t v, jsexcept_t *ei, INT *ret)
HRESULT to_int32(script_ctx_t *ctx, jsval_t v, INT *ret)
{
double n;
HRESULT hres;
hres = to_number(ctx, v, ei, &n);
hres = to_number(ctx, v, &n);
if(FAILED(hres))
return hres;
......@@ -656,12 +656,12 @@ HRESULT to_int32(script_ctx_t *ctx, jsval_t v, jsexcept_t *ei, INT *ret)
}
/* ECMA-262 3rd Edition 9.6 */
HRESULT to_uint32(script_ctx_t *ctx, jsval_t val, jsexcept_t *ei, DWORD *ret)
HRESULT to_uint32(script_ctx_t *ctx, jsval_t val, DWORD *ret)
{
double n;
HRESULT hres;
hres = to_number(ctx, val, ei, &n);
hres = to_number(ctx, val, &n);
if(FAILED(hres))
return hres;
......@@ -728,7 +728,7 @@ HRESULT double_to_bstr(double n, BSTR *str)
}
/* ECMA-262 3rd Edition 9.8 */
HRESULT to_string(script_ctx_t *ctx, jsval_t val, jsexcept_t *ei, BSTR *str)
HRESULT to_string(script_ctx_t *ctx, jsval_t val, BSTR *str)
{
const WCHAR undefinedW[] = {'u','n','d','e','f','i','n','e','d',0};
const WCHAR nullW[] = {'n','u','l','l',0};
......@@ -751,11 +751,11 @@ HRESULT to_string(script_ctx_t *ctx, jsval_t val, jsexcept_t *ei, BSTR *str)
jsval_t prim;
HRESULT hres;
hres = to_primitive(ctx, val, ei, &prim, HINT_STRING);
hres = to_primitive(ctx, val, &prim, HINT_STRING);
if(FAILED(hres))
return hres;
hres = to_string(ctx, prim, ei, str);
hres = to_string(ctx, prim, str);
jsval_release(prim);
return hres;
}
......@@ -837,22 +837,20 @@ HRESULT to_object(script_ctx_t *ctx, jsval_t val, IDispatch **disp)
HRESULT variant_change_type(script_ctx_t *ctx, VARIANT *dst, VARIANT *src, VARTYPE vt)
{
jsexcept_t ei;
jsval_t val;
HRESULT hres;
clear_ei(ctx);
hres = variant_to_jsval(src, &val);
if(FAILED(hres))
return hres;
memset(&ei, 0, sizeof(ei));
switch(vt) {
case VT_I2:
case VT_I4: {
INT i;
hres = to_int32(ctx, val, &ei, &i);
hres = to_int32(ctx, val, &i);
if(SUCCEEDED(hres)) {
if(vt == VT_I4)
V_I4(dst) = i;
......@@ -863,7 +861,7 @@ HRESULT variant_change_type(script_ctx_t *ctx, VARIANT *dst, VARIANT *src, VARTY
}
case VT_R8: {
double n;
hres = to_number(ctx, val, &ei, &n);
hres = to_number(ctx, val, &n);
if(SUCCEEDED(hres))
V_R8(dst) = n;
break;
......@@ -871,7 +869,7 @@ HRESULT variant_change_type(script_ctx_t *ctx, VARIANT *dst, VARIANT *src, VARTY
case VT_R4: {
double n;
hres = to_number(ctx, val, &ei, &n);
hres = to_number(ctx, val, &n);
if(SUCCEEDED(hres))
V_R4(dst) = n;
break;
......@@ -887,7 +885,7 @@ HRESULT variant_change_type(script_ctx_t *ctx, VARIANT *dst, VARIANT *src, VARTY
case VT_BSTR: {
BSTR str;
hres = to_string(ctx, val, &ei, &str);
hres = to_string(ctx, val, &str);
if(SUCCEEDED(hres))
V_BSTR(dst) = str;
break;
......@@ -904,10 +902,8 @@ HRESULT variant_change_type(script_ctx_t *ctx, VARIANT *dst, VARIANT *src, VARTY
}
jsval_release(val);
if(FAILED(hres)) {
jsval_release(ei.val);
if(FAILED(hres))
return hres;
}
V_VT(dst) = vt;
return S_OK;
......
......@@ -219,7 +219,7 @@ static inline void number_to_exponential(double val, int prec, BSTR *out)
/* ECMA-262 3rd Edition 15.7.4.2 */
static HRESULT Number_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r, jsexcept_t *ei)
jsval_t *r)
{
NumberInstance *number;
INT radix = 10;
......@@ -230,21 +230,21 @@ static HRESULT Number_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, u
TRACE("\n");
if(!(number = number_this(jsthis)))
return throw_type_error(ctx, ei, JS_E_NUMBER_EXPECTED, NULL);
return throw_type_error(ctx, JS_E_NUMBER_EXPECTED, NULL);
if(argc) {
hres = to_int32(ctx, argv[0], ei, &radix);
hres = to_int32(ctx, argv[0], &radix);
if(FAILED(hres))
return hres;
if(radix<2 || radix>36)
return throw_type_error(ctx, ei, JS_E_INVALIDARG, NULL);
return throw_type_error(ctx, JS_E_INVALIDARG, NULL);
}
val = number->value;
if(radix==10 || isnan(val) || isinf(val)) {
hres = to_string(ctx, jsval_number(val), ei, &str);
hres = to_string(ctx, jsval_number(val), &str);
if(FAILED(hres))
return hres;
}else {
......@@ -339,14 +339,14 @@ static HRESULT Number_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, u
}
static HRESULT Number_toLocaleString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r, jsexcept_t *ei)
jsval_t *r)
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT Number_toFixed(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r, jsexcept_t *ei)
jsval_t *r)
{
NumberInstance *number;
DOUBLE val;
......@@ -357,20 +357,20 @@ static HRESULT Number_toFixed(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, un
TRACE("\n");
if(!(number = number_this(jsthis)))
return throw_type_error(ctx, ei, JS_E_NUMBER_EXPECTED, NULL);
return throw_type_error(ctx, JS_E_NUMBER_EXPECTED, NULL);
if(argc) {
hres = to_int32(ctx, argv[0], ei, &prec);
hres = to_int32(ctx, argv[0], &prec);
if(FAILED(hres))
return hres;
if(prec<0 || prec>20)
return throw_range_error(ctx, ei, JS_E_FRACTION_DIGITS_OUT_OF_RANGE, NULL);
return throw_range_error(ctx, JS_E_FRACTION_DIGITS_OUT_OF_RANGE, NULL);
}
val = number->value;
if(isinf(val) || isnan(val)) {
hres = to_string(ctx, jsval_number(val), ei, &str);
hres = to_string(ctx, jsval_number(val), &str);
if(FAILED(hres))
return hres;
}else {
......@@ -385,7 +385,7 @@ static HRESULT Number_toFixed(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, un
}
static HRESULT Number_toExponential(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r, jsexcept_t *ei)
jsval_t *r)
{
NumberInstance *number;
DOUBLE val;
......@@ -396,20 +396,20 @@ static HRESULT Number_toExponential(script_ctx_t *ctx, vdisp_t *jsthis, WORD fla
TRACE("\n");
if(!(number = number_this(jsthis)))
return throw_type_error(ctx, ei, JS_E_NUMBER_EXPECTED, NULL);
return throw_type_error(ctx, JS_E_NUMBER_EXPECTED, NULL);
if(argc) {
hres = to_int32(ctx, argv[0], ei, &prec);
hres = to_int32(ctx, argv[0], &prec);
if(FAILED(hres))
return hres;
if(prec<0 || prec>20)
return throw_range_error(ctx, ei, JS_E_FRACTION_DIGITS_OUT_OF_RANGE, NULL);
return throw_range_error(ctx, JS_E_FRACTION_DIGITS_OUT_OF_RANGE, NULL);
}
val = number->value;
if(isinf(val) || isnan(val)) {
hres = to_string(ctx, jsval_number(val), ei, &str);
hres = to_string(ctx, jsval_number(val), &str);
if(FAILED(hres))
return hres;
}else {
......@@ -426,7 +426,7 @@ static HRESULT Number_toExponential(script_ctx_t *ctx, vdisp_t *jsthis, WORD fla
}
static HRESULT Number_toPrecision(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r, jsexcept_t *ei)
jsval_t *r)
{
NumberInstance *number;
INT prec = 0, size;
......@@ -435,20 +435,20 @@ static HRESULT Number_toPrecision(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags
HRESULT hres;
if(!(number = number_this(jsthis)))
return throw_type_error(ctx, ei, JS_E_NUMBER_EXPECTED, NULL);
return throw_type_error(ctx, JS_E_NUMBER_EXPECTED, NULL);
if(argc) {
hres = to_int32(ctx, argv[0], ei, &prec);
hres = to_int32(ctx, argv[0], &prec);
if(FAILED(hres))
return hres;
if(prec<1 || prec>21)
return throw_range_error(ctx, ei, JS_E_PRECISION_OUT_OF_RANGE, NULL);
return throw_range_error(ctx, JS_E_PRECISION_OUT_OF_RANGE, NULL);
}
val = number->value;
if(isinf(val) || isnan(val) || !prec) {
hres = to_string(ctx, jsval_number(val), ei, &str);
hres = to_string(ctx, jsval_number(val), &str);
if(FAILED(hres))
return hres;
}else {
......@@ -471,14 +471,14 @@ static HRESULT Number_toPrecision(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags
}
static HRESULT Number_valueOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r, jsexcept_t *ei)
jsval_t *r)
{
NumberInstance *number;
TRACE("\n");
if(!(number = number_this(jsthis)))
return throw_type_error(ctx, ei, JS_E_NUMBER_EXPECTED, NULL);
return throw_type_error(ctx, JS_E_NUMBER_EXPECTED, NULL);
if(r)
*r = jsval_number(number->value);
......@@ -486,13 +486,13 @@ static HRESULT Number_valueOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, un
}
static HRESULT Number_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r, jsexcept_t *ei)
jsval_t *r)
{
NumberInstance *number = number_from_vdisp(jsthis);
switch(flags) {
case INVOKE_FUNC:
return throw_type_error(ctx, ei, JS_E_FUNCTION_EXPECTED, NULL);
return throw_type_error(ctx, JS_E_FUNCTION_EXPECTED, NULL);
case DISPATCH_PROPERTYGET:
*r = jsval_number(number->value);
break;
......@@ -532,7 +532,7 @@ static const builtin_info_t NumberInst_info = {
};
static HRESULT NumberConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r, jsexcept_t *ei)
jsval_t *r)
{
double n;
HRESULT hres;
......@@ -547,7 +547,7 @@ static HRESULT NumberConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags
return S_OK;
}
hres = to_number(ctx, argv[0], ei, &n);
hres = to_number(ctx, argv[0], &n);
if(FAILED(hres))
return hres;
......@@ -559,7 +559,7 @@ static HRESULT NumberConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags
jsdisp_t *obj;
if(argc) {
hres = to_number(ctx, argv[0], ei, &n);
hres = to_number(ctx, argv[0], &n);
if(FAILED(hres))
return hres;
}else {
......
......@@ -33,7 +33,7 @@ static const WCHAR isPrototypeOfW[] = {'i','s','P','r','o','t','o','t','y','p','
static const WCHAR default_valueW[] = {'[','o','b','j','e','c','t',' ','O','b','j','e','c','t',']',0};
static HRESULT Object_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r, jsexcept_t *ei)
jsval_t *r)
{
jsdisp_t *jsdisp;
const WCHAR *str;
......@@ -79,7 +79,7 @@ static HRESULT Object_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, u
}
static HRESULT Object_toLocaleString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r, jsexcept_t *ei)
jsval_t *r)
{
TRACE("\n");
......@@ -88,11 +88,11 @@ static HRESULT Object_toLocaleString(script_ctx_t *ctx, vdisp_t *jsthis, WORD fl
return E_FAIL;
}
return jsdisp_call_name(jsthis->u.jsdisp, toStringW, DISPATCH_METHOD, 0, NULL, r, ei);
return jsdisp_call_name(jsthis->u.jsdisp, toStringW, DISPATCH_METHOD, 0, NULL, r);
}
static HRESULT Object_valueOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r, jsexcept_t *ei)
jsval_t *r)
{
TRACE("\n");
......@@ -104,7 +104,7 @@ static HRESULT Object_valueOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, un
}
static HRESULT Object_hasOwnProperty(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r, jsexcept_t *ei)
jsval_t *r)
{
BSTR name;
DISPID id;
......@@ -118,7 +118,7 @@ static HRESULT Object_hasOwnProperty(script_ctx_t *ctx, vdisp_t *jsthis, WORD fl
return S_OK;
}
hres = to_string(ctx, argv[0], ei, &name);
hres = to_string(ctx, argv[0], &name);
if(FAILED(hres))
return hres;
......@@ -148,27 +148,27 @@ static HRESULT Object_hasOwnProperty(script_ctx_t *ctx, vdisp_t *jsthis, WORD fl
}
static HRESULT Object_propertyIsEnumerable(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r, jsexcept_t *ei)
jsval_t *r)
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT Object_isPrototypeOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r, jsexcept_t *ei)
jsval_t *r)
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT Object_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r, jsexcept_t *ei)
jsval_t *r)
{
TRACE("\n");
switch(flags) {
case INVOKE_FUNC:
return throw_type_error(ctx, ei, JS_E_FUNCTION_EXPECTED, NULL);
return throw_type_error(ctx, JS_E_FUNCTION_EXPECTED, NULL);
case DISPATCH_PROPERTYGET: {
BSTR ret = SysAllocString(default_valueW);
if(!ret)
......@@ -216,7 +216,7 @@ static const builtin_info_t ObjectInst_info = {
};
static HRESULT ObjectConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r, jsexcept_t *ei)
jsval_t *r)
{
HRESULT hres;
......
......@@ -45,7 +45,7 @@ static inline VBArrayInstance *vbarray_this(vdisp_t *jsthis)
}
static HRESULT VBArray_dimensions(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r, jsexcept_t *ei)
jsval_t *r)
{
VBArrayInstance *vbarray;
......@@ -53,7 +53,7 @@ static HRESULT VBArray_dimensions(script_ctx_t *ctx, vdisp_t *vthis, WORD flags,
vbarray = vbarray_this(vthis);
if(!vbarray)
return throw_type_error(ctx, ei, JS_E_VBARRAY_EXPECTED, NULL);
return throw_type_error(ctx, JS_E_VBARRAY_EXPECTED, NULL);
if(r)
*r = jsval_number(SafeArrayGetDim(vbarray->safearray));
......@@ -61,7 +61,7 @@ static HRESULT VBArray_dimensions(script_ctx_t *ctx, vdisp_t *vthis, WORD flags,
}
static HRESULT VBArray_getItem(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r, jsexcept_t *ei)
jsval_t *r)
{
VBArrayInstance *vbarray;
int i, *indexes;
......@@ -72,17 +72,17 @@ static HRESULT VBArray_getItem(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, un
vbarray = vbarray_this(vthis);
if(!vbarray)
return throw_type_error(ctx, ei, JS_E_VBARRAY_EXPECTED, NULL);
return throw_type_error(ctx, JS_E_VBARRAY_EXPECTED, NULL);
if(argc < SafeArrayGetDim(vbarray->safearray))
return throw_range_error(ctx, ei, JS_E_SUBSCRIPT_OUT_OF_RANGE, NULL);
return throw_range_error(ctx, JS_E_SUBSCRIPT_OUT_OF_RANGE, NULL);
indexes = heap_alloc(sizeof(int)*argc);
if(!indexes)
return E_OUTOFMEMORY;
for(i=0; i<argc; i++) {
hres = to_int32(ctx, argv[i], ei, indexes+i);
hres = to_int32(ctx, argv[i], indexes+i);
if(FAILED(hres)) {
heap_free(indexes);
return hres;
......@@ -92,7 +92,7 @@ static HRESULT VBArray_getItem(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, un
hres = SafeArrayGetElement(vbarray->safearray, indexes, (void*)&out);
heap_free(indexes);
if(hres == DISP_E_BADINDEX)
return throw_range_error(ctx, ei, JS_E_SUBSCRIPT_OUT_OF_RANGE, NULL);
return throw_range_error(ctx, JS_E_SUBSCRIPT_OUT_OF_RANGE, NULL);
else if(FAILED(hres))
return hres;
......@@ -104,7 +104,7 @@ static HRESULT VBArray_getItem(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, un
}
static HRESULT VBArray_lbound(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r, jsexcept_t *ei)
jsval_t *r)
{
VBArrayInstance *vbarray;
int dim;
......@@ -114,10 +114,10 @@ static HRESULT VBArray_lbound(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, uns
vbarray = vbarray_this(vthis);
if(!vbarray)
return throw_type_error(ctx, ei, JS_E_VBARRAY_EXPECTED, NULL);
return throw_type_error(ctx, JS_E_VBARRAY_EXPECTED, NULL);
if(argc) {
hres = to_int32(ctx, argv[0], ei, &dim);
hres = to_int32(ctx, argv[0], &dim);
if(FAILED(hres))
return hres;
} else
......@@ -125,7 +125,7 @@ static HRESULT VBArray_lbound(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, uns
hres = SafeArrayGetLBound(vbarray->safearray, dim, &dim);
if(hres == DISP_E_BADINDEX)
return throw_range_error(ctx, ei, JS_E_SUBSCRIPT_OUT_OF_RANGE, NULL);
return throw_range_error(ctx, JS_E_SUBSCRIPT_OUT_OF_RANGE, NULL);
else if(FAILED(hres))
return hres;
......@@ -135,7 +135,7 @@ static HRESULT VBArray_lbound(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, uns
}
static HRESULT VBArray_toArray(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r, jsexcept_t *ei)
jsval_t *r)
{
VBArrayInstance *vbarray;
jsdisp_t *array;
......@@ -148,7 +148,7 @@ static HRESULT VBArray_toArray(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, un
vbarray = vbarray_this(vthis);
if(!vbarray)
return throw_type_error(ctx, ei, JS_E_VBARRAY_EXPECTED, NULL);
return throw_type_error(ctx, JS_E_VBARRAY_EXPECTED, NULL);
for(i=1; i<=SafeArrayGetDim(vbarray->safearray); i++) {
SafeArrayGetLBound(vbarray->safearray, i, &lbound);
......@@ -169,7 +169,7 @@ static HRESULT VBArray_toArray(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, un
for(i=0; i<size; i++) {
hres = variant_to_jsval(v, &val);
if(SUCCEEDED(hres)) {
hres = jsdisp_propput_idx(array, i, val, ei);
hres = jsdisp_propput_idx(array, i, val);
jsval_release(val);
}
if(FAILED(hres)) {
......@@ -188,7 +188,7 @@ static HRESULT VBArray_toArray(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, un
}
static HRESULT VBArray_ubound(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r, jsexcept_t *ei)
jsval_t *r)
{
VBArrayInstance *vbarray;
int dim;
......@@ -198,10 +198,10 @@ static HRESULT VBArray_ubound(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, uns
vbarray = vbarray_this(vthis);
if(!vbarray)
return throw_type_error(ctx, ei, JS_E_VBARRAY_EXPECTED, NULL);
return throw_type_error(ctx, JS_E_VBARRAY_EXPECTED, NULL);
if(argc) {
hres = to_int32(ctx, argv[0], ei, &dim);
hres = to_int32(ctx, argv[0], &dim);
if(FAILED(hres))
return hres;
} else
......@@ -209,7 +209,7 @@ static HRESULT VBArray_ubound(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, uns
hres = SafeArrayGetUBound(vbarray->safearray, dim, &dim);
if(hres == DISP_E_BADINDEX)
return throw_range_error(ctx, ei, JS_E_SUBSCRIPT_OUT_OF_RANGE, NULL);
return throw_range_error(ctx, JS_E_SUBSCRIPT_OUT_OF_RANGE, NULL);
else if(FAILED(hres))
return hres;
......@@ -219,7 +219,7 @@ static HRESULT VBArray_ubound(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, uns
}
static HRESULT VBArray_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r, jsexcept_t *ei)
jsval_t *r)
{
FIXME("\n");
......@@ -281,7 +281,7 @@ static HRESULT alloc_vbarray(script_ctx_t *ctx, jsdisp_t *object_prototype, VBAr
}
static HRESULT VBArrayConstr_value(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r, jsexcept_t *ei)
jsval_t *r)
{
VBArrayInstance *vbarray;
HRESULT hres;
......@@ -291,13 +291,13 @@ static HRESULT VBArrayConstr_value(script_ctx_t *ctx, vdisp_t *vthis, WORD flags
switch(flags) {
case DISPATCH_METHOD:
if(argc<1 || !is_variant(argv[0]) || V_VT(get_variant(argv[0])) != (VT_ARRAY|VT_VARIANT))
return throw_type_error(ctx, ei, JS_E_VBARRAY_EXPECTED, NULL);
return throw_type_error(ctx, JS_E_VBARRAY_EXPECTED, NULL);
return jsval_copy(argv[0], r);
case DISPATCH_CONSTRUCT:
if(argc<1 || !is_variant(argv[0]) || V_VT(get_variant(argv[0])) != (VT_ARRAY|VT_VARIANT))
return throw_type_error(ctx, ei, JS_E_VBARRAY_EXPECTED, NULL);
return throw_type_error(ctx, JS_E_VBARRAY_EXPECTED, NULL);
hres = alloc_vbarray(ctx, NULL, &vbarray);
if(FAILED(hres))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment