throwStat.js revision 550:917b16e509bd
1160814Ssimon/* 2160814Ssimon * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. 3160814Ssimon * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4160814Ssimon * 5160814Ssimon * This code is free software; you can redistribute it and/or modify it 6160814Ssimon * under the terms of the GNU General Public License version 2 only, as 7160814Ssimon * published by the Free Software Foundation. 8160814Ssimon * 9160814Ssimon * This code is distributed in the hope that it will be useful, but WITHOUT 10160814Ssimon * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11160814Ssimon * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12160814Ssimon * version 2 for more details (a copy is included in the LICENSE file that 13160814Ssimon * accompanied this code). 14160814Ssimon * 15160814Ssimon * You should have received a copy of the GNU General Public License version 16160814Ssimon * 2 along with this work; if not, write to the Free Software Foundation, 17160814Ssimon * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18160814Ssimon * 19160814Ssimon * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20160814Ssimon * or visit www.oracle.com if you need additional information or have any 21160814Ssimon * questions. 22160814Ssimon */ 23160814Ssimon 24160814Ssimon/** 25160814Ssimon * Tests for throw statement. 26160814Ssimon * 27160814Ssimon * @test 28160814Ssimon * @run 29160814Ssimon */ 30160814Ssimon 31160814Ssimonload(__DIR__ + "util.js"); 32160814Ssimon 33160814SsimonprintParse("throw err"); 34160814SsimonprintParse("throw 'wrong'"); 35160814SsimonprintParse("throw new TypeError"); 36160814SsimonprintParse("throw new TypeError('not an array')"); 37160814SsimonprintParse("throw { msg: 'wrong!' }"); 38160814Ssimon