Skip to content

Instantly share code, notes, and snippets.

@bvdeenen
Last active August 29, 2015 14:19
Show Gist options
  • Save bvdeenen/0cab7b213ddf19ea1217 to your computer and use it in GitHub Desktop.
Save bvdeenen/0cab7b213ddf19ea1217 to your computer and use it in GitHub Desktop.
sysPath=require('path');
files=['a','b','c'];
parent= "yo";
myjoin = function(a,b){return sysPath.join(a,b);}
console.log(files.map( myjoin.bind(null, parent) )); // works fine
console.log(files.map( sysPath.join.bind(null, parent) )); // throws exception
// [ 'yo/a', 'yo/b', 'yo/c' ]
// path.js:488
// throw new TypeError('Arguments to path.join must be strings');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment