1 function testStrict(sb) {
3 Assert.equal(sb.eval("typeof wrappedCtor()"), "string");
4 Assert.equal(sb.eval("typeof new wrappedCtor()"), "object");
8 var sb = new Cu.Sandbox(null);
9 var dateCtor = sb.Date;
10 sb.wrappedCtor = Cu.exportFunction(function wrapper(val) {
12 var constructing = this.constructor == wrapper;
13 return constructing ? new dateCtor(val) : dateCtor(val);
15 Assert.equal(typeof Date(), "string");
16 Assert.equal(typeof new Date(), "object");
17 Assert.equal(sb.eval("typeof wrappedCtor()"), "string");
18 Assert.equal(sb.eval("typeof new wrappedCtor()"), "object");