test/script/basic/JDK-8073733.js

Wed, 05 Sep 2018 01:21:35 -0700

author
diazhou
date
Wed, 05 Sep 2018 01:21:35 -0700
changeset 2374
037913b52507
parent 1512
152cfeee5001
permissions
-rw-r--r--

Added tag jdk8u192-b09 for changeset 456c0d45c43b

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

mercurial