@@ -9,7 +9,6 @@ import type PingsDatabase from "./pings/database.js";
99import type ErrorManager from "./error/index.js" ;
1010import Dispatcher from "./dispatcher.js" ;
1111import log , { LoggingLevel } from "./log.js" ;
12- import { isUndefined } from "./utils.js" ;
1312
1413const LOG_TAG = "core.Context" ;
1514
@@ -31,7 +30,7 @@ export class Context {
3130 private _dispatcher : Dispatcher ;
3231
3332 // The following group of properties are all set on Glean.initialize
34- // Attempting to get them before initialize Glean will throw an error.
33+ // Attempting to get them before they are set will log an error.
3534 private _uploadEnabled ! : boolean ;
3635 private _metricsDatabase ! : MetricsDatabase ;
3736 private _eventsDatabase ! : EventsDatabase ;
@@ -64,9 +63,7 @@ export class Context {
6463 *
6564 * Resets the Context to an uninitialized state.
6665 */
67- static async testUninitialize ( ) : Promise < void > {
68- // Clear the dispatcher queue.
69- await Context . instance . _dispatcher ?. testUninitialize ( ) ;
66+ static testUninitialize ( ) : void {
7067 Context . _instance = undefined ;
7168 }
7269
@@ -75,7 +72,7 @@ export class Context {
7572 }
7673
7774 static get uploadEnabled ( ) : boolean {
78- if ( isUndefined ( Context . instance . _uploadEnabled ) ) {
75+ if ( typeof Context . instance . _uploadEnabled === "undefined" ) {
7976 log (
8077 LOG_TAG ,
8178 [
@@ -93,7 +90,7 @@ export class Context {
9390 }
9491
9592 static get metricsDatabase ( ) : MetricsDatabase {
96- if ( isUndefined ( Context . instance . _metricsDatabase ) ) {
93+ if ( typeof Context . instance . _metricsDatabase === "undefined" ) {
9794 log (
9895 LOG_TAG ,
9996 [
@@ -111,7 +108,7 @@ export class Context {
111108 }
112109
113110 static get eventsDatabase ( ) : EventsDatabase {
114- if ( isUndefined ( Context . instance . _eventsDatabase ) ) {
111+ if ( typeof Context . instance . _eventsDatabase === "undefined" ) {
115112 log (
116113 LOG_TAG ,
117114 [
@@ -129,7 +126,7 @@ export class Context {
129126 }
130127
131128 static get pingsDatabase ( ) : PingsDatabase {
132- if ( isUndefined ( Context . instance . _pingsDatabase ) ) {
129+ if ( typeof Context . instance . _pingsDatabase === "undefined" ) {
133130 log (
134131 LOG_TAG ,
135132 [
@@ -147,7 +144,7 @@ export class Context {
147144 }
148145
149146 static get errorManager ( ) : ErrorManager {
150- if ( isUndefined ( Context . instance . _errorManager ) ) {
147+ if ( typeof Context . instance . _errorManager === "undefined" ) {
151148 log (
152149 LOG_TAG ,
153150 [
@@ -165,7 +162,7 @@ export class Context {
165162 }
166163
167164 static get applicationId ( ) : string {
168- if ( isUndefined ( Context . instance . _applicationId ) ) {
165+ if ( typeof Context . instance . _applicationId === "undefined" ) {
169166 log (
170167 LOG_TAG ,
171168 [
@@ -191,7 +188,7 @@ export class Context {
191188 }
192189
193190 static get debugOptions ( ) : DebugOptions {
194- if ( isUndefined ( Context . instance . _debugOptions ) ) {
191+ if ( typeof Context . instance . _debugOptions === "undefined" ) {
195192 log (
196193 LOG_TAG ,
197194 [
0 commit comments