revocation-function-property-order.js (637B)
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: Proxy revocation function property order 6 info: | 7 Set order: "length", "name" 8 ---*/ 9 10 var revocationFunction = Proxy.revocable({}, {}).revoke; 11 12 var propNames = Object.getOwnPropertyNames(revocationFunction); 13 var lengthIndex = propNames.indexOf("length"); 14 var nameIndex = propNames.indexOf("name"); 15 16 assert(lengthIndex >= 0 && nameIndex === lengthIndex + 1, 17 "The `length` property comes before the `name` property on built-in functions"); 18 19 reportCompare(0, 0);