Debian Codegraph @

js/src/tests/test262/built-ins/Function/property-order.js

raw
1 // Copyright (C) 2020 ExE Boss. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 esid: sec-createbuiltinfunction
5 description: Function constructor property order
6 info: |
7 Set order: "length", "name", ...
8 ---*/
9
10 var propNames = Object.getOwnPropertyNames(Function);
11 var lengthIndex = propNames.indexOf("length");
12 var nameIndex = propNames.indexOf("name");
13
14 assert(lengthIndex >= 0 && nameIndex === lengthIndex + 1,
15 "The `length` property comes before the `name` property on built-in functions");
16
17 reportCompare(0, 0);