2017-06-27 23:12:06 +02:00
|
|
|
// Copyright 2015 Microsoft Corporation. All rights reserved.
|
|
|
|
// This code is governed by the license found in the LICENSE file.
|
|
|
|
|
|
|
|
/*---
|
|
|
|
description: mapFn throws an exception
|
|
|
|
esid: sec-array.from
|
|
|
|
es6id: 22.1.2.1
|
|
|
|
---*/
|
|
|
|
|
2018-02-15 23:40:02 +01:00
|
|
|
var array = [2, 4, 8, 16, 32, 64, 128];
|
|
|
|
|
2021-08-10 23:51:54 +02:00
|
|
|
function mapFnThrows(value, index, obj) {
|
2018-02-15 23:40:02 +01:00
|
|
|
throw new Test262Error();
|
2017-06-27 23:12:06 +02:00
|
|
|
}
|
|
|
|
|
2018-02-15 23:40:02 +01:00
|
|
|
assert.throws(Test262Error, function() {
|
2021-08-10 23:51:54 +02:00
|
|
|
Array.from(array, mapFnThrows);
|
|
|
|
}, 'Array.from(array, mapFnThrows) throws a Test262Error exception');
|