You might want to add the semicolon back in, it delimits the assignment operation statement ensureDirExists = ...

http://stackoverflow.com/questions/1834642/best-practice-for-semicolon-after-every-function-in-javascript