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([1, 2, 3, 4], 2, {configurable
: false});
12 assertEq(testLenientAndStrict('var a = arr(); a.length = 2; a',
13 returnsCopyOf([1, 2, 3]),
14 raisesException(TypeError
)),
17 // Internally, SpiderMonkey has two representations for arrays:
18 // fast-but-inflexible, and slow-but-flexible. Adding a non-index property
19 // to an array turns it into the latter. We should test on both kinds.
25 assertEq(testLenientAndStrict('var a = addx(arr()); a.length = 2; a',
26 returnsCopyOf(addx([1, 2, 3])),
27 raisesException(TypeError
)),
30 reportCompare(true, true);
32 var successfullyParsed
= true;