nashorn/test/script/basic/JDK-8057019-payload.js
author hannesw
Fri, 03 Feb 2017 13:28:00 +0100
changeset 43555 1bb10bccf057
parent 26375 a741f7808507
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:
26375
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
     1
/*
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
     2
 * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
     4
 *
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
     7
 * published by the Free Software Foundation.
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
     8
 *
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    13
 * accompanied this code).
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    14
 *
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    18
 *
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    21
 * questions.
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    22
 */
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    23
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    24
/**
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    25
 * this apply with extra arguments
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    26
 *
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    27
 * @subtest
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    28
 */
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    29
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    30
function func(x, y, z) {
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    31
    print(x, y, z);
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    32
}
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    33
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    34
function g() {
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    35
    func.apply(this, arguments);
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    36
}
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    37
function h() {
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    38
    func.apply(this, arguments, 23);
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    39
}
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    40
function i() {
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    41
    func.apply(this, arguments, 23, 4711);
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    42
}
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    43
function j() {
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    44
    func.apply(this, arguments, 23, 4711, "apa", "dingo", "gorilla");
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    45
}
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    46
function k() {
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    47
    func.apply(this, arguments, 23);
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    48
}
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    49
function l() {
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    50
    func.apply(this, [23, "apa", "gorilla", "dingo"], 17);
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    51
}
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    52
function m() {
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    53
    func.apply(this, [23, "apa", "gorilla", "dingo"]);
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    54
}
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    55
function n() {
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    56
    func.apply(this, "significant");
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    57
}
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    58
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    59
g(1,2);
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    60
g(1,2,3);
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    61
g(1,2,3,4);
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    62
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    63
h(1,2);
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    64
h(1,2,3);
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    65
h(1,2,3,4);
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    66
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    67
i(1,2);
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    68
i(1,2,3);
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    69
i(1,2,3,4);
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    70
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    71
j(1,2);
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    72
j(1,2,3);
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    73
j(1,2,3,4);
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    74
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    75
k(1,2);
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    76
k(1,2,3);
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    77
k(1,2,3,4);
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    78
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    79
l(1,2);
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    80
l(1,2,3);
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    81
l(1,2,3,4);
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    82
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    83
m(1,2);
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    84
m(1,2,3);
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    85
m(1,2,3,4);
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    86
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    87
try {
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    88
    n(1,2);
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    89
} catch (e) {
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    90
    print(e);
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    91
}
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    92
try {
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    93
    n(1,2,3);
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    94
} catch (e) {
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    95
    print(e);    
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    96
}
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    97
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    98
try {
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
    99
    n(1,2,3,4);
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
   100
} catch (e) {
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
   101
    print(e);   
a741f7808507 8057019: Various problems with extra arguments to applies
lagergren
parents:
diff changeset
   102
}