Repository: ember-cli/ember-cli
Pull request #7794 (2018-04-27 00:42:04)

fixing a few typos, var names
Before checking in the package-info-cache, this PR is to just fix a few typos I found while doing that, to not conflate the two sets of changes.

Please take this PR ahead of #7729 .


Patch:
diff --git a/lib/cli/cli.js b/lib/cli/cli.js
index d36941c99..dd7396069 100644
--- a/lib/cli/cli.js
+++ b/lib/cli/cli.js
@@ -92,7 +92,7 @@ class CLI {
       let commandArgs = args;
       let helpOptions;
 
-      let commandLookupCreationtoken = heimdall.start('lookup-command');
+      let commandLookupCreationToken = heimdall.start('lookup-command');
 
       let CurrentCommand = lookupCommand(environment.commands, commandName, commandArgs, {
         project: environment.project,
@@ -110,7 +110,7 @@ class CLI {
         cli: this,
       });
 
-      commandLookupCreationtoken.stop();
+      commandLookupCreationToken.stop();
 
       getOptionArgs('--verbose', commandArgs).forEach(arg => {
         process.env[`EMBER_VERBOSE_${arg.toUpperCase()}`] = 'true';
diff --git a/lib/models/command.js b/lib/models/command.js
index b6a23ebeb..eba2bcced 100644
--- a/lib/models/command.js
+++ b/lib/models/command.js
@@ -552,7 +552,7 @@ let Command = CoreObject.extend({
     let validateParsed = function(key) {
       // ignore 'argv', 'h', and 'help'
       if (!commandOptions.hasOwnProperty(key) && key !== 'argv' && key !== 'h' && key !== 'help') {
-        this.ui.writeLine(chalk.yellow(`The option '--${key}' is not registered with the ${this.name} command. ` +
+        this.ui.writeLine(chalk.yellow(`The option '--${key}' is not registered with the '${this.name}' command. ` +
           `Run \`ember ${this.name} --help\` for a list of supported options.`));
       }
       if (typeof parsedOptions[key] !== 'object') {
diff --git a/lib/models/project.js b/lib/models/project.js
index 5116c32f8..a4ba6d3fa 100644
--- a/lib/models/project.js
+++ b/lib/models/project.js
@@ -17,6 +17,7 @@ const heimdall = require('heimdalljs');
 const experiments = require('../experiments');
 
 let processCwd = process.cwd();
+
 // ensure NULL_PROJECT is a singleton
 let NULL_PROJECT;
 
@@ -43,7 +44,7 @@ class Project {
     this.pkg = pkg;
     this.ui = ui;
     this.cli = cli;
-    this.addonPackages = {};
+    this.addonPackages = Object.create(null);
     this.addons = [];
     this.liveReloadFilterPatterns = [];
     this.setupBowerDirectory();
@@ -79,10 +80,10 @@ class Project {
   }
 
   /**
-    Sets the name of the bower directory for this project
-
-    @private
-    @method setupBowerDirectory
+   * Sets the name of the bower directory for this project
+   *
+   * @private
+   * @method setupBowerDirectory
    */
   setupBowerDirectory() {
     let bowerrcPath = path.join(this.root, '.bowerrc');
@@ -112,6 +113,7 @@ class Project {
       // Blueprint tests set this flag.
       return true;
     }
+
     for (let depName in this.dependencies()) {
       try {
         this.resolveSync(`${depName}/package.json`);
@@ -126,7 +128,6 @@ class Project {
     return false;
   }
 
-
   static nullProject(ui, cli) {
     if (NULL_PROJECT) { return NULL_PROJECT; }
 
@@ -225,7 +226,7 @@ class Project {
     @public
     @method config
     @param  {String} env Environment name
-    @return {Object}     Merged confiration object
+    @return {Object}     Merged configuration object
    */
   config(env) {
     let key = `${this.configPath()}|${env}`;
@@ -453,7 +454,7 @@ class Project {
    */
   addonCommands() {
     const Command = require('../models/command');
-    let commands = {};
+    let commands = Object.create(null);
     this.addons.forEach(addon => {
       if (!addon.includedCommands) { return; }
 
@@ -464,7 +465,7 @@ class Project {
       });
 
       let includedCommands = addon.includedCommands();
-      let addonCommands = {};
+      let addonCommands = Object.create(null);
 
       for (let key in includedCommands) {
         if (typeof includedCommands[key] === 'function') {


Test patch:
diff --git a/tests/acceptance/addon-generate-test.js b/tests/acceptance/addon-generate-test.js
index 92c410d2f..cf711c56a 100644
--- a/tests/acceptance/addon-generate-test.js
+++ b/tests/acceptance/addon-generate-test.js
@@ -77,7 +77,7 @@ describe('Acceptance: ember generate in-addon', function() {
     }
   }));
 
-  it('runs the `addon-import` bluprint from a classic addon', co.wrap(function *() {
+  it('runs the `addon-import` blueprint from a classic addon', co.wrap(function *() {
     yield initAddon('my-addon');
 
     yield outputFile(
@@ -92,7 +92,7 @@ describe('Acceptance: ember generate in-addon', function() {
   }));
 
   if (experiments.MODULE_UNIFICATION) {
-    it('does not run the `addon-import` bluprint from a module unification addon', co.wrap(function *() {
+    it('does not run the `addon-import` blueprint from a module unification addon', co.wrap(function *() {
       yield initAddon('my-addon');
       yield ensureDir('src');
 
@@ -108,7 +108,7 @@ describe('Acceptance: ember generate in-addon', function() {
     }));
   }
 
-  it('runs a custom "*-addon" bluprint from a classic addon', co.wrap(function *() {
+  it('runs a custom "*-addon" blueprint from a classic addon', co.wrap(function *() {
     yield initAddon('my-addon');
 
     yield outputFile(
@@ -128,7 +128,7 @@ describe('Acceptance: ember generate in-addon', function() {
   }));
 
   if (experiments.MODULE_UNIFICATION) {
-    it('skips a custom "*-addon" bluprint from a module unficiation addon', co.wrap(function *() {
+    it('skips a custom "*-addon" blueprint from a module unification addon', co.wrap(function *() {
       yield initAddon('my-addon');
       yield ensureDir('src');
 
diff --git a/tests/unit/models/addon-test.js b/tests/unit/models/addon-test.js
index 70ee278f2..fd9f73f22 100644
--- a/tests/unit/models/addon-test.js
+++ b/tests/unit/models/addon-test.js
@@ -424,7 +424,7 @@ describe('models/addon.js', function() {
         expect(addon.findOwnAddonByName('my-cool-addon')).to.eql(ownAddon);
       });
 
-      it('it does not the given addon', function() {
+      it('it does not have the given addon', function() {
         let addon = new ThisAddon();
         let ownAddon = { name: 'my-cool-addon' };
         addon.addons = [ownAddon];
diff --git a/tests/unit/models/command-test.js b/tests/unit/models/command-test.js
index d642653ef..67121efa2 100644
--- a/tests/unit/models/command-test.js
+++ b/tests/unit/models/command-test.js
@@ -140,7 +140,7 @@ describe('models/command.js', function() {
     new ServeCommand(Object.assign(options, {
       settings: config.getAll(),
     })).parseArgs(['foo', '--envirmont', 'production']);
-    expect(ui.output).to.match(/The option '--envirmont' is not registered with the serve command. Run `ember serve --help` for a list of supported options./);
+    expect(ui.output).to.match(/The option '--envirmont' is not registered with the 'serve' command. Run `ember serve --help` for a list of supported options./);
   });
 
   it('parseArgs() should parse shorthand options.', function() {