summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Object/prototype/__defineGetter__/define-abrupt.js
blob: b47387ea73ad8bf14edf3cd2ad2951e35126aa41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-additional-properties-of-the-object.prototype-object
description: Behavior when [[DefineOwnProperty]] returns an abrupt completion
info: |
    [...]
    5. Perform ? DefinePropertyOrThrow(O, key, desc).
features: [Proxy, __getter__]
---*/

var noop = function() {};
var thrower = function() {
  throw new Test262Error();
};
var subject = new Proxy({}, { defineProperty: thrower });

assert.throws(Test262Error, function() {
  subject.__defineGetter__('attr', noop);
});

reportCompare(0, 0);