refactor(console): remove the console module (#5338)

* refactor(console): remove the console module

Removing the console module implementation eliminates some error-prone
formatting logic, and certain platform-specific checks. The
implementation was also android-specific. Left a stub Console class
implementation as one is necessary to avoid errors with `console` being
undefined during the snapshot stage for android.

The console module is replaced by a 'console' implementation in the Android Runtime. See
android-runtime/PR #884

* fix(tests): update console module tests
This commit is contained in:
Peter Kanev
2018-02-04 23:29:58 +02:00
committed by Svetoslav
parent 464cdd5a07
commit 0b1c36192d
4 changed files with 34 additions and 404 deletions

View File

@@ -34,11 +34,6 @@ export function pageLoaded() {
var str = "text";
var obj = { name: "John", age: 34 };
var button = new buttonModule.Button();
function Foo() {
this.abc = "Hello";
this.circular = this;
}
var foo = new Foo();
console.log(true);
console.log(false);
@@ -49,17 +44,21 @@ export function pageLoaded() {
console.log(str);
console.log(obj);
console.log('number: %i', num);
console.log('string: %s', str);
console.log("%s %f", str, num);
console.log(`number: ${num}`);
console.log(`string: ${str}`);
console.log(`${str} ${num}`);
console.info("info");
console.warn("warn");
console.error("error");
console.assert(false, "%d not equals %d", 0, 1);
console.assert(false, `false == true`);
console.assert(true, "1 equals 1");
console.assert("", "empty string evalutes to 'false'");
console.trace("console.trace() called");
if (app.android) {
console.dir(true);
console.dir(false);
@@ -70,8 +69,10 @@ export function pageLoaded() {
console.dir(str);
console.dir(obj);
console.dir(foo);
console.log("%j", button);
console.log(`${button}`);
console.log(num, str, obj);
console.log([1, 5, 12.5, obj, str, 42]);
}
console.trace();