return S_OK;
}
- if(!is_jsdisp(vdisp)) {
- FIXME("Not JScript object\n");
- return E_FAIL;
- }
+ if(!is_jsdisp(vdisp))
+ return throw_type_error(ctx, ei, IDS_JSCRIPT_EXPECTED, NULL);
hres = jsdisp_propget_name(vdisp->u.jsdisp, lengthW, &var, ei, NULL/*FIXME*/);
if(FAILED(hres))
IDS_ILLEGAL_ASSIGN "Illegal assignment"
IDS_UNDEFINED "'|' is undefined"
IDS_NOT_BOOL "Boolean object expected"
+ IDS_JSCRIPT_EXPECTED "JScript object expected"
IDS_REGEXP_SYNTAX_ERROR "Syntax error in regular expression"
IDS_INVALID_LENGTH "Array length must be a finite positive integer"
}
#define IDS_ILLEGAL_ASSIGN 0x1390
#define IDS_UNDEFINED 0x1391
#define IDS_NOT_BOOL 0x1392
+#define IDS_JSCRIPT_EXPECTED 0x1396
#define IDS_REGEXP_SYNTAX_ERROR 0x1399
#define IDS_INVALID_LENGTH 0x13A5
exception_test(function() {eval("nonexistingfunc()")}, "TypeError", -2146823281);
exception_test(function() {RegExp(/a/, "g");}, "RegExpError", -2146823271);
+function testArrayHostThis(func) {
+ exception_test(function() { Array.prototype[func].call(testObj); }, "TypeError", -2146823274);
+}
+
+testArrayHostThis("push");
+testArrayHostThis("shift");
+testArrayHostThis("slice");
+testArrayHostThis("splice");
+testArrayHostThis("unshift");
+
function testObjectInherit(obj, constr, ts, tls, vo) {
ok(obj instanceof Object, "obj is not instance of Object");
ok(obj instanceof constr, "obj is not instance of its constructor");