mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
Like `Function.prototype.bind` (but unlike `ramda.partial`) it takes the curried arguments as rest arguments, not as an array; cf. https://lodash.com/docs/4.17.10#partial and https://underscorejs.org/#partial.
31 lines
527 B
JavaScript
31 lines
527 B
JavaScript
let underscore = require('underscore');
|
|
let lodash = require('lodash');
|
|
let R = require('ramda');
|
|
|
|
let source1 = "tainted1";
|
|
let source2 = "tainted2";
|
|
|
|
function f1(x, y) {
|
|
let sink1 = x;
|
|
let sink2 = y;
|
|
}
|
|
f1.bind(null, source1)(source2);
|
|
|
|
function f2(x, y) {
|
|
let sink1 = x;
|
|
let sink2 = y;
|
|
}
|
|
underscore.partial(f2, source1)(source2);
|
|
|
|
function f3(x, y) {
|
|
let sink1 = x;
|
|
let sink2 = y;
|
|
}
|
|
lodash.partial(f3, source1)(source2);
|
|
|
|
function f4(x, y) {
|
|
let sink1 = x;
|
|
let sink2 = y;
|
|
}
|
|
R.partial(f4, [source1])(source2);
|