Removed protections against user code redefining undefined
Jasmine hasn't even run on platforms that allowed redefining undefined since 2.x.
This commit is contained in:
@@ -31,10 +31,8 @@ getJasmineRequireObj().DiffBuilder = function(j$) {
|
||||
|
||||
const actualCustom = this.prettyPrinter_.customFormat_(actual);
|
||||
const expectedCustom = this.prettyPrinter_.customFormat_(expected);
|
||||
const useCustom = !(
|
||||
j$.util.isUndefined(actualCustom) &&
|
||||
j$.util.isUndefined(expectedCustom)
|
||||
);
|
||||
const useCustom =
|
||||
actualCustom !== undefined || expectedCustom !== undefined;
|
||||
|
||||
if (useCustom) {
|
||||
const prettyActual = actualCustom || this.prettyPrinter_(actual);
|
||||
|
||||
@@ -177,13 +177,13 @@ getJasmineRequireObj().MatchersUtil = function(j$) {
|
||||
bStack,
|
||||
diffBuilder
|
||||
);
|
||||
if (!j$.util.isUndefined(asymmetricResult)) {
|
||||
if (asymmetricResult !== undefined) {
|
||||
return asymmetricResult;
|
||||
}
|
||||
|
||||
for (const tester of this.customTesters_) {
|
||||
const customTesterResult = tester(a, b);
|
||||
if (!j$.util.isUndefined(customTesterResult)) {
|
||||
if (customTesterResult !== undefined) {
|
||||
if (!customTesterResult) {
|
||||
diffBuilder.recordMismatch();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user