| 1 |
// Copyright (c) 2012 Ecma International. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
|
| 4 |
/*--- |
| 5 |
es5id: 15.2.3.7-6-a-313 |
| 6 |
description: > |
| 7 |
Object.defineProperties - 'O' is an Arguments object, 'P' is |
| 8 |
generic own accessor property of 'O', test TypeError is thrown |
| 9 |
when updating the [[Configurable]] attribute value of 'P' which is |
| 10 |
not configurable (10.6 [[DefineOwnProperty]] step 4) |
| 11 |
includes: [propertyHelper.js] |
| 12 |
---*/ |
| 13 |
|
| 14 |
var arg = (function() { |
| 15 |
return arguments; |
| 16 |
}(1, 2, 3)); |
| 17 |
|
| 18 |
function setFun(value) { |
| 19 |
arg.genericPropertyString = value; |
| 20 |
} |
| 21 |
Object.defineProperty(arg, "genericProperty", { |
| 22 |
set: setFun, |
| 23 |
configurable: false |
| 24 |
}); |
| 25 |
|
| 26 |
try { |
| 27 |
Object.defineProperties(arg, { |
| 28 |
"genericProperty": { |
| 29 |
configurable: true |
| 30 |
} |
| 31 |
}); |
| 32 |
|
| 33 |
$ERROR("Expected an exception."); |
| 34 |
} catch (e) { |
| 35 |
verifyWritable(arg, "genericProperty", "genericPropertyString"); |
| 36 |
|
| 37 |
verifyNotEnumerable(arg, "genericProperty"); |
| 38 |
|
| 39 |
verifyNotConfigurable(arg, "genericProperty"); |
| 40 |
|
| 41 |
if (!(e instanceof TypeError)) { |
| 42 |
$ERROR("Expected TypeError, got " + e); |
| 43 |
} |
| 44 |
|
| 45 |
} |