Skip to content

Commit

Permalink
Use a more future-proof/collision-safe Symbol name
Browse files Browse the repository at this point in the history
If we find ourselves dealing with two different versions of this package
in the same runtime, our only hope of identifying previously-patched and
hacked methods is a Symbol that's retrievable with `Symbol.for(...)`.

Hopefully that should never happen, however.
  • Loading branch information
Alhadis committed Jul 6, 2019
1 parent 41c7574 commit 132a04b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ module.exports = (options = {}) => {


/**
* @const {Symbol} OriginalMethod
* @const {Symbol} MochaWhen.OriginalMethod
* @summary Symbol for referencing the original version of a replaced global.
*/
const OriginalMethod = Symbol("OriginalMethod");
const OriginalMethod = Symbol.for("MochaWhen.OriginalMethod");


/**
Expand Down

0 comments on commit 132a04b

Please sign in to comment.