Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/defineProperty/15.2.3.6-4-26.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-26
6 description: >
7 Object.defineProperty - 'name' is own accessor property (8.12.9
8 step 1)
9 ---*/
10
11 var obj = {};
12
13 Object.defineProperty(obj, "property", {
14 get: function() {
15 return 11;
16 },
17 configurable: false
18 });
19 assert.throws(TypeError, function() {
20 Object.defineProperty(obj, "property", {
21 get: function() {
22 return 12;
23 },
24 configurable: true
25 });
26 });
27 assert.sameValue(obj.property, 11, 'obj.property');