nashorn/test/script/basic/JDK-8133119.js
author hannesw
Fri, 03 Feb 2017 13:28:00 +0100
changeset 43555 1bb10bccf057
parent 32049 af8f6292d54d
permissions -rw-r--r--
8173888: Test for JDK-8169481 causes stack overflows in parser tests Reviewed-by: jlaskey, sundar
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
32049
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
     1
/*
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
     2
 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
     4
 *
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
     7
 * published by the Free Software Foundation.
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
     8
 *
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    13
 * accompanied this code).
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    14
 *
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    18
 *
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    21
 * questions.
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    22
 */
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    23
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    24
/**
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    25
 * JDK-8133119: Error message associated with TypeError for call and new should include stringified Node
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    26
 *
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    27
 * @test
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    28
 * @run
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    29
 */
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    30
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    31
var obj = {}
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    32
try {
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    33
    obj.func();
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    34
} catch (e) {
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    35
    print(e);
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    36
}
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    37
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    38
var arr = [33];
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    39
try {
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    40
    arr[0].func();
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    41
} catch (e) {
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    42
    print(e);
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    43
}
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    44
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    45
try {
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    46
    new obj.func();
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    47
} catch (e) {
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    48
    print(e);
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    49
}
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    50
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    51
try {
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    52
    new arr[0].func();
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    53
} catch (e) {
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    54
    print(e);
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    55
}
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    56
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    57
obj.foo = {}
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    58
try {
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    59
    new obj.foo();
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    60
} catch (e) {
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    61
    print(e);
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    62
}
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    63
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    64
try {
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    65
    obj.foo();
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    66
} catch (e) {
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    67
    print(e);
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    68
}
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    69
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    70
var v = new java.util.Vector();
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    71
try {
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    72
    v();
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    73
} catch (e) {
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    74
    print(e);
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    75
}
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    76
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    77
try {
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    78
    new v();
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    79
} catch (e) {
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    80
    print(e);
af8f6292d54d 8133119: Error message associated with TypeError for call and new should include stringified Node
sundar
parents:
diff changeset
    81
}