From b4175eebc0e9e21489f8c6b57e486f100bd394a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Fri, 25 Mar 2022 16:45:41 +0200 Subject: [PATCH] mshtml/tests: Test for RegExp.prototype.toString with non-regexp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/mshtml/tests/documentmode.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index b4d0bebfef0..3f772cf092f 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -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() {