Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/defineProperty/15.2.3.6-4-408.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-408
6 description: >
7 ES5 Attributes - Successfully add a property to an object when the
8 object's prototype has a property with same name and [[Writable]]
9 attribute is set to true (Date instance)
10 ---*/
11
12 Object.defineProperty(Date.prototype, "prop", {
13 value: 1001,
14 writable: true,
15 enumerable: true,
16 configurable: true
17 });
18 var dateObj = new Date();
19 dateObj.prop = 1002;
20
21 assert(dateObj.hasOwnProperty("prop"), 'dateObj.hasOwnProperty("prop") !== true');
22 assert.sameValue(dateObj.prop, 1002, 'dateObj.prop');