diff --git a/js/lib/mediawiki.Util.js b/js/lib/mediawiki.Util.js
index <HASH>..<HASH> 100644
--- a/js/lib/mediawiki.Util.js
+++ b/js/lib/mediawiki.Util.js
@@ -187,7 +187,7 @@ var HTML5 = require( 'html5' ).HTML5,
 		Object.freeze(o); // First freeze the object.
 		for (var propKey in o) {
 			var prop = o[propKey];
-			if (!o.hasOwnProperty(propKey) || !(typeof prop === "object") || Object.isFrozen(prop)) {
+			if (!o.hasOwnProperty(propKey) || !(prop instanceof Object) || Object.isFrozen(prop)) {
 				// If the object is on the prototype, not an object, or is already frozen,
 				// skip it. Note that this might leave an unfrozen reference somewhere in the
 				// object if there is an already frozen object containing an unfrozen object.
Fix a deepFreeze crash

This fixes a crasher from a client log where isFrozen was called on a
non-object. 'foo instanceof Object' seems to be the better test for freeze,
and is used to test the top-level object anyway.

Change-Id: Ice<I>c<I>d<I>df<I>edc5a7f1ec4df<I>e<I>e<I>c