|
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 */ |
|
7 |
|
8 //----------------------------------------------------------------------------- |
|
9 var BUGNUMBER = 518663; |
|
10 var summary = 'Object.getOwnPropertyNames: function objects'; |
|
11 |
|
12 print(BUGNUMBER + ": " + summary); |
|
13 |
|
14 /************** |
|
15 * BEGIN TEST * |
|
16 **************/ |
|
17 |
|
18 function two(a, b) { } |
|
19 |
|
20 assertEq(Object.getOwnPropertyNames(two).indexOf("length") >= 0, true); |
|
21 |
|
22 var bound0 = Function.prototype.bind |
|
23 ? two.bind("this") |
|
24 : function two(a, b) { }; |
|
25 |
|
26 assertEq(Object.getOwnPropertyNames(bound0).indexOf("length") >= 0, true); |
|
27 assertEq(bound0.length, 2); |
|
28 |
|
29 var bound1 = Function.prototype.bind |
|
30 ? two.bind("this", 1) |
|
31 : function one(a) { }; |
|
32 |
|
33 assertEq(Object.getOwnPropertyNames(bound1).indexOf("length") >= 0, true); |
|
34 assertEq(bound1.length, 1); |
|
35 |
|
36 var bound2 = Function.prototype.bind |
|
37 ? two.bind("this", 1, 2) |
|
38 : function zero() { }; |
|
39 |
|
40 assertEq(Object.getOwnPropertyNames(bound2).indexOf("length") >= 0, true); |
|
41 assertEq(bound2.length, 0); |
|
42 |
|
43 var bound3 = Function.prototype.bind |
|
44 ? two.bind("this", 1, 2, 3) |
|
45 : function zero() { }; |
|
46 |
|
47 assertEq(Object.getOwnPropertyNames(bound3).indexOf("length") >= 0, true); |
|
48 assertEq(bound3.length, 0); |
|
49 |
|
50 |
|
51 /******************************************************************************/ |
|
52 |
|
53 reportCompare(true, true); |
|
54 |
|
55 print("All tests passed!"); |