michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: michael@0: /* michael@0: * Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/licenses/publicdomain/ michael@0: */ michael@0: michael@0: function arr() { michael@0: return Object.defineProperty([1, 2, 3], 2, {configurable: false}); michael@0: } michael@0: michael@0: function obj() { michael@0: var o = {0: 1, 1: 2, 2: 3, length: 3}; michael@0: Object.defineProperty(o, 2, {configurable: false}); michael@0: return o; michael@0: } michael@0: michael@0: assertEq(testLenientAndStrict('var a = arr(); [a.pop(), a]', michael@0: raisesException(TypeError), michael@0: raisesException(TypeError)), michael@0: true); michael@0: michael@0: assertEq(testLenientAndStrict('var o = obj(); [Array.prototype.pop.call(o), o]', michael@0: raisesException(TypeError), michael@0: raisesException(TypeError)), michael@0: true); michael@0: michael@0: reportCompare(true, true);