Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Function.prototype.apply.bind #7879

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
[tests] Add arguments bind test
  • Loading branch information
goodmind committed Jul 9, 2019
commit f99e5f5478bcfaaab22093aef65437454d33adcc
8 changes: 7 additions & 1 deletion tests/function/bind.js
Original file line number Diff line number Diff line change
@@ -30,9 +30,15 @@ let tests = [
appliedFn(null, ['']); // error
},


function(x: (x: number) => void, y: (x: string) => void) {
const appliedFn = Function.apply.bind(x); // ok
const reappliedFn = appliedFn.bind(y); // wrong, should error
reappliedFn(null, ['']); // wrong
}
},

function(x: (x: number) => void) {
const appliedFn = Function.apply.bind(x, null); // should be ok
appliedFn(['']); // wrong
},
];