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([20, 10, 30], 0, {writable: false});
12 assertEq(testLenientAndStrict('var a = arr(); a.sort()',
13 raisesException(TypeError),
14 raisesException(TypeError)),
18 var o = {0: 20, 1: 10, 2: 30, length: 3};
19 Object.defineProperty(o, 0, {writable: false});
23 assertEq(testLenientAndStrict('var o = obj(); Array.prototype.sort.call(o)',
24 raisesException(TypeError),
25 raisesException(TypeError)),
28 // The behavior of sort is implementation-defined if the object being
29 // sorted is sparse, so I'm not sure how to test its behavior on
30 // non-configurable properties.
32 reportCompare(true, true);