blob: 439cb34e92b648aaddffef11c0a21933b6509897 [file] [log] [blame]
keith_miller@apple.combcc77f22016-07-15 06:03:25 +00001// Copyright (C) 2015 the V8 project authors. All rights reserved.
2// This code is governed by the BSD license found in the LICENSE file.
3
4/*---
5description: >
6 `Promise.resolve` invoked on a non-object value
7es6id: 25.4.4.5
8info: >
9 1. Let C be the this value.
10 2. If Type(C) is not Object, throw a TypeError exception.
11features: [Symbol]
12---*/
13
14assert.throws(TypeError, function() {
15 Promise.resolve.call(undefined, []);
16});
17
18assert.throws(TypeError, function() {
19 Promise.resolve.call(null, []);
20});
21
22assert.throws(TypeError, function() {
23 Promise.resolve.call(86, []);
24});
25
26assert.throws(TypeError, function() {
27 Promise.resolve.call('string', []);
28});
29
30assert.throws(TypeError, function() {
31 Promise.resolve.call(true, []);
32});
33
34assert.throws(TypeError, function() {
35 Promise.resolve.call(Symbol(), []);
36});