summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Reflect/getOwnPropertyDescriptor/return-abrupt-from-property-key.js
blob: 61a47cc03680cfbeac9201d0c0fb556fa2bfaa12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 26.1.7
description: >
  Return abrupt from ToPropertyKey(propertyKey)
info: |
  26.1.7 Reflect.getOwnPropertyDescriptor ( target, propertyKey )

  ...
  2. Let key be ToPropertyKey(propertyKey).
  3. ReturnIfAbrupt(key).
  ...
features: [Reflect]
---*/

var p = {
  toString: function() {
    throw new Test262Error();
  }
};

assert.throws(Test262Error, function() {
  Reflect.getOwnPropertyDescriptor({}, p);
});

reportCompare(0, 0);