Skip to content

Commit

Permalink
Replace deprecated no-native-reassign with no-global-assign
Browse files Browse the repository at this point in the history
  • Loading branch information
mroderick committed Oct 8, 2018
1 parent 7b0826b commit 720743b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions test/util/core/wrap-method-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,17 @@ describe("util/core/wrapMethod", function () {

var i = 0;

Error = TypeError = function () { // eslint-disable-line no-native-reassign, no-undef
// eslint-disable-next-line no-global-assign
Error = TypeError = function () {
this.stack = ":STACK" + ++i + ":";
};
});

afterEach(function () {
Error = this.oldError; // eslint-disable-line no-native-reassign, no-undef
TypeError = this.oldTypeError; // eslint-disable-line no-native-reassign, no-undef
// eslint-disable-next-line no-global-assign
Error = this.oldError;
// eslint-disable-next-line no-global-assign
TypeError = this.oldTypeError;
});

it("throws with stack trace showing original wrapMethod call", function () {
Expand Down
3 changes: 2 additions & 1 deletion test/util/fake-timers-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,8 @@ describe("fakeTimers.clock", function () {
it("creates real Date objects when Date constructor is gone", function () {
var realDate = new Date();

Date = function () {}; // eslint-disable-line no-undef, no-native-reassign
// eslint-disable-next-line no-global-assign
Date = function () {};
this.global.Date = function () {};

var date = new this.clock.Date();
Expand Down

0 comments on commit 720743b

Please sign in to comment.