Skip to content

Commit

Permalink
Fix resetRetrieveHandlers to reset retrieveSourceMap and `retriev…
Browse files Browse the repository at this point in the history
…eFile` functions

The `handlerExec` function produces functions that are using original `retrieveFileHandlers`/`retrieveMapHandlers` references, so because the array variables are  re-assigned in the `resetRetrieveHandlers` function, `retrieveSourceMap` and `retrieveFile` need to be re-created to point them to correct instances of `retrieveFileHandlers`/`retrieveMapHandlers`.

This fixes:
jestjs/jest#6424
jestjs/jest#7402
  • Loading branch information
ArtemGovorov authored Feb 22, 2019
1 parent 80643a6 commit 16f1a6d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions source-map-support.js
Original file line number Diff line number Diff line change
Expand Up @@ -557,4 +557,7 @@ exports.resetRetrieveHandlers = function() {

retrieveFileHandlers = originalRetrieveFileHandlers.slice(0);
retrieveMapHandlers = originalRetrieveMapHandlers.slice(0);

retrieveSourceMap = handlerExec(retrieveMapHandlers);
retrieveFile = handlerExec(retrieveFileHandlers);
}

0 comments on commit 16f1a6d

Please sign in to comment.