Update path.js

Returning in global context is not valid. Here's a fix.