Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/defineProperty/15.2.3.6-4-596.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-596
6 description: >
7 ES5 Attributes - Fail to update value of property into of
8 [[Proptotype]] internal property (Function.prototype.bind)
9 includes: [propertyHelper.js]
10 ---*/
11
12 var foo = function() {};
13 var data = "data";
14
15 Object.defineProperty(Function.prototype, "prop", {
16 get: function() {
17 return data;
18 },
19 enumerable: false,
20 configurable: true
21 });
22
23 var obj = foo.bind({});
24
25 assert(!obj.hasOwnProperty("prop"));
26 verifyNotWritable(obj, "prop", "nocheck");
27 assert.sameValue(obj.prop, "data");;