Merge branch 'iserror-tt' of https://github.com/bjarkler/jasmine into main

* Fixes Trusted Types error in Chromium-based browsers
* Merges #1921 from @bjarkler
* Fixes #1910
This commit is contained in:
Steve Gravrock
2021-07-19 12:06:12 -07:00
2 changed files with 20 additions and 0 deletions

View File

@@ -270,6 +270,16 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) {
if (value instanceof Error) {
return true;
}
if (
typeof window !== 'undefined' &&
typeof window.trustedTypes !== 'undefined'
) {
return (
value &&
typeof value.stack === 'string' &&
typeof value.message === 'string'
);
}
if (value && value.constructor && value.constructor.constructor) {
var valueGlobal = value.constructor.constructor('return this');
if (j$.isFunction_(valueGlobal)) {

View File

@@ -102,6 +102,16 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) {
if (value instanceof Error) {
return true;
}
if (
typeof window !== 'undefined' &&
typeof window.trustedTypes !== 'undefined'
) {
return (
value &&
typeof value.stack === 'string' &&
typeof value.message === 'string'
);
}
if (value && value.constructor && value.constructor.constructor) {
var valueGlobal = value.constructor.constructor('return this');
if (j$.isFunction_(valueGlobal)) {