1 // Copyright (c) 2012 Ecma International. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
6 description: ES5 Attributes - all attributes in Object.lastIndexOf are correct
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") {
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');