diff --git a/tns-core-modules/application/application-common.ts b/tns-core-modules/application/application-common.ts index 0ca6c76a1..c6bda6fe4 100644 --- a/tns-core-modules/application/application-common.ts +++ b/tns-core-modules/application/application-common.ts @@ -1,6 +1,5 @@ // Require globals first so that snapshot takes __extends function. -require("../globals"); - +import "../globals"; import { Observable, EventData } from "../data/observable"; import { View } from "../ui/core/view"; import { diff --git a/tns-core-modules/globals/polyfills/polyfill-helpers/polyfill-helpers.ts b/tns-core-modules/globals/polyfills/polyfill-helpers/polyfill-helpers.ts index 371f5bfea..e5ecd55a7 100644 --- a/tns-core-modules/globals/polyfills/polyfill-helpers/polyfill-helpers.ts +++ b/tns-core-modules/globals/polyfills/polyfill-helpers/polyfill-helpers.ts @@ -17,7 +17,7 @@ function registerOnGlobalContext(moduleName: string, exportName: string): void { } export function installPolyfills(moduleName: string, exportNames: string[]) { - if ((global).__snapshot || (global).__snapshotEnabled) { + if (global.__snapshot) { const loadedModule = global.loadModule(moduleName); exportNames.forEach(exportName => global[exportName] = loadedModule[exportName]); } else { diff --git a/tns-core-modules/module.d.ts b/tns-core-modules/module.d.ts index 748487b6b..90d58cbf1 100644 --- a/tns-core-modules/module.d.ts +++ b/tns-core-modules/module.d.ts @@ -82,6 +82,7 @@ declare namespace NodeJS { __onUncaughtError: (error: NativeScriptError) => void; __onDiscardedError: (error: NativeScriptError) => void; TNS_WEBPACK?: boolean; + __snapshot?: boolean; __requireOverride?: (name: string, dir: string) => any; } } diff --git a/tns-core-modules/ui/frame/activity.android.ts b/tns-core-modules/ui/frame/activity.android.ts index 28fdca7b5..8bfadbc56 100644 --- a/tns-core-modules/ui/frame/activity.android.ts +++ b/tns-core-modules/ui/frame/activity.android.ts @@ -2,7 +2,7 @@ import { setActivityCallbacks, AndroidActivityCallbacks } from "./frame"; import * as globals from "../../globals"; import * as appModule from "../../application"; -if ((global).__snapshot || (global).__snapshotEnabled) { +if (global.__snapshot) { globals.install(); } diff --git a/tns-core-modules/xml/xml.js b/tns-core-modules/xml/xml.js index 22f24476f..06bbf33dc 100644 --- a/tns-core-modules/xml/xml.js +++ b/tns-core-modules/xml/xml.js @@ -106,14 +106,14 @@ function _HandleAmpEntities(found, decimalValue, hexValue, wordValue) { } var res = _ampCodes.get(wordValue); if (res) { - return String.fromCharCode(res); + return String.fromCodePoint(res); } return found; } if (decimalValue) { - return String.fromCharCode(parseInt(decimalValue, 10)); + return String.fromCodePoint(parseInt(decimalValue, 10)); } - return String.fromCharCode(parseInt(hexValue, 16)); + return String.fromCodePoint(parseInt(hexValue, 16)); } var XmlParser = (function () { function XmlParser(onEvent, onError, processNamespaces) { diff --git a/tns-core-modules/xml/xml.ts b/tns-core-modules/xml/xml.ts index cc11f454f..ef4d93e9e 100644 --- a/tns-core-modules/xml/xml.ts +++ b/tns-core-modules/xml/xml.ts @@ -88,7 +88,7 @@ function _generateAmpMap(): any { } // android-specific implementation, which pre-populates the map to get it saved into the heap blob -if ((global).__snapshot) { +if (global.__snapshot) { _ampCodes = _generateAmpMap(); }