test/script/basic/JDK-8025488.js

Fri, 20 Feb 2015 15:47:28 +0100

author
attila
date
Fri, 20 Feb 2015 15:47:28 +0100
changeset 1250
9ee1fc3f6136
parent 962
ac62e33a99b0
child 1205
4112748288bb
permissions
-rw-r--r--

8072426: Can't compare Java objects to strings or numbers
Reviewed-by: hannesw, lagergren, sundar

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

mercurial