michael@0: /* michael@0: * Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/licenses/publicdomain/ michael@0: * Contributor: michael@0: * Jeff Walden michael@0: */ michael@0: michael@0: //----------------------------------------------------------------------------- michael@0: var BUGNUMBER = 518663; michael@0: var summary = 'Object.getOwnPropertyNames: function objects'; michael@0: michael@0: print(BUGNUMBER + ": " + summary); michael@0: michael@0: /************** michael@0: * BEGIN TEST * michael@0: **************/ michael@0: michael@0: function two(a, b) { } michael@0: michael@0: assertEq(Object.getOwnPropertyNames(two).indexOf("length") >= 0, true); michael@0: michael@0: var bound0 = Function.prototype.bind michael@0: ? two.bind("this") michael@0: : function two(a, b) { }; michael@0: michael@0: assertEq(Object.getOwnPropertyNames(bound0).indexOf("length") >= 0, true); michael@0: assertEq(bound0.length, 2); michael@0: michael@0: var bound1 = Function.prototype.bind michael@0: ? two.bind("this", 1) michael@0: : function one(a) { }; michael@0: michael@0: assertEq(Object.getOwnPropertyNames(bound1).indexOf("length") >= 0, true); michael@0: assertEq(bound1.length, 1); michael@0: michael@0: var bound2 = Function.prototype.bind michael@0: ? two.bind("this", 1, 2) michael@0: : function zero() { }; michael@0: michael@0: assertEq(Object.getOwnPropertyNames(bound2).indexOf("length") >= 0, true); michael@0: assertEq(bound2.length, 0); michael@0: michael@0: var bound3 = Function.prototype.bind michael@0: ? two.bind("this", 1, 2, 3) michael@0: : function zero() { }; michael@0: michael@0: assertEq(Object.getOwnPropertyNames(bound3).indexOf("length") >= 0, true); michael@0: assertEq(bound3.length, 0); michael@0: michael@0: michael@0: /******************************************************************************/ michael@0: michael@0: reportCompare(true, true); michael@0: michael@0: print("All tests passed!");