Backed out 3 changesets (bug 1892041) for causing failures on async-module-does-not...
[gecko.git] / js / src / tests / test262 / built-ins / Object / defineProperty / 15.2.3.6-4-613.js
blob162333109fc1bb4d5de980376944cdf9693cd4ce
1 // Copyright (c) 2012 Ecma International.  All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 es5id: 15.2.3.6-4-613
6 description: ES5 Attributes - all attributes in Object.lastIndexOf are correct
7 ---*/
9 var desc = Object.getOwnPropertyDescriptor(Array.prototype, "lastIndexOf");
11 var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true);
13 var temp = Array.prototype.lastIndexOf;
15 Array.prototype.lastIndexOf = "2010";
17 var isWritable = (Array.prototype.lastIndexOf === "2010");
19 var isEnumerable = false;
21 for (var prop in Array.prototype) {
22   if (prop === "lastIndexOf") {
23     isEnumerable = true;
24   }
27 delete Array.prototype.lastIndexOf;
29 var isConfigurable = !Array.prototype.hasOwnProperty("lastIndexOf");
31 assert(propertyAreCorrect, 'propertyAreCorrect !== true');
32 assert(isWritable, 'isWritable !== true');
33 assert.sameValue(isEnumerable, false, 'isEnumerable');
34 assert(isConfigurable, 'isConfigurable !== true');
36 reportCompare(0, 0);