Browse Source

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

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

+ 4 - 5
support/boot.js

@@ -751,13 +751,12 @@ 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.klass === globals.Boolean) {
-				return shouldBeBoolean == true;
-			} else {
-				globals.NonBooleanReceiver._new()._object_(shouldBeBoolean)._signal();
+			else if (shouldBeBoolean != null && typeof shouldBeBoolean === "object") {
+				shouldBeBoolean = shouldBeBoolean.valueOf();
+				if (typeof shouldBeBoolean === "boolean") return shouldBeBoolean;
 			}
+			globals.NonBooleanReceiver._new()._object_(shouldBeBoolean)._signal();
 		};
 
 		/* List of all reserved words in JavaScript. They may not be used as variables