summaryrefslogtreecommitdiffstats
path: root/js/xpconnect/tests/unit/test_xray_regexp.js
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-03-20 10:05:23 +0100
committerwolfbeast <mcwerewolf@gmail.com>2018-03-20 10:07:06 +0100
commit7197b308fb97cd8ab7a972df6a3a17a7a265b594 (patch)
treee6a36f10a28710bac1b901915a643ce398580cdf /js/xpconnect/tests/unit/test_xray_regexp.js
parent173a526ec0bedec17f35cc838b9c7d47a5ce13b7 (diff)
parenta413cf72888dcb5197ba44aba547b8d496231cff (diff)
downloadUXP-7197b308fb97cd8ab7a972df6a3a17a7a265b594.tar
UXP-7197b308fb97cd8ab7a972df6a3a17a7a265b594.tar.gz
UXP-7197b308fb97cd8ab7a972df6a3a17a7a265b594.tar.lz
UXP-7197b308fb97cd8ab7a972df6a3a17a7a265b594.tar.xz
UXP-7197b308fb97cd8ab7a972df6a3a17a7a265b594.zip
Make RegExp.prototype return a regular object instead of an instance.
This resolves #77. Merged remote-tracking branch 'janek/js_regexp_ordinary-object_1'
Diffstat (limited to 'js/xpconnect/tests/unit/test_xray_regexp.js')
-rw-r--r--js/xpconnect/tests/unit/test_xray_regexp.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/js/xpconnect/tests/unit/test_xray_regexp.js b/js/xpconnect/tests/unit/test_xray_regexp.js
new file mode 100644
index 000000000..4baffd63e
--- /dev/null
+++ b/js/xpconnect/tests/unit/test_xray_regexp.js
@@ -0,0 +1,9 @@
+const Cu = Components.utils;
+
+function run_test() {
+ var sandbox = Cu.Sandbox('http://www.example.com');
+ var regexp = Cu.evalInSandbox("/test/i", sandbox);
+ equal(RegExp.prototype.toString.call(regexp), "/test/i");
+ var prototype = Cu.evalInSandbox("RegExp.prototype", sandbox);
+ equal(typeof prototype.lastIndex, "undefined");
+}