summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Object/setPrototypeOf/o-not-obj-coercible.js
blob: 242fbed95a8a44748f8f42c8354dd876d70d848e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 19.1.2.18
description: Object.setPrototypeOf invoked with a non-object-coercible value
info: |
    1. Let O be RequireObjectCoercible(O).
    2. ReturnIfAbrupt(O).
---*/

assert.throws(TypeError, function() {
  Object.setPrototypeOf(null);
});

assert.throws(TypeError, function() {
  Object.setPrototypeOf(undefined);
});

reportCompare(0, 0);