From ade44b415ec4743526cca848ebab271ecee382cd Mon Sep 17 00:00:00 2001 From: Alex St Laurent Date: Wed, 3 Apr 2019 21:15:00 -0400 Subject: [PATCH] wip --- .../Promise/allSettled/ctx-ctor-throws.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 test/built-ins/Promise/allSettled/ctx-ctor-throws.js diff --git a/test/built-ins/Promise/allSettled/ctx-ctor-throws.js b/test/built-ins/Promise/allSettled/ctx-ctor-throws.js new file mode 100644 index 00000000000..e9ecffc4410 --- /dev/null +++ b/test/built-ins/Promise/allSettled/ctx-ctor-throws.js @@ -0,0 +1,19 @@ +// Copyright (C) 2019 Alex St Laurent. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + `Promise.allSettled` invoked on a constructor value that throws an error +esid: #sec-promise.allSettled +info: | + Analogous to test/built-ins/Promise/all/ctx-ctor-throws.js +---*/ + +const CustomPromise = function() { + throw new Test262Error(); +}; + +assert.throws(Test262Error, function() { + // Promise.allSettled.call(CustomPromise); // fails on promise.allsettled shim + Promise.allSettled.call(CustomPromise, []); // shim tries to iterate before running C +});