always attach console implementation on android

This commit is contained in:
Peter Kanev
2017-03-16 15:45:21 +02:00
parent 3ea7365871
commit de7e787283

View File

@@ -121,7 +121,11 @@ if ((<any>global).__snapshot) {
registerOnGlobalContext("fetch", "fetch");
}
if (!(<any>global).console) {
// check whether the 'android' namespace is exposed
// if positive - the current device is an Android
// so a custom implementation of the global 'console' object is attached.
// otherwise do nothing on iOS - the NS runtime provides a native 'console' functionality.
if ((<any>global).android) {
const consoleModule = require("console");
(<any>global).console = new consoleModule.Console();
}