Debian Codegraph @

js/src/tests/test262/built-ins/Object/defineProperties/property-description-must-be-an-object-not-undefined.js

raw
1 // Copyright (C) 2020 Rick Waldron. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 esid: sec-objectdefineproperties
5 description: >
6 Property description must be an object (undefined)
7 info: |
8 ObjectDefineProperties ( O, Properties )
9
10 ...
11 For each element nextKey of keys, do
12 Let propDesc be ? props.[[GetOwnProperty]](nextKey).
13 If propDesc is not undefined and propDesc.[[Enumerable]] is true, then
14 Let descObj be ? Get(props, nextKey).
15 Let desc be ? ToPropertyDescriptor(descObj).
16 ...
17
18 ToPropertyDescriptor ( Obj )
19
20 If Type(Obj) is not Object, throw a TypeError exception.
21 ...
22 ---*/
23
24 assert.throws(TypeError, () => {
25 Object.defineProperties({}, {
26 a: undefined
27 });
28 });
29
30 reportCompare(0, 0);