michael@0: // Array.of does a strict assignment to the new object's .length. michael@0: // The assignment is strict even if the code we're calling from is not strict. michael@0: michael@0: load(libdir + "asserts.js"); michael@0: michael@0: function Empty() {} michael@0: Empty.of = Array.of; michael@0: Object.defineProperty(Empty.prototype, "length", {get: () => 0}); michael@0: michael@0: var nothing = new Empty; michael@0: nothing.length = 2; // no exception; this is not a strict mode assignment michael@0: michael@0: assertThrowsInstanceOf(() => Empty.of(), TypeError);