Skip to content

Commit

Permalink
Merge pull request emberjs#16467 from rwjblue/exports
Browse files Browse the repository at this point in the history
Cleanup / validate global exports.
  • Loading branch information
rwjblue authored Apr 5, 2018
2 parents d06fd50 + fcec631 commit 0547703
Show file tree
Hide file tree
Showing 8 changed files with 236 additions and 302 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*globals EmberDev */
import { VERSION } from 'ember';
import VERSION from 'ember/version';
import { ENV, context } from 'ember-environment';
import { libraries, setNamespaceSearchDisabled } from 'ember-metal';
import { getDebugFunction, setDebugFunction } from 'ember-debug';
Expand Down
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
6 changes: 5 additions & 1 deletion packages/ember-metal/lib/libraries.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { warn, debug } from 'ember-debug';
import { DEBUG } from 'ember-env-flags';
import { get } from './property_get';
import { EMBER_LIBRARIES_ISREGISTERED } from 'ember/features';
import VERSION from 'ember/version';

/**
@module ember
*/
Expand Down Expand Up @@ -82,5 +84,7 @@ if (DEBUG) {
debug('-------------------------------');
};
}
const LIBRARIES = new Libraries();
LIBRARIES.registerCoreLibrary('Ember', VERSION);

export default new Libraries();
export default LIBRARIES;
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 0547703

Please sign in to comment.