Permalink
Browse files

Diff: Fix exception on property "constructor". Fixes #394.

Use hasOwn check instead undefined because the latter also
includes inherited properties.
  • Loading branch information...
1 parent f249711 commit 52b3b4294dc69b0b9db57e3f6b58b5a45a402bca @Krinkle Krinkle committed Jan 18, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 qunit/qunit.js
View
@@ -2016,7 +2016,7 @@ QUnit.diff = (function() {
os = {};
for ( i = 0; i < n.length; i++ ) {
- if ( ns[ n[i] ] == null ) {
+ if ( !hasOwn.call( ns, n[i] ) ) {
ns[ n[i] ] = {
rows: [],
o: null
@@ -2026,7 +2026,7 @@ QUnit.diff = (function() {
}
for ( i = 0; i < o.length; i++ ) {
- if ( os[ o[i] ] == null ) {
+ if ( !hasOwn.call( os, o[i] ) ) {
os[ o[i] ] = {
rows: [],
n: null
@@ -2039,7 +2039,7 @@ QUnit.diff = (function() {
if ( !hasOwn.call( ns, i ) ) {
continue;
}
- if ( ns[i].rows.length === 1 && os[i] !== undefined && os[i].rows.length === 1 ) {
+ if ( ns[i].rows.length === 1 && hasOwn.call( os, i ) && os[i].rows.length === 1 ) {
n[ ns[i].rows[0] ] = {
text: n[ ns[i].rows[0] ],
row: os[i].rows[0]

0 comments on commit 52b3b42

Please sign in to comment.