| 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: 8.14.4-8-b_2 |
| 6 |
description: Non-writable property on a prototype written to in strict mode. |
| 7 |
flags: [onlyStrict] |
| 8 |
---*/ |
| 9 |
|
| 10 |
function foo() {}; |
| 11 |
Object.defineProperty(foo.prototype, "bar", {value: "unwritable"}); |
| 12 |
|
| 13 |
var o = new foo(); |
| 14 |
assert.throws(TypeError, function() { |
| 15 |
o.bar = "overridden"; |
| 16 |
}); |
| 17 |
assert.sameValue(o.bar, "unwritable", 'o.bar'); |