Make JsPath#prune retain the original path on success
Merge pull request #3666 from gmethvin/jspath-prune

The path returned by JsPath.prune should be the original path