Browse Source

Revert "boot.js: Cross-frame version of st.assert"

This reverts commit 75626551e5257fd2d7e445312af186f7b9e8116b.
Herbert Vojčík 9 years ago
parent
commit
480ee773fd
1 changed files with 5 additions and 4 deletions
  1. 5 4
      support/boot.js

+ 5 - 4
support/boot.js

@@ -751,12 +751,13 @@ define("amber/boot", [ 'require', './browser-compatibility' ], function (require
 
 		/* Boolean assertion */
 		st.assert = function(shouldBeBoolean) {
+			// jshint -W041
 			if (typeof shouldBeBoolean === "boolean") return shouldBeBoolean;
-			else if (shouldBeBoolean != null && typeof shouldBeBoolean === "object") {
-				shouldBeBoolean = shouldBeBoolean.valueOf();
-				if (typeof shouldBeBoolean === "boolean") return shouldBeBoolean;
+			else if (shouldBeBoolean != null && typeof shouldBeBoolean === "object" && shouldBeBoolean.klass === globals.Boolean) {
+				return shouldBeBoolean == true;
+			} else {
+				globals.NonBooleanReceiver._new()._object_(shouldBeBoolean)._signal();
 			}
-			globals.NonBooleanReceiver._new()._object_(shouldBeBoolean)._signal();
 		};
 
 		/* List of all reserved words in JavaScript. They may not be used as variables