2014-07-22 01:09:02 +02:00
|
|
|
// Copyright (c) 2012 Ecma International. All rights reserved.
|
2015-07-17 17:42:45 +02:00
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
2014-07-22 01:09:02 +02:00
|
|
|
|
|
|
|
/*---
|
2014-07-25 00:41:42 +02:00
|
|
|
es5id: 15.2.3.6-4-531-17
|
2014-07-22 01:09:02 +02:00
|
|
|
description: >
|
|
|
|
ES5 Attributes - Updating an indexed accessor property 'P' using
|
|
|
|
simple assignment is successful, 'O' is the global object (8.12.5
|
|
|
|
step 5.b)
|
|
|
|
---*/
|
|
|
|
|
2016-04-22 19:07:00 +02:00
|
|
|
var obj = this;
|
2015-08-13 17:41:47 +02:00
|
|
|
|
2014-07-22 01:09:02 +02:00
|
|
|
obj.verifySetFunc = "data";
|
|
|
|
var setFunc = function (value) {
|
|
|
|
obj.verifySetFunc = value;
|
|
|
|
};
|
|
|
|
var getFunc = function () {
|
|
|
|
return obj.verifySetFunc;
|
|
|
|
};
|
|
|
|
|
|
|
|
Object.defineProperty(obj, "0", {
|
|
|
|
get: getFunc,
|
|
|
|
set: setFunc,
|
|
|
|
enumerable: true,
|
|
|
|
configurable: true
|
|
|
|
});
|
|
|
|
|
|
|
|
obj[0] = "overrideData";
|
|
|
|
var propertyDefineCorrect = obj.hasOwnProperty("0");
|
|
|
|
var desc = Object.getOwnPropertyDescriptor(obj, "0");
|
|
|
|
|
2015-08-13 17:41:47 +02:00
|
|
|
assert(propertyDefineCorrect, 'propertyDefineCorrect !== true');
|
|
|
|
assert.sameValue(desc.set, setFunc, 'desc.set');
|
|
|
|
assert.sameValue(obj[0], "overrideData", 'obj[0]');
|