summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Function/prototype/bind/instance-length-prop-desc.js
blob: 80f75b3b6469893f0f28c7a29bcf953b6daba969 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright (c) 2012 Ecma International.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-function.prototype.bind
description: >
  "length" property of a bound function has correct descriptor.
info: |
  Function.prototype.bind ( thisArg, ...args )

  [...]
  8. Perform ! SetFunctionLength(F, L).
  [...]

  SetFunctionLength ( F, length )

  [...]
  4. Return ! DefinePropertyOrThrow(F, "length", PropertyDescriptor { [[Value]]:
  length, [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }).
includes: [propertyHelper.js]
---*/

function fn() {}

verifyProperty(fn.bind(null), "length", {
  value: 0,
  writable: false,
  enumerable: false,
  configurable: true,
});

reportCompare(0, 0);