Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/defineProperty/15.2.3.6-4-583.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-583
6 description: >
7 ES5 Attributes - [[Get]] field of inherited property of
8 [[Prototype]] internal property is correct (Error Instance)
9 ---*/
10
11 var data = "data";
12
13 Object.defineProperty(Error.prototype, "prop", {
14 get: function() {
15 return data;
16 },
17 set: function(value) {
18 data = value;
19 },
20 enumerable: true,
21 configurable: true
22 });
23 var errObj = new Error();
24
25 assert.sameValue(errObj.hasOwnProperty("prop"), false, 'errObj.hasOwnProperty("prop")');
26 assert.sameValue(errObj.prop, "data", 'errObj.prop');