JDK-8012164.js revision 313:b4e6cc05ce09
1241221Sglebius/*
2241221Sglebius * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
3241221Sglebius * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4241221Sglebius *
5241221Sglebius * This code is free software; you can redistribute it and/or modify it
6241221Sglebius * under the terms of the GNU General Public License version 2 only, as
7241221Sglebius * published by the Free Software Foundation.
8241221Sglebius *
9241221Sglebius * This code is distributed in the hope that it will be useful, but WITHOUT
10241221Sglebius * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11241221Sglebius * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12241221Sglebius * version 2 for more details (a copy is included in the LICENSE file that
13241221Sglebius * accompanied this code).
14241221Sglebius *
15241221Sglebius * You should have received a copy of the GNU General Public License version
16241221Sglebius * 2 along with this work; if not, write to the Free Software Foundation,
17241221Sglebius * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18241221Sglebius *
19241221Sglebius * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20241221Sglebius * or visit www.oracle.com if you need additional information or have any
21241221Sglebius * questions.
22241221Sglebius */
23241221Sglebius
24241221Sglebius
25241221Sglebius/**
26241221Sglebius * JDK-8012164: Error.stack needs trimming
27241221Sglebius *
28241221Sglebius * @test
29241221Sglebius * @run
30241221Sglebius */
31241221Sglebius
32241221Sglebiusfunction func() {
33241221Sglebius   error();
34241221Sglebius}
35241221Sglebius
36241221Sglebiusfunction error() {
37241221Sglebius  try {
38241221Sglebius      throw new Error('foo');
39241221Sglebius  } catch (e) {
40241221Sglebius      for (i in e.stack) {
41241221Sglebius          print(e.stack[i]);
42241221Sglebius      }
43241221Sglebius  }
44241221Sglebius}
45241221Sglebius
46241221Sglebiusfunc();
47241221Sglebius