test/script/basic/arity.js

Thu, 12 Oct 2017 19:52:15 +0800

author
aoqi
date
Thu, 12 Oct 2017 19:52:15 +0800
changeset 1205
4112748288bb
parent 962
ac62e33a99b0
parent 952
6d5471a497fb
permissions
-rw-r--r--

merge

aoqi@0 1 /*
aoqi@0 2 * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
aoqi@0 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
attila@962 4 *
aoqi@0 5 * This code is free software; you can redistribute it and/or modify it
aoqi@0 6 * under the terms of the GNU General Public License version 2 only, as
aoqi@0 7 * published by the Free Software Foundation.
attila@962 8 *
aoqi@0 9 * This code is distributed in the hope that it will be useful, but WITHOUT
aoqi@0 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aoqi@0 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aoqi@0 12 * version 2 for more details (a copy is included in the LICENSE file that
aoqi@0 13 * accompanied this code).
attila@962 14 *
aoqi@0 15 * You should have received a copy of the GNU General Public License version
aoqi@0 16 * 2 along with this work; if not, write to the Free Software Foundation,
aoqi@0 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
attila@962 18 *
aoqi@0 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aoqi@0 20 * or visit www.oracle.com if you need additional information or have any
aoqi@0 21 * questions.
aoqi@0 22 */
aoqi@0 23
aoqi@0 24 /**
aoqi@0 25 * arity test.
aoqi@0 26 *
aoqi@0 27 * @test
attila@962 28 * @run
aoqi@0 29 */
aoqi@0 30
aoqi@0 31 function func1(a) { print(a); }
aoqi@0 32 function func2(a, b) { print(a, b); }
aoqi@0 33 function func3(a, b, c) { print(a, b, c); }
aoqi@0 34 function func4(a, b, c, d) { print(a, b, c, d); }
aoqi@0 35 function func5(a, b, c, d, e) { print(a, b, c, d, e); }
aoqi@0 36 function func6(a, b, c, d, e, f) { print(a, b, c, d, e, f); }
aoqi@0 37 function func7(a, b, c, d, e, f, g) { print(a, b, c, d, e, f, g); }
aoqi@0 38 function func8(a, b, c, d, e, f, g, h) { print(a, b, c, d, e, f, g, h); }
aoqi@0 39 function func9(a, b, c, d, e, f, g, h, i) { print(a, b, c, d, e, f, g, h, i); }
aoqi@0 40 function func10(a, b, c, d, e, f, g, h, i, j) { print(a, b, c, d, e, f, g, h, i, j); }
aoqi@0 41 function func11(a, b, c, d, e, f, g, h, i, j, k) { print(a, b, c, d, e, f, g, h, i, j, k); }
aoqi@0 42 function func12(a, b, c, d, e, f, g, h, i, j, k, l) { print(a, b, c, d, e, f, g, h, i, j, k, l); }
aoqi@0 43 function func13(a, b, c, d, e, f, g, h, i, j, k, l, m) { print(a, b, c, d, e, f, g, h, i, j, k, l, m); }
aoqi@0 44
aoqi@0 45 function vfunc1(a) { print(a); arguments; }
aoqi@0 46 function vfunc2(a, b) { print(a, b); arguments; }
aoqi@0 47 function vfunc3(a, b, c) { print(a, b, c); arguments; }
aoqi@0 48 function vfunc4(a, b, c, d) { print(a, b, c, d); arguments; }
aoqi@0 49 function vfunc5(a, b, c, d, e) { print(a, b, c, d, e); arguments; }
aoqi@0 50 function vfunc6(a, b, c, d, e, f) { print(a, b, c, d, e, f); arguments; }
aoqi@0 51 function vfunc7(a, b, c, d, e, f, g) { print(a, b, c, d, e, f, g); arguments; }
aoqi@0 52 function vfunc8(a, b, c, d, e, f, g, h) { print(a, b, c, d, e, f, g, h); arguments; }
aoqi@0 53 function vfunc9(a, b, c, d, e, f, g, h, i) { print(a, b, c, d, e, f, g, h, i); arguments; }
aoqi@0 54 function vfunc10(a, b, c, d, e, f, g, h, i, j) { print(a, b, c, d, e, f, g, h, i, j); arguments; }
aoqi@0 55 function vfunc11(a, b, c, d, e, f, g, h, i, j, k) { print(a, b, c, d, e, f, g, h, i, j, k); arguments; }
aoqi@0 56 function vfunc12(a, b, c, d, e, f, g, h, i, j, k, l) { print(a, b, c, d, e, f, g, h, i, j, k, l); arguments; }
aoqi@0 57 function vfunc13(a, b, c, d, e, f, g, h, i, j, k, l, m) { print(a, b, c, d, e, f, g, h, i, j, k, l, m); arguments; }
aoqi@0 58
aoqi@0 59 func1(1);
aoqi@0 60 func2(1, 2);
aoqi@0 61 func3(1, 2, 3);
aoqi@0 62 func4(1, 2, 3, 4);
aoqi@0 63 func5(1, 2, 3, 4, 5);
aoqi@0 64 func6(1, 2, 3, 4, 5, 6);
aoqi@0 65 func7(1, 2, 3, 4, 5, 6, 7);
aoqi@0 66 func8(1, 2, 3, 4, 5, 6, 7, 8);
aoqi@0 67 func9(1, 2, 3, 4, 5, 6, 7, 8, 9);
aoqi@0 68 func10(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
aoqi@0 69 func11(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
aoqi@0 70 func12(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
aoqi@0 71 func13(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13);
aoqi@0 72
aoqi@0 73 func1(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13);
aoqi@0 74 func13(1);
aoqi@0 75
aoqi@0 76 vfunc1(1);
aoqi@0 77 vfunc2(1, 2);
aoqi@0 78 vfunc3(1, 2, 3);
aoqi@0 79 vfunc4(1, 2, 3, 4);
aoqi@0 80 vfunc5(1, 2, 3, 4, 5);
aoqi@0 81 vfunc6(1, 2, 3, 4, 5, 6);
aoqi@0 82 vfunc7(1, 2, 3, 4, 5, 6, 7);
aoqi@0 83 vfunc8(1, 2, 3, 4, 5, 6, 7, 8);
aoqi@0 84 vfunc9(1, 2, 3, 4, 5, 6, 7, 8, 9);
aoqi@0 85 vfunc10(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
aoqi@0 86 vfunc11(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
aoqi@0 87 vfunc12(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
aoqi@0 88 vfunc13(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13);
aoqi@0 89
aoqi@0 90 vfunc1(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13);
aoqi@0 91 vfunc13(1);

mercurial