mirror of https://github.com/svaarala/duktape.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
489 B
40 lines
489 B
12 years ago
|
|
||
|
var func;
|
||
|
|
||
|
/*===
|
||
|
|
||
|
1 2
|
||
|
1 2 3 4
|
||
|
1 2 3
|
||
|
===*/
|
||
|
|
||
|
/* Basic cases */
|
||
|
print.bind(null)();
|
||
|
print.bind(null,1,2)();
|
||
|
print.bind(null,1,2)(3,4);
|
||
|
print.bind(null,1).bind(null,2).bind(null,3)();
|
||
|
|
||
|
/*===
|
||
|
2
|
||
|
2
|
||
|
1
|
||
|
0
|
||
|
0
|
||
|
===*/
|
||
|
|
||
|
/* FIXME: length handling of bound function, improve */
|
||
|
|
||
|
function f1(x,y) {
|
||
|
}
|
||
|
|
||
|
print(f1.length);
|
||
|
func = f1.bind(null);
|
||
|
print(func.length);
|
||
|
func = f1.bind(null, 1);
|
||
|
print(func.length);
|
||
|
func = f1.bind(null, 1, 2);
|
||
|
print(func.length);
|
||
|
func = f1.bind(null, 1, 2, 3);
|
||
|
print(func.length);
|
||
|
|