summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Reflect/getOwnPropertyDescriptor/return-abrupt-from-result.js
blob: a5af7f65c2b0254c6516b3d0d6466a25a99e123e (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
28
// 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 result from getting the property descriptor.
info: |
  26.1.7 Reflect.getOwnPropertyDescriptor ( target, propertyKey )

  ...
  4. Let desc be target.[[GetOwnProperty]](key).
  5. ReturnIfAbrupt(desc).
  ...
features: [Proxy, Reflect]
---*/

var o1 = {};
var p = new Proxy(o1, {
  getOwnPropertyDescriptor: function() {
    throw new Test262Error();
  }
});

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

reportCompare(0, 0);