| 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: 11.13.1-2-s |
| 6 |
description: > |
| 7 |
Strict Mode - TypeError is thrown if The LeftHandSide is a |
| 8 |
reference to an accessor property with the attribute value |
| 9 |
{[[Set]]:undefined} under strict mode |
| 10 |
flags: [onlyStrict] |
| 11 |
---*/ |
| 12 |
|
| 13 |
var obj = {}; |
| 14 |
Object.defineProperty(obj, "prop", { |
| 15 |
get: function () { |
| 16 |
return 11; |
| 17 |
}, |
| 18 |
set: undefined, |
| 19 |
enumerable: true, |
| 20 |
configurable: true |
| 21 |
}); |
| 22 |
assert.throws(TypeError, function() { |
| 23 |
obj.prop = 20; |
| 24 |
}); |
| 25 |
assert.sameValue(obj.prop, 11, 'obj.prop'); |