michael@0: // Array.of returns an object in the target compartment, not the caller's compartment. michael@0: // This rules out implementations along the lines of (...args) => args. michael@0: michael@0: var g = newGlobal(); michael@0: var ga = g.Array.of(1, 2, 3); michael@0: assertEq(ga instanceof g.Array, true); michael@0: michael@0: g.Array.of = Array.of; michael@0: var a = g.Array.of(1, 2, 3); // this-value is a wrapper of g.Array, which IsConstructor, so we call it michael@0: assertEq(ga instanceof g.Array, true); // it produces a g.Array instance