| 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.2-32-s |
| 6 |
description: > |
| 7 |
Strict Mode - TypeError is thrown if The LeftHandSide of a |
| 8 |
Compound Assignment operator(^=) is a reference to a data property |
| 9 |
with the attribute value {[[Writable]]:false} |
| 10 |
flags: [onlyStrict] |
| 11 |
---*/ |
| 12 |
|
| 13 |
var obj = {}; |
| 14 |
Object.defineProperty(obj, "prop", { |
| 15 |
value: 10, |
| 16 |
writable: false, |
| 17 |
enumerable: true, |
| 18 |
configurable: true |
| 19 |
}); |
| 20 |
assert.throws(TypeError, function() { |
| 21 |
obj.prop ^= 20; |
| 22 |
}); |
| 23 |
assert.sameValue(obj.prop, 10, 'obj.prop'); |