summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Object/prototype/__proto__/set-abrupt.js
blob: 02a617978af0b070ae2f6a06a24fd19d42fa4af9 (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
// 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-object.prototype.__proto__
es6id: B.2.2.1
description: Abrupt completion from [[SetPrototypeOf]]
info: |
    [...]
    4. Let status be ? O.[[SetPrototypeOf]](proto).
features: [Proxy, __proto__]
---*/

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

assert.throws(Test262Error, function() {
  subject.__proto__ = {};
});

assert.sameValue(Object.getPrototypeOf(subject), Object.prototype);

reportCompare(0, 0);