Commit 8b836797 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Directly return error code instead of using throw_type_error where possible.

parent b6e91906
...@@ -86,7 +86,7 @@ static HRESULT get_length(script_ctx_t *ctx, vdisp_t *vdisp, jsdisp_t **jsthis, ...@@ -86,7 +86,7 @@ static HRESULT get_length(script_ctx_t *ctx, vdisp_t *vdisp, jsdisp_t **jsthis,
} }
if(!is_jsdisp(vdisp)) if(!is_jsdisp(vdisp))
return throw_type_error(ctx, JS_E_JSCRIPT_EXPECTED, NULL); return JS_E_JSCRIPT_EXPECTED;
hres = jsdisp_propget_name(vdisp->u.jsdisp, lengthW, &val); hres = jsdisp_propget_name(vdisp->u.jsdisp, lengthW, &val);
if(FAILED(hres)) if(FAILED(hres))
...@@ -934,7 +934,7 @@ static HRESULT Array_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, un ...@@ -934,7 +934,7 @@ static HRESULT Array_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, un
array = array_this(jsthis); array = array_this(jsthis);
if(!array) if(!array)
return throw_type_error(ctx, JS_E_ARRAY_EXPECTED, NULL); return JS_E_ARRAY_EXPECTED;
return array_join(ctx, &array->dispex, array->length, default_separatorW, return array_join(ctx, &array->dispex, array->length, default_separatorW,
lstrlenW(default_separatorW), r); lstrlenW(default_separatorW), r);
......
...@@ -66,7 +66,7 @@ static HRESULT Bool_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, uns ...@@ -66,7 +66,7 @@ static HRESULT Bool_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, uns
TRACE("\n"); TRACE("\n");
if(!(bool = bool_this(jsthis))) if(!(bool = bool_this(jsthis)))
return throw_type_error(ctx, JS_E_BOOLEAN_EXPECTED, NULL); return JS_E_BOOLEAN_EXPECTED;
if(r) { if(r) {
jsstr_t *val; jsstr_t *val;
...@@ -89,7 +89,7 @@ static HRESULT Bool_valueOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsi ...@@ -89,7 +89,7 @@ static HRESULT Bool_valueOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsi
TRACE("\n"); TRACE("\n");
if(!(bool = bool_this(jsthis))) if(!(bool = bool_this(jsthis)))
return throw_type_error(ctx, JS_E_BOOLEAN_EXPECTED, NULL); return JS_E_BOOLEAN_EXPECTED;
if(r) if(r)
*r = jsval_bool(bool->val); *r = jsval_bool(bool->val);
...@@ -103,7 +103,7 @@ static HRESULT Bool_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsign ...@@ -103,7 +103,7 @@ static HRESULT Bool_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsign
switch(flags) { switch(flags) {
case INVOKE_FUNC: case INVOKE_FUNC:
return throw_type_error(ctx, JS_E_FUNCTION_EXPECTED, NULL); return JS_E_FUNCTION_EXPECTED;
default: default:
FIXME("unimplemented flags %x\n", flags); FIXME("unimplemented flags %x\n", flags);
return E_NOTIMPL; return E_NOTIMPL;
......
...@@ -1908,7 +1908,7 @@ HRESULT jsdisp_call_value(jsdisp_t *jsfunc, IDispatch *jsthis, WORD flags, unsig ...@@ -1908,7 +1908,7 @@ HRESULT jsdisp_call_value(jsdisp_t *jsfunc, IDispatch *jsthis, WORD flags, unsig
if(!jsfunc->builtin_info->value_prop.invoke) { if(!jsfunc->builtin_info->value_prop.invoke) {
WARN("Not a function\n"); WARN("Not a function\n");
return throw_type_error(jsfunc->ctx, JS_E_FUNCTION_EXPECTED, NULL); return JS_E_FUNCTION_EXPECTED;
} }
set_disp(&vdisp, jsthis); set_disp(&vdisp, jsthis);
......
...@@ -153,7 +153,7 @@ static HRESULT stack_pop_object(script_ctx_t *ctx, IDispatch **r) ...@@ -153,7 +153,7 @@ static HRESULT stack_pop_object(script_ctx_t *ctx, IDispatch **r)
v = stack_pop(ctx); v = stack_pop(ctx);
if(is_object_instance(v)) { if(is_object_instance(v)) {
if(!get_object(v)) if(!get_object(v))
return throw_type_error(ctx, JS_E_OBJECT_REQUIRED, NULL); return JS_E_OBJECT_REQUIRED;
*r = get_object(v); *r = get_object(v);
return S_OK; return S_OK;
} }
...@@ -1183,11 +1183,11 @@ static HRESULT interp_new(script_ctx_t *ctx) ...@@ -1183,11 +1183,11 @@ static HRESULT interp_new(script_ctx_t *ctx)
/* NOTE: Should use to_object here */ /* NOTE: Should use to_object here */
if(is_null(constr)) if(is_null(constr))
return throw_type_error(ctx, JS_E_OBJECT_EXPECTED, NULL); return JS_E_OBJECT_EXPECTED;
else if(!is_object_instance(constr)) else if(!is_object_instance(constr))
return throw_type_error(ctx, JS_E_INVALID_ACTION, NULL); return JS_E_INVALID_ACTION;
else if(!get_object(constr)) else if(!get_object(constr))
return throw_type_error(ctx, JS_E_INVALID_PROPERTY, NULL); return JS_E_INVALID_PROPERTY;
clear_acc(ctx); clear_acc(ctx);
return disp_call_value(ctx, get_object(constr), NULL, DISPATCH_CONSTRUCT | DISPATCH_JSCRIPT_CALLEREXECSSOURCE, return disp_call_value(ctx, get_object(constr), NULL, DISPATCH_CONSTRUCT | DISPATCH_JSCRIPT_CALLEREXECSSOURCE,
...@@ -1205,7 +1205,7 @@ static HRESULT interp_call(script_ctx_t *ctx) ...@@ -1205,7 +1205,7 @@ static HRESULT interp_call(script_ctx_t *ctx)
obj = stack_topn(ctx, argn); obj = stack_topn(ctx, argn);
if(!is_object_instance(obj)) if(!is_object_instance(obj))
return throw_type_error(ctx, JS_E_INVALID_PROPERTY, NULL); return JS_E_INVALID_PROPERTY;
clear_acc(ctx); clear_acc(ctx);
return disp_call_value(ctx, get_object(obj), NULL, DISPATCH_METHOD | DISPATCH_JSCRIPT_CALLEREXECSSOURCE, return disp_call_value(ctx, get_object(obj), NULL, DISPATCH_METHOD | DISPATCH_JSCRIPT_CALLEREXECSSOURCE,
...@@ -1222,7 +1222,7 @@ static HRESULT interp_call_member(script_ctx_t *ctx) ...@@ -1222,7 +1222,7 @@ static HRESULT interp_call_member(script_ctx_t *ctx)
TRACE("%d %d\n", argn, do_ret); TRACE("%d %d\n", argn, do_ret);
if(!stack_topn_exprval(ctx, argn, &ref)) if(!stack_topn_exprval(ctx, argn, &ref))
return throw_type_error(ctx, ref.u.hres, NULL); return ref.u.hres;
clear_acc(ctx); clear_acc(ctx);
return exprval_call(ctx, &ref, DISPATCH_METHOD | DISPATCH_JSCRIPT_CALLEREXECSSOURCE, return exprval_call(ctx, &ref, DISPATCH_METHOD | DISPATCH_JSCRIPT_CALLEREXECSSOURCE,
...@@ -1619,7 +1619,7 @@ static HRESULT interp_instanceof(script_ctx_t *ctx) ...@@ -1619,7 +1619,7 @@ static HRESULT interp_instanceof(script_ctx_t *ctx)
v = stack_pop(ctx); v = stack_pop(ctx);
if(!is_object_instance(v) || !get_object(v)) { if(!is_object_instance(v) || !get_object(v)) {
jsval_release(v); jsval_release(v);
return throw_type_error(ctx, JS_E_FUNCTION_EXPECTED, NULL); return JS_E_FUNCTION_EXPECTED;
} }
obj = iface_to_jsdisp(get_object(v)); obj = iface_to_jsdisp(get_object(v));
...@@ -1632,7 +1632,7 @@ static HRESULT interp_instanceof(script_ctx_t *ctx) ...@@ -1632,7 +1632,7 @@ static HRESULT interp_instanceof(script_ctx_t *ctx)
if(is_class(obj, JSCLASS_FUNCTION)) { if(is_class(obj, JSCLASS_FUNCTION)) {
hres = jsdisp_propget_name(obj, prototypeW, &prot); hres = jsdisp_propget_name(obj, prototypeW, &prot);
}else { }else {
hres = throw_type_error(ctx, JS_E_FUNCTION_EXPECTED, NULL); hres = JS_E_FUNCTION_EXPECTED;
} }
jsdisp_release(obj); jsdisp_release(obj);
if(FAILED(hres)) if(FAILED(hres))
...@@ -1679,7 +1679,7 @@ static HRESULT interp_in(script_ctx_t *ctx) ...@@ -1679,7 +1679,7 @@ static HRESULT interp_in(script_ctx_t *ctx)
obj = stack_pop(ctx); obj = stack_pop(ctx);
if(!is_object_instance(obj) || !get_object(obj)) { if(!is_object_instance(obj) || !get_object(obj)) {
jsval_release(obj); jsval_release(obj);
return throw_type_error(ctx, JS_E_OBJECT_EXPECTED, NULL); return JS_E_OBJECT_EXPECTED;
} }
v = stack_pop(ctx); v = stack_pop(ctx);
...@@ -2090,7 +2090,7 @@ static HRESULT interp_postinc(script_ctx_t *ctx) ...@@ -2090,7 +2090,7 @@ static HRESULT interp_postinc(script_ctx_t *ctx)
TRACE("%d\n", arg); TRACE("%d\n", arg);
if(!stack_pop_exprval(ctx, &ref)) if(!stack_pop_exprval(ctx, &ref))
return throw_type_error(ctx, JS_E_OBJECT_EXPECTED, NULL); return JS_E_OBJECT_EXPECTED;
hres = exprval_propget(ctx, &ref, &v); hres = exprval_propget(ctx, &ref, &v);
if(SUCCEEDED(hres)) { if(SUCCEEDED(hres)) {
...@@ -2121,7 +2121,7 @@ static HRESULT interp_preinc(script_ctx_t *ctx) ...@@ -2121,7 +2121,7 @@ static HRESULT interp_preinc(script_ctx_t *ctx)
TRACE("%d\n", arg); TRACE("%d\n", arg);
if(!stack_pop_exprval(ctx, &ref)) if(!stack_pop_exprval(ctx, &ref))
return throw_type_error(ctx, JS_E_OBJECT_EXPECTED, NULL); return JS_E_OBJECT_EXPECTED;
hres = exprval_propget(ctx, &ref, &v); hres = exprval_propget(ctx, &ref, &v);
if(SUCCEEDED(hres)) { if(SUCCEEDED(hres)) {
......
...@@ -103,7 +103,7 @@ static HRESULT Enumerator_atEnd(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, ...@@ -103,7 +103,7 @@ static HRESULT Enumerator_atEnd(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
EnumeratorInstance *This; EnumeratorInstance *This;
if (!(This = enumerator_this(jsthis))) if (!(This = enumerator_this(jsthis)))
return throw_type_error(ctx, JS_E_ENUMERATOR_EXPECTED, NULL); return JS_E_ENUMERATOR_EXPECTED;
TRACE("%d\n", This->atend); TRACE("%d\n", This->atend);
...@@ -120,7 +120,7 @@ static HRESULT Enumerator_item(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, u ...@@ -120,7 +120,7 @@ static HRESULT Enumerator_item(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, u
TRACE("\n"); TRACE("\n");
if (!(This = enumerator_this(jsthis))) if (!(This = enumerator_this(jsthis)))
return throw_type_error(ctx, JS_E_ENUMERATOR_EXPECTED, NULL); return JS_E_ENUMERATOR_EXPECTED;
return r ? jsval_copy(This->item, r) : S_OK; return r ? jsval_copy(This->item, r) : S_OK;
} }
...@@ -134,7 +134,7 @@ static HRESULT Enumerator_moveFirst(script_ctx_t *ctx, vdisp_t *jsthis, WORD fla ...@@ -134,7 +134,7 @@ static HRESULT Enumerator_moveFirst(script_ctx_t *ctx, vdisp_t *jsthis, WORD fla
TRACE("\n"); TRACE("\n");
if (!(This = enumerator_this(jsthis))) if (!(This = enumerator_this(jsthis)))
return throw_type_error(ctx, JS_E_ENUMERATOR_EXPECTED, NULL); return JS_E_ENUMERATOR_EXPECTED;
if (This->enumvar) if (This->enumvar)
{ {
...@@ -162,7 +162,7 @@ static HRESULT Enumerator_moveNext(script_ctx_t *ctx, vdisp_t *jsthis, WORD flag ...@@ -162,7 +162,7 @@ static HRESULT Enumerator_moveNext(script_ctx_t *ctx, vdisp_t *jsthis, WORD flag
TRACE("\n"); TRACE("\n");
if (!(This = enumerator_this(jsthis))) if (!(This = enumerator_this(jsthis)))
return throw_type_error(ctx, JS_E_ENUMERATOR_EXPECTED, NULL); return JS_E_ENUMERATOR_EXPECTED;
if (This->enumvar) if (This->enumvar)
{ {
......
...@@ -129,7 +129,7 @@ static HRESULT Error_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, ...@@ -129,7 +129,7 @@ static HRESULT Error_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
switch(flags) { switch(flags) {
case INVOKE_FUNC: case INVOKE_FUNC:
return throw_type_error(ctx, JS_E_FUNCTION_EXPECTED, NULL); return JS_E_FUNCTION_EXPECTED;
default: default:
FIXME("unimplemented flags %x\n", flags); FIXME("unimplemented flags %x\n", flags);
return E_NOTIMPL; return E_NOTIMPL;
......
...@@ -292,7 +292,7 @@ static HRESULT Function_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, ...@@ -292,7 +292,7 @@ static HRESULT Function_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
TRACE("\n"); TRACE("\n");
if(!(function = function_this(jsthis))) if(!(function = function_this(jsthis)))
return throw_type_error(ctx, JS_E_FUNCTION_EXPECTED, NULL); return JS_E_FUNCTION_EXPECTED;
hres = function->vtbl->toString(function, &str); hres = function->vtbl->toString(function, &str);
if(FAILED(hres)) if(FAILED(hres))
...@@ -352,7 +352,7 @@ static HRESULT Function_apply(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, un ...@@ -352,7 +352,7 @@ static HRESULT Function_apply(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, un
TRACE("\n"); TRACE("\n");
if(!(function = function_this(jsthis)) && (jsthis->flags & VDISP_JSDISP)) if(!(function = function_this(jsthis)) && (jsthis->flags & VDISP_JSDISP))
return throw_type_error(ctx, JS_E_FUNCTION_EXPECTED, NULL); return JS_E_FUNCTION_EXPECTED;
if(argc) { if(argc) {
if(!is_undefined(argv[0]) && !is_null(argv[0])) { if(!is_undefined(argv[0]) && !is_null(argv[0])) {
...@@ -417,7 +417,7 @@ static HRESULT Function_call(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, uns ...@@ -417,7 +417,7 @@ static HRESULT Function_call(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, uns
TRACE("\n"); TRACE("\n");
if(!(function = function_this(jsthis))) if(!(function = function_this(jsthis)))
return throw_type_error(ctx, JS_E_FUNCTION_EXPECTED, NULL); return JS_E_FUNCTION_EXPECTED;
if(argc) { if(argc) {
if(!is_undefined(argv[0]) && !is_null(argv[0])) { if(!is_undefined(argv[0]) && !is_null(argv[0])) {
...@@ -446,7 +446,7 @@ static HRESULT Function_bind(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, uns ...@@ -446,7 +446,7 @@ static HRESULT Function_bind(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, uns
TRACE("\n"); TRACE("\n");
if(!(function = function_this(jsthis))) if(!(function = function_this(jsthis)))
return throw_type_error(ctx, JS_E_FUNCTION_EXPECTED, NULL); return JS_E_FUNCTION_EXPECTED;
if(argc < 1) { if(argc < 1) {
FIXME("no this argument\n"); FIXME("no this argument\n");
......
...@@ -559,7 +559,7 @@ static HRESULT RegExp_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsi ...@@ -559,7 +559,7 @@ static HRESULT RegExp_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsi
switch(flags) { switch(flags) {
case INVOKE_FUNC: case INVOKE_FUNC:
return throw_type_error(ctx, JS_E_FUNCTION_EXPECTED, NULL); return JS_E_FUNCTION_EXPECTED;
default: default:
FIXME("unimplemented flags %x\n", flags); FIXME("unimplemented flags %x\n", flags);
return E_NOTIMPL; return E_NOTIMPL;
......
...@@ -445,7 +445,7 @@ HRESULT to_primitive(script_ctx_t *ctx, jsval_t val, jsval_t *ret, hint_t hint) ...@@ -445,7 +445,7 @@ HRESULT to_primitive(script_ctx_t *ctx, jsval_t val, jsval_t *ret, hint_t hint)
jsdisp_release(jsdisp); jsdisp_release(jsdisp);
WARN("failed\n"); WARN("failed\n");
return throw_type_error(ctx, JS_E_TO_PRIMITIVE, NULL); return JS_E_TO_PRIMITIVE;
} }
return jsval_copy(val, ret); return jsval_copy(val, ret);
...@@ -850,7 +850,7 @@ HRESULT to_object(script_ctx_t *ctx, jsval_t val, IDispatch **disp) ...@@ -850,7 +850,7 @@ HRESULT to_object(script_ctx_t *ctx, jsval_t val, IDispatch **disp)
case JSV_UNDEFINED: case JSV_UNDEFINED:
case JSV_NULL: case JSV_NULL:
WARN("object expected\n"); WARN("object expected\n");
return throw_type_error(ctx, JS_E_OBJECT_EXPECTED, NULL); return JS_E_OBJECT_EXPECTED;
case JSV_VARIANT: case JSV_VARIANT:
switch(V_VT(get_variant(val))) { switch(V_VT(get_variant(val))) {
case VT_ARRAY|VT_VARIANT: case VT_ARRAY|VT_VARIANT:
......
...@@ -241,15 +241,15 @@ static HRESULT Number_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, u ...@@ -241,15 +241,15 @@ static HRESULT Number_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, u
TRACE("\n"); TRACE("\n");
if(!(number = number_this(jsthis))) if(!(number = number_this(jsthis)))
return throw_type_error(ctx, JS_E_NUMBER_EXPECTED, NULL); return JS_E_NUMBER_EXPECTED;
if(argc) { if(argc) {
hres = to_int32(ctx, argv[0], &radix); hres = to_int32(ctx, argv[0], &radix);
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
if(radix<2 || radix>36) if(radix < 2 || radix > 36)
return throw_type_error(ctx, JS_E_INVALIDARG, NULL); return JS_E_INVALIDARG;
} }
val = number->value; val = number->value;
...@@ -368,7 +368,7 @@ static HRESULT Number_toFixed(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, un ...@@ -368,7 +368,7 @@ static HRESULT Number_toFixed(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, un
TRACE("\n"); TRACE("\n");
if(!(number = number_this(jsthis))) if(!(number = number_this(jsthis)))
return throw_type_error(ctx, JS_E_NUMBER_EXPECTED, NULL); return JS_E_NUMBER_EXPECTED;
if(argc) { if(argc) {
hres = to_int32(ctx, argv[0], &prec); hres = to_int32(ctx, argv[0], &prec);
...@@ -409,7 +409,7 @@ static HRESULT Number_toExponential(script_ctx_t *ctx, vdisp_t *jsthis, WORD fla ...@@ -409,7 +409,7 @@ static HRESULT Number_toExponential(script_ctx_t *ctx, vdisp_t *jsthis, WORD fla
TRACE("\n"); TRACE("\n");
if(!(number = number_this(jsthis))) if(!(number = number_this(jsthis)))
return throw_type_error(ctx, JS_E_NUMBER_EXPECTED, NULL); return JS_E_NUMBER_EXPECTED;
if(argc) { if(argc) {
hres = to_int32(ctx, argv[0], &prec); hres = to_int32(ctx, argv[0], &prec);
...@@ -450,7 +450,7 @@ static HRESULT Number_toPrecision(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags ...@@ -450,7 +450,7 @@ static HRESULT Number_toPrecision(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags
HRESULT hres; HRESULT hres;
if(!(number = number_this(jsthis))) if(!(number = number_this(jsthis)))
return throw_type_error(ctx, JS_E_NUMBER_EXPECTED, NULL); return JS_E_NUMBER_EXPECTED;
if(argc) { if(argc) {
hres = to_int32(ctx, argv[0], &prec); hres = to_int32(ctx, argv[0], &prec);
...@@ -495,7 +495,7 @@ static HRESULT Number_valueOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, un ...@@ -495,7 +495,7 @@ static HRESULT Number_valueOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, un
TRACE("\n"); TRACE("\n");
if(!(number = number_this(jsthis))) if(!(number = number_this(jsthis)))
return throw_type_error(ctx, JS_E_NUMBER_EXPECTED, NULL); return JS_E_NUMBER_EXPECTED;
if(r) if(r)
*r = jsval_number(number->value); *r = jsval_number(number->value);
......
...@@ -399,9 +399,9 @@ static HRESULT to_property_descriptor(script_ctx_t *ctx, jsdisp_t *attr_obj, pro ...@@ -399,9 +399,9 @@ static HRESULT to_property_descriptor(script_ctx_t *ctx, jsdisp_t *attr_obj, pro
if(desc->explicit_getter || desc->explicit_setter) { if(desc->explicit_getter || desc->explicit_setter) {
if(desc->explicit_value) if(desc->explicit_value)
hres = throw_type_error(ctx, JS_E_PROP_DESC_MISMATCH, NULL); hres = JS_E_PROP_DESC_MISMATCH;
else if(desc->mask & PROPF_WRITABLE) else if(desc->mask & PROPF_WRITABLE)
hres = throw_type_error(ctx, JS_E_INVALID_WRITABLE_PROP_DESC, NULL); hres = JS_E_INVALID_WRITABLE_PROP_DESC;
} }
if(FAILED(hres)) if(FAILED(hres))
...@@ -472,7 +472,7 @@ static HRESULT Object_defineProperty(script_ctx_t *ctx, vdisp_t *jsthis, WORD fl ...@@ -472,7 +472,7 @@ static HRESULT Object_defineProperty(script_ctx_t *ctx, vdisp_t *jsthis, WORD fl
TRACE("\n"); TRACE("\n");
if(argc < 1 || !is_object_instance(argv[0])) if(argc < 1 || !is_object_instance(argv[0]))
return throw_type_error(ctx, JS_E_OBJECT_EXPECTED, NULL); return JS_E_OBJECT_EXPECTED;
obj = to_jsdisp(get_object(argv[0])); obj = to_jsdisp(get_object(argv[0]));
if(!obj) { if(!obj) {
FIXME("not implemented non-JS object\n"); FIXME("not implemented non-JS object\n");
...@@ -492,7 +492,7 @@ static HRESULT Object_defineProperty(script_ctx_t *ctx, vdisp_t *jsthis, WORD fl ...@@ -492,7 +492,7 @@ static HRESULT Object_defineProperty(script_ctx_t *ctx, vdisp_t *jsthis, WORD fl
hres = E_NOTIMPL; hres = E_NOTIMPL;
} }
}else { }else {
hres = throw_type_error(ctx, JS_E_OBJECT_EXPECTED, NULL); hres = JS_E_OBJECT_EXPECTED;
} }
jsstr_release(name_str); jsstr_release(name_str);
if(FAILED(hres)) if(FAILED(hres))
...@@ -536,7 +536,7 @@ static HRESULT Object_getOwnPropertyDescriptor(script_ctx_t *ctx, vdisp_t *jsthi ...@@ -536,7 +536,7 @@ static HRESULT Object_getOwnPropertyDescriptor(script_ctx_t *ctx, vdisp_t *jsthi
TRACE("\n"); TRACE("\n");
if(argc < 1 || !is_object_instance(argv[0])) if(argc < 1 || !is_object_instance(argv[0]))
return throw_type_error(ctx, JS_E_OBJECT_EXPECTED, NULL); return JS_E_OBJECT_EXPECTED;
obj = to_jsdisp(get_object(argv[0])); obj = to_jsdisp(get_object(argv[0]));
if(!obj) { if(!obj) {
FIXME("not implemented non-JS object\n"); FIXME("not implemented non-JS object\n");
......
...@@ -58,7 +58,7 @@ static HRESULT VBArray_dimensions(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, ...@@ -58,7 +58,7 @@ static HRESULT VBArray_dimensions(script_ctx_t *ctx, vdisp_t *vthis, WORD flags,
vbarray = vbarray_this(vthis); vbarray = vbarray_this(vthis);
if(!vbarray) if(!vbarray)
return throw_type_error(ctx, JS_E_VBARRAY_EXPECTED, NULL); return JS_E_VBARRAY_EXPECTED;
if(r) if(r)
*r = jsval_number(SafeArrayGetDim(vbarray->safearray)); *r = jsval_number(SafeArrayGetDim(vbarray->safearray));
...@@ -77,7 +77,7 @@ static HRESULT VBArray_getItem(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, un ...@@ -77,7 +77,7 @@ static HRESULT VBArray_getItem(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, un
vbarray = vbarray_this(vthis); vbarray = vbarray_this(vthis);
if(!vbarray) if(!vbarray)
return throw_type_error(ctx, JS_E_VBARRAY_EXPECTED, NULL); return JS_E_VBARRAY_EXPECTED;
if(argc < SafeArrayGetDim(vbarray->safearray)) if(argc < SafeArrayGetDim(vbarray->safearray))
return JS_E_SUBSCRIPT_OUT_OF_RANGE; return JS_E_SUBSCRIPT_OUT_OF_RANGE;
...@@ -119,7 +119,7 @@ static HRESULT VBArray_lbound(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, uns ...@@ -119,7 +119,7 @@ static HRESULT VBArray_lbound(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, uns
vbarray = vbarray_this(vthis); vbarray = vbarray_this(vthis);
if(!vbarray) if(!vbarray)
return throw_type_error(ctx, JS_E_VBARRAY_EXPECTED, NULL); return JS_E_VBARRAY_EXPECTED;
if(argc) { if(argc) {
hres = to_int32(ctx, argv[0], &dim); hres = to_int32(ctx, argv[0], &dim);
...@@ -153,7 +153,7 @@ static HRESULT VBArray_toArray(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, un ...@@ -153,7 +153,7 @@ static HRESULT VBArray_toArray(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, un
vbarray = vbarray_this(vthis); vbarray = vbarray_this(vthis);
if(!vbarray) if(!vbarray)
return throw_type_error(ctx, JS_E_VBARRAY_EXPECTED, NULL); return JS_E_VBARRAY_EXPECTED;
for(i=1; i<=SafeArrayGetDim(vbarray->safearray); i++) { for(i=1; i<=SafeArrayGetDim(vbarray->safearray); i++) {
SafeArrayGetLBound(vbarray->safearray, i, &lbound); SafeArrayGetLBound(vbarray->safearray, i, &lbound);
...@@ -205,7 +205,7 @@ static HRESULT VBArray_ubound(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, uns ...@@ -205,7 +205,7 @@ static HRESULT VBArray_ubound(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, uns
vbarray = vbarray_this(vthis); vbarray = vbarray_this(vthis);
if(!vbarray) if(!vbarray)
return throw_type_error(ctx, JS_E_VBARRAY_EXPECTED, NULL); return JS_E_VBARRAY_EXPECTED;
if(argc) { if(argc) {
hres = to_int32(ctx, argv[0], &dim); hres = to_int32(ctx, argv[0], &dim);
...@@ -298,13 +298,13 @@ static HRESULT VBArrayConstr_value(script_ctx_t *ctx, vdisp_t *vthis, WORD flags ...@@ -298,13 +298,13 @@ static HRESULT VBArrayConstr_value(script_ctx_t *ctx, vdisp_t *vthis, WORD flags
switch(flags) { switch(flags) {
case DISPATCH_METHOD: case DISPATCH_METHOD:
if(argc<1 || !is_variant(argv[0]) || V_VT(get_variant(argv[0])) != (VT_ARRAY|VT_VARIANT)) if(argc<1 || !is_variant(argv[0]) || V_VT(get_variant(argv[0])) != (VT_ARRAY|VT_VARIANT))
return throw_type_error(ctx, JS_E_VBARRAY_EXPECTED, NULL); return JS_E_VBARRAY_EXPECTED;
return jsval_copy(argv[0], r); return jsval_copy(argv[0], r);
case DISPATCH_CONSTRUCT: case DISPATCH_CONSTRUCT:
if(argc<1 || !is_variant(argv[0]) || V_VT(get_variant(argv[0])) != (VT_ARRAY|VT_VARIANT)) if(argc<1 || !is_variant(argv[0]) || V_VT(get_variant(argv[0])) != (VT_ARRAY|VT_VARIANT))
return throw_type_error(ctx, JS_E_VBARRAY_EXPECTED, NULL); return JS_E_VBARRAY_EXPECTED;
hres = alloc_vbarray(ctx, NULL, &vbarray); hres = alloc_vbarray(ctx, NULL, &vbarray);
if(FAILED(hres)) 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