Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
3 /*
4 * Any copyright is dedicated to the Public Domain.
5 * http://creativecommons.org/licenses/publicdomain/
6 */
8 function arr() {
9 return Object.defineProperty([20, 10, 30], 0, {writable: false});
10 }
12 assertEq(testLenientAndStrict('var a = arr(); a.sort()',
13 raisesException(TypeError),
14 raisesException(TypeError)),
15 true);
17 function obj() {
18 var o = {0: 20, 1: 10, 2: 30, length: 3};
19 Object.defineProperty(o, 0, {writable: false});
20 return o;
21 }
23 assertEq(testLenientAndStrict('var o = obj(); Array.prototype.sort.call(o)',
24 raisesException(TypeError),
25 raisesException(TypeError)),
26 true);
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);