test/script/basic/JDK-8019226.js

Thu, 27 Jun 2013 13:24:50 +0530

author
sundar
date
Thu, 27 Jun 2013 13:24:50 +0530
changeset 383
f9c855b828fe
child 386
218c2833c344
permissions
-rw-r--r--

8019226: line number not generated for first statement if it is on the same function declaration line
Reviewed-by: jlaskey, hannesw

sundar@383 1 /*
sundar@383 2 * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
sundar@383 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
sundar@383 4 *
sundar@383 5 * This code is free software; you can redistribute it and/or modify it
sundar@383 6 * under the terms of the GNU General Public License version 2 only, as
sundar@383 7 * published by the Free Software Foundation.
sundar@383 8 *
sundar@383 9 * This code is distributed in the hope that it will be useful, but WITHOUT
sundar@383 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
sundar@383 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
sundar@383 12 * version 2 for more details (a copy is included in the LICENSE file that
sundar@383 13 * accompanied this code).
sundar@383 14 *
sundar@383 15 * You should have received a copy of the GNU General Public License version
sundar@383 16 * 2 along with this work; if not, write to the Free Software Foundation,
sundar@383 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
sundar@383 18 *
sundar@383 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
sundar@383 20 * or visit www.oracle.com if you need additional information or have any
sundar@383 21 * questions.
sundar@383 22 */
sundar@383 23
sundar@383 24 /**
sundar@383 25 * JDK-8019226: line number not generated for first statement if it is on the same function declaration line
sundar@383 26 *
sundar@383 27 * @test
sundar@383 28 * @run
sundar@383 29 */
sundar@383 30
sundar@383 31 function func1() { func2() }
sundar@383 32
sundar@383 33 function func2() { throw new Error() }
sundar@383 34
sundar@383 35 try {
sundar@383 36 func1()
sundar@383 37 } catch (e) {
sundar@383 38 print(e.stack.replace(/\\/g, '/'))
sundar@383 39 }

mercurial