mapfn-throws-exception.js (500B)
1 // Copyright 2015 Microsoft Corporation. All rights reserved. 2 // This code is governed by the license found in the LICENSE file. 3 4 /*--- 5 description: mapFn throws an exception 6 esid: sec-array.from 7 es6id: 22.1.2.1 8 ---*/ 9 10 var array = [2, 4, 8, 16, 32, 64, 128]; 11 12 function mapFnThrows(value, index, obj) { 13 throw new Test262Error(); 14 } 15 16 assert.throws(Test262Error, function() { 17 Array.from(array, mapFnThrows); 18 }, 'Array.from(array, mapFnThrows) throws a Test262Error exception'); 19 20 reportCompare(0, 0);