mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Core: Fix issue with RegExp detection if object is from another context.
This commit is contained in:
parent
fadef949ff
commit
0c1b4376d3
1 changed files with 7 additions and 5 deletions
|
@ -1916,12 +1916,14 @@ new function() { // // Scope to inject various item event handlers
|
|||
// Compare further with the _class property value instead.
|
||||
value = this._class;
|
||||
}
|
||||
if (compare instanceof RegExp) {
|
||||
return compare.test(value);
|
||||
} else if (typeof compare === 'function') {
|
||||
if (typeof compare === 'function') {
|
||||
return !!compare(value);
|
||||
} else if (Base.isPlainObject(compare)) {
|
||||
return matchObject(compare, value);
|
||||
} else if (compare) {
|
||||
if (compare.test) { // RegExp-ish
|
||||
return compare.test(value);
|
||||
} else if (Base.isPlainObject(compare)) {
|
||||
return matchObject(compare, value);
|
||||
}
|
||||
}
|
||||
return Base.equals(value, compare);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue