/* Test an inlined argument returns the arguments from the right function */ function get_arg_2() { return arguments[2]; } function test() { return get_arg_2(1,2,3); }
/* Test the right length of the argument vector gets returned */ function arg_len() { return arguments.length; } function test2() { return arg_len(1,2,3); }
/* Test funapply with arguments */ function return0(a, b, c) { return 0; } function funapply() { return return0.apply(undefined, arguments); } function test4() { return funapply(1,2,3) }
/* Test if funapply gets the right arguments */ function apply3(a, b, c) {
assertEq(a,1)
assertEq(b,2)
assertEq(c,3)
} function funapply2() { return apply3.apply(undefined, arguments); } function test5() { return funapply2(1,2,3) }
/* Test funapply when argument vector has less args than callee and callee known */ function apply_fun1(a, b, c) { assertEq(c, undefined) } function funapply3() { return apply_fun1.apply(undefined, arguments); } function test7() { return funapply3(1,2) }
/* Test funapply when argument vector has less args than callee and callee unknown */ var fun; function apply_fun2(a, b, c) { assertEq(c, undefined) } function funapply4() { return fun.apply(undefined, arguments); } function test8() { return funapply4(1,2) }
fun = apply_fun1;
test8("a","b","c","d","e");
fun = apply_fun2;
test8("a","b","c","d","e");
fun = apply_fun1;
test8("a","b","c","d","e");
fun = apply_fun2;
test8("a","b","c","d","e");
////////////
function dumpArgs(i) { if (i == 90) return funapply5.arguments.length; return [i]; } function funapply5() { return dumpArgs.apply(undefined, arguments); } function test9(i) { return funapply5(i); }
function noion14(i) { if (i == 2) { return funapply14.arguments; } return [i]; eval(""); } function funapply14(i) { if (i == 90) { i = "2"; } return noion14(i); } function test14(i) { return funapply14(i); }
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.