summaryrefslogtreecommitdiffstats
path: root/js/xpconnect/tests/unit
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-19 12:47:01 +0100
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-19 12:47:01 +0100
commita413cf72888dcb5197ba44aba547b8d496231cff (patch)
tree35a642b0239e0a0c01e8326fcea611416ce7dd80 /js/xpconnect/tests/unit
parent3114d48cee98c43c5d980eccfc104854860ef2be (diff)
downloadUXP-a413cf72888dcb5197ba44aba547b8d496231cff.tar
UXP-a413cf72888dcb5197ba44aba547b8d496231cff.tar.gz
UXP-a413cf72888dcb5197ba44aba547b8d496231cff.tar.lz
UXP-a413cf72888dcb5197ba44aba547b8d496231cff.tar.xz
UXP-a413cf72888dcb5197ba44aba547b8d496231cff.zip
Update RegExp Xray code
Issue #77
Diffstat (limited to 'js/xpconnect/tests/unit')
-rw-r--r--js/xpconnect/tests/unit/test_xray_regexp.js9
-rw-r--r--js/xpconnect/tests/unit/xpcshell.ini1
2 files changed, 10 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");
+}
diff --git a/js/xpconnect/tests/unit/xpcshell.ini b/js/xpconnect/tests/unit/xpcshell.ini
index 99d44b975..12648d3ec 100644
--- a/js/xpconnect/tests/unit/xpcshell.ini
+++ b/js/xpconnect/tests/unit/xpcshell.ini
@@ -133,5 +133,6 @@ head = head_watchdog.js
[test_xrayed_iterator.js]
[test_xray_SavedFrame.js]
[test_xray_SavedFrame-02.js]
+[test_xray_regexp.js]
[test_resolve_dead_promise.js]
[test_asyncLoadSubScriptError.js]