Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/defineProperty/15.2.3.6-4-410.js

raw
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-410
6 description: >
7 ES5 Attributes - Failed to add a property to an object when the
8 object's prototype has a property with the same name and
9 [[Writable]] set to false (JSON)
10 includes: [propertyHelper.js]
11 ---*/
12
13 Object.defineProperty(Object.prototype, "prop", {
14 value: 1001,
15 writable: false,
16 enumerable: false,
17 configurable: true
18 });
19
20 assert(!JSON.hasOwnProperty("prop"));
21 verifyNotWritable(JSON, "prop", "noCheckOwnProp");
22 assert.sameValue(JSON.prop, 1001);