Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup / validate global exports. #16467

Merged
merged 1 commit into from
Apr 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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