Hi Gabriel,
On 3/24/22 16:31, Gabriel Ivăncescu wrote:
- hres = to_flat_string(ctx, argc ? argv[0] : jsval_undefined(), &name_str, &name);
- if(FAILED(hres))
return hres;
- if(argc < 2 || !is_object_instance(argv[1]))
hres = JS_E_FUNCTION_EXPECTED;
- else {
hres = S_OK;
desc.getter = to_jsdisp(get_object(argv[1]));
if(!desc.getter) {
FIXME("getter is not JS object\n");
hres = E_NOTIMPL;
}
/* FIXME: Check IsCallable */
- }
According to the spec, argv[1] is validated before to_string(argv[0]). If you followed spec, error handling could be also nicer here.
Thanks,
Jacek