File tree Expand file tree Collapse file tree
packages/@ember/-internals/environment Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11export * from './lib/context' ;
22export * from './lib/env' ;
3- export { default as global } from './lib/global' ;
Original file line number Diff line number Diff line change 1- import global from './global' ;
2-
31export interface GlobalContext {
42 imports : object ;
53 exports : object ;
64 lookup : Record < string , unknown > ;
75}
86
7+ const global = globalThis as Record < string , unknown > ;
8+ const Ember = global [ 'Ember' ] as Partial < GlobalContext > | undefined ;
9+
910// legacy imports/exports/lookup stuff (should we keep this??)
10- export const context = ( function (
11- global : Record < string , unknown > ,
12- Ember : Partial < GlobalContext > | undefined
13- ) : GlobalContext {
14- return Ember === undefined
11+ export const context : GlobalContext =
12+ Ember === undefined
1513 ? { imports : global , exports : global , lookup : global }
1614 : {
1715 // import jQuery
@@ -21,7 +19,6 @@ export const context = (function (
2119 // search for Namespaces
2220 lookup : Ember . lookup || global ,
2321 } ;
24- } ) ( global , global . Ember ) ;
2522
2623export function getLookup ( ) : Record < string , unknown > {
2724 return context . lookup ;
Original file line number Diff line number Diff line change 11import { DEBUG } from '@glimmer/env' ;
2- import global from './global' ;
32
43/**
54 The hash of environment variables used to control various configuration
@@ -154,9 +153,15 @@ export const ENV = {
154153 } ,
155154} ;
156155
157- ( ( EmberENV ) => {
158- if ( typeof EmberENV !== 'object' || EmberENV === null ) return ;
156+ interface EmberENVConfig extends Record < string , unknown > {
157+ EXTEND_PROTOTYPES ?: boolean ;
158+ EMBER_LOAD_HOOKS ?: Record < string , unknown > ;
159+ FEATURES ?: Record < string , unknown > ;
160+ }
161+
162+ const EmberENV = ( globalThis as { EmberENV ?: EmberENVConfig } ) . EmberENV ;
159163
164+ if ( typeof EmberENV === 'object' && EmberENV !== null ) {
160165 for ( let flag in EmberENV ) {
161166 if (
162167 ! Object . prototype . hasOwnProperty . call ( EmberENV , flag ) ||
@@ -197,7 +202,7 @@ export const ENV = {
197202 if ( DEBUG ) {
198203 ENV . _DEBUG_RENDER_TREE = true ;
199204 }
200- } ) ( global . EmberENV ) ;
205+ }
201206
202207export function getENV ( ) : object {
203208 return ENV ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments