[PATCH v3 4/7] mshtml/tests: Test for RegExp.prototype.toString with non-regexp.

Gabriel Ivăncescu gabrielopcode at gmail.com
Fri Mar 25 09:45:41 CDT 2022


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 at gmail.com>
---

FFXIV Launcher checks for this.

 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 b4d0beb..3f772cf 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() {
-- 
2.34.1




More information about the wine-devel mailing list