ctx-non-object.js (884B)
1 // Copyright (C) 2019 Leo Balter. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 description: > 6 Promise.allSettled invoked on a non-object value 7 esid: sec-promise.allsettled 8 info: | 9 1. Let C be the this value. 10 2. If Type(C) is not Object, throw a TypeError exception. 11 features: [Promise.allSettled, Symbol] 12 ---*/ 13 14 assert.throws(TypeError, function() { 15 Promise.allSettled.call(undefined, []); 16 }); 17 18 assert.throws(TypeError, function() { 19 Promise.allSettled.call(null, []); 20 }); 21 22 assert.throws(TypeError, function() { 23 Promise.allSettled.call(86, []); 24 }); 25 26 assert.throws(TypeError, function() { 27 Promise.allSettled.call('string', []); 28 }); 29 30 assert.throws(TypeError, function() { 31 Promise.allSettled.call(true, []); 32 }); 33 34 assert.throws(TypeError, function() { 35 Promise.allSettled.call(Symbol(), []); 36 }); 37 38 reportCompare(0, 0);