| 1 |
// Copyright (C) 2017 Claude Pache. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
/*--- |
| 4 |
esid: sec-invariants-of-the-essential-internal-methods |
| 5 |
es6id: 6.1.7.3 |
| 6 |
description: > |
| 7 |
A property made non-writable, non-configurable must not be reported as writable |
| 8 |
("$1" property of the RegExp built-in) |
| 9 |
info: | |
| 10 |
[[GetOwnProperty]] (P) |
| 11 |
[...] |
| 12 |
- If the [[Writable]] attribute may change from false to true, |
| 13 |
then the [[Configurable]] attribute must be true.. |
| 14 |
[...] |
| 15 |
(This invariant was violated for the specific property under test by at least |
| 16 |
one implementation as of January 2017.) |
| 17 |
---*/ |
| 18 |
|
| 19 |
if (Reflect.defineProperty(RegExp, '$1', { |
| 20 |
writable: false, |
| 21 |
configurable: false |
| 22 |
})) { |
| 23 |
var desc = Reflect.getOwnPropertyDescriptor(RegExp, '$1'); |
| 24 |
assert.sameValue(desc.writable, false); |
| 25 |
} |