Dactyloidae/js/xpconnect/tests/unit/test_xray_regexp.js

9 lines
346 B
JavaScript
Raw Normal View History

2018-03-19 12:47:01 +01:00
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");
}