diff --git a/packages/container/lib/owner.js b/packages/container/lib/owner.js index 7800dae55d7..49690f1f813 100644 --- a/packages/container/lib/owner.js +++ b/packages/container/lib/owner.js @@ -3,7 +3,7 @@ @submodule ember-runtime */ -import { symbol } from 'ember-metal/utils'; +import symbol from 'ember-metal/symbol'; export const OWNER = symbol('OWNER'); diff --git a/packages/ember-htmlbars/lib/keywords/closure-component.js b/packages/ember-htmlbars/lib/keywords/closure-component.js index 0e377318eda..79a76687f1f 100644 --- a/packages/ember-htmlbars/lib/keywords/closure-component.js +++ b/packages/ember-htmlbars/lib/keywords/closure-component.js @@ -5,7 +5,7 @@ import { assert } from 'ember-metal/debug'; import isNone from 'ember-metal/is_none'; -import { symbol } from 'ember-metal/utils'; +import symbol from 'ember-metal/symbol'; import BasicStream from 'ember-metal/streams/stream'; import { read } from 'ember-metal/streams/utils'; import { labelForSubexpr } from 'ember-htmlbars/hooks/subexpr'; diff --git a/packages/ember-htmlbars/lib/keywords/mut.js b/packages/ember-htmlbars/lib/keywords/mut.js index 23399011db7..1c4362f77c9 100644 --- a/packages/ember-htmlbars/lib/keywords/mut.js +++ b/packages/ember-htmlbars/lib/keywords/mut.js @@ -4,7 +4,7 @@ */ import { assert } from 'ember-metal/debug'; -import { symbol } from 'ember-metal/utils'; +import symbol from 'ember-metal/symbol'; import ProxyStream from 'ember-metal/streams/proxy-stream'; import BasicStream from 'ember-metal/streams/stream'; import { isStream } from 'ember-metal/streams/utils'; diff --git a/packages/ember-htmlbars/lib/node-managers/component-node-manager.js b/packages/ember-htmlbars/lib/node-managers/component-node-manager.js index bc7ed0806de..40df227639b 100644 --- a/packages/ember-htmlbars/lib/node-managers/component-node-manager.js +++ b/packages/ember-htmlbars/lib/node-managers/component-node-manager.js @@ -8,7 +8,7 @@ import { instrument } from 'ember-htmlbars/system/instrumentation-support'; import LegacyEmberComponent from 'ember-views/components/component'; import GlimmerComponent from 'ember-htmlbars/glimmer-component'; import extractPositionalParams from 'ember-htmlbars/utils/extract-positional-params'; -import { symbol } from 'ember-metal/utils'; +import symbol from 'ember-metal/symbol'; import { setOwner } from 'container/owner'; // These symbols will be used to limit link-to's public API surface area. diff --git a/packages/ember-metal/lib/property_events.js b/packages/ember-metal/lib/property_events.js index 7db70472ea9..166f998ec1a 100644 --- a/packages/ember-metal/lib/property_events.js +++ b/packages/ember-metal/lib/property_events.js @@ -9,7 +9,7 @@ import { accumulateListeners } from 'ember-metal/events'; import ObserverSet from 'ember-metal/observer_set'; -import { symbol } from 'ember-metal/utils'; +import symbol from 'ember-metal/symbol'; export let PROPERTY_DID_CHANGE = symbol('PROPERTY_DID_CHANGE'); diff --git a/packages/ember-metal/lib/symbol.js b/packages/ember-metal/lib/symbol.js index e69de29bb2d..c06a279a093 100644 --- a/packages/ember-metal/lib/symbol.js +++ b/packages/ember-metal/lib/symbol.js @@ -0,0 +1,9 @@ +import { GUID_KEY, intern } from 'ember-metal/utils'; + +export default function symbol(debugName) { + // TODO: Investigate using platform symbols, but we do not + // want to require non-enumerability for this API, which + // would introduce a large cost. + + return intern(debugName + ' [id=' + GUID_KEY + Math.floor(Math.random() * new Date()) + ']'); +} diff --git a/packages/ember-metal/lib/utils.js b/packages/ember-metal/lib/utils.js index 9a939f89a45..23efbd2f4da 100644 --- a/packages/ember-metal/lib/utils.js +++ b/packages/ember-metal/lib/utils.js @@ -80,7 +80,7 @@ var stringCache = {}; @private @return {String} interned version of the provided string */ -function intern(str) { +export function intern(str) { var obj = {}; obj[str] = 1; for (var key in obj) { @@ -91,14 +91,6 @@ function intern(str) { return str; } -export function symbol(debugName) { - // TODO: Investigate using platform symbols, but we do not - // want to require non-enumerability for this API, which - // would introduce a large cost. - - return intern(debugName + ' [id=' + GUID_KEY + Math.floor(Math.random() * new Date()) + ']'); -} - /** A unique key used to assign guids and other private metadata to objects. If you inspect an object in your browser debugger you will often see these. diff --git a/packages/ember-routing-htmlbars/lib/keywords/closure-action.js b/packages/ember-routing-htmlbars/lib/keywords/closure-action.js index 0c284988967..ab0c4bcdbd7 100644 --- a/packages/ember-routing-htmlbars/lib/keywords/closure-action.js +++ b/packages/ember-routing-htmlbars/lib/keywords/closure-action.js @@ -3,7 +3,7 @@ import { read, readArray } from 'ember-metal/streams/utils'; -import { symbol } from 'ember-metal/utils'; +import symbol from 'ember-metal/symbol'; import { get } from 'ember-metal/property_get'; import { labelForSubexpr } from 'ember-htmlbars/hooks/subexpr'; import EmberError from 'ember-metal/error'; diff --git a/packages/ember-runtime/lib/system/core_object.js b/packages/ember-runtime/lib/system/core_object.js index 681e3bb29c9..748711c95b4 100644 --- a/packages/ember-runtime/lib/system/core_object.js +++ b/packages/ember-runtime/lib/system/core_object.js @@ -45,7 +45,7 @@ import { K } from 'ember-metal/core'; import { validatePropertyInjections } from 'ember-runtime/inject'; -import { symbol } from 'ember-metal/utils'; +import symbol from 'ember-metal/symbol'; export let POST_INIT = symbol('POST_INIT'); var schedule = run.schedule; diff --git a/packages/ember-views/lib/compat/attrs-proxy.js b/packages/ember-views/lib/compat/attrs-proxy.js index 4706acd500a..f9418ab4c40 100644 --- a/packages/ember-views/lib/compat/attrs-proxy.js +++ b/packages/ember-views/lib/compat/attrs-proxy.js @@ -1,5 +1,5 @@ import { Mixin } from 'ember-metal/mixin'; -import { symbol } from 'ember-metal/utils'; +import symbol from 'ember-metal/symbol'; import { PROPERTY_DID_CHANGE } from 'ember-metal/property_events'; export function deprecation(key) { diff --git a/packages/ember-views/lib/mixins/view_support.js b/packages/ember-views/lib/mixins/view_support.js index 9510d8f24e9..7d87703568d 100644 --- a/packages/ember-views/lib/mixins/view_support.js +++ b/packages/ember-views/lib/mixins/view_support.js @@ -8,7 +8,7 @@ import { computed } from 'ember-metal/computed'; import { Mixin } from 'ember-metal/mixin'; import { POST_INIT } from 'ember-runtime/system/core_object'; import isEnabled from 'ember-metal/features'; -import { symbol } from 'ember-metal/utils'; +import symbol from 'ember-metal/symbol'; import { getOwner } from 'container/owner'; const INIT_WAS_CALLED = symbol('INIT_WAS_CALLED');