| 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.6-4-310 |
| 6 |
description: > |
| 7 |
Object.defineProperty - 'O' is an Arguments object, 'name' is an |
| 8 |
index named accessor property of 'O' but not defined in |
| 9 |
[[ParameterMap]] of 'O', test TypeError is thrown when updating |
| 10 |
the [[Set]] attribute value of 'name' which is not configurable |
| 11 |
(10.6 [[DefineOwnProperty]] step 4) |
| 12 |
includes: [propertyHelper.js] |
| 13 |
---*/ |
| 14 |
|
| 15 |
(function() { |
| 16 |
function getFunc() { |
| 17 |
return 0; |
| 18 |
} |
| 19 |
Object.defineProperty(arguments, "0", { |
| 20 |
get: getFunc, |
| 21 |
set: undefined, |
| 22 |
enumerable: false, |
| 23 |
configurable: false |
| 24 |
}); |
| 25 |
|
| 26 |
function setFunc(value) { |
| 27 |
this.setVerifyHelpProp = value; |
| 28 |
} |
| 29 |
try { |
| 30 |
Object.defineProperty(arguments, "0", { |
| 31 |
set: setFunc |
| 32 |
}); |
| 33 |
$ERROR("Expected an exception."); |
| 34 |
} catch (e) { |
| 35 |
verifyEqualTo(arguments, "0", getFunc()); |
| 36 |
|
| 37 |
verifyNotEnumerable(arguments, "0"); |
| 38 |
|
| 39 |
verifyNotConfigurable(arguments, "0"); |
| 40 |
|
| 41 |
if (!(e instanceof TypeError)) { |
| 42 |
$ERROR("Expected TypeError, got " + e); |
| 43 |
} |
| 44 |
|
| 45 |
} |
| 46 |
}()); |