summaryrefslogtreecommitdiffstats
path: root/js/xpconnect/tests/unit/test_xray_regexp.js
diff options
context:
space:
mode:
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");
+}