Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Reflect/getOwnPropertyDescriptor/undefined-own-property.js

raw
1 // Copyright (C) 2015 Leonardo Balter. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 es6id: 26.1.7
5 description: >
6 Return undefined for an non existing own property.
7 info: |
8 26.1.7 Reflect.getOwnPropertyDescriptor ( target, propertyKey )
9
10 ...
11 4. Let desc be target.[[GetOwnProperty]](key).
12 5. ReturnIfAbrupt(desc).
13 6. Return FromPropertyDescriptor(desc).
14
15 6.2.4.4 FromPropertyDescriptor ( Desc )
16
17 1. If Desc is undefined, return undefined.
18 ---*/
19
20 var o = Object.create({
21 p: 1
22 });
23
24 var result = Reflect.getOwnPropertyDescriptor(o, 'p');
25 assert.sameValue(result, undefined);