From e24e403656b9de62d55b1a3111e4eb309276d4b8 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Fri, 11 Nov 2016 19:32:18 +0100 Subject: [PATCH] Code cleanup based on ESLint warnings --- STYLEGUIDE.md | 2 +- bin/changelog | 2 +- bin/feature-flag-yuidoc-filter.js | 33 ++++++------ bin/run-sauce-tests.js | 2 +- bin/run-travis-browser-tests.js | 1 - blueprints/-addon-import.js | 2 +- blueprints/component-addon/index.js | 2 +- blueprints/component-test/index.js | 6 +-- blueprints/component/index.js | 6 +-- blueprints/helper-test/index.js | 10 ++-- blueprints/route/index.js | 2 +- config/s3ProjectConfig.js | 4 +- ember-cli-build.js | 3 +- ...-inside-round-braces-in-call-expression.js | 2 - lib/packages.js | 2 - node-tests/blueprints/acceptance-test-test.js | 4 +- node-tests/blueprints/component-test.js | 8 +-- node-tests/blueprints/controller-test.js | 4 +- node-tests/blueprints/helper-test.js | 8 +-- node-tests/blueprints/initializer-test.js | 4 +- .../blueprints/instance-initializer-test.js | 4 +- node-tests/blueprints/mixin-test.js | 4 +- node-tests/blueprints/service-test.js | 4 +- node-tests/blueprints/template-test.js | 1 - node-tests/blueprints/util-test.js | 4 +- .../lib/system/application.js | 15 ++---- .../ember-application/lib/system/engine.js | 11 ++-- .../default_resolver_test.js | 18 +++---- .../tests/system/dependency_injection_test.js | 4 +- .../engine_instance_initializers_test.js | 4 +- .../tests/system/initializers_test.js | 2 +- .../tests/system/reset_test.js | 4 -- packages/ember-console/lib/index.js | 4 +- packages/ember-debug/lib/deprecate.js | 2 +- packages/ember-debug/tests/main_test.js | 10 ++-- .../lib/data_adapter.js | 2 +- .../lib/components/text_field.js | 2 +- packages/ember-glimmer/lib/index.js | 2 +- .../integration/components/append-test.js | 6 +-- .../components/curly-components-test.js | 27 ++-------- .../components/fragment-components-test.js | 15 ------ .../components/instrumentation-test.js | 2 +- .../integration/components/life-cycle-test.js | 52 +++++++++--------- .../components/local-lookup-test.js | 2 +- .../components/target-action-test.js | 2 +- .../helpers/closure-action-test.js | 9 ---- .../integration/helpers/custom-helper-test.js | 11 ++-- .../tests/integration/helpers/get-test.js | 11 ++-- .../tests/integration/helpers/partial-test.js | 14 ++--- .../tests/integration/helpers/unbound-test.js | 24 ++++----- .../tests/integration/helpers/yield-test.js | 4 +- .../tests/integration/outlet-test.js | 2 +- .../tests/integration/syntax/each-test.js | 8 +-- packages/ember-metal/lib/dependent_keys.js | 2 +- packages/ember-metal/lib/events.js | 2 +- packages/ember-metal/lib/instrumentation.js | 2 +- packages/ember-metal/lib/property_events.js | 2 +- packages/ember-metal/lib/transaction.js | 2 +- .../tests/accessors/mandatory_setters_test.js | 16 +++--- .../tests/accessors/set_path_test.js | 2 +- packages/ember-metal/tests/computed_test.js | 38 ++++++------- packages/ember-metal/tests/descriptor_test.js | 4 +- .../ember-metal/tests/mixin/reopen_test.js | 2 +- packages/ember-metal/tests/observer_test.js | 18 +++---- .../ember-metal/tests/run_loop/next_test.js | 3 +- .../ember-metal/tests/watching/watch_test.js | 6 +-- packages/ember-routing/lib/system/route.js | 7 +-- packages/ember-routing/lib/system/router.js | 2 +- packages/ember-routing/lib/utils.js | 2 +- .../ember-routing/tests/location/util_test.js | 1 - .../lib/mixins/action_handler.js | 5 +- packages/ember-runtime/lib/mixins/array.js | 2 +- .../ember-runtime/lib/mixins/enumerable.js | 3 +- .../tests/controllers/controller_test.js | 3 +- .../ember-runtime/tests/core/compare_test.js | 3 +- packages/ember-runtime/tests/ext/rsvp_test.js | 8 +-- .../mixins/observable/observable_test.js | 7 ++- .../mixins/observable/propertyChanges_test.js | 8 ++- .../tests/legacy_1x/system/binding_test.js | 6 +-- .../legacy_1x/system/object/base_test.js | 8 +-- .../legacy_1x/system/object/bindings_test.js | 14 ++--- .../tests/legacy_1x/system/run_loop_test.js | 10 ++-- .../tests/mixins/enumerable_test.js | 2 +- .../tests/mixins/mutable_enumerable_test.js | 4 +- .../tests/mixins/observable_test.js | 2 +- .../tests/mixins/promise_proxy_test.js | 2 +- packages/ember-runtime/tests/suites/array.js | 2 +- .../ember-runtime/tests/suites/enumerable.js | 6 +-- .../tests/suites/enumerable/filter.js | 2 +- packages/ember-runtime/tests/suites/suite.js | 2 +- .../system/object/es-compatibility-test.js | 8 +-- .../tests/system/object_proxy_test.js | 8 +-- .../lib/plugins/deprecate-render-model.js | 3 +- .../lib/plugins/deprecate-render.js | 3 +- .../plugins/transform-top-level-components.js | 2 - packages/ember-testing/tests/helpers_test.js | 3 +- packages/ember-utils/lib/apply-str.js | 12 ++--- .../ember-views/lib/mixins/action_support.js | 4 +- .../lib/system/event_dispatcher.js | 54 +++++++++---------- .../tests/component_registration_test.js | 2 +- .../link_to_transitioning_classes_test.js | 4 +- packages/ember/tests/routing/basic_test.js | 12 +---- .../ember/tests/routing/substates_test.js | 8 +-- .../ember/tests/routing/toplevel_dom_test.js | 4 +- .../lib/external-helpers-dev.js | 2 - .../lib/external-helpers-prod.js | 2 - packages/loader/lib/index.js | 1 - server/index.js | 2 +- tests/node/helpers/app-module.js | 16 +++--- tests/node/helpers/component-module.js | 2 +- tests/node/template-compiler-test.js | 2 +- vendor/ember/shims.js | 2 +- 112 files changed, 318 insertions(+), 441 deletions(-) diff --git a/STYLEGUIDE.md b/STYLEGUIDE.md index ec6211625a2..1590c2f9492 100644 --- a/STYLEGUIDE.md +++ b/STYLEGUIDE.md @@ -192,7 +192,7 @@ while (true) { try { // code that throws an error -} catch(e) { +} catch (e) { // code that handles an error } ``` diff --git a/bin/changelog b/bin/changelog index 12de72e087a..4f8ebd2632f 100755 --- a/bin/changelog +++ b/bin/changelog @@ -42,7 +42,7 @@ function getCommitMessage(commitInfo) { try { // command from http://stackoverflow.com/questions/8475448/find-merge-commit-which-include-a-specific-commit message = execSync('commit=$((git rev-list ' + originalCommit + '..origin/master --ancestry-path | cat -n; git rev-list ' + originalCommit + '..origin/master --first-parent | cat -n) | sort -k2 | uniq -f1 -d | sort -n | tail -1 | cut -f2) && git show --format="%s\n\n%b" $commit', { encoding: 'utf8' }); - } catch(e) { } + } catch (e) { } } return message; diff --git a/bin/feature-flag-yuidoc-filter.js b/bin/feature-flag-yuidoc-filter.js index f9d02692de1..d5d81bc22ea 100644 --- a/bin/feature-flag-yuidoc-filter.js +++ b/bin/feature-flag-yuidoc-filter.js @@ -11,19 +11,19 @@ function isClassToBeIncluded(item, featuresToFilter) { } } return true; -}; +} function gatherFeatures() { - var featuresJson = JSON.parse(fs.readFileSync('features.json')); - var featuresObj = featuresJson.features; - var featuresToFilter = []; - for (var feature in featuresObj) { - if (featuresObj[feature] === null || featuresObj[feature] === false) { - featuresToFilter.push(feature); - } + var featuresJson = JSON.parse(fs.readFileSync('features.json')); + var featuresObj = featuresJson.features; + var featuresToFilter = []; + for (var feature in featuresObj) { + if (featuresObj[feature] === null || featuresObj[feature] === false) { + featuresToFilter.push(feature); } - return featuresToFilter; -}; + } + return featuresToFilter; +} function gatherClassesToDocument(data, featuresToFilter) { var classesToDocument = {}; @@ -34,24 +34,23 @@ function gatherClassesToDocument(data, featuresToFilter) { } } return classesToDocument; -}; +} function updateClassReferencesInNamespaces(data) { for (var namespace in data.modules) { var namespaceClasses = {}; var originalClasses = data.modules[namespace].classes; - for(var className in originalClasses) { + for (var className in originalClasses) { if (data.classes.hasOwnProperty(className)) { namespaceClasses[className] = originalClasses[className] } } data.modules[namespace].classes = namespaceClasses; } - -}; +} module.exports = function (data, options) { - var featuresToFilter = gatherFeatures(); - data.classes = gatherClassesToDocument(data, featuresToFilter); - updateClassReferencesInNamespaces(data); + var featuresToFilter = gatherFeatures(); + data.classes = gatherClassesToDocument(data, featuresToFilter); + updateClassReferencesInNamespaces(data); }; diff --git a/bin/run-sauce-tests.js b/bin/run-sauce-tests.js index 06d62ac3d2b..7ca35774abb 100755 --- a/bin/run-sauce-tests.js +++ b/bin/run-sauce-tests.js @@ -50,7 +50,7 @@ RSVP.resolve() console.log('error'); console.log(error); process.exit(1); - }).then(function(){ + }).then(function() { console.log('success'); process.exit(0); }); diff --git a/bin/run-travis-browser-tests.js b/bin/run-travis-browser-tests.js index 7407ba5c8cd..be34083a905 100644 --- a/bin/run-travis-browser-tests.js +++ b/bin/run-travis-browser-tests.js @@ -2,7 +2,6 @@ var RSVP = require('rsvp'); var spawn = require('child_process').spawn; -var execSync = require('child_process').execSync; function run(command, _args) { var args = _args || []; diff --git a/blueprints/-addon-import.js b/blueprints/-addon-import.js index 3b83f2b8901..429cdc2efe2 100644 --- a/blueprints/-addon-import.js +++ b/blueprints/-addon-import.js @@ -38,7 +38,7 @@ module.exports = { var modulePathSegments = [addonName, inflector.pluralize(options.originBlueprintName), fileName]; if (blueprintName.match(/-addon/)) { - blueprintName = blueprintName.substr(0,blueprintName.indexOf('-addon')); + blueprintName = blueprintName.substr(0, blueprintName.indexOf('-addon')); modulePathSegments = [addonName, inflector.pluralize(blueprintName), fileName]; } diff --git a/blueprints/component-addon/index.js b/blueprints/component-addon/index.js index 626e24e1eba..3af402b242f 100644 --- a/blueprints/component-addon/index.js +++ b/blueprints/component-addon/index.js @@ -45,7 +45,7 @@ module.exports = { var importPathName = [addonName, 'components', fileName].join('/'); if (options.pod) { - importPathName = [addonName, 'components', fileName,'component'].join('/'); + importPathName = [addonName, 'components', fileName, 'component'].join('/'); } return { diff --git a/blueprints/component-test/index.js b/blueprints/component-test/index.js index 8a14227ac79..5e5470e8257 100644 --- a/blueprints/component-test/index.js +++ b/blueprints/component-test/index.js @@ -15,9 +15,9 @@ module.exports = useTestFrameworkDetector({ name: 'test-type', type: ['integration', 'unit'], default: 'integration', - aliases:[ - { 'i': 'integration'}, - { 'u': 'unit'}, + aliases: [ + { 'i': 'integration' }, + { 'u': 'unit' }, { 'integration': 'integration' }, { 'unit': 'unit' } ] diff --git a/blueprints/component/index.js b/blueprints/component/index.js index bcfaf3c6b8b..e05f6aaee38 100644 --- a/blueprints/component/index.js +++ b/blueprints/component/index.js @@ -16,8 +16,8 @@ module.exports = { name: 'path', type: String, default: 'components', - aliases:[ - {'no-path': ''} + aliases: [ + { 'no-path': '' } ] } ], @@ -57,7 +57,7 @@ module.exports = { var contents = ''; // if we're in an addon, build import statement if (options.project.isEmberCLIAddon() || options.inRepoAddon && !options.inDummy) { - if(options.pod) { + if (options.pod) { templatePath = './template'; } else { templatePath = pathUtil.getRelativeParentPath(options.entity.name) + diff --git a/blueprints/helper-test/index.js b/blueprints/helper-test/index.js index 198308aaeda..ff1bd06a8df 100644 --- a/blueprints/helper-test/index.js +++ b/blueprints/helper-test/index.js @@ -13,9 +13,9 @@ module.exports = useTestFrameworkDetector({ name: 'test-type', type: ['integration', 'unit'], default: 'unit', - aliases:[ - { 'i': 'integration'}, - { 'u': 'unit'}, + aliases: [ + { 'i': 'integration' }, + { 'u': 'unit' }, { 'integration': 'integration' }, { 'unit': 'unit' } ] @@ -38,7 +38,7 @@ module.exports = useTestFrameworkDetector({ return { friendlyTestName: friendlyTestName, dasherizedModulePrefix: stringUtils.dasherize(options.project.config().modulePrefix), - testType:testType + testType: testType }; }, @@ -49,4 +49,4 @@ module.exports = useTestFrameworkDetector({ ]); } } -}); \ No newline at end of file +}); diff --git a/blueprints/route/index.js b/blueprints/route/index.js index d1b1f543820..64f50ae5002 100644 --- a/blueprints/route/index.js +++ b/blueprints/route/index.js @@ -45,7 +45,7 @@ module.exports = { } if (options.inDummy) { - return path.join('tests','dummy','app'); + return path.join('tests', 'dummy', 'app'); } if (options.inAddon) { diff --git a/config/s3ProjectConfig.js b/config/s3ProjectConfig.js index 103a38686bd..97cc7992e39 100644 --- a/config/s3ProjectConfig.js +++ b/config/s3ProjectConfig.js @@ -1,4 +1,4 @@ -function fileMap(revision,tag,date) { +function fileMap(revision, tag, date) { return { "ember.js": fileObject("ember", ".js", "text/javascript", revision, tag, date), "ember.debug.js": fileObject("ember.debug", ".js", "text/javascript", revision, tag, date), @@ -15,7 +15,7 @@ function fileMap(revision,tag,date) { "composer.json": fileObject("composer", ".json", "application/json", revision, tag, date), "package.json": fileObject("package", ".json", "application/json", revision, tag, date), }; -}; +} function fileObject(baseName, extension, contentType, currentRevision, tag, date) { var fullName = "/" + baseName + extension; diff --git a/ember-cli-build.js b/ember-cli-build.js index 4ca6673b1a2..f3af79ff85d 100644 --- a/ember-cli-build.js +++ b/ember-cli-build.js @@ -17,7 +17,6 @@ var filterImports = require('babel-plugin-filter-imports'); var vendoredPackage = require('emberjs-build/lib/vendored-package'); var htmlbarsPackage = require('emberjs-build/lib/htmlbars-package'); -var vendoredES6Package = require('emberjs-build/lib/es6-vendored-package'); var replaceVersion = require('emberjs-build/lib/utils/replace-version'); var Funnel = require('broccoli-funnel'); @@ -254,7 +253,7 @@ module.exports = function() { 'router': router(), 'dag-map': dag(), 'route-recognizer': routeRecognizer(), - 'simple-html-tokenizer': htmlbarsPackage('simple-html-tokenizer', { libPath: 'node_modules/glimmer-engine/dist/es6'}), + 'simple-html-tokenizer': htmlbarsPackage('simple-html-tokenizer', { libPath: 'node_modules/glimmer-engine/dist/es6' }), 'glimmer': glimmerPackage('glimmer'), 'glimmer-compiler': glimmerPackage('glimmer-compiler'), diff --git a/lib/jscs-rules/disallow-space-inside-round-braces-in-call-expression.js b/lib/jscs-rules/disallow-space-inside-round-braces-in-call-expression.js index 3685932f017..1245ee81680 100644 --- a/lib/jscs-rules/disallow-space-inside-round-braces-in-call-expression.js +++ b/lib/jscs-rules/disallow-space-inside-round-braces-in-call-expression.js @@ -35,8 +35,6 @@ module.exports.prototype = { }, check: function(file, errors) { - var tokens = file.getTokens(); - file.iterateNodesByType('CallExpression', function(node) { var nodeBeforeRoundBrace = node; diff --git a/lib/packages.js b/lib/packages.js index a88721bd8e0..93b80b956c0 100644 --- a/lib/packages.js +++ b/lib/packages.js @@ -1,5 +1,3 @@ -var fs = require('fs'); - module.exports = function(features) { var packages = { 'container': { trees: null, requirements: ['ember-utils'] }, diff --git a/node-tests/blueprints/acceptance-test-test.js b/node-tests/blueprints/acceptance-test-test.js index 36d3853ba54..acaa3739d94 100644 --- a/node-tests/blueprints/acceptance-test-test.js +++ b/node-tests/blueprints/acceptance-test-test.js @@ -68,8 +68,8 @@ describe('Acceptance: ember generate and destroy acceptance-test', function() { return emberNew() .then(() => modifyPackages([ - {name: 'ember-cli-qunit', delete: true}, - {name: 'ember-cli-mocha', dev: true} + { name: 'ember-cli-qunit', delete: true }, + { name: 'ember-cli-mocha', dev: true } ])) .then(() => emberGenerateDestroy(args, _file => { expect(_file('tests/acceptance/foo-test.js')) diff --git a/node-tests/blueprints/component-test.js b/node-tests/blueprints/component-test.js index ce234fc7f36..903012a1793 100644 --- a/node-tests/blueprints/component-test.js +++ b/node-tests/blueprints/component-test.js @@ -791,8 +791,8 @@ describe('Acceptance: ember generate component', function() { return emberNew() .then(() => modifyPackages([ - {name: 'ember-cli-qunit', delete: true}, - {name: 'ember-cli-mocha', dev: true} + { name: 'ember-cli-qunit', delete: true }, + { name: 'ember-cli-mocha', dev: true } ])) .then(() => emberGenerateDestroy(args, _file => { expect(_file('tests/integration/components/x-foo-test.js')) @@ -810,8 +810,8 @@ describe('Acceptance: ember generate component', function() { return emberNew() .then(() => modifyPackages([ - {name: 'ember-cli-qunit', delete: true}, - {name: 'ember-cli-mocha', dev: true} + { name: 'ember-cli-qunit', delete: true }, + { name: 'ember-cli-mocha', dev: true } ])) .then(() => emberGenerateDestroy(args, _file => { expect(_file('tests/unit/components/x-foo-test.js')) diff --git a/node-tests/blueprints/controller-test.js b/node-tests/blueprints/controller-test.js index 58bbf23299b..7ebfa336ae8 100644 --- a/node-tests/blueprints/controller-test.js +++ b/node-tests/blueprints/controller-test.js @@ -238,8 +238,8 @@ describe('Acceptance: ember generate and destroy controller', function() { return emberNew() .then(() => modifyPackages([ - {name: 'ember-cli-qunit', delete: true}, - {name: 'ember-cli-mocha', dev: true} + { name: 'ember-cli-qunit', delete: true }, + { name: 'ember-cli-mocha', dev: true } ])) .then(() => emberGenerateDestroy(args, _file => { expect(_file('tests/unit/controllers/foo-test.js')) diff --git a/node-tests/blueprints/helper-test.js b/node-tests/blueprints/helper-test.js index 4379b587d08..e794b1dc354 100644 --- a/node-tests/blueprints/helper-test.js +++ b/node-tests/blueprints/helper-test.js @@ -249,8 +249,8 @@ describe('Acceptance: ember generate and destroy helper', function() { return emberNew() .then(() => modifyPackages([ - {name: 'ember-cli-qunit', delete: true}, - {name: 'ember-cli-mocha', dev: true} + { name: 'ember-cli-qunit', delete: true }, + { name: 'ember-cli-mocha', dev: true } ])) .then(() => emberGenerateDestroy(args, _file => { expect(_file('tests/integration/helpers/foo/bar-baz-test.js')) @@ -264,8 +264,8 @@ describe('Acceptance: ember generate and destroy helper', function() { return emberNew() .then(() => modifyPackages([ - {name: 'ember-cli-qunit', delete: true}, - {name: 'ember-cli-mocha', dev: true} + { name: 'ember-cli-qunit', delete: true }, + { name: 'ember-cli-mocha', dev: true } ])) .then(() => emberGenerateDestroy(args, _file => { expect(_file('tests/unit/helpers/foo/bar-baz-test.js')) diff --git a/node-tests/blueprints/initializer-test.js b/node-tests/blueprints/initializer-test.js index ece49b61723..9ff79920df9 100644 --- a/node-tests/blueprints/initializer-test.js +++ b/node-tests/blueprints/initializer-test.js @@ -296,8 +296,8 @@ describe('Acceptance: ember generate and destroy initializer', function() { return emberNew() .then(() => modifyPackages([ - {name: 'ember-cli-qunit', delete: true}, - {name: 'ember-cli-mocha', dev: true} + { name: 'ember-cli-qunit', delete: true }, + { name: 'ember-cli-mocha', dev: true } ])) .then(() => emberGenerateDestroy(args, _file => { expect(_file('tests/unit/initializers/foo-test.js')) diff --git a/node-tests/blueprints/instance-initializer-test.js b/node-tests/blueprints/instance-initializer-test.js index ccd01e03001..a32187de4ec 100644 --- a/node-tests/blueprints/instance-initializer-test.js +++ b/node-tests/blueprints/instance-initializer-test.js @@ -296,8 +296,8 @@ describe('Acceptance: ember generate and destroy instance-initializer', function return emberNew() .then(() => modifyPackages([ - {name: 'ember-cli-qunit', delete: true}, - {name: 'ember-cli-mocha', dev: true} + { name: 'ember-cli-qunit', delete: true }, + { name: 'ember-cli-mocha', dev: true } ])) .then(() => emberGenerateDestroy(args, _file => { expect(_file('tests/unit/instance-initializers/foo-test.js')) diff --git a/node-tests/blueprints/mixin-test.js b/node-tests/blueprints/mixin-test.js index 052339ef73c..4fe7141c540 100644 --- a/node-tests/blueprints/mixin-test.js +++ b/node-tests/blueprints/mixin-test.js @@ -235,8 +235,8 @@ describe('Acceptance: ember generate and destroy mixin', function() { return emberNew() .then(() => modifyPackages([ - {name: 'ember-cli-qunit', delete: true}, - {name: 'ember-cli-mocha', dev: true} + { name: 'ember-cli-qunit', delete: true }, + { name: 'ember-cli-mocha', dev: true } ])) .then(() => emberGenerateDestroy(args, _file => { expect(_file('tests/unit/mixins/foo-test.js')) diff --git a/node-tests/blueprints/service-test.js b/node-tests/blueprints/service-test.js index 0250a3c516b..57719efc405 100644 --- a/node-tests/blueprints/service-test.js +++ b/node-tests/blueprints/service-test.js @@ -170,8 +170,8 @@ describe('Acceptance: ember generate and destroy service', function() { return emberNew() .then(() => modifyPackages([ - {name: 'ember-cli-qunit', delete: true}, - {name: 'ember-cli-mocha', dev: true} + { name: 'ember-cli-qunit', delete: true }, + { name: 'ember-cli-mocha', dev: true } ])) .then(() => emberGenerateDestroy(args, _file => { expect(_file('tests/unit/services/foo-test.js')) diff --git a/node-tests/blueprints/template-test.js b/node-tests/blueprints/template-test.js index 9a8635f288b..326330eb1da 100644 --- a/node-tests/blueprints/template-test.js +++ b/node-tests/blueprints/template-test.js @@ -133,5 +133,4 @@ describe('Acceptance: ember generate and destroy template', function() { expect(_file('lib/my-addon/addon/templates/foo/bar.hbs')).to.equal(''); })); }); - }); diff --git a/node-tests/blueprints/util-test.js b/node-tests/blueprints/util-test.js index f3c69edf4ea..5e7886c7503 100644 --- a/node-tests/blueprints/util-test.js +++ b/node-tests/blueprints/util-test.js @@ -150,8 +150,8 @@ describe('Acceptance: ember generate and destroy util', function() { return emberNew() .then(() => modifyPackages([ - {name: 'ember-cli-qunit', delete: true}, - {name: 'ember-cli-mocha', dev: true} + { name: 'ember-cli-qunit', delete: true }, + { name: 'ember-cli-mocha', dev: true } ])) .then(() => emberGenerateDestroy(args, _file => { expect(_file('tests/unit/utils/foo-bar-test.js')) diff --git a/packages/ember-application/lib/system/application.js b/packages/ember-application/lib/system/application.js index 72a58710618..534efb0a724 100644 --- a/packages/ember-application/lib/system/application.js +++ b/packages/ember-application/lib/system/application.js @@ -37,15 +37,6 @@ import { setupApplicationRegistry } from 'ember-glimmer'; let librariesRegistered = false; -let warnedAboutLegacyViewAddon = false; -let warnedAboutLegacyControllerAddon = false; - -// For testing -export function _resetLegacyAddonWarnings() { - warnedAboutLegacyViewAddon = false; - warnedAboutLegacyControllerAddon = false; -} - /** An instance of `Ember.Application` is the starting point for every Ember application. It helps to instantiate, initialize and coordinate the many @@ -563,7 +554,7 @@ const Application = Engine.extend({ try { this._bootSync(); - } catch(_) { + } catch (_) { // Ignore th error: in the asynchronous boot path, the error is already reflected // in the promise rejection } @@ -601,7 +592,7 @@ const Application = Engine.extend({ runLoadHooks('application', this); this.advanceReadiness(); // Continues to `didBecomeReady` - } catch(error) { + } catch (error) { // For the asynchronous boot path defer.reject(error); @@ -743,7 +734,7 @@ const Application = Engine.extend({ // For the synchronous boot path this._booted = true; - } catch(error) { + } catch (error) { // For the asynchronous boot path this._bootResolver.reject(error); diff --git a/packages/ember-application/lib/system/engine.js b/packages/ember-application/lib/system/engine.js index c1d881495b2..f3554bc0a9e 100644 --- a/packages/ember-application/lib/system/engine.js +++ b/packages/ember-application/lib/system/engine.js @@ -127,12 +127,11 @@ const Engine = Namespace.extend(RegistryProxyMixin, { assert('No application initializer named \'' + name + '\'', !!initializer); if (initializer.initialize.length === 2) { deprecate('The `initialize` method for Application initializer \'' + name + '\' should take only one argument - `App`, an instance of an `Application`.', - false, - { - id: 'ember-application.app-initializer-initialize-arguments', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x/#toc_initializer-arity' - }); + false, { + id: 'ember-application.app-initializer-initialize-arguments', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x/#toc_initializer-arity' + }); initializer.initialize(this.__registry__, this); } else { diff --git a/packages/ember-application/tests/system/dependency_injection/default_resolver_test.js b/packages/ember-application/tests/system/dependency_injection/default_resolver_test.js index 76e817ea84d..df67be92f9a 100644 --- a/packages/ember-application/tests/system/dependency_injection/default_resolver_test.js +++ b/packages/ember-application/tests/system/dependency_injection/default_resolver_test.js @@ -139,14 +139,14 @@ QUnit.test('the default resolver resolves to the same instance, no matter the no }); QUnit.test('the default resolver throws an error if the fullName to resolve is invalid', function() { - throws(() => { registry.resolve(undefined);}, TypeError, /Invalid fullName/ ); - throws(() => { registry.resolve(null); }, TypeError, /Invalid fullName/ ); - throws(() => { registry.resolve(''); }, TypeError, /Invalid fullName/ ); - throws(() => { registry.resolve(''); }, TypeError, /Invalid fullName/ ); - throws(() => { registry.resolve(':'); }, TypeError, /Invalid fullName/ ); - throws(() => { registry.resolve('model'); }, TypeError, /Invalid fullName/ ); - throws(() => { registry.resolve('model:'); }, TypeError, /Invalid fullName/ ); - throws(() => { registry.resolve(':type'); }, TypeError, /Invalid fullName/ ); + throws(() => { registry.resolve(undefined);}, TypeError, /Invalid fullName/); + throws(() => { registry.resolve(null); }, TypeError, /Invalid fullName/); + throws(() => { registry.resolve(''); }, TypeError, /Invalid fullName/); + throws(() => { registry.resolve(''); }, TypeError, /Invalid fullName/); + throws(() => { registry.resolve(':'); }, TypeError, /Invalid fullName/); + throws(() => { registry.resolve('model'); }, TypeError, /Invalid fullName/); + throws(() => { registry.resolve('model:'); }, TypeError, /Invalid fullName/); + throws(() => { registry.resolve(':type'); }, TypeError, /Invalid fullName/); }); QUnit.test('the default resolver logs hits if `LOG_RESOLVER` is set', function() { @@ -200,7 +200,7 @@ QUnit.test('doesn\'t log without LOG_RESOLVER', function() { application.ScoobyDoo = EmberObject.extend(); - setDebugFunction('info', (symbol, name) => infoCount = infoCount + 1 ); + setDebugFunction('info', (symbol, name) => infoCount = infoCount + 1); registry.resolve('doo:scooby'); registry.resolve('doo:scrappy'); diff --git a/packages/ember-application/tests/system/dependency_injection_test.js b/packages/ember-application/tests/system/dependency_injection_test.js index 0860b3d0573..be4c4b85b74 100644 --- a/packages/ember-application/tests/system/dependency_injection_test.js +++ b/packages/ember-application/tests/system/dependency_injection_test.js @@ -6,7 +6,7 @@ import Application from '../../system/application'; let EmberApplication = Application; let originalLookup = context.lookup; -let registry, locator, lookup, application, originalModelInjections; +let registry, locator, application, originalModelInjections; QUnit.module('Ember.Application Dependency Injection', { setup() { @@ -30,7 +30,7 @@ QUnit.module('Ember.Application Dependency Injection', { registry = application.__registry__; locator = application.__container__; - lookup = context.lookup = {}; + context.lookup = {}; }, teardown() { run(application, 'destroy'); diff --git a/packages/ember-application/tests/system/engine_instance_initializers_test.js b/packages/ember-application/tests/system/engine_instance_initializers_test.js index 8b6c8654bfb..639c08d9207 100644 --- a/packages/ember-application/tests/system/engine_instance_initializers_test.js +++ b/packages/ember-application/tests/system/engine_instance_initializers_test.js @@ -3,9 +3,7 @@ import Engine from '../../system/engine'; import EngineInstance from '../../system/engine-instance'; import { setEngineParent } from '../../system/engine-parent'; -let MyEngine, - myEngine, - myEngineInstance; +let MyEngine, myEngine, myEngineInstance; function buildEngineInstance(EngineClass) { let engineInstance = EngineClass.buildInstance(); diff --git a/packages/ember-application/tests/system/initializers_test.js b/packages/ember-application/tests/system/initializers_test.js index 35be25ffcf8..e324e2f4bfe 100644 --- a/packages/ember-application/tests/system/initializers_test.js +++ b/packages/ember-application/tests/system/initializers_test.js @@ -55,7 +55,7 @@ QUnit.test('initializers that throw errors cause the boot promise to reject with equal(err.message, 'boot failure'); } ); - } catch(e) { + } catch (e) { QUnit.start(); ok(false, 'The boot method should not throw'); throw e; diff --git a/packages/ember-application/tests/system/reset_test.js b/packages/ember-application/tests/system/reset_test.js index 3629d36bb06..c93602a22b1 100644 --- a/packages/ember-application/tests/system/reset_test.js +++ b/packages/ember-application/tests/system/reset_test.js @@ -193,10 +193,6 @@ QUnit.test('When an application with advance/deferReadiness is reset, the app do }); QUnit.test('With ember-data like initializer and constant', function() { - let readyCallCount; - - readyCallCount = 0; - let DS = { Store: EmberObject.extend({ init() { diff --git a/packages/ember-console/lib/index.js b/packages/ember-console/lib/index.js index ffb7c416875..8f8e596f4f3 100644 --- a/packages/ember-console/lib/index.js +++ b/packages/ember-console/lib/index.js @@ -1,6 +1,6 @@ import { context } from 'ember-environment'; -function K(){} +function K() {} function consoleMethod(name) { let consoleObj; @@ -30,7 +30,7 @@ function assertPolyfill(test, message) { try { // attempt to preserve the stack throw new Error('assertion failed: ' + message); - } catch(error) { + } catch (error) { setTimeout(() => { throw error; }, 0); diff --git a/packages/ember-debug/lib/deprecate.js b/packages/ember-debug/lib/deprecate.js index 9f82d1f3d41..3d7190e97f8 100644 --- a/packages/ember-debug/lib/deprecate.js +++ b/packages/ember-debug/lib/deprecate.js @@ -39,7 +39,7 @@ if (new Error().stack) { }; } else { captureErrorForStack = function() { - try { __fail__.fail(); } catch(e) { return e; } + try { __fail__.fail(); } catch (e) { return e; } }; } diff --git a/packages/ember-debug/tests/main_test.js b/packages/ember-debug/tests/main_test.js index a7071a1c27b..09b43a2adf4 100644 --- a/packages/ember-debug/tests/main_test.js +++ b/packages/ember-debug/tests/main_test.js @@ -46,7 +46,7 @@ QUnit.test('Ember.deprecate does not throw if RAISE_ON_DEPRECATION is false', fu try { deprecate('Should not throw', false, { id: 'test', until: 'forever' }); assert.ok(true, 'Ember.deprecate did not throw'); - } catch(e) { + } catch (e) { assert.ok(false, `Expected deprecate not to throw but it did: ${e.message}`); } }); @@ -59,7 +59,7 @@ QUnit.test('Ember.deprecate resets deprecation level to RAISE if ENV.RAISE_ON_DE try { deprecate('Should not throw', false, { id: 'test', until: 'forever' }); assert.ok(true, 'Ember.deprecate did not throw'); - } catch(e) { + } catch (e) { assert.ok(false, `Expected deprecate not to throw but it did: ${e.message}`); } @@ -83,7 +83,7 @@ QUnit.test('When ENV.RAISE_ON_DEPRECATION is true, it is still possible to silen try { deprecate('should be silenced with matching id', false, { id: 'my-deprecation', until: 'forever' }); assert.ok(true, 'Did not throw when level is set by id'); - } catch(e) { + } catch (e) { assert.ok(false, `Expected deprecate not to throw but it did: ${e.message}`); } @@ -177,14 +177,14 @@ QUnit.test('Ember.deprecate does not throw a deprecation at log and silence leve try { deprecate('Deprecation for testing purposes', false, { id, until }); ok(true, 'Deprecation did not throw'); - } catch(e) { + } catch (e) { ok(false, 'Deprecation was thrown despite being added to blacklist'); } try { deprecate('Deprecation for testing purposes', false, { id, until }); ok(true, 'Deprecation did not throw'); - } catch(e) { + } catch (e) { ok(false, 'Deprecation was thrown despite being added to blacklist'); } diff --git a/packages/ember-extension-support/lib/data_adapter.js b/packages/ember-extension-support/lib/data_adapter.js index 03bd07f0a15..c81769582c6 100644 --- a/packages/ember-extension-support/lib/data_adapter.js +++ b/packages/ember-extension-support/lib/data_adapter.js @@ -154,7 +154,7 @@ export default EmberObject.extend({ typesAdded(typesToSend); let release = () => { - releaseMethods.forEach((fn) => fn() ); + releaseMethods.forEach((fn) => fn()); this.releaseMethods.removeObject(release); }; this.releaseMethods.pushObject(release); diff --git a/packages/ember-glimmer/lib/components/text_field.js b/packages/ember-glimmer/lib/components/text_field.js index 1100535cd8a..bc838f24f97 100644 --- a/packages/ember-glimmer/lib/components/text_field.js +++ b/packages/ember-glimmer/lib/components/text_field.js @@ -30,7 +30,7 @@ function canSetTypeOfInput(type) { try { inputTypeTestElement.type = type; - } catch(e) { } + } catch (e) { } return inputTypes[type] = inputTypeTestElement.type === type; } diff --git a/packages/ember-glimmer/lib/index.js b/packages/ember-glimmer/lib/index.js index 7ba410f96e8..da0465c1cff 100644 --- a/packages/ember-glimmer/lib/index.js +++ b/packages/ember-glimmer/lib/index.js @@ -204,7 +204,7 @@ export { registerSyntax } from './syntax'; export { default as template } from './template'; export { default as Checkbox } from './components/checkbox'; export { default as TextField } from './components/text_field'; -export { default as TextArea} from './components/text_area'; +export { default as TextArea } from './components/text_area'; export { default as LinkComponent } from './components/link-to'; export { default as Component } from './component'; export { default as Helper, helper } from './helper'; diff --git a/packages/ember-glimmer/tests/integration/components/append-test.js b/packages/ember-glimmer/tests/integration/components/append-test.js index 2bcd30e3711..45afb0bb765 100644 --- a/packages/ember-glimmer/tests/integration/components/append-test.js +++ b/packages/ember-glimmer/tests/integration/components/append-test.js @@ -424,7 +424,7 @@ class AbstractAppendTest extends RenderingTest { return this.append(component); }; - let wrapper1, wrapper2, element1, element2; + let element1, element2; this.registerComponent('first-component', { ComponentClass: Component.extend({ layout: compile('component-one'), @@ -433,7 +433,7 @@ class AbstractAppendTest extends RenderingTest { element1 = this.element; let SecondComponent = owner._lookupFactory('component:second-component'); - wrapper2 = append(SecondComponent.create()); + append(SecondComponent.create()); } }) }); @@ -450,7 +450,7 @@ class AbstractAppendTest extends RenderingTest { let FirstComponent = this.owner._lookupFactory('component:first-component'); - this.runTask(() => wrapper1 = append(FirstComponent.create())); + this.runTask(() => append(FirstComponent.create())); this.assertComponentElement(element1, { content: 'component-one' }); this.assertComponentElement(element2, { content: 'component-two' }); diff --git a/packages/ember-glimmer/tests/integration/components/curly-components-test.js b/packages/ember-glimmer/tests/integration/components/curly-components-test.js index 6c8222c32a6..5ddaae571a1 100644 --- a/packages/ember-glimmer/tests/integration/components/curly-components-test.js +++ b/packages/ember-glimmer/tests/integration/components/curly-components-test.js @@ -906,7 +906,6 @@ moduleFor('Components test: curly components', class extends RenderingTest { ['@test late bound layouts return the same definition'](assert) { let templateIds = []; - let component; // This is testing the scenario where you import a template and // set it to the layout property: @@ -923,7 +922,6 @@ moduleFor('Components test: curly components', class extends RenderingTest { init() { this._super(...arguments); this.layout = this.cond ? hello : bye; - component = this; templateIds.push(this.layout.id); } }); @@ -2126,7 +2124,7 @@ moduleFor('Components test: curly components', class extends RenderingTest { expectDeprecation(/modified wrapper.content twice on in a single render/); } - let outer, middle; + let outer; this.registerComponent('x-outer', { ComponentClass: Component.extend({ @@ -2142,10 +2140,6 @@ moduleFor('Components test: curly components', class extends RenderingTest { this.registerComponent('x-inner', { ComponentClass: Component.extend({ - init() { - this._super(...arguments); - middle = this; - }, didReceiveAttrs() { this.get('wrapper').set('content', this.get('value')); }, @@ -2224,16 +2218,10 @@ moduleFor('Components test: curly components', class extends RenderingTest { } ['@test specifying classNames results in correct class'](assert) { - let clickyThing; - this.registerComponent('some-clicky-thing', { ComponentClass: Component.extend({ tagName: 'button', - classNames: ['foo', 'bar'], - init() { - this._super(...arguments); - clickyThing = this; - } + classNames: ['foo', 'bar'] }) }); @@ -2261,15 +2249,10 @@ moduleFor('Components test: curly components', class extends RenderingTest { } ['@test specifying custom concatenatedProperties avoids clobbering'](assert) { - let clickyThing; this.registerComponent('some-clicky-thing', { ComponentClass: Component.extend({ concatenatedProperties: ['blahzz'], - blahzz: ['blark', 'pory'], - init() { - this._super(...arguments); - clickyThing = this; - } + blahzz: ['blark', 'pory'] }), template: strip` {{#each blahzz as |p|}} @@ -2675,8 +2658,6 @@ moduleFor('Components test: curly components', class extends RenderingTest { } ['@test child triggers revalidate during parent destruction (GH#13846)']() { - let select; - this.registerComponent('x-select', { ComponentClass: Component.extend({ tagName: 'select', @@ -2685,8 +2666,6 @@ moduleFor('Components test: curly components', class extends RenderingTest { this._super(); this.options = emberA([]); this.value = null; - - select = this; }, updateValue() { diff --git a/packages/ember-glimmer/tests/integration/components/fragment-components-test.js b/packages/ember-glimmer/tests/integration/components/fragment-components-test.js index c00e652a9a8..26602709d84 100644 --- a/packages/ember-glimmer/tests/integration/components/fragment-components-test.js +++ b/packages/ember-glimmer/tests/integration/components/fragment-components-test.js @@ -47,14 +47,9 @@ moduleFor('Components test: fragment components', class extends RenderingTest { } ['@test throws an error if an event function is defined in a tagless component']() { - let instance; let template = `hit dem folks`; let FooBarComponent = Component.extend({ tagName: '', - init() { - this._super(); - instance = this; - }, click() { } }); @@ -66,14 +61,9 @@ moduleFor('Components test: fragment components', class extends RenderingTest { } ['@test throws an error if a custom defined event function is defined in a tagless component']() { - let instance; let template = `hit dem folks`; let FooBarComponent = Component.extend({ tagName: '', - init() { - this._super(); - instance = this; - }, folks() { } }); @@ -85,14 +75,9 @@ moduleFor('Components test: fragment components', class extends RenderingTest { } ['@test throws an error if `tagName` is an empty string and `classNameBindings` are specified']() { - let instance; let template = `hit dem folks`; let FooBarComponent = Component.extend({ tagName: '', - init() { - this._super(); - instance = this; - }, foo: true, classNameBindings: ['foo:is-foo:is-bar'] }); diff --git a/packages/ember-glimmer/tests/integration/components/instrumentation-test.js b/packages/ember-glimmer/tests/integration/components/instrumentation-test.js index 5181940f7b2..20878469a0c 100644 --- a/packages/ember-glimmer/tests/integration/components/instrumentation-test.js +++ b/packages/ember-glimmer/tests/integration/components/instrumentation-test.js @@ -123,7 +123,7 @@ moduleFor('Components instrumentation', class extends RenderingTest { } _assertEvents(label, actual, expected, initialRender) { - this.assert.equal(actual.length, expected.length , `${label}: expected ${expected.length} and got ${actual.length}`); + this.assert.equal(actual.length, expected.length, `${label}: expected ${expected.length} and got ${actual.length}`); actual.forEach((payload, i) => this.assertPayload(payload, expected[i], initialRender)); } diff --git a/packages/ember-glimmer/tests/integration/components/life-cycle-test.js b/packages/ember-glimmer/tests/integration/components/life-cycle-test.js index 644a2ddaa12..f14e16be107 100644 --- a/packages/ember-glimmer/tests/integration/components/life-cycle-test.js +++ b/packages/ember-glimmer/tests/integration/components/life-cycle-test.js @@ -1106,34 +1106,34 @@ class LifeCycleHooksTest extends RenderingTest { interactive: [ // Sync hooks - ...initialHooks(1), - ...initialHooks(2), - ...initialHooks(3), - ...initialHooks(4), - ...initialHooks(5), + ...initialHooks(1), + ...initialHooks(2), + ...initialHooks(3), + ...initialHooks(4), + ...initialHooks(5), // Async hooks - ...initialAfterRenderHooks(5), - ...initialAfterRenderHooks(4), - ...initialAfterRenderHooks(3), - ...initialAfterRenderHooks(2), - ...initialAfterRenderHooks(1) + ...initialAfterRenderHooks(5), + ...initialAfterRenderHooks(4), + ...initialAfterRenderHooks(3), + ...initialAfterRenderHooks(2), + ...initialAfterRenderHooks(1) ], nonInteractive: [ // Sync hooks - ...initialHooks(1), - ...initialHooks(2), - ...initialHooks(3), - ...initialHooks(4), - ...initialHooks(5), + ...initialHooks(1), + ...initialHooks(2), + ...initialHooks(3), + ...initialHooks(4), + ...initialHooks(5), // Async hooks - ...initialAfterRenderHooks(5), - ...initialAfterRenderHooks(4), - ...initialAfterRenderHooks(3), - ...initialAfterRenderHooks(2), - ...initialAfterRenderHooks(1) + ...initialAfterRenderHooks(5), + ...initialAfterRenderHooks(4), + ...initialAfterRenderHooks(3), + ...initialAfterRenderHooks(2), + ...initialAfterRenderHooks(1) ] }); @@ -1458,12 +1458,12 @@ moduleFor('Run loop and lifecycle hooks', class extends RenderingTest { }); let array = emberA([ - { id: 1 }, - { id: 2 }, - { id: 3 }, - { id: 4 }, - { id: 5 } - ]); + { id: 1 }, + { id: 2 }, + { id: 3 }, + { id: 4 }, + { id: 5 } + ]); this.render(strip` {{#each items as |item|}} diff --git a/packages/ember-glimmer/tests/integration/components/local-lookup-test.js b/packages/ember-glimmer/tests/integration/components/local-lookup-test.js index 135b4295e24..ab640904df4 100644 --- a/packages/ember-glimmer/tests/integration/components/local-lookup-test.js +++ b/packages/ember-glimmer/tests/integration/components/local-lookup-test.js @@ -99,7 +99,7 @@ moduleFor('Components test: local lookup', class extends RenderingTest { this.assertText('yall finished or yall done?'); } - ['@test it can local lookup a dynamic component from a passed named argument']() { + ['@test it can local lookup a dynamic component from a passed named argument']() { this.registerComponent('parent-foo', { template: `yall finished {{global-biz baz=(component 'local-bar')}}` }); this.registerComponent('global-biz', { template: 'or {{component baz}}' }); this.registerComponent('parent-foo/local-bar', { template: 'yall done?' }); diff --git a/packages/ember-glimmer/tests/integration/components/target-action-test.js b/packages/ember-glimmer/tests/integration/components/target-action-test.js index caf198a915a..7fe3710adf2 100644 --- a/packages/ember-glimmer/tests/integration/components/target-action-test.js +++ b/packages/ember-glimmer/tests/integration/components/target-action-test.js @@ -551,7 +551,7 @@ moduleFor('Components test: send', class extends RenderingTest { this.runTask(() => component.send('poke')); } - ['@test action can be handled by a superclass\' actions object'](assert) { + ['@test action can be handled by a superclass\' actions object'](assert) { this.assert.expect(4); let component; diff --git a/packages/ember-glimmer/tests/integration/helpers/closure-action-test.js b/packages/ember-glimmer/tests/integration/helpers/closure-action-test.js index 12495ae5507..b405a18050b 100644 --- a/packages/ember-glimmer/tests/integration/helpers/closure-action-test.js +++ b/packages/ember-glimmer/tests/integration/helpers/closure-action-test.js @@ -120,8 +120,6 @@ if (isFeatureEnabled('ember-improved-instrumentation')) { ['@test instrumented action should return value']() { let returnedValue = 'Chris P is so krispy'; - let beforeParameter; - let afterParameter; let actualReturnedValue; let InnerComponent = Component.extend({ @@ -150,10 +148,8 @@ if (isFeatureEnabled('ember-improved-instrumentation')) { this.subscribe('interaction.ember-action', { before(name, timestamp, payload) { - beforeParameter = payload.target.get('myProperty'); }, after(name, timestamp, payload) { - afterParameter = payload.target.get('myProperty'); } }); @@ -634,7 +630,6 @@ moduleFor('Helpers test: closure {{action}}', class extends RenderingTest { let actualReturnedValue; let innerComponent; - let outerComponent; let InnerComponent = Component.extend({ init() { @@ -647,10 +642,6 @@ moduleFor('Helpers test: closure {{action}}', class extends RenderingTest { }); let OuterComponent = Component.extend({ - init() { - this._super(...arguments); - outerComponent = this; - }, actions: { outerAction(incomingFirst, incomingSecond) { actualFirst = incomingFirst; diff --git a/packages/ember-glimmer/tests/integration/helpers/custom-helper-test.js b/packages/ember-glimmer/tests/integration/helpers/custom-helper-test.js index 1255a2e981a..e8b21735f87 100644 --- a/packages/ember-glimmer/tests/integration/helpers/custom-helper-test.js +++ b/packages/ember-glimmer/tests/integration/helpers/custom-helper-test.js @@ -328,9 +328,8 @@ moduleFor('Helpers test: custom helpers', class extends RenderingTest { (join-words "overcomes" "by") model.reason (join-words (join-words "hath overcome but" "half")) - (join-words "his" (join-words "foe"))}}`, { - model: { reason: 'force' } - }); + (join-words "his" (join-words "foe"))}}`, + { model: { reason: 'force' } }); this.assertText('Who overcomes by force hath overcome but half his foe'); @@ -572,7 +571,7 @@ let pushingIntoFrozenArrayThrows = (() => { array.push('foo'); return false; - } catch(e) { + } catch (e) { return true; } })(); @@ -585,7 +584,7 @@ let assigningExistingFrozenPropertyThrows = (() => { obj.foo = 'derp'; return false; - } catch(e) { + } catch (e) { return true; } })(); @@ -598,7 +597,7 @@ let addingPropertyToFrozenObjectThrows = (() => { obj.bar = 'derp'; return false; - } catch(e) { + } catch (e) { return true; } })(); diff --git a/packages/ember-glimmer/tests/integration/helpers/get-test.js b/packages/ember-glimmer/tests/integration/helpers/get-test.js index 1765d05df16..bf2c6c30369 100644 --- a/packages/ember-glimmer/tests/integration/helpers/get-test.js +++ b/packages/ember-glimmer/tests/integration/helpers/get-test.js @@ -139,12 +139,11 @@ moduleFor('Helpers test: {{get}}', class extends RenderingTest { this.assertText('[yellow-redish] [yellow-redish]'); this.runTask(() => set(this.context, 'colors', { - apple: { - gala: 'red and yellow', - mcintosh: 'red' - } - }) - ); + apple: { + gala: 'red and yellow', + mcintosh: 'red' + } + })); this.assertText('[red and yellow] [red and yellow]'); } diff --git a/packages/ember-glimmer/tests/integration/helpers/partial-test.js b/packages/ember-glimmer/tests/integration/helpers/partial-test.js index a6f54728a94..adb8beb78f4 100644 --- a/packages/ember-glimmer/tests/integration/helpers/partial-test.js +++ b/packages/ember-glimmer/tests/integration/helpers/partial-test.js @@ -81,11 +81,11 @@ moduleFor('Helpers test: {{partial}}', class extends RenderingTest { {{#each model.items as |template i|}} {{model.type}}: {{partial template}} {{/each}}`, { - model: { - items: ['even', 'odd', 'even', 'odd'], - type: 'number' - } - }); + model: { + items: ['even', 'odd', 'even', 'odd'], + type: 'number' + } + }); this.assertStableRerender(); @@ -112,8 +112,8 @@ moduleFor('Helpers test: {{partial}}', class extends RenderingTest { {{else}} Nothing! {{/with}}`, { - item: { thing: false } - }); + item: { thing: false } + }); this.assertStableRerender(); diff --git a/packages/ember-glimmer/tests/integration/helpers/unbound-test.js b/packages/ember-glimmer/tests/integration/helpers/unbound-test.js index 3c6d41cafa6..1cd522ab512 100644 --- a/packages/ember-glimmer/tests/integration/helpers/unbound-test.js +++ b/packages/ember-glimmer/tests/integration/helpers/unbound-test.js @@ -274,12 +274,12 @@ moduleFor('Helpers test: {{unbound}}', class extends RenderingTest { this.render(strip` {{unbound (surround model.prefix model.value "bar")}} {{surround model.prefix model.value "bar"}} {{unbound (surround "bar" model.value model.suffix)}} {{surround "bar" model.value model.suffix}}`, { - model: { - prefix: 'before', - value: 'core', - suffix: 'after' - } - }); + model: { + prefix: 'before', + value: 'core', + suffix: 'after' + } + }); this.assertText('before-core-bar before-core-bar bar-core-after bar-core-after'); @@ -513,12 +513,12 @@ moduleFor('Helpers test: {{unbound}}', class extends RenderingTest { {{#if model.bar}}true{{/if}} {{#unless model.bar}}false{{/unless}} {{/unless}}`, { - model: { - foo: true, - notfoo: false, - bar: true - } - }); + model: { + foo: true, + notfoo: false, + bar: true + } + }); this.assertText('truetrue'); diff --git a/packages/ember-glimmer/tests/integration/helpers/yield-test.js b/packages/ember-glimmer/tests/integration/helpers/yield-test.js index 4d276ed2608..c243f19c8ce 100644 --- a/packages/ember-glimmer/tests/integration/helpers/yield-test.js +++ b/packages/ember-glimmer/tests/integration/helpers/yield-test.js @@ -12,7 +12,7 @@ moduleFor('Helpers test: {{yield}} helper', class extends RenderingTest { this.assertStableRerender(); - this.runTask(() => set(this.context, 'object.title', 'Vancouver') ); + this.runTask(() => set(this.context, 'object.title', 'Vancouver')); this.assertText('[In layout:] [In Block:] Vancouver'); this.runTask(() => set(this.context, 'object', { title: 'Seattle' })); @@ -28,7 +28,7 @@ moduleFor('Helpers test: {{yield}} helper', class extends RenderingTest { this.assertStableRerender(); - this.runTask(() => set(this.context, 'object.title', 'Vancouver') ); + this.runTask(() => set(this.context, 'object.title', 'Vancouver')); this.assertText('[In layout:] [In Block:] Vancouver'); this.runTask(() => set(this.context, 'object', { title: 'Seattle' })); diff --git a/packages/ember-glimmer/tests/integration/outlet-test.js b/packages/ember-glimmer/tests/integration/outlet-test.js index ff150b6fa14..09cb2e7c71e 100644 --- a/packages/ember-glimmer/tests/integration/outlet-test.js +++ b/packages/ember-glimmer/tests/integration/outlet-test.js @@ -315,7 +315,7 @@ moduleFor('outlet view', class extends RenderingTest { } }; - this.runTask(() => this.component.setOutletState(outletState) ); + this.runTask(() => this.component.setOutletState(outletState)); runAppend(this.component); diff --git a/packages/ember-glimmer/tests/integration/syntax/each-test.js b/packages/ember-glimmer/tests/integration/syntax/each-test.js index ad922e04f00..e4d7024e1e5 100644 --- a/packages/ember-glimmer/tests/integration/syntax/each-test.js +++ b/packages/ember-glimmer/tests/integration/syntax/each-test.js @@ -445,7 +445,7 @@ class SingleEachTest extends AbstractEachTest { this.makeList([{ value: 1 }, { value: 2 }, { value: 3 }]); let FooBarComponent = Component.extend({ - init () { + init() { this._super(...arguments); this.isEven = true; this.tagName = 'li'; @@ -818,9 +818,9 @@ moduleFor('Syntax test: Multiple {{#each as}} helpers', class extends RenderingT {{/each}} {{/each}} `, { - content: emberA(['X', 'Y']), - options: emberA([{ label: 'One', value: 1 }, { label: 'Two', value: 2 }]) - }); + content: emberA(['X', 'Y']), + options: emberA([{ label: 'One', value: 1 }, { label: 'Two', value: 2 }]) + }); this.assertText('X-1:One2:TwoY-1:One2:Two'); diff --git a/packages/ember-metal/lib/dependent_keys.js b/packages/ember-metal/lib/dependent_keys.js index 7c4f113c994..27a2b075bab 100644 --- a/packages/ember-metal/lib/dependent_keys.js +++ b/packages/ember-metal/lib/dependent_keys.js @@ -28,7 +28,7 @@ export function addDependentKeys(desc, obj, keyName, meta) { for (idx = 0; idx < depKeys.length; idx++) { depKey = depKeys[idx]; // Increment the number of times depKey depends on keyName. - meta.writeDeps(depKey, keyName, (meta.peekDeps(depKey, keyName)|| 0) + 1); + meta.writeDeps(depKey, keyName, (meta.peekDeps(depKey, keyName) || 0) + 1); // Watch the depKey watch(obj, depKey, meta); } diff --git a/packages/ember-metal/lib/events.js b/packages/ember-metal/lib/events.js index a62155c480b..75c53884d00 100644 --- a/packages/ember-metal/lib/events.js +++ b/packages/ember-metal/lib/events.js @@ -37,7 +37,7 @@ function indexOf(array, target, method) { // hashes are added to the end of the event array // so it makes sense to start searching at the end // of the array and search in reverse - for (let i = array.length - 3 ; i >=0; i -= 3) { + for (let i = array.length - 3; i >= 0; i -= 3) { if (target === array[i] && method === array[i + 1]) { index = i; break; diff --git a/packages/ember-metal/lib/instrumentation.js b/packages/ember-metal/lib/instrumentation.js index c09083f89eb..b7a86ea80cb 100644 --- a/packages/ember-metal/lib/instrumentation.js +++ b/packages/ember-metal/lib/instrumentation.js @@ -118,7 +118,7 @@ function withFinalizer(callback, finalizer, payload, binding) { let result; try { result = callback.call(binding); - } catch(e) { + } catch (e) { payload.exception = e; result = payload; } finally { diff --git a/packages/ember-metal/lib/property_events.js b/packages/ember-metal/lib/property_events.js index 35bee932f0d..6d9c3c86c67 100644 --- a/packages/ember-metal/lib/property_events.js +++ b/packages/ember-metal/lib/property_events.js @@ -225,7 +225,7 @@ function beginPropertyChanges() { */ function endPropertyChanges() { deferred--; - if (deferred<=0) { + if (deferred <= 0) { beforeObserverSet.clear(); observerSet.flush(); } diff --git a/packages/ember-metal/lib/transaction.js b/packages/ember-metal/lib/transaction.js index e77338427c3..5b1e75ca5b0 100644 --- a/packages/ember-metal/lib/transaction.js +++ b/packages/ember-metal/lib/transaction.js @@ -69,7 +69,7 @@ if (isEnabled('ember-glimmer-detect-backtracking-rerender') || label = 'the same value'; } - return `You modified ${parts.join('.')} twice on ${object} in a single render. This was unreliable and slow in Ember 1.x and ${implication}`; + return `You modified ${label} twice on ${object} in a single render. This was unreliable and slow in Ember 1.x and ${implication}`; }()), false); diff --git a/packages/ember-metal/tests/accessors/mandatory_setters_test.js b/packages/ember-metal/tests/accessors/mandatory_setters_test.js index d93d28f4617..730d20b3200 100644 --- a/packages/ember-metal/tests/accessors/mandatory_setters_test.js +++ b/packages/ember-metal/tests/accessors/mandatory_setters_test.js @@ -9,7 +9,7 @@ QUnit.module('mandatory-setters'); function hasMandatorySetter(object, property) { try { return Object.getOwnPropertyDescriptor(object, property).set.isMandatorySetter === true; - } catch(e) { + } catch (e) { return false; } } @@ -373,15 +373,15 @@ if (isEnabled('mandatory-setter')) { let child = new Parent(); - equal(child.food , 'chips'); + equal(child.food, 'chips'); watch(child, 'food'); - equal(child.food , 'chips'); + equal(child.food, 'chips'); Parent.prototype.food = 'icecreame'; - equal(child.food , 'icecreame'); + equal(child.food, 'icecreame'); unwatch(child, 'food'); @@ -406,15 +406,15 @@ if (isEnabled('mandatory-setter')) { let child = new Parent('chips'); - equal(child.food , 'chips'); + equal(child.food, 'chips'); watch(child, 'food'); - equal(child.food , 'chips'); + equal(child.food, 'chips'); - child._food = 'icecreame'; + child._food = 'icecreame'; - equal(child.food , 'icecreame'); + equal(child.food, 'icecreame'); unwatch(child, 'food'); diff --git a/packages/ember-metal/tests/accessors/set_path_test.js b/packages/ember-metal/tests/accessors/set_path_test.js index ee5d3927eb0..d45dab901ba 100644 --- a/packages/ember-metal/tests/accessors/set_path_test.js +++ b/packages/ember-metal/tests/accessors/set_path_test.js @@ -61,7 +61,7 @@ QUnit.test('[obj, bla.bla] gives a proper exception message', function() { let exceptionMessage = 'Property set failed: object in path \"bla\" could not be found or was destroyed.'; try { set(obj, 'bla.bla', 'BAM'); - } catch(ex) { + } catch (ex) { equal(ex.message, exceptionMessage); } }); diff --git a/packages/ember-metal/tests/computed_test.js b/packages/ember-metal/tests/computed_test.js index d76426f00b8..38cbc164c2f 100644 --- a/packages/ember-metal/tests/computed_test.js +++ b/packages/ember-metal/tests/computed_test.js @@ -653,7 +653,7 @@ QUnit.test('adding a computed property should show up in key iteration', functio for (let key in obj) { found.push(key); } - ok(found.indexOf('foo')>=0, 'should find computed property in iteration found=' + found); + ok(found.indexOf('foo') >= 0, 'should find computed property in iteration found=' + found); ok('foo' in obj, 'foo in obj should pass'); }); @@ -684,16 +684,17 @@ testBoth('setting a watched computed property', function(get, set) { firstName: 'Yehuda', lastName: 'Katz' }; + defineProperty(obj, 'fullName', computed({ - get() { return get(this, 'firstName') + ' ' + get(this, 'lastName'); }, - set(key, value) { - let values = value.split(' '); - set(this, 'firstName', values[0]); - set(this, 'lastName', values[1]); - return value; - } - }).property('firstName', 'lastName') - ); + get() { return get(this, 'firstName') + ' ' + get(this, 'lastName'); }, + set(key, value) { + let values = value.split(' '); + set(this, 'firstName', values[0]); + set(this, 'lastName', values[1]); + return value; + } + }).property('firstName', 'lastName')); + let fullNameWillChange = 0; let fullNameDidChange = 0; let firstNameWillChange = 0; @@ -741,14 +742,15 @@ testBoth('setting a cached computed property that modifies the value you give it let obj = { foo: 0 }; + defineProperty(obj, 'plusOne', computed({ - get(key) { return get(this, 'foo') + 1; }, - set(key, value) { - set(this, 'foo', value); - return value + 1; - } - }).property('foo') - ); + get(key) { return get(this, 'foo') + 1; }, + set(key, value) { + set(this, 'foo', value); + return value + 1; + } + }).property('foo')); + let plusOneWillChange = 0; let plusOneDidChange = 0; _addBeforeObserver(obj, 'plusOne', function () { @@ -822,7 +824,7 @@ testBoth('protects against setting', function(get, set) { throws(() => { set(obj, 'bar', 'newBar'); - }, /Cannot set read\-only property "bar" on object:/ ); + }, /Cannot set read\-only property "bar" on object:/); equal(get(obj, 'bar'), 'barValue'); }); diff --git a/packages/ember-metal/tests/descriptor_test.js b/packages/ember-metal/tests/descriptor_test.js index 4977fb3b0d6..4db36e33489 100644 --- a/packages/ember-metal/tests/descriptor_test.js +++ b/packages/ember-metal/tests/descriptor_test.js @@ -11,7 +11,7 @@ const hasCompliantDelete = (function() { try { delete obj.zomg; - } catch(e) { + } catch (e) { return true; } @@ -26,7 +26,7 @@ const hasCompliantAssign = (function() { try { obj.zomg = 'lol'; - } catch(e) { + } catch (e) { return true; } diff --git a/packages/ember-metal/tests/mixin/reopen_test.js b/packages/ember-metal/tests/mixin/reopen_test.js index 3a6cd5f4abd..aec53cce67c 100644 --- a/packages/ember-metal/tests/mixin/reopen_test.js +++ b/packages/ember-metal/tests/mixin/reopen_test.js @@ -39,7 +39,7 @@ QUnit.test('using reopen() and calling _super where there is not a super functio run(() => { try { result = taco.createBreakfast(); - } catch(e) { + } catch (e) { result = 'Your breakfast was interrupted by an infinite stack error.'; } }); diff --git a/packages/ember-metal/tests/observer_test.js b/packages/ember-metal/tests/observer_test.js index 6bf5cbe5554..de96c62318c 100644 --- a/packages/ember-metal/tests/observer_test.js +++ b/packages/ember-metal/tests/observer_test.js @@ -223,10 +223,10 @@ testBoth('removing an chain observer on change should not fail', function(get, s } function observer4() { count4++; } - addObserver(obj1, 'foo.bar' , observer1); - addObserver(obj2, 'foo.bar' , observer2); - addObserver(obj3, 'foo.bar' , observer3); - addObserver(obj4, 'foo.bar' , observer4); + addObserver(obj1, 'foo.bar', observer1); + addObserver(obj2, 'foo.bar', observer2); + addObserver(obj3, 'foo.bar', observer3); + addObserver(obj4, 'foo.bar', observer4); set(foo, 'bar', 'baz'); @@ -257,10 +257,10 @@ testBoth('removing an chain before observer on change should not fail', function } function observer4() { count4++; } - _addBeforeObserver(obj1, 'foo.bar' , observer1); - _addBeforeObserver(obj2, 'foo.bar' , observer2); - _addBeforeObserver(obj3, 'foo.bar' , observer3); - _addBeforeObserver(obj4, 'foo.bar' , observer4); + _addBeforeObserver(obj1, 'foo.bar', observer1); + _addBeforeObserver(obj2, 'foo.bar', observer2); + _addBeforeObserver(obj3, 'foo.bar', observer3); + _addBeforeObserver(obj4, 'foo.bar', observer4); set(foo, 'bar', 'baz'); @@ -448,7 +448,7 @@ testBoth('deferring property change notifications safely despite exceptions', fu set(obj, 'foo', 'BAZ'); throw exc; }); - } catch(err) { + } catch (err) { if (err !== exc) { throw err; } diff --git a/packages/ember-metal/tests/run_loop/next_test.js b/packages/ember-metal/tests/run_loop/next_test.js index 2a7c61d4c0d..bbe70dc7ec6 100644 --- a/packages/ember-metal/tests/run_loop/next_test.js +++ b/packages/ember-metal/tests/run_loop/next_test.js @@ -31,9 +31,8 @@ asyncTest('callback should be called from within separate loop', function() { }); asyncTest('multiple calls to run.next share coalesce callbacks into same run loop', function() { - let firstRunLoop, secondRunLoop, thirdRunLoop; + let secondRunLoop, thirdRunLoop; run(() => { - firstRunLoop = run.currentRunLoop; run.next(() => secondRunLoop = run.currentRunLoop); run.next(() => thirdRunLoop = run.currentRunLoop); }); diff --git a/packages/ember-metal/tests/watching/watch_test.js b/packages/ember-metal/tests/watching/watch_test.js index 4638b706a0c..5c848770a79 100644 --- a/packages/ember-metal/tests/watching/watch_test.js +++ b/packages/ember-metal/tests/watching/watch_test.js @@ -12,9 +12,7 @@ import { destroy } from '../../watching'; -let willCount, didCount, - willKeys, didKeys, - originalLookup, lookup; +let willCount, didCount, willKeys, didKeys, originalLookup; QUnit.module('watch', { setup() { @@ -23,7 +21,7 @@ QUnit.module('watch', { didKeys = []; originalLookup = context.lookup; - context.lookup = lookup = {}; + context.lookup = {}; }, teardown() { diff --git a/packages/ember-routing/lib/system/route.js b/packages/ember-routing/lib/system/route.js index 56f3629bf52..cc83ffcbf05 100644 --- a/packages/ember-routing/lib/system/route.js +++ b/packages/ember-routing/lib/system/route.js @@ -1558,7 +1558,7 @@ let Route = EmberObject.extend(ActionHandler, Evented, { @public */ model(params, transition) { - let match, name, sawParams, value; + let name, sawParams, value; let queryParams = get(this, '_qp.map'); for (let prop in params) { @@ -1566,7 +1566,8 @@ let Route = EmberObject.extend(ActionHandler, Evented, { continue; } - if (match = prop.match(/^(.*)_id$/)) { + let match = prop.match(/^(.*)_id$/); + if (match) { name = match[1]; value = params[prop]; } @@ -2280,7 +2281,7 @@ function buildRenderOptions(route, namePassed, isDefaultRender, _name, options) let template = owner.lookup(`template:${templateName}`); let parent; - if (into && (parent = parentRoute(route)) && into === parentRoute(route).routeName) { + if (into && (parent = parentRoute(route)) && into === parent.routeName) { into = undefined; } diff --git a/packages/ember-routing/lib/system/router.js b/packages/ember-routing/lib/system/router.js index c7f2801ecd4..2590e7068ab 100644 --- a/packages/ember-routing/lib/system/router.js +++ b/packages/ember-routing/lib/system/router.js @@ -1432,7 +1432,7 @@ function didBeginTransition(transition, router) { } function resemblesURL(str) { - return typeof str === 'string' && ( str === '' || str.charAt(0) === '/'); + return typeof str === 'string' && (str === '' || str.charAt(0) === '/'); } function forEachQueryParam(router, handlerInfos, queryParams, callback) { diff --git a/packages/ember-routing/lib/utils.js b/packages/ember-routing/lib/utils.js index 4cc7fdfddc4..0876d962e4b 100644 --- a/packages/ember-routing/lib/utils.js +++ b/packages/ember-routing/lib/utils.js @@ -169,7 +169,7 @@ function accumulateQueryParamDescriptors(_desc, accum) { @private */ function resemblesURL(str) { - return typeof str === 'string' && ( str === '' || str.charAt(0) === '/'); + return typeof str === 'string' && (str === '' || str.charAt(0) === '/'); } /* diff --git a/packages/ember-routing/tests/location/util_test.js b/packages/ember-routing/tests/location/util_test.js index cf893161c35..8ee8824357d 100644 --- a/packages/ember-routing/tests/location/util_test.js +++ b/packages/ember-routing/tests/location/util_test.js @@ -131,7 +131,6 @@ QUnit.test("Feature-detecting the history API", function() { true, "returns true for Windows Phone 8.1 with misleading user agent string" ); - }); // jscs:enable diff --git a/packages/ember-runtime/lib/mixins/action_handler.js b/packages/ember-runtime/lib/mixins/action_handler.js index 570d31b05ac..18025b7bd83 100644 --- a/packages/ember-runtime/lib/mixins/action_handler.js +++ b/packages/ember-runtime/lib/mixins/action_handler.js @@ -176,14 +176,13 @@ const ActionHandler = Mixin.create({ @public */ send(actionName, ...args) { - let target; - if (this.actions && this.actions[actionName]) { let shouldBubble = this.actions[actionName].apply(this, args) === true; if (!shouldBubble) { return; } } - if (target = get(this, 'target')) { + let target = get(this, 'target'); + if (target) { assert( 'The `target` for ' + this + ' (' + target + ') does not have a `send` method', typeof target.send === 'function' diff --git a/packages/ember-runtime/lib/mixins/array.js b/packages/ember-runtime/lib/mixins/array.js index 08024c7ea7d..cba9713cb9f 100644 --- a/packages/ember-runtime/lib/mixins/array.js +++ b/packages/ember-runtime/lib/mixins/array.js @@ -252,7 +252,7 @@ const ArrayMixin = Mixin.create(Enumerable, { This returns the objects at the specified indexes, using `objectAt`. ```javascript - let arr = ['a', 'b', 'c', 'd']; + let arr = ['a', 'b', 'c', 'd']; arr.objectsAt([0, 1, 2]); // ['a', 'b', 'c'] arr.objectsAt([2, 3, 4]); // ['c', 'd', undefined] diff --git a/packages/ember-runtime/lib/mixins/enumerable.js b/packages/ember-runtime/lib/mixins/enumerable.js index 49cd66383df..3fc1ed6e389 100644 --- a/packages/ember-runtime/lib/mixins/enumerable.js +++ b/packages/ember-runtime/lib/mixins/enumerable.js @@ -519,7 +519,8 @@ const Enumerable = Mixin.create({ for (let idx = 0; idx < len && !found; idx++) { next = this.nextObject(idx, last, context); - if (found = callback.call(target, next, idx, this)) { + found = callback.call(target, next, idx, this); + if (found) { ret = next; } diff --git a/packages/ember-runtime/tests/controllers/controller_test.js b/packages/ember-runtime/tests/controllers/controller_test.js index 398fb29e62c..f1c28fdcb07 100644 --- a/packages/ember-runtime/tests/controllers/controller_test.js +++ b/packages/ember-runtime/tests/controllers/controller_test.js @@ -127,10 +127,9 @@ QUnit.test('`content` is moved to `model` when `model` is unset', function() { QUnit.test('specifying `content` (without `model` specified) results in deprecation', function() { expect(1); - let controller; expectDeprecation(function() { - controller = Controller.extend({ + Controller.extend({ content: 'foo-bar' }).create(); }, 'Do not specify `content` on a Controller, use `model` instead.'); diff --git a/packages/ember-runtime/tests/core/compare_test.js b/packages/ember-runtime/tests/core/compare_test.js index 29c4b9f6615..6b6f5d4bdef 100644 --- a/packages/ember-runtime/tests/core/compare_test.js +++ b/packages/ember-runtime/tests/core/compare_test.js @@ -34,8 +34,7 @@ QUnit.module('Ember.compare()', { }); QUnit.test('ordering should work', function() { - let suspect, comparable, failureMessage, - suspectIndex, comparableIndex; + let suspect, comparable, failureMessage, suspectIndex, comparableIndex; for (suspectIndex = 0; suspectIndex < data.length; suspectIndex++) { suspect = data[suspectIndex]; diff --git a/packages/ember-runtime/tests/ext/rsvp_test.js b/packages/ember-runtime/tests/ext/rsvp_test.js index 8a22806664a..a9b6ee1bdd7 100644 --- a/packages/ember-runtime/tests/ext/rsvp_test.js +++ b/packages/ember-runtime/tests/ext/rsvp_test.js @@ -25,7 +25,7 @@ QUnit.test('Ensure that errors thrown from within a promise are sent to the cons }); }); ok(false, 'expected assertion to be thrown'); - } catch(e) { + } catch (e) { equal(e, error, 'error was re-thrown'); } }); @@ -46,7 +46,7 @@ QUnit.test('Can reject with non-Error object', function(assert) { try { run(RSVP, 'reject', 'foo'); - } catch(e) { + } catch (e) { ok(false, 'should not throw'); } finally { setTesting(wasEmberTesting); @@ -62,7 +62,7 @@ QUnit.test('Can reject with no arguments', function(assert) { try { run(RSVP, 'reject'); - } catch(e) { + } catch (e) { ok(false, 'should not throw'); } finally { setTesting(wasEmberTesting); @@ -249,7 +249,7 @@ QUnit.test('handled in the next microTask queue flush (ajax example)', function( run(function() { let rejection = RSVP.Promise.reject(reason); ajax('/something/').then(() => { - rejection.catch(function() { }); + rejection.catch(function() {}); ok(true, 'reached end of test'); }); }); diff --git a/packages/ember-runtime/tests/legacy_1x/mixins/observable/observable_test.js b/packages/ember-runtime/tests/legacy_1x/mixins/observable/observable_test.js index 7c9a1c18744..2e0df098d60 100644 --- a/packages/ember-runtime/tests/legacy_1x/mixins/observable/observable_test.js +++ b/packages/ember-runtime/tests/legacy_1x/mixins/observable/observable_test.js @@ -406,7 +406,7 @@ QUnit.test('setting values should call function return value', function() { // property. Other properties blindly call set. expectedLength = 3; equal(calls.length, expectedLength, `set(${key}) should be called the right amount of times`); - for (idx = 0;idx < 2;idx++) { + for (idx = 0; idx < 2; idx++) { equal(calls[idx], values[idx], `call #${idx + 1} to set(${key}) should have passed value ${values[idx]}`); } }); @@ -611,7 +611,7 @@ QUnit.module('Observable objects & object properties ', { getEach() { var keys = ['normal', 'abnormal']; var ret = []; - for (var idx = 0; idx < keys.length;idx++) { + for (var idx = 0; idx < keys.length; idx++) { ret[ret.length] = this.get(keys[idx]); } return ret; @@ -825,8 +825,7 @@ QUnit.test('removing an observer inside of an observer shouldn’t cause any pro run(function() { ObjectD.set('observableValue', 'hi world'); }); - } - catch(e) { + } catch (e) { encounteredError = true; } equal(encounteredError, false); diff --git a/packages/ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.js b/packages/ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.js index 9e04da1af5e..642bd11bcb9 100644 --- a/packages/ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.js +++ b/packages/ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.js @@ -23,7 +23,6 @@ import { computed, observer } from 'ember-metal'; const ObservableObject = EmberObject.extend(Observable); -let revMatches = false; let ObjectA; QUnit.module('object.propertyChanges', { @@ -41,16 +40,15 @@ QUnit.module('object.propertyChanges', { }), starObserver(target, key, value, rev) { - revMatches = (rev === target.propertyRevision); this.starProp = key; } }).create({ starProp: null, - foo : 'fooValue', - prop : 'propValue', + foo: 'fooValue', + prop: 'propValue', - newFoo : 'newFooValue', + newFoo: 'newFooValue', newProp: 'newPropValue' }); } diff --git a/packages/ember-runtime/tests/legacy_1x/system/binding_test.js b/packages/ember-runtime/tests/legacy_1x/system/binding_test.js index 5202081b962..d2b273131c0 100644 --- a/packages/ember-runtime/tests/legacy_1x/system/binding_test.js +++ b/packages/ember-runtime/tests/legacy_1x/system/binding_test.js @@ -131,7 +131,7 @@ QUnit.test('binding disconnection actually works', function() { equal(get(toObject, 'value'), 'start'); }); -let first, second, third, binding1, binding2; // global variables +let first, second, third; // global variables // .......................................................... // chained binding @@ -157,11 +157,11 @@ QUnit.module('chained binding', { root = { first: first, second: second, third: third }; expectDeprecation(() => { - binding1 = bind(root, 'second.input', 'first.output'); + bind(root, 'second.input', 'first.output'); }, /`Ember\.Binding` is deprecated./); expectDeprecation(() => { - binding2 = bind(root, 'second.output', 'third.input'); + bind(root, 'second.output', 'third.input'); }, /`Ember\.Binding` is deprecated./); }); }, diff --git a/packages/ember-runtime/tests/legacy_1x/system/object/base_test.js b/packages/ember-runtime/tests/legacy_1x/system/object/base_test.js index 518838f477c..18de80f1cd2 100644 --- a/packages/ember-runtime/tests/legacy_1x/system/object/base_test.js +++ b/packages/ember-runtime/tests/legacy_1x/system/object/base_test.js @@ -23,7 +23,7 @@ import EmberObject from '../../../../system/object'; // EmberObject Base Tests // ======================================================================== -let obj, obj1, don; // global variables +let obj, obj1; // global variables QUnit.module('A new EmberObject instance', { @@ -68,17 +68,11 @@ QUnit.module('EmberObject superclass and subclasses', { } }); obj1 = obj.extend(); - don = obj1.create({ - method2() { - return this.superclass(); - } - }); }, teardown() { obj = undefined; obj1 = undefined; - don = undefined; } }); diff --git a/packages/ember-runtime/tests/legacy_1x/system/object/bindings_test.js b/packages/ember-runtime/tests/legacy_1x/system/object/bindings_test.js index e23d248e654..571f0d6979e 100644 --- a/packages/ember-runtime/tests/legacy_1x/system/object/bindings_test.js +++ b/packages/ember-runtime/tests/legacy_1x/system/object/bindings_test.js @@ -20,7 +20,7 @@ import EmberObject from '../../../../system/object'; // ======================================================================== let originalLookup = context.lookup; -let testObject, fromObject, extraObject, TestObject; +let testObject, fromObject, TestObject; let TestNamespace, lookup; QUnit.module('bind() method', { @@ -38,10 +38,6 @@ QUnit.module('bind() method', { extraObject: null }); - extraObject = EmberObject.create({ - foo: 'extraObjectValue' - }); - lookup['TestNamespace'] = TestNamespace = { fromObject: fromObject, testObject: testObject @@ -49,7 +45,7 @@ QUnit.module('bind() method', { }, teardown() { - testObject = fromObject = extraObject = null; + testObject = fromObject = null; context.lookup = originalLookup; } }); @@ -97,10 +93,6 @@ QUnit.module('fooBinding method', { extraObject: null }); - extraObject = EmberObject.create({ - foo: 'extraObjectValue' - }); - lookup['TestNamespace'] = TestNamespace = { fromObject: fromObject, testObject: TestObject @@ -109,7 +101,7 @@ QUnit.module('fooBinding method', { teardown() { context.lookup = originalLookup; - TestObject = fromObject = extraObject = null; + TestObject = fromObject = null; // delete TestNamespace; } }); diff --git a/packages/ember-runtime/tests/legacy_1x/system/run_loop_test.js b/packages/ember-runtime/tests/legacy_1x/system/run_loop_test.js index eb2387b1712..3b58385840f 100644 --- a/packages/ember-runtime/tests/legacy_1x/system/run_loop_test.js +++ b/packages/ember-runtime/tests/legacy_1x/system/run_loop_test.js @@ -20,7 +20,7 @@ import EmberObject from '../../../system/object'; broken anyway. I don't think it ever even worked. */ -let MyApp, binding1, binding2; +let MyApp; QUnit.module('System:run_loop() - chained binding', { setup() { @@ -50,13 +50,13 @@ QUnit.test('Should propagate bindings after the RunLoop completes (using Ember.R run(() => { //Binding of output of MyApp.first object to input of MyApp.second object expectDeprecation(() => { - binding1 = Binding.from('first.output') + Binding.from('first.output') .to('second.input').connect(MyApp); }, deprecationMessage); //Binding of output of MyApp.second object to input of MyApp.third object expectDeprecation(() => { - binding2 = Binding.from('second.output') + Binding.from('second.output') .to('third.input').connect(MyApp); }, deprecationMessage); }); @@ -85,13 +85,13 @@ QUnit.test('Should propagate bindings after the RunLoop completes', function() { run(() => { //Binding of output of MyApp.first object to input of MyApp.second object expectDeprecation(() => { - binding1 = Binding.from('first.output') + Binding.from('first.output') .to('second.input').connect(MyApp); }, deprecationMessage); //Binding of output of MyApp.second object to input of MyApp.third object expectDeprecation(() => { - binding2 = Binding.from('second.output') + Binding.from('second.output') .to('third.input').connect(MyApp); }, deprecationMessage); }); diff --git a/packages/ember-runtime/tests/mixins/enumerable_test.js b/packages/ember-runtime/tests/mixins/enumerable_test.js index 1dd4565b28f..1dad7a4475a 100644 --- a/packages/ember-runtime/tests/mixins/enumerable_test.js +++ b/packages/ember-runtime/tests/mixins/enumerable_test.js @@ -24,7 +24,7 @@ const TestEnumerable = EmberObject.extend(Enumerable, { }, addObject(obj) { - if (this._content.indexOf(obj)>=0) { + if (this._content.indexOf(obj) >= 0) { return this; } diff --git a/packages/ember-runtime/tests/mixins/mutable_enumerable_test.js b/packages/ember-runtime/tests/mixins/mutable_enumerable_test.js index 82e16dd711b..3f5b8532b73 100644 --- a/packages/ember-runtime/tests/mixins/mutable_enumerable_test.js +++ b/packages/ember-runtime/tests/mixins/mutable_enumerable_test.js @@ -11,7 +11,7 @@ const TestMutableEnumerable = EmberObject.extend(MutableEnumerable, { _content: null, addObject(obj) { - if (this._content.indexOf(obj)>=0) { + if (this._content.indexOf(obj) >= 0) { return this; } @@ -37,7 +37,7 @@ const TestMutableEnumerable = EmberObject.extend(MutableEnumerable, { }, nextObject(idx) { - return idx>=get(this, 'length') ? undefined : this._content[idx]; + return idx >= get(this, 'length') ? undefined : this._content[idx]; }, length: computed(function() { diff --git a/packages/ember-runtime/tests/mixins/observable_test.js b/packages/ember-runtime/tests/mixins/observable_test.js index 94a85952dea..371e473c570 100644 --- a/packages/ember-runtime/tests/mixins/observable_test.js +++ b/packages/ember-runtime/tests/mixins/observable_test.js @@ -62,7 +62,7 @@ testBoth('calling setProperties completes safely despite exceptions', function(g lastName: 'Cook', companyName: 'Fruit Co., Inc.' }); - } catch(err) { + } catch (err) { if (err !== exc) { throw err; } diff --git a/packages/ember-runtime/tests/mixins/promise_proxy_test.js b/packages/ember-runtime/tests/mixins/promise_proxy_test.js index 1b2feb2b9ba..84bfc5a0918 100644 --- a/packages/ember-runtime/tests/mixins/promise_proxy_test.js +++ b/packages/ember-runtime/tests/mixins/promise_proxy_test.js @@ -252,7 +252,7 @@ QUnit.test('should have reason when isRejected is set', function() { try { run(deferred, 'reject', error); - } catch(e) { + } catch (e) { equal(e, error); } }); diff --git a/packages/ember-runtime/tests/suites/array.js b/packages/ember-runtime/tests/suites/array.js index c8d904e8237..b5e4c8b786c 100644 --- a/packages/ember-runtime/tests/suites/array.js +++ b/packages/ember-runtime/tests/suites/array.js @@ -48,4 +48,4 @@ if (isFeatureEnabled('ember-runtime-enumerable-includes')) { ArrayTests.importModuleTests(includesTests); } -export {ArrayTests, ObserverClass}; +export { ArrayTests, ObserverClass }; diff --git a/packages/ember-runtime/tests/suites/enumerable.js b/packages/ember-runtime/tests/suites/enumerable.js index 756b6a1ae5d..55fe4de28c2 100644 --- a/packages/ember-runtime/tests/suites/enumerable.js +++ b/packages/ember-runtime/tests/suites/enumerable.js @@ -12,7 +12,7 @@ const ObserverClass = EmberObject.extend({ _keysBefore: null, _keys: null, _values: null, - _before : null, + _before: null, _after: null, isEnabled: true, @@ -55,7 +55,7 @@ const ObserverClass = EmberObject.extend({ observeBefore(obj) { let keys = Array.prototype.slice.call(arguments, 1); let loc = keys.length; - while (--loc>=0) { + while (--loc >= 0) { _addBeforeObserver(obj, keys[loc], this, 'propertyWillChange'); } @@ -330,4 +330,4 @@ if (isFeatureEnabled('ember-runtime-enumerable-includes')) { EnumerableTests.importModuleTests(withoutTests); export default EnumerableTests; -export {EnumerableTests, ObserverClass}; +export { EnumerableTests, ObserverClass }; diff --git a/packages/ember-runtime/tests/suites/enumerable/filter.js b/packages/ember-runtime/tests/suites/enumerable/filter.js index 85c1a816817..708e0a9b670 100644 --- a/packages/ember-runtime/tests/suites/enumerable/filter.js +++ b/packages/ember-runtime/tests/suites/enumerable/filter.js @@ -19,7 +19,7 @@ suite.test('filter should invoke on each item', function() { // return true on all but the last two result = obj.filter(function(i) { found.push(i); - return --cnt>=0; + return --cnt >= 0; }); deepEqual(found, ary, 'should have invoked on each item'); deepEqual(result, ary.slice(0, -2), 'filtered array should exclude items'); diff --git a/packages/ember-runtime/tests/suites/suite.js b/packages/ember-runtime/tests/suites/suite.js index cc8f4e83e9d..8313ad2aa7c 100644 --- a/packages/ember-runtime/tests/suites/suite.js +++ b/packages/ember-runtime/tests/suites/suite.js @@ -138,6 +138,6 @@ const SuiteModuleBuilder = EmberObject.extend({ } }); -export {SuiteModuleBuilder, Suite}; +export { SuiteModuleBuilder, Suite }; export default Suite; diff --git a/packages/ember-runtime/tests/system/object/es-compatibility-test.js b/packages/ember-runtime/tests/system/object/es-compatibility-test.js index 2e276a19a37..6ad906a039c 100644 --- a/packages/ember-runtime/tests/system/object/es-compatibility-test.js +++ b/packages/ember-runtime/tests/system/object/es-compatibility-test.js @@ -115,11 +115,11 @@ QUnit.test('extending an ES subclass of EmberObject', function(assert) { class MyObject extends SubEmberObject {} - let myObject = MyObject.create(); + MyObject.create(); assert.deepEqual(calls, ['constructor', 'init'], 'constructor then init called (create)'); calls = []; - myObject = new MyObject(); + new MyObject(); assert.deepEqual(calls, ['constructor', 'init'], 'constructor then init called (new)'); }); @@ -141,10 +141,10 @@ QUnit.skip('calling extend on an ES subclass of EmberObject', function(assert) { let MyObject = SubEmberObject.extend({}); - let myObject = MyObject.create(); + MyObject.create(); assert.deepEqual(calls, ['constructor', 'init'], 'constructor then init called (create)'); calls = []; - myObject = new MyObject(); + new MyObject(); assert.deepEqual(calls, ['constructor', 'init'], 'constructor then init called (new)'); }); diff --git a/packages/ember-runtime/tests/system/object_proxy_test.js b/packages/ember-runtime/tests/system/object_proxy_test.js index 050757c31d2..e92029e536f 100644 --- a/packages/ember-runtime/tests/system/object_proxy_test.js +++ b/packages/ember-runtime/tests/system/object_proxy_test.js @@ -30,10 +30,10 @@ testBoth('should not proxy properties passed to create', function (get, set) { testBoth('should proxy properties to content', function(get, set) { let content = { - firstName: 'Tom', - lastName: 'Dale', - unknownProperty(key) { return key + ' unknown';} - }; + firstName: 'Tom', + lastName: 'Dale', + unknownProperty(key) { return key + ' unknown';} + }; let proxy = ObjectProxy.create(); equal(get(proxy, 'firstName'), undefined, 'get on proxy without content should return undefined'); diff --git a/packages/ember-template-compiler/lib/plugins/deprecate-render-model.js b/packages/ember-template-compiler/lib/plugins/deprecate-render-model.js index ecc8520f6f9..842d9c2df41 100644 --- a/packages/ember-template-compiler/lib/plugins/deprecate-render-model.js +++ b/packages/ember-template-compiler/lib/plugins/deprecate-render-model.js @@ -7,8 +7,7 @@ export default function DeprecateRenderModel(options) { this.options = options; } -DeprecateRenderModel.prototype.transform = - function DeprecateRenderModel_transform(ast) { +DeprecateRenderModel.prototype.transform = function DeprecateRenderModel_transform(ast) { let moduleName = this.options.meta.moduleName; let walker = new this.syntax.Walker(); diff --git a/packages/ember-template-compiler/lib/plugins/deprecate-render.js b/packages/ember-template-compiler/lib/plugins/deprecate-render.js index ccd9ad4a639..668c951dccb 100644 --- a/packages/ember-template-compiler/lib/plugins/deprecate-render.js +++ b/packages/ember-template-compiler/lib/plugins/deprecate-render.js @@ -6,8 +6,7 @@ export default function DeprecateRender(options) { this.options = options; } -DeprecateRender.prototype.transform = - function DeprecateRender_transform(ast) { +DeprecateRender.prototype.transform = function DeprecateRender_transform(ast) { let moduleName = this.options.meta.moduleName; let walker = new this.syntax.Walker(); diff --git a/packages/ember-template-compiler/lib/plugins/transform-top-level-components.js b/packages/ember-template-compiler/lib/plugins/transform-top-level-components.js index 384af7dab80..01b64d7a768 100644 --- a/packages/ember-template-compiler/lib/plugins/transform-top-level-components.js +++ b/packages/ember-template-compiler/lib/plugins/transform-top-level-components.js @@ -22,7 +22,6 @@ function hasSingleComponentNode(program, componentCallback) { if (!loc || loc.start.line !== 1 || loc.start.column !== 0) { return; } let lastComponentNode; - let lastIndex; let nodeCount = 0; for (let i = 0; i < body.length; i++) { @@ -36,7 +35,6 @@ function hasSingleComponentNode(program, componentCallback) { if (curr.type === 'ComponentNode' || curr.type === 'ElementNode') { lastComponentNode = curr; - lastIndex = i; } } diff --git a/packages/ember-testing/tests/helpers_test.js b/packages/ember-testing/tests/helpers_test.js index e743513df96..e3a7c727bae 100644 --- a/packages/ember-testing/tests/helpers_test.js +++ b/packages/ember-testing/tests/helpers_test.js @@ -642,7 +642,7 @@ QUnit.test('`triggerEvent` can be used to trigger arbitrary events', function() QUnit.test('`fillIn` takes context into consideration', function() { expect(2); - var fillIn, find, visit, andThen, wait; + var fillIn, find, visit, andThen; setTemplate('index', compile('
{{input type="text" id="first" class="current"}}
{{input type="text" id="second" class="current"}}')); @@ -652,7 +652,6 @@ QUnit.test('`fillIn` takes context into consideration', function() { find = App.testHelpers.find; visit = App.testHelpers.visit; andThen = App.testHelpers.andThen; - wait = App.testHelpers.wait; visit('/'); fillIn('.current', '#parent', 'current value'); diff --git a/packages/ember-utils/lib/apply-str.js b/packages/ember-utils/lib/apply-str.js index 4cc3149265f..ee141d0c4fb 100644 --- a/packages/ember-utils/lib/apply-str.js +++ b/packages/ember-utils/lib/apply-str.js @@ -8,11 +8,11 @@ export default function applyStr(t, m, a) { let l = a && a.length; if (!a || !l) { return t[m](); } switch (l) { - case 1: return t[m](a[0]); - case 2: return t[m](a[0], a[1]); - case 3: return t[m](a[0], a[1], a[2]); - case 4: return t[m](a[0], a[1], a[2], a[3]); - case 5: return t[m](a[0], a[1], a[2], a[3], a[4]); - default: return t[m].apply(t, a); + case 1: return t[m](a[0]); + case 2: return t[m](a[0], a[1]); + case 3: return t[m](a[0], a[1], a[2]); + case 4: return t[m](a[0], a[1], a[2], a[3]); + case 5: return t[m](a[0], a[1], a[2], a[3], a[4]); + default: return t[m].apply(t, a); } } diff --git a/packages/ember-views/lib/mixins/action_support.js b/packages/ember-views/lib/mixins/action_support.js index df0fb77cf5a..b6db765c3a5 100644 --- a/packages/ember-views/lib/mixins/action_support.js +++ b/packages/ember-views/lib/mixins/action_support.js @@ -129,7 +129,6 @@ export default Mixin.create({ }, send(actionName, ...args) { - let target; let action = this.actions && this.actions[actionName]; if (action) { @@ -137,8 +136,7 @@ export default Mixin.create({ if (!shouldBubble) { return; } } - target = get(this, 'target'); - + let target = get(this, 'target'); if (target) { assert( 'The `target` for ' + this + ' (' + target + diff --git a/packages/ember-views/lib/system/event_dispatcher.js b/packages/ember-views/lib/system/event_dispatcher.js index c37eab62baf..c643f6d8810 100644 --- a/packages/ember-views/lib/system/event_dispatcher.js +++ b/packages/ember-views/lib/system/event_dispatcher.js @@ -57,33 +57,33 @@ export default EmberObject.extend({ @private */ events: { - touchstart : 'touchStart', - touchmove : 'touchMove', - touchend : 'touchEnd', - touchcancel : 'touchCancel', - keydown : 'keyDown', - keyup : 'keyUp', - keypress : 'keyPress', - mousedown : 'mouseDown', - mouseup : 'mouseUp', - contextmenu : 'contextMenu', - click : 'click', - dblclick : 'doubleClick', - mousemove : 'mouseMove', - focusin : 'focusIn', - focusout : 'focusOut', - mouseenter : 'mouseEnter', - mouseleave : 'mouseLeave', - submit : 'submit', - input : 'input', - change : 'change', - dragstart : 'dragStart', - drag : 'drag', - dragenter : 'dragEnter', - dragleave : 'dragLeave', - dragover : 'dragOver', - drop : 'drop', - dragend : 'dragEnd' + touchstart: 'touchStart', + touchmove: 'touchMove', + touchend: 'touchEnd', + touchcancel: 'touchCancel', + keydown: 'keyDown', + keyup: 'keyUp', + keypress: 'keyPress', + mousedown: 'mouseDown', + mouseup: 'mouseUp', + contextmenu: 'contextMenu', + click: 'click', + dblclick: 'doubleClick', + mousemove: 'mouseMove', + focusin: 'focusIn', + focusout: 'focusOut', + mouseenter: 'mouseEnter', + mouseleave: 'mouseLeave', + submit: 'submit', + input: 'input', + change: 'change', + dragstart: 'dragStart', + drag: 'drag', + dragenter: 'dragEnter', + dragleave: 'dragLeave', + dragover: 'dragOver', + drop: 'drop', + dragend: 'dragEnd' }, /** diff --git a/packages/ember/tests/component_registration_test.js b/packages/ember/tests/component_registration_test.js index 7212e649025..d411446fef6 100644 --- a/packages/ember/tests/component_registration_test.js +++ b/packages/ember/tests/component_registration_test.js @@ -36,7 +36,7 @@ QUnit.module('Application Lifecycle - Component Registration', { teardown: cleanup }); -function boot(callback, startURL='/') { +function boot(callback, startURL = '/') { run(() => { App = Application.create({ name: 'App', diff --git a/packages/ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.js b/packages/ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.js index 756be2f7ec5..b1d0c9b2e87 100644 --- a/packages/ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.js +++ b/packages/ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.js @@ -6,12 +6,12 @@ import { Application } from 'ember-application'; import { jQuery } from 'ember-views'; import { setTemplates, setTemplate } from 'ember-glimmer'; -let Router, App, router, registry, container; +let Router, App, registry, container; let aboutDefer, otherDefer; function bootApplication() { - router = container.lookup('router:main'); + container.lookup('router:main'); run(App, 'advanceReadiness'); } diff --git a/packages/ember/tests/routing/basic_test.js b/packages/ember/tests/routing/basic_test.js index 22b6740888c..cc9152cf748 100644 --- a/packages/ember/tests/routing/basic_test.js +++ b/packages/ember/tests/routing/basic_test.js @@ -1374,7 +1374,6 @@ QUnit.test('Route inherits model from parent route', function() { let post1 = {}; let post2 = {}; let post3 = {}; - let currentPost; let share1 = {}; let share2 = {}; let share3 = {}; @@ -1420,15 +1419,12 @@ QUnit.test('Route inherits model from parent route', function() { bootApplication(); - currentPost = post1; handleURL('/posts/1/comments'); handleURL('/posts/1/shares/1'); - currentPost = post2; handleURL('/posts/2/comments'); handleURL('/posts/2/shares/2'); - currentPost = post3; handleURL('/posts/3/comments'); handleURL('/posts/3/shares/3'); }); @@ -1446,7 +1442,6 @@ QUnit.test('Routes with { resetNamespace: true } inherits model from parent rout let post1 = {}; let post2 = {}; let post3 = {}; - let currentPost; let posts = { 1: post1, @@ -1470,13 +1465,8 @@ QUnit.test('Routes with { resetNamespace: true } inherits model from parent rout bootApplication(); - currentPost = post1; handleURL('/posts/1/comments'); - - currentPost = post2; handleURL('/posts/2/comments'); - - currentPost = post3; handleURL('/posts/3/comments'); }); @@ -2871,7 +2861,7 @@ QUnit.test('Specifying non-existent controller name in route#render throws', fun renderTemplate() { try { this.render('homepage', { controller: 'stefanpenneristhemanforme' }); - } catch(e) { + } catch (e) { equal(e.message, 'You passed `controller: \'stefanpenneristhemanforme\'` into the `render` method, but no such controller could be found.'); } } diff --git a/packages/ember/tests/routing/substates_test.js b/packages/ember/tests/routing/substates_test.js index f09c94dbb7e..b85311a09be 100644 --- a/packages/ember/tests/routing/substates_test.js +++ b/packages/ember/tests/routing/substates_test.js @@ -6,7 +6,7 @@ import { Application, Resolver } from 'ember-application'; import { jQuery } from 'ember-views'; import { setTemplates, setTemplate } from 'ember-glimmer'; -let Router, App, templates, router, container, registry, counter; +let Router, App, templates, router, container, counter; function step(expectedValue, description) { equal(counter, expectedValue, 'Step ' + expectedValue + ': ' + description); @@ -50,7 +50,6 @@ QUnit.module('Loading/Error Substates', { Router = App.Router; container = App.__container__; - registry = App.__registry__; templates = { application: '
{{outlet}}
', @@ -590,8 +589,6 @@ QUnit.test('Handled errors that bubble can be handled at a higher level', functi QUnit.test('errors that are bubbled are thrown at a higher level if not handled', function() { expect(3); - let handledError; - templates['grandma'] = 'GRANDMA {{outlet}}'; Router.map(function() { @@ -616,9 +613,6 @@ QUnit.test('errors that are bubbled are thrown at a higher level if not handled' actions: { error(err) { step(2, 'MomSallyRoute#error'); - - handledError = err; - return true; } } diff --git a/packages/ember/tests/routing/toplevel_dom_test.js b/packages/ember/tests/routing/toplevel_dom_test.js index eac6723694f..fd1c2cff611 100644 --- a/packages/ember/tests/routing/toplevel_dom_test.js +++ b/packages/ember/tests/routing/toplevel_dom_test.js @@ -5,13 +5,13 @@ import { jQuery } from 'ember-views'; import { NoneLocation } from 'ember-routing'; import { setTemplates, setTemplate } from 'ember-glimmer'; -let App, templates, router, container; +let App, templates, container; function bootApplication() { for (let name in templates) { setTemplate(name, compile(templates[name])); } - router = container.lookup('router:main'); + container.lookup('router:main'); run(App, 'advanceReadiness'); } diff --git a/packages/external-helpers/lib/external-helpers-dev.js b/packages/external-helpers/lib/external-helpers-dev.js index a597eec1f13..5a9b07ceb2b 100644 --- a/packages/external-helpers/lib/external-helpers-dev.js +++ b/packages/external-helpers/lib/external-helpers-dev.js @@ -1,5 +1,3 @@ -var babelHelpers; - function classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); diff --git a/packages/external-helpers/lib/external-helpers-prod.js b/packages/external-helpers/lib/external-helpers-prod.js index b95339dc22d..4c5aa7fc0a6 100644 --- a/packages/external-helpers/lib/external-helpers-prod.js +++ b/packages/external-helpers/lib/external-helpers-prod.js @@ -1,5 +1,3 @@ -var babelHelpers; - function inherits(subClass, superClass) { subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { diff --git a/packages/loader/lib/index.js b/packages/loader/lib/index.js index 50c1c83a8be..51201879456 100644 --- a/packages/loader/lib/index.js +++ b/packages/loader/lib/index.js @@ -1,5 +1,4 @@ var enifed, requireModule, Ember; -var mainContext = this; (function() { var isNode = typeof window === 'undefined' && diff --git a/server/index.js b/server/index.js index e2592e6a13c..45239abe1a0 100644 --- a/server/index.js +++ b/server/index.js @@ -1,5 +1,5 @@ module.exports = function(app) { - app.get('/', function(req, res){ + app.get('/', function(req, res) { res.redirect('/tests/index.html?hidepassed'); }); }; diff --git a/tests/node/helpers/app-module.js b/tests/node/helpers/app-module.js index 1efa9d7f608..0eb12c014dc 100644 --- a/tests/node/helpers/app-module.js +++ b/tests/node/helpers/app-module.js @@ -7,7 +7,6 @@ var QUnit = require('qunitjs'); var distPath = path.join(__dirname, '../../../dist'); var emberPath = path.join(distPath, 'ember.debug'); var templateCompilerPath = path.join(distPath, 'ember-template-compiler'); -var features = require(path.join(__dirname, '../../../features.json')).features; var SimpleDOM = require('simple-dom'); /* @@ -158,11 +157,8 @@ function renderToHTML(url) { document: dom, rootElement: root }).then(function() { - var element = root; var serializer = new SimpleDOM.HTMLSerializer(SimpleDOM.voidMap); - var serialized = serializer.serialize(root); - - return serialized; + return serializer.serialize(root); }); } @@ -178,27 +174,27 @@ function registerApplicationClasses(app, registry) { } function registerTemplate(name, template) { - this.register('template:'+name, this.compile(template)); + this.register('template:' + name, this.compile(template)); } function registerComponent(name, componentProps) { var component = this.Ember.Component.extend(componentProps); - this.register('component:'+name, component); + this.register('component:' + name, component); } function registerController(name, controllerProps) { var controller = this.Ember.Controller.extend(controllerProps); - this.register('controller:'+name, controller); + this.register('controller:' + name, controller); } function registerRoute(name, routeProps) { var route = this.Ember.Route.extend(routeProps); - this.register('route:'+name, route); + this.register('route:' + name, route); } function registerService(name, serviceProps) { var service = this.Ember.Object.extend(serviceProps); - this.register('service:'+name, service); + this.register('service:' + name, service); } function registerRoutes(cb) { diff --git a/tests/node/helpers/component-module.js b/tests/node/helpers/component-module.js index 6adfa875360..2b725743ce2 100644 --- a/tests/node/helpers/component-module.js +++ b/tests/node/helpers/component-module.js @@ -60,7 +60,7 @@ function setupComponentTest() { var module = this; module.element = new SimpleDOM.Document(); - module.owner = buildOwner(this.Ember, { resolve: function(){} }); + module.owner = buildOwner(this.Ember, { resolve: function() {} }); module.owner.register('service:-document', new SimpleDOM.Document(), { instantiate: false }); this._hasRendered = false; diff --git a/tests/node/template-compiler-test.js b/tests/node/template-compiler-test.js index 36a4ddd5075..c88162ef822 100644 --- a/tests/node/template-compiler-test.js +++ b/tests/node/template-compiler-test.js @@ -9,7 +9,7 @@ var templateCompilerPath = path.join(distPath, 'ember-template-compiler'); var module = QUnit.module; var test = QUnit.test; -var compile; +var templateCompiler; module('ember-template-compiler.js', { setup: function() { diff --git a/vendor/ember/shims.js b/vendor/ember/shims.js index 95106c50b56..cfa3dc3d53e 100644 --- a/vendor/ember/shims.js +++ b/vendor/ember/shims.js @@ -202,7 +202,7 @@ 'default': Ember.computed }; var computedMacros = [ - "empty","notEmpty", "none", "not", "bool", "match", "equal", "gt", "gte", + "empty", "notEmpty", "none", "not", "bool", "match", "equal", "gt", "gte", "lt", "lte", "alias", "oneWay", "reads", "readOnly", "deprecatingAlias", "and", "or", "collect", "sum", "min", "max", "map", "sort", "setDiff", "mapBy", "filter", "filterBy", "uniq", "union", "intersect"