rm monkey patch warnings

This commit is contained in:
Steve Gravrock
2025-11-27 09:38:54 -08:00
parent 8b3c4ce3b4
commit 876de65803
9 changed files with 2 additions and 228 deletions

View File

@@ -192,8 +192,6 @@ callbacks to execute _before_ running the next one.
setInterval[IsMockClockTimingFn] = true;
clearInterval[IsMockClockTimingFn] = true;
j$.private.deprecateMonkeyPatching(this);
return this;
// Advances the Clock's time until the mode changes.

View File

@@ -835,8 +835,6 @@ getJasmineRequireObj().Env = function(j$) {
this.cleanup_ = function() {
uninstallGlobalErrors();
};
j$.private.deprecateMonkeyPatching(this, ['deprecated']);
}
function indirectCallerFilename(depth) {

View File

@@ -1,22 +0,0 @@
getJasmineRequireObj().deprecateMonkeyPatching = function(j$) {
return function deprecateMonkeyPatching(obj, keysToSkip) {
for (const key of Object.keys(obj)) {
if (!keysToSkip?.includes(key)) {
let value = obj[key];
Object.defineProperty(obj, key, {
enumerable: key in obj,
get() {
return value;
},
set(newValue) {
j$.getEnv().deprecated(
'Monkey patching detected. This is not supported and will break in a future jasmine-core release.'
);
value = newValue;
}
});
}
}
};
};

View File

@@ -27,7 +27,6 @@ var getJasmineRequireObj = (function() {
});
jRequire.base(j$, globalThis);
j$.private.deprecateMonkeyPatching = jRequire.deprecateMonkeyPatching(j$);
j$.private.util = jRequire.util(j$);
j$.private.errors = jRequire.errors();
j$.private.formatErrorMsg = jRequire.formatErrorMsg(j$);
@@ -103,20 +102,6 @@ var getJasmineRequireObj = (function() {
j$.private.loadedAsBrowserEsm =
globalThis.document && !globalThis.document.currentScript;
j$.private.deprecateMonkeyPatching(j$, [
// These are meant to be set by users.
'DEFAULT_TIMEOUT_INTERVAL',
'MAX_PRETTY_PRINT_ARRAY_LENGTH',
'MAX_PRETTY_PRINT_CHARS',
'MAX_PRETTY_PRINT_DEPTH',
// These are part of the deprecation warning mechanism. To avoid infinite
// recursion, they're separately protected in a way that doesn't emit
// deprecation warnings.
'private',
'getEnv'
]);
return j$;
};

View File

@@ -369,7 +369,6 @@ getJasmineRequireObj().interface = function(jasmine, env) {
*/
jasmine: jasmine
};
const existingKeys = Object.keys(jasmine);
/**
* Add a custom equality tester for the current scope of specs.
@@ -536,7 +535,5 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @namespace asymmetricEqualityTesters
*/
jasmine.private.deprecateMonkeyPatching(jasmine, existingKeys);
return jasmineInterface;
};