mshtml/tests: Test for RegExp.prototype.toString with non-regexp.

According to the ES6 spec, it should work in generic way for objects exposing
"source" and "flags", but native IE seems to not follow it here and throws.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Gabriel Ivăncescu 2022-03-25 16:45:41 +02:00 committed by Alexandre Julliard
parent ed55216558
commit b4175eebc0
1 changed files with 7 additions and 0 deletions

View File

@ -1300,6 +1300,13 @@ sync_test("builtins_diffs", function() {
ok(e.number === (v < 9 ? 0xa01b6 : 0xa138f) - 0x80000000, "Object." + props[i] + " with non-object: exception = " + e.number);
}
}
try {
RegExp.prototype.toString.call({source: "foo", flags: "g"});
ok(false, "RegExp.toString with non-regexp: expected exception");
}catch(e) {
ok(e.number === 0xa1398 - 0x80000000, "RegExp.toString with non-regexp: exception = " + e.number);
}
});
sync_test("__proto__", function() {