1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
4 * Any copyright is dedicated to the Public Domain.
5 * http://creativecommons.org/licenses/publicdomain/
9 return Object.defineProperty([10, 20, 30], 0, {writable: false});
13 var o = {0: 10, 1: 20, 2: 30, length: 3};
14 Object.defineProperty(o, 0, {writable: false});
18 assertEq(testLenientAndStrict('var a = arr(); [a.shift(), a]',
19 raisesException(TypeError),
20 raisesException(TypeError)),
23 assertEq(testLenientAndStrict('var o = obj(); [Array.prototype.shift.call(o), o]',
24 raisesException(TypeError),
25 raisesException(TypeError)),
30 Object.defineProperty(a, 1, {configurable: false});
35 var o = {0: 1, 1: 2, /* no 2 */ 3: 4, length: 4};
36 Object.defineProperty(o, 1, {configurable: false});
40 assertEq(testLenientAndStrict('var a = agap(); [a.shift(), a]',
41 raisesException(TypeError),
42 raisesException(TypeError)),
45 assertEq(testLenientAndStrict('var o = ogap(); [Array.prototype.shift.call(o), o]',
46 raisesException(TypeError),
47 raisesException(TypeError)),
50 reportCompare(true, true);
52 var successfullyParsed = true;