Starfish engine, which is used in WebWidgets, does not support console.assert
[Verification] WebWidgetTCT runs succesfully
Change-Id: I6286537c6bc8995b5fd3c0a60f22b2d2595ed787
Signed-off-by: Rafal Walczyna <r.walczyna@samsung.com>
Utils.prototype.error = console.error.bind(console);
Utils.prototype.warn = console.warn.bind(console);
Utils.prototype.log = _enableJsLogs ? console.log.bind(console) : function() {};
-Utils.prototype.assert = console.assert.bind(console);
+if (console.assert) {
+ Utils.prototype.assert = console.assert.bind(console);
+} else {
+ Utils.prototype.assert = function() {
+ if (false === arguments[0]) {
+ console.error("Assertion failed: ", Array.prototype.slice.call(arguments, 1));
+ }
+ }
+}
Utils.prototype.global = _global;