Skip to content

Commit de7e787

Browse files
committed
always attach console implementation on android
1 parent 3ea7365 commit de7e787

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tns-core-modules/globals/globals.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,11 @@ if ((<any>global).__snapshot) {
121121
registerOnGlobalContext("fetch", "fetch");
122122
}
123123

124-
if (!(<any>global).console) {
124+
// check whether the 'android' namespace is exposed
125+
// if positive - the current device is an Android
126+
// so a custom implementation of the global 'console' object is attached.
127+
// otherwise do nothing on iOS - the NS runtime provides a native 'console' functionality.
128+
if ((<any>global).android) {
125129
const consoleModule = require("console");
126130
(<any>global).console = new consoleModule.Console();
127131
}

0 commit comments

Comments
 (0)