Skip to content

Commit

Permalink
Cleanup / validate global exports.
Browse files Browse the repository at this point in the history
* Remove unused legacy global flags.
* Move imports "to the top"
* Bring back `Ember.NAME_KEY`
* Ensure all `computed.*` exports are setup in reexports test
  • Loading branch information
rwjblue committed Apr 4, 2018
1 parent f99538d commit a4a3349
Show file tree
Hide file tree
Showing 6 changed files with 230 additions and 300 deletions.
25 changes: 12 additions & 13 deletions packages/ember-environment/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ export const ENV =
(typeof global.ENV === 'object' && global.ENV) ||
{};

export function getENV() {
return ENV;
}

// ENABLE_ALL_FEATURES was documented, but you can't actually enable non optional features.
if (ENV.ENABLE_ALL_FEATURES) {
ENV.ENABLE_OPTIONAL_FEATURES = true;
Expand Down Expand Up @@ -66,19 +70,6 @@ ENV.LOG_STACKTRACE_ON_DEPRECATION = defaultTrue(ENV.LOG_STACKTRACE_ON_DEPRECATIO
*/
ENV.LOG_VERSION = defaultTrue(ENV.LOG_VERSION);

/**
Debug parameter you can turn on. This will log all bindings that fire to
the console. This should be disabled in production code. Note that you
can also enable this from the console or temporarily.
@property LOG_BINDINGS
@for EmberENV
@type Boolean
@default false
@public
*/
ENV.LOG_BINDINGS = defaultFalse(ENV.LOG_BINDINGS);

ENV.RAISE_ON_DEPRECATION = defaultFalse(ENV.RAISE_ON_DEPRECATION);

/**
Expand Down Expand Up @@ -131,6 +122,14 @@ export const context = {
lookup: originalContext.lookup || global,
};

export function getLookup() {
return context.lookup;
}

export function setLookup(value) {
context.lookup = value;
}

// TODO: cleanup single source of truth issues with this stuff
export const environment = hasDOM
? {
Expand Down
3 changes: 3 additions & 0 deletions packages/ember-utils/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ export { HAS_NATIVE_SYMBOL } from './symbol-utils';
export { HAS_NATIVE_PROXY } from './proxy-utils';
export { default as WeakSet } from './weak_set';
export { isProxy, setProxy } from './is_proxy';

import symbol from './symbol';
export const NAME_KEY = symbol('NAME_KEY');
Loading

0 comments on commit a4a3349

Please sign in to comment.