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 /*
2 * Any copyright is dedicated to the Public Domain.
3 * http://creativecommons.org/licenses/publicdomain/
4 * Contributor:
5 * Jeff Walden <jwalden+code@mit.edu>
6 */
8 //-----------------------------------------------------------------------------
9 var BUGNUMBER = 518663;
10 var summary = 'Object.getOwnPropertyNames: function objects';
12 print(BUGNUMBER + ": " + summary);
14 /**************
15 * BEGIN TEST *
16 **************/
18 function two(a, b) { }
20 assertEq(Object.getOwnPropertyNames(two).indexOf("length") >= 0, true);
22 var bound0 = Function.prototype.bind
23 ? two.bind("this")
24 : function two(a, b) { };
26 assertEq(Object.getOwnPropertyNames(bound0).indexOf("length") >= 0, true);
27 assertEq(bound0.length, 2);
29 var bound1 = Function.prototype.bind
30 ? two.bind("this", 1)
31 : function one(a) { };
33 assertEq(Object.getOwnPropertyNames(bound1).indexOf("length") >= 0, true);
34 assertEq(bound1.length, 1);
36 var bound2 = Function.prototype.bind
37 ? two.bind("this", 1, 2)
38 : function zero() { };
40 assertEq(Object.getOwnPropertyNames(bound2).indexOf("length") >= 0, true);
41 assertEq(bound2.length, 0);
43 var bound3 = Function.prototype.bind
44 ? two.bind("this", 1, 2, 3)
45 : function zero() { };
47 assertEq(Object.getOwnPropertyNames(bound3).indexOf("length") >= 0, true);
48 assertEq(bound3.length, 0);
51 /******************************************************************************/
53 reportCompare(true, true);
55 print("All tests passed!");