Skip to content

Commit

Permalink
fix: 1.2.x should have been a breaking change
Browse files Browse the repository at this point in the history
BREAKING CHANGE: the closure provied to hookRequire, hookRunInThisContext, etc., is now passed an object with a filename member, rather than a string representing filename.
  • Loading branch information
Benjamin committed Jun 6, 2018
1 parent 74cb3bb commit 92e5bc2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/istanbul-lib-hook/lib/hook.js
Expand Up @@ -13,6 +13,9 @@ function transformFn(matcher, transformer, verbose) {

return function (code, options) {
options = options || {};

// prior to 2.x, hookRequire returned filename
// rather than object.
if (typeof options === 'string') {
options = { filename: options };
}
Expand Down

0 comments on commit 92e5bc2

Please sign in to comment.