1// Copyright JS Foundation and other contributors, http://js.foundation 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15try { 16 Object (...1, {}); 17 assert (false); 18} catch (ex) { 19 // expected error: "TypeError: object is not iterable" 20 assert (ex instanceof TypeError); 21} 22 23try { 24 Object (...1, {}, {}); 25 assert (false); 26} catch (ex) { 27 // expected error: "TypeError: object is not iterable" 28 assert (ex instanceof TypeError); 29} 30 31try { 32 Object (...1, { "prop": 2 }, 1, { "prop": 2 }); 33 assert (false); 34} catch (ex) { 35 // expected error: "TypeError: object is not iterable" 36 assert (ex instanceof TypeError); 37} 38 39try { 40 Object (...1, "str"); 41 assert (false); 42} catch (ex) { 43 // expected error: "TypeError: object is not iterable" 44 assert (ex instanceof TypeError); 45} 46 47try { 48 Object (...[], { "prop": 2 }, 1, { "prop": 2 }, ...1); 49 assert (false); 50} catch (ex) { 51 // expected error: "TypeError: object is not iterable" 52 assert (ex instanceof TypeError); 53} 54