2014-10-23 19:58:31 +02:00
|
|
|
// Copyright 2014 Cubane Canada, Inc. All rights reserved.
|
|
|
|
// See LICENSE for details.
|
|
|
|
|
|
|
|
/*---
|
|
|
|
info: >
|
|
|
|
Promise.race must throw TypeError per
|
|
|
|
CreatePromiseCapabilityRecord step 8 when
|
|
|
|
promiseCapabliity.[[Resolve]] is not callable
|
2015-02-10 22:01:39 +01:00
|
|
|
es6id: S25.4.4.3_A3.1_T2
|
2014-10-23 19:58:31 +02:00
|
|
|
author: Sam Mikes
|
|
|
|
description: Promise.race throws TypeError, even on empty array, when 'this' does not conform to Promise constructor
|
|
|
|
---*/
|
|
|
|
|
|
|
|
function BadPromiseConstructor(f) { f(undefined, undefined); }
|
|
|
|
|
2015-06-26 20:56:43 +02:00
|
|
|
assert.throws(TypeError, function() {
|
|
|
|
Promise.race.call(BadPromiseConstructor, []);
|
|
|
|
});
|