jscript: Properly set Error object's constructor property.

This commit is contained in:
Jacek Caban 2012-07-16 15:31:37 +02:00 committed by Alexandre Julliard
parent bf7b7272ee
commit 27747d3a75
2 changed files with 9 additions and 1 deletions

View File

@ -370,7 +370,7 @@ HRESULT init_error_constr(script_ctx_t *ctx, jsdisp_t *object_prototype)
hres = jsdisp_propput_name(err, nameW, &v, NULL/*FIXME*/); hres = jsdisp_propput_name(err, nameW, &v, NULL/*FIXME*/);
if(SUCCEEDED(hres)) if(SUCCEEDED(hres))
hres = create_builtin_function(ctx, constr_val[i], names[i], NULL, hres = create_builtin_constructor(ctx, constr_val[i], names[i], NULL,
PROPF_CONSTR|1, err, constr_addr[i]); PROPF_CONSTR|1, err, constr_addr[i]);
jsdisp_release(err); jsdisp_release(err);

View File

@ -104,6 +104,14 @@ testConstructor(RegExp, "RegExp");
testConstructor(Function, "Function"); testConstructor(Function, "Function");
testConstructor(Date, "Date"); testConstructor(Date, "Date");
testConstructor(VBArray, "VBArray"); testConstructor(VBArray, "VBArray");
testConstructor(Error, "Error");
testConstructor(EvalError, "EvalError");
testConstructor(RangeError, "RangeError");
testConstructor(ReferenceError, "ReferenceError");
//testConstructor(RegExpError, "RegExpError");
testConstructor(SyntaxError, "SyntaxError");
testConstructor(TypeError, "TypeError");
testConstructor(URIError, "URIError");
Function.prototype.test = true; Function.prototype.test = true;
ok(testFunc1.test === true, "testFunc1.test !== true"); ok(testFunc1.test === true, "testFunc1.test !== true");