Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/defineProperties/15.2.3.7-3-8.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.7-3-8
6 description: >
7 Object.defineProperties - no additional property is defined in 'O'
8 when 'Properties' doesn't contain enumerable own property
9 ---*/
10
11 var obj = {};
12
13 var props = {};
14
15 Object.defineProperty(props, "prop1", {
16 value: {},
17 enumerable: false
18 });
19
20 Object.defineProperty(props, "prop2", {
21 get: function() {
22 return {};
23 },
24 enumerable: true
25 });
26
27 Object.defineProperties(obj, props);
28
29 assert.sameValue(obj.hasOwnProperty("prop1"), false, 'obj.hasOwnProperty("prop1")');
30 assert(obj.hasOwnProperty("prop2"), 'obj.hasOwnProperty("prop2") !== true');