Fix failing unit test in older IE.

Former-commit-id: 2de10b6bc3b9720a14fba86d9fe2638b30a7d0ef
This commit is contained in:
John-David Dalton
2013-02-03 21:43:17 -08:00
parent 22d4a7690f
commit 6ee606e3e2
2 changed files with 8 additions and 0 deletions

View File

@@ -1732,6 +1732,9 @@
" (!b || (otherType != 'function' && otherType != 'object'))) {",
' return false;',
' }',
' if (a == null || b == null) {',
' return a === b;',
' }',
' var className = toString.call(a),',
' otherClass = toString.call(b);',
'',

View File

@@ -1461,6 +1461,11 @@
(!b || (otherType != 'function' && otherType != 'object'))) {
return false;
}
// exit early for `null` and `undefined`, avoiding ES3's Function#call behavior
// http://es5.github.com/#x15.3.4.4
if (a == null || b == null) {
return a === b;
}
// compare [[Class]] names
var className = toString.call(a),
otherClass = toString.call(b);