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

spring cleaning #13658

Merged
merged 1 commit into from
Jun 15, 2016
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 8 additions & 8 deletions packages/ember-application/lib/system/application-instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ const ApplicationInstance = EngineInstance.extend({
@private
*/
startRouting() {
var router = get(this, 'router');
let router = get(this, 'router');
router.startRouting();
this._didSetupRouter = true;
},
Expand All @@ -194,7 +194,7 @@ const ApplicationInstance = EngineInstance.extend({
if (this._didSetupRouter) { return; }
this._didSetupRouter = true;

var router = get(this, 'router');
let router = get(this, 'router');
router.setupRouter();
},

Expand All @@ -206,7 +206,7 @@ const ApplicationInstance = EngineInstance.extend({
@private
*/
handleURL(url) {
var router = get(this, 'router');
let router = get(this, 'router');

this.setupRouter();
return router.handleURL(url);
Expand All @@ -216,11 +216,11 @@ const ApplicationInstance = EngineInstance.extend({
@private
*/
setupEventDispatcher() {
var dispatcher = this.lookup('event_dispatcher:main');
var applicationCustomEvents = get(this.application, 'customEvents');
var instanceCustomEvents = get(this, 'customEvents');
let dispatcher = this.lookup('event_dispatcher:main');
let applicationCustomEvents = get(this.application, 'customEvents');
let instanceCustomEvents = get(this, 'customEvents');

var customEvents = assign({}, applicationCustomEvents, instanceCustomEvents);
let customEvents = assign({}, applicationCustomEvents, instanceCustomEvents);
dispatcher.setup(customEvents, this.rootElement);

return dispatcher;
Expand Down Expand Up @@ -482,7 +482,7 @@ Object.defineProperty(ApplicationInstance.prototype, 'container', {
configurable: true,
enumerable: false,
get() {
var instance = this;
let instance = this;
return {
lookup() {
deprecate(
Expand Down
42 changes: 20 additions & 22 deletions packages/ember-application/lib/system/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import RSVP from 'ember-runtime/ext/rsvp';
import Engine, { GLIMMER } from './engine';
import require from 'require';

var librariesRegistered = false;
let librariesRegistered = false;

let warnedAboutLegacyViewAddon = false;
let warnedAboutLegacyControllerAddon = false;
Expand Down Expand Up @@ -103,7 +103,7 @@ export function _resetLegacyAddonWarnings() {
names by setting the application's `customEvents` property:

```javascript
var App = Ember.Application.create({
let App = Ember.Application.create({
customEvents: {
// add support for the paste event
paste: 'paste'
Expand All @@ -116,7 +116,7 @@ export function _resetLegacyAddonWarnings() {
property:

```javascript
var App = Ember.Application.create({
let App = Ember.Application.create({
customEvents: {
// prevent listeners for mouseenter/mouseleave events
mouseenter: null,
Expand All @@ -134,7 +134,7 @@ export function _resetLegacyAddonWarnings() {
should be delegated, set your application's `rootElement` property:

```javascript
var App = Ember.Application.create({
let App = Ember.Application.create({
rootElement: '#ember-app'
});
```
Expand Down Expand Up @@ -177,7 +177,7 @@ export function _resetLegacyAddonWarnings() {
the `LOG_TRANSITIONS_INTERNAL` flag:

```javascript
var App = Ember.Application.create({
let App = Ember.Application.create({
LOG_TRANSITIONS: true, // basic logging of successful transitions
LOG_TRANSITIONS_INTERNAL: true // detailed logging of all routing steps
});
Expand Down Expand Up @@ -253,7 +253,7 @@ const Application = Engine.extend({
To add new events to be listened to:

```javascript
var App = Ember.Application.create({
let App = Ember.Application.create({
customEvents: {
// add support for the paste event
paste: 'paste'
Expand All @@ -264,7 +264,7 @@ const Application = Engine.extend({
To prevent default events from being listened to:

```javascript
var App = Ember.Application.create({
let App = Ember.Application.create({
customEvents: {
// remove support for mouseenter / mouseleave events
mouseenter: null,
Expand Down Expand Up @@ -299,7 +299,7 @@ const Application = Engine.extend({
classes.

```javascript
var App = Ember.Application.create({
let App = Ember.Application.create({
...
});

Expand Down Expand Up @@ -499,7 +499,7 @@ const Application = Engine.extend({
Example:

```javascript
var App = Ember.Application.create();
let App = Ember.Application.create();

App.deferReadiness();

Expand Down Expand Up @@ -623,7 +623,7 @@ const Application = Engine.extend({
Typical Example:

```javascript
var App;
let App;

run(function() {
App = Ember.Application.create();
Expand Down Expand Up @@ -651,7 +651,7 @@ const Application = Engine.extend({
to the app becoming ready.

```javascript
var App;
let App;

run(function() {
App = Ember.Application.create();
Expand Down Expand Up @@ -686,7 +686,7 @@ const Application = Engine.extend({
create new \`Ember.ApplicationInstance\`s and dispose them
via their \`destroy()\` method instead.`, this._globalsMode && this.autoboot);

var instance = this.__deprecatedInstance__;
let instance = this.__deprecatedInstance__;

this._readinessDeferrals = 1;
this._bootPromise = null;
Expand Down Expand Up @@ -1026,10 +1026,10 @@ Application.reopenClass({
commonSetupRegistry(registry);

if (options[GLIMMER]) {
var glimmerSetupRegistry = require('ember-glimmer/setup-registry').setupApplicationRegistry;
let glimmerSetupRegistry = require('ember-glimmer/setup-registry').setupApplicationRegistry;
glimmerSetupRegistry(registry);
} else {
var htmlbarsSetupRegistry = require('ember-htmlbars/setup-registry').setupApplicationRegistry;
let htmlbarsSetupRegistry = require('ember-htmlbars/setup-registry').setupApplicationRegistry;
htmlbarsSetupRegistry(registry);
}

Expand Down Expand Up @@ -1067,18 +1067,16 @@ function logLibraryVersions() {
if (ENV.LOG_VERSION) {
// we only need to see this once per Application#init
ENV.LOG_VERSION = false;
var libs = libraries._registry;
let libs = libraries._registry;

var nameLengths = libs.map(function(item) {
return get(item, 'name.length');
});
let nameLengths = libs.map(item => get(item, 'name.length'));

var maxNameLength = Math.max.apply(this, nameLengths);
let maxNameLength = Math.max.apply(this, nameLengths);

debug('-------------------------------');
for (var i = 0; i < libs.length; i++) {
var lib = libs[i];
var spaces = new Array(maxNameLength - lib.name.length + 1).join(' ');
for (let i = 0; i < libs.length; i++) {
let lib = libs[i];
let spaces = new Array(maxNameLength - lib.name.length + 1).join(' ');
debug([lib.name, spaces, ' : ', lib.version].join(''));
}
debug('-------------------------------');
Expand Down
8 changes: 2 additions & 6 deletions packages/ember-application/lib/system/engine-instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,12 @@ if (isEnabled('ember-application-engines')) {
'event_dispatcher:main',
P`-bucket-cache:main`,
'service:-routing'
].forEach((key) => {
this.register(key, parent.resolveRegistration(key));
});
].forEach(key => this.register(key, parent.resolveRegistration(key)));

[
'router:main',
'-view-registry:main'
].forEach((key) => {
this.register(key, parent.lookup(key), { instantiate: false });
});
].forEach(key => this.register(key, parent.lookup(key), { instantiate: false }));
}
});
}
Expand Down
28 changes: 12 additions & 16 deletions packages/ember-application/lib/system/engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const GLIMMER = symbol('GLIMMER');
function props(obj) {
var properties = [];

for (var key in obj) {
for (let key in obj) {
properties.push(key);
}

Expand Down Expand Up @@ -104,7 +104,7 @@ const Engine = Namespace.extend(RegistryProxy, {
@return {Ember.Registry} the configured registry
*/
buildRegistry() {
var registry = this.__registry__ = this.constructor.buildRegistry(this, {
let registry = this.__registry__ = this.constructor.buildRegistry(this, {
[GLIMMER]: this[GLIMMER]
});

Expand Down Expand Up @@ -163,19 +163,17 @@ const Engine = Namespace.extend(RegistryProxy, {
},

_runInitializer(bucketName, cb) {
var initializersByName = get(this.constructor, bucketName);
var initializers = props(initializersByName);
var graph = new DAG();
var initializer;
let initializersByName = get(this.constructor, bucketName);
let initializers = props(initializersByName);
let graph = new DAG();
let initializer;

for (var i = 0; i < initializers.length; i++) {
for (let i = 0; i < initializers.length; i++) {
initializer = initializersByName[initializers[i]];
graph.addEdges(initializer.name, initializer, initializer.before, initializer.after);
}

graph.topsort(function (vertex) {
cb(vertex.name, vertex.value);
});
graph.topsort(vertex => cb(vertex.name, vertex.value));
}
});

Expand Down Expand Up @@ -395,7 +393,7 @@ Engine.reopenClass({
@public
*/
buildRegistry(namespace, options = {}) {
var registry = new Registry({
let registry = new Registry({
resolver: resolverFor(namespace)
});

Expand All @@ -406,10 +404,10 @@ Engine.reopenClass({
commonSetupRegistry(registry);

if (options[GLIMMER]) {
var glimmerSetupRegistry = require('ember-glimmer/setup-registry').setupEngineRegistry;
let glimmerSetupRegistry = require('ember-glimmer/setup-registry').setupEngineRegistry;
glimmerSetupRegistry(registry);
} else {
var htmlbarsSetupRegistry = require('ember-htmlbars/setup-registry').setupEngineRegistry;
let htmlbarsSetupRegistry = require('ember-htmlbars/setup-registry').setupEngineRegistry;
htmlbarsSetupRegistry(registry);
}

Expand Down Expand Up @@ -466,7 +464,7 @@ function buildInitializerMethod(bucketName, humanName) {
// prototypal inheritance. Without this, attempting to add initializers to the subclass would
// pollute the parent class as well as other subclasses.
if (this.superclass[bucketName] !== undefined && this.superclass[bucketName] === this[bucketName]) {
var attrs = {};
let attrs = {};
attrs[bucketName] = Object.create(this[bucketName]);
this.reopenClass(attrs);
}
Expand Down Expand Up @@ -503,8 +501,6 @@ function commonSetupRegistry(registry) {

registry.injection('route', 'router', 'router:main');



// Register the routing service...
registry.register('service:-routing', RoutingService);
// Then inject the app router into it
Expand Down
Loading