From c1db8f2f82dfeaf1908be1600512ebdfae33a347 Mon Sep 17 00:00:00 2001 From: Steve Gravrock Date: Tue, 12 Oct 2021 15:40:13 -0700 Subject: [PATCH] Clarified deprecation message for this in describes --- lib/jasmine-core/jasmine.js | 4 +++- spec/core/EnvSpec.js | 4 +++- src/core/deprecatingThisProxy.js | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index 34e9212a..700e7e18 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -4219,7 +4219,9 @@ getJasmineRequireObj().deprecatingSuiteProxy = function(j$) { /* eslint-disable compat/compat */ // TODO: Remove this in the next major release. getJasmineRequireObj().deprecatingThisProxy = function(j$) { - var msg = "Access to 'this' in describe functions is deprecated."; + var msg = + "Access to 'this' in describe functions (and in arrow functions " + + 'inside describe functions) is deprecated.'; try { new Proxy({}, {}); diff --git a/spec/core/EnvSpec.js b/spec/core/EnvSpec.js index 4825d4b1..ced422a4 100644 --- a/spec/core/EnvSpec.js +++ b/spec/core/EnvSpec.js @@ -768,7 +768,9 @@ describe('Env', function() { it("deprecates access to 'this' in describes", function() { jasmine.getEnv().requireProxy(); - var msg = "Access to 'this' in describe functions is deprecated.", + var msg = + "Access to 'this' in describe functions (and in arrow " + + 'functions inside describe functions) is deprecated.', ran = false; spyOn(env, 'deprecated'); diff --git a/src/core/deprecatingThisProxy.js b/src/core/deprecatingThisProxy.js index 6f924b18..aaa72e8d 100644 --- a/src/core/deprecatingThisProxy.js +++ b/src/core/deprecatingThisProxy.js @@ -1,7 +1,9 @@ /* eslint-disable compat/compat */ // TODO: Remove this in the next major release. getJasmineRequireObj().deprecatingThisProxy = function(j$) { - var msg = "Access to 'this' in describe functions is deprecated."; + var msg = + "Access to 'this' in describe functions (and in arrow functions " + + 'inside describe functions) is deprecated.'; try { new Proxy({}, {});