mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Merge pull request #3815 from NativeScript/pete/fix-android-console
Always attach console implementation on android
This commit is contained in:
@@ -121,7 +121,11 @@ if ((<any>global).__snapshot) {
|
|||||||
registerOnGlobalContext("fetch", "fetch");
|
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");
|
const consoleModule = require("console");
|
||||||
(<any>global).console = new consoleModule.Console();
|
(<any>global).console = new consoleModule.Console();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user