language
stringclasses
1 value
owner
stringlengths
2
15
repo
stringlengths
2
21
sha
stringlengths
45
45
message
stringlengths
7
36.3k
path
stringlengths
1
199
patch
stringlengths
15
102k
is_multipart
bool
2 classes
Other
emberjs
ember.js
951920f5655280b5dbaf4ceae7e9baf4672a7933.json
Use one variable assignment per declaration.
packages/ember-metal/tests/utils/type_of_test.js
@@ -6,10 +6,10 @@ test("Ember.typeOf", function() { var MockedDate = function() { }; MockedDate.prototype = new Date(); - var mockedDate = new MockedDate(), - date = new Date(), - error = new Error('boum'), - object = {a: 'b'}; + var mockedDate = new MockedDate(); + var date = new Date(); + var error = new Error('boum'); + var object = {a: 'b'}; equal( typeOf(), 'undefined', "undefined"); equal( typeOf(null), 'null', "null"); @@ -24,8 +24,8 @@ test("Ember.typeOf", function() { equal( typeOf(object), 'object', "object"); if(Ember.Object) { - var klass = Ember.Object.extend(), - instance = Ember.Object.create(); + var klass = Ember.Object.extend(); + var instance = Ember.Object.create(); equal( Ember.typeOf(klass), 'class', "class"); equal( Ember.typeOf(instance), 'instance', "instance");
true
Other
emberjs
ember.js
951920f5655280b5dbaf4ceae7e9baf4672a7933.json
Use one variable assignment per declaration.
packages/ember-metal/tests/watching/isWatching_test.js
@@ -13,7 +13,8 @@ import { isWatching } from 'ember-metal/watching'; QUnit.module('isWatching'); function testObserver(setup, teardown, key) { - var obj = {}, fn = function() {}; + var obj = {}; + var fn = function() {}; key = key || 'foo'; equal(isWatching(obj, key), false, "precond - isWatching is false by default");
true
Other
emberjs
ember.js
e5aab140fd7377f9cd934d1883c46dab1c6a92bb.json
Pass index into computed array callbacks
packages/ember-runtime/lib/computed/reduce_computed_macros.js
@@ -154,16 +154,17 @@ export function min(dependentKey) { The callback method you provide should have the following signature. `item` is the current item in the iteration. + `index` is the integer index of the current item in the iteration. ```javascript - function(item); + function(item, index); ``` Example ```javascript var Hamster = Ember.Object.extend({ - excitingChores: Ember.computed.map('chores', function(chore) { + excitingChores: Ember.computed.map('chores', function(chore, index) { return chore.toUpperCase() + '!'; }) }); @@ -184,7 +185,7 @@ export function min(dependentKey) { export function map(dependentKey, callback) { var options = { addedItem: function(array, item, changeMeta, instanceMeta) { - var mapped = callback.call(this, item); + var mapped = callback.call(this, item, changeMeta.index); array.insertAt(changeMeta.index, mapped); return array; }, @@ -245,14 +246,15 @@ export var mapProperty = mapBy; The callback method you provide should have the following signature. `item` is the current item in the iteration. + `index` is the integer index of the current item in the iteration. ```javascript - function(item); + function(item, index); ``` ```javascript var Hamster = Ember.Object.extend({ - remainingChores: Ember.computed.filter('chores', function(chore) { + remainingChores: Ember.computed.filter('chores', function(chore, index) { return !chore.done; }) }); @@ -281,7 +283,7 @@ export function filter(dependentKey, callback) { }, addedItem: function (array, item, changeMeta, instanceMeta) { - var match = !!callback.call(this, item); + var match = !!callback.call(this, item, changeMeta.index); var filterIndex = instanceMeta.filteredArrayIndexes.addItem(changeMeta.index, match); if (match) {
true
Other
emberjs
ember.js
e5aab140fd7377f9cd934d1883c46dab1c6a92bb.json
Pass index into computed array callbacks
packages/ember-runtime/tests/computed/reduce_computed_macros_test.js
@@ -119,6 +119,20 @@ test("it maps simple unshifted properties", function() { deepEqual(get(obj, 'mapped'), ['A', 'B'], "properties unshifted in sequence are mapped correctly"); }); +test("it passes the index to the callback", function() { + var array = Ember.A(['a', 'b', 'c']); + + run(function() { + obj = EmberObject.createWithMixins({ + array: array, + mapped: computedMap('array', function (item, index) { return index; }) + }); + get(obj, 'mapped'); + }); + + deepEqual(get(obj, 'mapped'), [0, 1, 2], "index is passed to callback correctly"); +}); + test("it maps objects", function() { deepEqual(get(obj, 'mappedObjects'), [{ name: 'Robert'}, { name: 'Leanna' }]); @@ -245,6 +259,20 @@ test("it filters according to the specified filter function", function() { deepEqual(filtered, [2,4,6,8], "computedFilter filters by the specified function"); }); +test("it passes the index to the callback", function() { + var array = Ember.A(['a', 'b', 'c']); + + run(function() { + obj = EmberObject.createWithMixins({ + array: array, + filtered: computedFilter('array', function (item, index) { return index === 1; }) + }); + get(obj, 'filtered'); + }); + + deepEqual(get(obj, 'filtered'), ['b'], "index is passed to callback correctly"); +}); + test("it caches properly", function() { var array = get(obj, 'array'), filtered = get(obj, 'filtered');
true
Other
emberjs
ember.js
92d564f3a8b1dd0bae32d1c64d63762520776e04.json
Use ActionManager to register in-template actions
packages/ember-routing-handlebars/lib/helpers/action.js
@@ -5,6 +5,7 @@ import { uuid } from "ember-metal/utils"; import run from "ember-metal/run_loop"; import { isSimpleClick } from "ember-views/system/utils"; +import ActionManager from "ember-views/system/action_manager"; import EmberRouter from "ember-routing/system/router"; import EmberHandlebars from "ember-handlebars"; @@ -33,9 +34,7 @@ function args(options, actionName) { return ret.concat(resolveParams(options.context, options.params, { types: types, data: data })); } -var ActionHelper = { - registeredActions: {} -}; +var ActionHelper = {}; export { ActionHelper }; @@ -80,7 +79,7 @@ function ignoreKeyEvent(eventName, event, keyCode) { ActionHelper.registerAction = function(actionNameOrPath, options, allowedKeys) { var actionId = uuid(); - ActionHelper.registeredActions[actionId] = { + ActionManager.registeredActions[actionId] = { eventName: options.eventName, handler: function handleRegisteredAction(event) { if (!isAllowedEvent(event, allowedKeys)) { return true; } @@ -135,7 +134,7 @@ ActionHelper.registerAction = function(actionNameOrPath, options, allowedKeys) { }; options.view.on('willClearRender', function() { - delete ActionHelper.registeredActions[actionId]; + delete ActionManager.registeredActions[actionId]; }); return actionId;
true
Other
emberjs
ember.js
92d564f3a8b1dd0bae32d1c64d63762520776e04.json
Use ActionManager to register in-template actions
packages/ember-routing-handlebars/tests/helpers/action_test.js
@@ -2,6 +2,7 @@ import Ember from 'ember-metal/core'; // A, FEATURES, assert, TESTING_DEPRECATIO import { set } from "ember-metal/property_set"; import run from "ember-metal/run_loop"; import EventDispatcher from "ember-views/system/event_dispatcher"; +import ActionManager from "ember-views/system/action_manager"; import Container from "ember-runtime/system/container"; import EmberObject from "ember-runtime/system/object"; @@ -328,7 +329,7 @@ test("should register an event handler", function() { var actionId = view.$('a[data-ember-action]').attr('data-ember-action'); - ok(ActionHelper.registeredActions[actionId], "The action was registered"); + ok(ActionManager.registeredActions[actionId], "The action was registered"); view.$('a').trigger('click'); @@ -354,7 +355,7 @@ test("handles whitelisted modifier keys", function() { var actionId = view.$('a[data-ember-action]').attr('data-ember-action'); - ok(ActionHelper.registeredActions[actionId], "The action was registered"); + ok(ActionManager.registeredActions[actionId], "The action was registered"); var e = jQuery.Event('click'); e.altKey = true; @@ -512,11 +513,11 @@ test("should unregister event handlers on rerender", function() { view.rerender(); }); - ok(!ActionHelper.registeredActions[previousActionId], "On rerender, the event handler was removed"); + ok(!ActionManager.registeredActions[previousActionId], "On rerender, the event handler was removed"); var newActionId = view.$('a[data-ember-action]').attr('data-ember-action'); - ok(ActionHelper.registeredActions[newActionId], "After rerender completes, a new event handler was added"); + ok(ActionManager.registeredActions[newActionId], "After rerender completes, a new event handler was added"); }); test("should unregister event handlers on inside virtual views", function() { @@ -538,7 +539,7 @@ test("should unregister event handlers on inside virtual views", function() { things.removeAt(0); }); - ok(!ActionHelper.registeredActions[actionId], "After the virtual view was destroyed, the action was unregistered"); + ok(!ActionManager.registeredActions[actionId], "After the virtual view was destroyed, the action was unregistered"); }); test("should properly capture events on child elements of a container with an action", function() {
true
Other
emberjs
ember.js
92d564f3a8b1dd0bae32d1c64d63762520776e04.json
Use ActionManager to register in-template actions
packages/ember-routing-handlebars/tests/helpers/render_test.js
@@ -23,12 +23,10 @@ import EmberHandlebars from "ember-handlebars"; import EmberView from "ember-routing/ext/view"; import _MetamorphView from "ember-handlebars/views/metamorph_view"; import jQuery from "ember-views/system/jquery"; +import ActionManager from "ember-views/system/action_manager"; import renderHelper from "ember-routing-handlebars/helpers/render"; -import { - ActionHelper, - actionHelper -} from "ember-routing-handlebars/helpers/action"; +import { actionHelper } from "ember-routing-handlebars/helpers/action"; import { outletHelper } from "ember-routing-handlebars/helpers/outlet"; function appendView(view) { @@ -476,7 +474,7 @@ test("{{render}} helper should link child controllers to the parent controller", var button = jQuery("#parent-action"), actionId = button.data('ember-action'), - action = ActionHelper.registeredActions[actionId], + action = ActionManager.registeredActions[actionId], handler = action.handler; equal(button.text(), "Go to Mom", "The parentController property is set on the child controller");
true
Other
emberjs
ember.js
92d564f3a8b1dd0bae32d1c64d63762520776e04.json
Use ActionManager to register in-template actions
packages/ember-views/lib/system/action_manager.js
@@ -0,0 +1,17 @@ +/** +@module ember +@submodule ember-views +*/ + +function ActionManager() {} + +/** + Global action id hash. + + @private + @property registeredActions + @type Object +*/ +ActionManager.registeredActions = {}; + +export default ActionManager;
true
Other
emberjs
ember.js
92d564f3a8b1dd0bae32d1c64d63762520776e04.json
Use ActionManager to register in-template actions
packages/ember-views/lib/system/event_dispatcher.js
@@ -12,11 +12,10 @@ import { typeOf } from "ember-metal/utils"; import { fmt } from "ember-runtime/system/string"; import EmberObject from "ember-runtime/system/object"; import jQuery from "ember-views/system/jquery"; +import ActionManager from "ember-views/system/action_manager"; import View from "ember-views/views/view"; import merge from "ember-metal/merge"; -var ActionHelper; - //ES6TODO: // find a better way to do Ember.View.views without global state @@ -189,11 +188,8 @@ export default EmberObject.extend({ }); rootElement.on(event + '.ember', '[data-ember-action]', function(evt) { - //ES6TODO: Needed for ActionHelper (generally not available in ember-views test suite) - if (!ActionHelper) { ActionHelper = requireModule("ember-routing-handlebars/helpers/action")["ActionHelper"]; } - var actionId = jQuery(evt.currentTarget).attr('data-ember-action'), - action = ActionHelper.registeredActions[actionId]; + action = ActionManager.registeredActions[actionId]; // We have to check for action here since in some cases, jQuery will trigger // an event on `removeChild` (i.e. focusout) after we've already torn down the @@ -244,6 +240,6 @@ export default EmberObject.extend({ }, toString: function() { - return '(EventDisptacher)'; + return '(EventDispatcher)'; } });
true
Other
emberjs
ember.js
92d564f3a8b1dd0bae32d1c64d63762520776e04.json
Use ActionManager to register in-template actions
packages/ember/tests/routing/basic_test.js
@@ -2,6 +2,7 @@ import "ember"; import { forEach } from "ember-metal/enumerable_utils"; import { get } from "ember-metal/property_get"; import { set } from "ember-metal/property_set"; +import ActionManager from "ember-views/system/action_manager"; var Router, App, AppView, templates, router, container, originalLoggerError; var compile = Ember.Handlebars.compile; @@ -1165,7 +1166,7 @@ asyncTest("Events are triggered on the controller if a matching action name is i bootApplication(); var actionId = Ember.$("#qunit-fixture a").data("ember-action"); - var action = Ember.Handlebars.ActionHelper.registeredActions[actionId]; + var action = ActionManager.registeredActions[actionId]; var event = new Ember.$.Event("click"); action.handler(event); }); @@ -1199,7 +1200,7 @@ asyncTest("Events are triggered on the current state when defined in `actions` o bootApplication(); var actionId = Ember.$("#qunit-fixture a").data("ember-action"); - var action = Ember.Handlebars.ActionHelper.registeredActions[actionId]; + var action = ActionManager.registeredActions[actionId]; var event = new Ember.$.Event("click"); action.handler(event); }); @@ -1237,7 +1238,7 @@ asyncTest("Events defined in `actions` object are triggered on the current state bootApplication(); var actionId = Ember.$("#qunit-fixture a").data("ember-action"); - var action = Ember.Handlebars.ActionHelper.registeredActions[actionId]; + var action = ActionManager.registeredActions[actionId]; var event = new Ember.$.Event("click"); action.handler(event); }); @@ -1272,7 +1273,7 @@ asyncTest("Events are triggered on the current state when defined in `events` ob bootApplication(); var actionId = Ember.$("#qunit-fixture a").data("ember-action"); - var action = Ember.Handlebars.ActionHelper.registeredActions[actionId]; + var action = ActionManager.registeredActions[actionId]; var event = new Ember.$.Event("click"); action.handler(event); }); @@ -1311,7 +1312,7 @@ asyncTest("Events defined in `events` object are triggered on the current state bootApplication(); var actionId = Ember.$("#qunit-fixture a").data("ember-action"); - var action = Ember.Handlebars.ActionHelper.registeredActions[actionId]; + var action = ActionManager.registeredActions[actionId]; var event = new Ember.$.Event("click"); action.handler(event); }); @@ -1394,7 +1395,7 @@ if (Ember.FEATURES.isEnabled('ember-routing-drop-deprecated-action-style')) { bootApplication(); var actionId = Ember.$("#qunit-fixture a").data("ember-action"); - var action = Ember.Handlebars.ActionHelper.registeredActions[actionId]; + var action = ActionManager.registeredActions[actionId]; var event = new Ember.$.Event("click"); action.handler(event); }); @@ -1438,7 +1439,7 @@ if (Ember.FEATURES.isEnabled('ember-routing-drop-deprecated-action-style')) { bootApplication(); var actionId = Ember.$("#qunit-fixture a").data("ember-action"); - var action = Ember.Handlebars.ActionHelper.registeredActions[actionId]; + var action = ActionManager.registeredActions[actionId]; var event = new Ember.$.Event("click"); action.handler(event); }); @@ -1478,7 +1479,7 @@ asyncTest("actions can be triggered with multiple arguments", function() { bootApplication(); var actionId = Ember.$("#qunit-fixture a").data("ember-action"); - var action = Ember.Handlebars.ActionHelper.registeredActions[actionId]; + var action = ActionManager.registeredActions[actionId]; var event = new Ember.$.Event("click"); action.handler(event); });
true
Other
emberjs
ember.js
10474ed87120abfc15e4767b2f4d5ef7aa72745d.json
Prefer Ember.merge over jQuery.extend.
packages/ember-handlebars/lib/helpers/view.js
@@ -15,6 +15,7 @@ import { IS_BINDING } from "ember-metal/mixin"; import jQuery from "ember-views/system/jquery"; import View from "ember-views/views/view"; import { isGlobalPath } from "ember-metal/binding"; +import merge from "ember-metal/merge"; import { normalizePath, handlebarsGet @@ -97,7 +98,7 @@ export var ViewHelper = EmberObject.create({ } if (dup) { - hash = jQuery.extend({}, hash); + hash = merge({}, hash); delete hash.id; delete hash.tag; delete hash['class']; @@ -139,7 +140,7 @@ export var ViewHelper = EmberObject.create({ } } - return jQuery.extend(hash, extensions); + return merge(hash, extensions); }, // Transform bindings from the current context to a context that can be evaluated within the view.
true
Other
emberjs
ember.js
10474ed87120abfc15e4767b2f4d5ef7aa72745d.json
Prefer Ember.merge over jQuery.extend.
packages/ember-views/lib/system/event_dispatcher.js
@@ -13,6 +13,7 @@ import { fmt } from "ember-runtime/system/string"; import EmberObject from "ember-runtime/system/object"; import jQuery from "ember-views/system/jquery"; import View from "ember-views/views/view"; +import merge from "ember-metal/merge"; var ActionHelper; @@ -132,7 +133,7 @@ export default EmberObject.extend({ setup: function(addedEvents, rootElement) { var event, events = get(this, 'events'); - jQuery.extend(events, addedEvents || {}); + merge(events, addedEvents || {}); if (!isNone(rootElement)) { set(this, 'rootElement', rootElement);
true
Other
emberjs
ember.js
8b3bebbcb7b992e065814b655aa2d288007051ba.json
Allow {{view}} without a container
packages/ember-handlebars/lib/helpers/view.js
@@ -391,8 +391,11 @@ export function viewHelper(path, options) { // and get an instance of the registered `view:toplevel` if (path && path.data && path.data.isRenderData) { options = path; - Ember.assert('{{view}} helper requires parent view to have a container but none was found. This usually happens when you are manually-managing views.', !!options.data.view.container); - path = options.data.view.container.lookupFactory('view:toplevel'); + if (options.data && options.data.view && options.data.view.container) { + path = options.data.view.container.lookupFactory('view:toplevel'); + } else { + path = View; + } } options.helperName = options.helperName || 'view';
true
Other
emberjs
ember.js
8b3bebbcb7b992e065814b655aa2d288007051ba.json
Allow {{view}} without a container
packages/ember-handlebars/tests/helpers/view_test.js
@@ -55,6 +55,16 @@ test("By default view:toplevel is used", function() { } }); +test("By default, without a container, EmberView is used", function() { + view = EmberView.extend({ + template: Ember.Handlebars.compile('{{view tagName="span"}}'), + }).create(); + + run(view, 'appendTo', '#qunit-fixture'); + + ok(jQuery('#qunit-fixture').html().match(/<span/), 'contains view with span'); +}); + test("View lookup - App.FuView", function() { Ember.lookup = { App: {
true
Other
emberjs
ember.js
0bf36052bbd7fc7a914a36fd51381f255dde0c7f.json
Clarify silent changes in willDestroyElement
packages/ember-views/lib/views/view.js
@@ -1625,6 +1625,9 @@ var View = CoreView.extend({ this function to do any teardown that requires an element, like removing event listeners. + Please note: any property changes made during this event will have no + effect on object observers. + @event willDestroyElement */ willDestroyElement: Ember.K,
false
Other
emberjs
ember.js
abf800a73c3850a021b5b3887aa7189a5bd77211.json
reintroduce guid’s for SimpleHandlebarsView This guids are incredibly cheap, and enable a recent BB optimization
packages/ember-handlebars/lib/views/handlebars_bound_view.js
@@ -30,13 +30,14 @@ var viewStates = states; import _MetamorphView from "ember-handlebars/views/metamorph_view"; import { handlebarsGet } from "ember-handlebars/ext"; +import { uuid } from "ember-metal/utils"; function SimpleHandlebarsView(path, pathRoot, isEscaped, templateData) { this.path = path; this.pathRoot = pathRoot; this.isEscaped = isEscaped; this.templateData = templateData; - + this[Ember.GUID_KEY] = uuid(); this._lastNormalizedValue = undefined; this.morph = Metamorph(); this.state = 'preRender';
false
Other
emberjs
ember.js
5f037f29a485a35395021749d6c0ae0c197df74e.json
Add test for more than two nested async helpers In ember prior to commit 633cf453, if an acceptance test has more than 2 async test helpers in an `andThen`, those later test helpers will not fire in the proper order. Refs #5251
packages/ember-testing/tests/acceptance_test.js
@@ -187,6 +187,24 @@ test("Nested async helpers", function() { }); }); +test("Multiple nested async helpers", function() { + expect(2); + + visit('/posts'); + + andThen(function() { + click('a:first', '#comments-link'); + + fillIn('.ember-text-field', "hello"); + fillIn('.ember-text-field', "goodbye"); + }); + + andThen(function() { + equal(find('.ember-text-field').val(), 'goodbye', "Fillin successfully works"); + equal(currentRoute, 'comments', "Successfully visited comments route"); + }); +}); + test("Helpers nested in thens", function() { expect(3);
false
Other
emberjs
ember.js
c07fbbb2b374f9bb5974127fcf04ae62141cae6e.json
Tell Travis we are NOT a Ruby project.
.travis.yml
@@ -1,5 +1,5 @@ --- -rvm: 2.1 +language: node_js sudo: false
false
Other
emberjs
ember.js
b9d2369f3d0e601f1d5ddc05e5008e931bac9003.json
utilize Cache object
packages/ember-handlebars/lib/helpers/binding.js
@@ -24,6 +24,7 @@ import jQuery from "ember-views/system/jquery"; import { isArray } from "ember-metal/utils"; import { getEscaped as handlebarsGetEscaped } from "ember-handlebars/ext"; import keys from "ember-runtime/keys"; +import Cache from "ember-metal/cache"; import { _HandlebarsBoundView, @@ -274,6 +275,10 @@ function _triageMustacheHelper(property, options) { return helpers.bind.call(this, property, options); } +export var ISNT_HELPER_CACHE = new Cache(1000, function(key) { + return key.indexOf('-') === -1; +}); + /** Used to lookup/resolve handlebars helpers. The lookup order is: @@ -294,7 +299,7 @@ function resolveHelper(container, name) { return helpers[name]; } - if (!container || name.indexOf('-') === -1) { + if (!container || ISNT_HELPER_CACHE.get(name)) { return; } @@ -375,7 +380,6 @@ function boundIfHelper(property, fn) { return bind.call(context, property, fn, true, shouldDisplayIfHelperContent, shouldDisplayIfHelperContent, ['isTruthy', 'length']); } - /** @private
true
Other
emberjs
ember.js
b9d2369f3d0e601f1d5ddc05e5008e931bac9003.json
utilize Cache object
packages/ember-metal/lib/binding.js
@@ -9,6 +9,10 @@ import { _suspendObserver } from "ember-metal/observer"; import run from "ember-metal/run_loop"; +import { + isGlobal as isGlobalPath +} from "ember-metal/path_cache"; + // ES6TODO: where is Ember.lookup defined? /** @@ -31,8 +35,6 @@ import run from "ember-metal/run_loop"; */ Ember.LOG_BINDINGS = false || !!Ember.ENV.LOG_BINDINGS; -var IS_GLOBAL = /^([A-Z$]|([0-9][A-Z$]))/; - /** Returns true if the provided path is global (e.g., `MyApp.fooController.bar`) instead of local (`foo.bar.baz`). @@ -43,9 +45,6 @@ var IS_GLOBAL = /^([A-Z$]|([0-9][A-Z$]))/; @param {String} path @return Boolean */ -function isGlobalPath(path) { - return IS_GLOBAL.test(path); -} function getWithGlobals(obj, path) { return get(isGlobalPath(path) ? Ember.lookup : obj, path);
true
Other
emberjs
ember.js
b9d2369f3d0e601f1d5ddc05e5008e931bac9003.json
utilize Cache object
packages/ember-metal/lib/main.js
@@ -33,7 +33,7 @@ import { } from "ember-metal/utils"; import EmberError from "ember-metal/error"; import EnumerableUtils from "ember-metal/enumerable_utils"; - +import Cache from "ember-metal/cache"; import {create, platform} from "ember-metal/platform"; import {map, forEach, filter, indexOf} from "ember-metal/array"; import Logger from "ember-metal/logger"; @@ -96,6 +96,8 @@ EmberInstrumentation.reset = reset; Ember.instrument = instrument; Ember.subscribe = subscribe; +Ember._Cache = Cache; + Ember.generateGuid = generateGuid; Ember.GUID_KEY = GUID_KEY; Ember.create = create;
true
Other
emberjs
ember.js
b9d2369f3d0e601f1d5ddc05e5008e931bac9003.json
utilize Cache object
packages/ember-metal/lib/path_cache.js
@@ -0,0 +1,33 @@ +import Cache from 'ember-metal/cache'; + +var IS_GLOBAL = /^([A-Z$]|([0-9][A-Z$]))/; +var IS_GLOBAL_PATH = /^([A-Z$]|([0-9][A-Z$])).*[\.]/; +var HAS_THIS = 'this.'; + +var isGlobalCache = new Cache(1000, function(key) { return IS_GLOBAL.test(key); }); +var isGlobalPathCache = new Cache(1000, function(key) { return IS_GLOBAL_PATH.test(key); }); +var hasThisCache = new Cache(1000, function(key) { return key.indexOf(HAS_THIS) !== -1; }); +var isPathCache = new Cache(1000, function(key) { return key.indexOf('.') !== -1; }); + +export var caches = { + isGlobalCache: isGlobalCache, + isGlobalPathCache: isGlobalPathCache, + hasThisCache: hasThisCache, + isPathCache: isPathCache +}; + +export function isGlobal(path) { + return isGlobalCache.get(path); +} + +export function isGlobalPath(path) { + return isGlobalPathCache.get(path); +} + +export function hasThis(path) { + return hasThisCache.get(path); +} + +export function isPath(path) { + return isPathCache.get(path); +}
true
Other
emberjs
ember.js
b9d2369f3d0e601f1d5ddc05e5008e931bac9003.json
utilize Cache object
packages/ember-metal/lib/properties.js
@@ -12,8 +12,8 @@ import { overrideChains } from "ember-metal/property_events"; import { get } from "ember-metal/property_get"; import { set } from "ember-metal/property_set"; -var metaFor = meta, - objectDefineProperty = platform.defineProperty; +var metaFor = meta; +var objectDefineProperty = platform.defineProperty; var MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER;
true
Other
emberjs
ember.js
b9d2369f3d0e601f1d5ddc05e5008e931bac9003.json
utilize Cache object
packages/ember-metal/lib/property_events.js
@@ -34,10 +34,10 @@ var deferred = 0; @return {void} */ function propertyWillChange(obj, keyName) { - var m = obj[META_KEY], - watching = (m && m.watching[keyName] > 0) || keyName === 'length', - proto = m && m.proto, - desc = m && m.descs[keyName]; + var m = obj[META_KEY]; + var watching = (m && m.watching[keyName] > 0) || keyName === 'length'; + var proto = m && m.proto; + var desc = m && m.descs[keyName]; if (!watching) { return; } if (proto === obj) { return; } @@ -63,10 +63,10 @@ function propertyWillChange(obj, keyName) { @return {void} */ function propertyDidChange(obj, keyName) { - var m = obj[META_KEY], - watching = (m && m.watching[keyName] > 0) || keyName === 'length', - proto = m && m.proto, - desc = m && m.descs[keyName]; + var m = obj[META_KEY]; + var watching = (m && m.watching[keyName] > 0) || keyName === 'length'; + var proto = m && m.proto; + var desc = m && m.descs[keyName]; if (proto === obj) { return; } @@ -124,9 +124,9 @@ function chainsWillChange(obj, keyName, m) { return; } - var nodes = m.chainWatchers[keyName], - events = [], - i, l; + var nodes = m.chainWatchers[keyName]; + var events = []; + var i, l; for(i = 0, l = nodes.length; i < l; i++) { nodes[i].willChange(events); @@ -143,9 +143,9 @@ function chainsDidChange(obj, keyName, m, suppressEvents) { return; } - var nodes = m.chainWatchers[keyName], - events = suppressEvents ? null : [], - i, l; + var nodes = m.chainWatchers[keyName]; + var events = suppressEvents ? null : []; + var i, l; for(i = 0, l = nodes.length; i < l; i++) { nodes[i].didChange(events);
true
Other
emberjs
ember.js
b9d2369f3d0e601f1d5ddc05e5008e931bac9003.json
utilize Cache object
packages/ember-metal/lib/property_get.js
@@ -5,13 +5,13 @@ import Ember from "ember-metal/core"; import { META_KEY } from "ember-metal/utils"; import EmberError from "ember-metal/error"; - -var get; +import { + isGlobalPath, + isPath, + hasThis as pathHasThis +} from "ember-metal/path_cache"; var MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER; - -var IS_GLOBAL_PATH = /^([A-Z$]|([0-9][A-Z$])).*[\.]/; -var HAS_THIS = 'this.'; var FIRST_KEY = /^([^\.]+)/; // .......................................................... @@ -51,7 +51,7 @@ var get = function get(obj, keyName) { return obj; } - if (!keyName && 'string'===typeof obj) { + if (!keyName && 'string' === typeof obj) { keyName = obj; obj = null; } @@ -63,7 +63,7 @@ var get = function get(obj, keyName) { var meta = obj[META_KEY], desc = meta && meta.descs[keyName], ret; - if (desc === undefined && keyName.indexOf('.') !== -1) { + if (desc === undefined && isPath(keyName)) { return _getPath(obj, keyName); } @@ -106,9 +106,9 @@ if (Ember.config.overrideAccessors) { @return {Array} a temporary array with the normalized target/path pair. */ function normalizeTuple(target, path) { - var hasThis = path.indexOf(HAS_THIS) === 0, - isGlobal = !hasThis && IS_GLOBAL_PATH.test(path), - key; + var hasThis = pathHasThis(path); + var isGlobal = !hasThis && isGlobalPath(path); + var key; if (!target || isGlobal) target = Ember.lookup; if (hasThis) path = path.slice(5); @@ -131,10 +131,12 @@ function _getPath(root, path) { // If there is no root and path is a key name, return that // property from the global object. // E.g. get('Ember') -> Ember - if (root === null && path.indexOf('.') === -1) { return get(Ember.lookup, path); } + if (root === null && !isPath(path)) { + return get(Ember.lookup, path); + } // detect complicated paths and normalize them - hasThis = path.indexOf(HAS_THIS) === 0; + hasThis = pathHasThis(path); if (!root || hasThis) { tuple = normalizeTuple(root, path);
true
Other
emberjs
ember.js
b9d2369f3d0e601f1d5ddc05e5008e931bac9003.json
utilize Cache object
packages/ember-metal/lib/property_set.js
@@ -7,6 +7,10 @@ import { } from "ember-metal/property_events"; import { defineProperty } from "ember-metal/properties"; import EmberError from "ember-metal/error"; +import { + isPath +} from "ember-metal/path_cache"; + var MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER; var IS_GLOBAL = /^([A-Z$]|([0-9][A-Z$]))/; @@ -41,7 +45,7 @@ var set = function set(obj, keyName, value, tolerant) { var meta = obj[META_KEY], desc = meta && meta.descs[keyName], isUnknown, currentValue; - if (desc === undefined && keyName.indexOf('.') !== -1) { + if (desc === undefined && isPath(keyName)) { return setPath(obj, keyName, value, tolerant); }
true
Other
emberjs
ember.js
b9d2369f3d0e601f1d5ddc05e5008e931bac9003.json
utilize Cache object
packages/ember-runtime/lib/system/string.js
@@ -8,8 +8,47 @@ import { inspect as emberInspect } from "ember-metal/utils"; +import Cache from "ember-metal/cache"; + var STRING_DASHERIZE_REGEXP = (/[ _]/g); -var STRING_DASHERIZE_CACHE = {}; + +var STRING_DASHERIZE_CACHE = new Cache(1000, function(key) { + return decamelize(key).replace(STRING_DASHERIZE_REGEXP, '-'); +}); + +var CAMELIZE_CACHE = new Cache(1000, function(key) { + return key.replace(STRING_CAMELIZE_REGEXP, function(match, separator, chr) { + return chr ? chr.toUpperCase() : ''; + }).replace(/^([A-Z])/, function(match, separator, chr) { + return match.toLowerCase(); + }); +}); + +var CLASSIFY_CACHE = new Cache(1000, function(str) { + var parts = str.split("."), + out = []; + + for (var i=0, l=parts.length; i<l; i++) { + var camelized = camelize(parts[i]); + out.push(camelized.charAt(0).toUpperCase() + camelized.substr(1)); + } + + return out.join("."); +}); + +var UNDERSCORE_CACHE = new Cache(1000, function(str) { + return str.replace(STRING_UNDERSCORE_REGEXP_1, '$1_$2'). + replace(STRING_UNDERSCORE_REGEXP_2, '_').toLowerCase(); +}); + +var CAPITALIZE_CACHE = new Cache(1000, function(str) { + return str.charAt(0).toUpperCase() + str.substr(1); +}); + +var DECAMELIZE_CACHE = new Cache(1000, function(str) { + return str.replace(STRING_DECAMELIZE_REGEXP, '$1_$2').toLowerCase(); +}); + var STRING_DECAMELIZE_REGEXP = (/([a-z\d])([A-Z])/g); var STRING_CAMELIZE_REGEXP = (/(\-|_|\.|\s)+(.)?/g); var STRING_UNDERSCORE_REGEXP_1 = (/([a-z\d])([A-Z]+)/g); @@ -43,51 +82,27 @@ function w(str) { } function decamelize(str) { - return str.replace(STRING_DECAMELIZE_REGEXP, '$1_$2').toLowerCase(); + return DECAMELIZE_CACHE.get(str); } function dasherize(str) { - var cache = STRING_DASHERIZE_CACHE, - hit = cache.hasOwnProperty(str), - ret; - - if (hit) { - return cache[str]; - } else { - ret = decamelize(str).replace(STRING_DASHERIZE_REGEXP,'-'); - cache[str] = ret; - } - - return ret; + return STRING_DASHERIZE_CACHE.get(str); } function camelize(str) { - return str.replace(STRING_CAMELIZE_REGEXP, function(match, separator, chr) { - return chr ? chr.toUpperCase() : ''; - }).replace(/^([A-Z])/, function(match, separator, chr) { - return match.toLowerCase(); - }); + return CAMELIZE_CACHE.get(str); } function classify(str) { - var parts = str.split("."), - out = []; - - for (var i=0, l=parts.length; i<l; i++) { - var camelized = camelize(parts[i]); - out.push(camelized.charAt(0).toUpperCase() + camelized.substr(1)); - } - - return out.join("."); + return CLASSIFY_CACHE.get(str); } function underscore(str) { - return str.replace(STRING_UNDERSCORE_REGEXP_1, '$1_$2'). - replace(STRING_UNDERSCORE_REGEXP_2, '_').toLowerCase(); + return UNDERSCORE_CACHE.get(str); } function capitalize(str) { - return str.charAt(0).toUpperCase() + str.substr(1); + return CAPITALIZE_CACHE.get(str); } /**
true
Other
emberjs
ember.js
fde1505b1720c940239c5f29ccc40d5fe2279530.json
introduce Ember._Cache still private API
packages/ember-metal/lib/cache.js
@@ -0,0 +1,55 @@ +import dictionary from 'ember-metal/dictionary'; +export default Cache; + +function Cache(limit, func) { + this.store = dictionary(null); + this.size = 0; + this.misses = 0; + this.hits = 0; + this.limit = limit; + this.func = func; +} + +var FALSE = function() { }; +var ZERO = function() { }; +var UNDEFINED = function() { }; +var NULL = function() { }; + +Cache.prototype = { + set: function(key, value) { + if (this.limit > this.size) { + this.size ++; + if (value === undefined) { + this.store[key] = UNDEFINED; + } else { + this.store[key] = value; + } + } + + return value; + }, + + get: function(key) { + var value = this.store[key]; + + if (value === undefined) { + this.misses ++; + value = this.set(key, this.func(key)); + } else if (value === UNDEFINED) { + this.hits ++; + value = UNDEFINED; + } else { + this.hits ++; + // nothing to translate + } + + return value; + }, + + purge: function() { + this.store = dictionary(null); + this.size = 0; + this.hits = 0; + this.misses = 0; + } +};
false
Other
emberjs
ember.js
1ff5df4b65d268e346195b2749a76419649bf6f4.json
Relocate RSVP configuration. Ember.DeferredMixin will ultimately be deprecated and removed, but this configuration (that allows test friendly promises) is not related to Ember.DeferredMixin anyways. This just moves that code out of the DeferredMixin.
packages/ember-runtime/lib/ext/rsvp.js
@@ -2,10 +2,39 @@ import Ember from 'ember-metal/core'; import Logger from 'ember-metal/logger'; +import run from "ember-metal/run_loop"; var RSVP = requireModule('rsvp'); var Test, testModuleName = 'ember-testing/test'; +var asyncStart = function() { + if (Ember.Test && Ember.Test.adapter) { + Ember.Test.adapter.asyncStart(); + } +}; + +var asyncEnd = function() { + if (Ember.Test && Ember.Test.adapter) { + Ember.Test.adapter.asyncEnd(); + } +}; + +RSVP.configure('async', function(callback, promise) { + var async = !run.currentRunLoop; + + if (Ember.testing && async) { asyncStart(); } + + run.backburner.schedule('actions', function(){ + if (Ember.testing && async) { asyncEnd(); } + callback(promise); + }); +}); + +RSVP.Promise.prototype.fail = function(callback, label){ + Ember.deprecate('RSVP.Promise.fail has been renamed as RSVP.Promise.catch'); + return this['catch'](callback, label); +}; + RSVP.onerrorDefault = function (error) { if (error instanceof Error) { if (Ember.testing) {
true
Other
emberjs
ember.js
1ff5df4b65d268e346195b2749a76419649bf6f4.json
Relocate RSVP configuration. Ember.DeferredMixin will ultimately be deprecated and removed, but this configuration (that allows test friendly promises) is not related to Ember.DeferredMixin anyways. This just moves that code out of the DeferredMixin.
packages/ember-runtime/lib/mixins/deferred.js
@@ -2,37 +2,8 @@ import Ember from "ember-metal/core"; // Ember.FEATURES, Ember.Test import { get } from "ember-metal/property_get"; import { Mixin } from "ember-metal/mixin"; import { computed } from "ember-metal/computed"; -import run from "ember-metal/run_loop"; import RSVP from "ember-runtime/ext/rsvp"; -var asyncStart = function() { - if (Ember.Test && Ember.Test.adapter) { - Ember.Test.adapter.asyncStart(); - } -}; - -var asyncEnd = function() { - if (Ember.Test && Ember.Test.adapter) { - Ember.Test.adapter.asyncEnd(); - } -}; - -RSVP.configure('async', function(callback, promise) { - var async = !run.currentRunLoop; - - if (Ember.testing && async) { asyncStart(); } - - run.backburner.schedule('actions', function(){ - if (Ember.testing && async) { asyncEnd(); } - callback(promise); - }); -}); - -RSVP.Promise.prototype.fail = function(callback, label){ - Ember.deprecate('RSVP.Promise.fail has been renamed as RSVP.Promise.catch'); - return this['catch'](callback, label); -}; - /** @module ember @submodule ember-runtime
true
Other
emberjs
ember.js
2f22edcbd02f173fd8c2fdbce0c1aa92e8c7df4f.json
Remove Ember.StateManager cruft. Ember.StateManager has been removed for quite some time. This error/warning can be removed.
packages/ember/lib/main.js
@@ -21,35 +21,3 @@ Ember @module ember */ -function throwWithMessage(msg) { - return function() { - throw new Ember.Error(msg); - }; -} - -function generateRemovedClass(className) { - var msg = " has been moved into a plugin: https://github.com/emberjs/ember-states"; - - return { - extend: throwWithMessage(className + msg), - create: throwWithMessage(className + msg) - }; -} - -Ember.StateManager = generateRemovedClass("Ember.StateManager"); - -/** - This was exported to ember-states plugin for v 1.0.0 release. See: https://github.com/emberjs/ember-states - - @class StateManager - @namespace Ember -*/ - -Ember.State = generateRemovedClass("Ember.State"); - -/** - This was exported to ember-states plugin for v 1.0.0 release. See: https://github.com/emberjs/ember-states - - @class State - @namespace Ember -*/
true
Other
emberjs
ember.js
2f22edcbd02f173fd8c2fdbce0c1aa92e8c7df4f.json
Remove Ember.StateManager cruft. Ember.StateManager has been removed for quite some time. This error/warning can be removed.
packages/ember/tests/states_removal_test.js
@@ -1,28 +0,0 @@ -import "ember"; - -/*globals EmberDev */ - -QUnit.module("ember-states removal"); - -test("errors occur when attempting to use Ember.StateManager or Ember.State", function() { - if (EmberDev && EmberDev.runningProdBuild){ - ok(true, 'Ember.State & Ember.StateManager are not added to production builds'); - return; - } - - raises(function() { - Ember.StateManager.extend(); - }, /has been moved into a plugin/); - - raises(function() { - Ember.State.extend(); - }, /has been moved into a plugin/); - - raises(function() { - Ember.StateManager.create(); - }, /has been moved into a plugin/); - - raises(function() { - Ember.State.create(); - }, /has been moved into a plugin/); -});
true
Other
emberjs
ember.js
b2a24fade97e367bb7ee9365d17b1cccda0e0cb5.json
Add EditorConfig file
.editorconfig
@@ -0,0 +1,11 @@ +# http://editorconfig.org + +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true
false
Other
emberjs
ember.js
aa2de8cbd5fbcbc9314b143f9b6625fe26427b97.json
Trim trailing whitespace from JS files and README
README.md
@@ -5,11 +5,11 @@ that you'd normally have to do by hand. There are tasks that are common to every web app; Ember.js does those things for you, so you can focus on building killer features and UI. -- [Website](http://emberjs.com) -- [Guides](http://emberjs.com/guides) -- [API](http://emberjs.com/api) -- [Community](http://emberjs.com/community) -- [Blog](http://emberjs.com/blog) +- [Website](http://emberjs.com) +- [Guides](http://emberjs.com/guides) +- [API](http://emberjs.com/api) +- [Community](http://emberjs.com/community) +- [Blog](http://emberjs.com/blog) - [Builds](http://emberjs.com/builds) # Building Ember.js
true
Other
emberjs
ember.js
aa2de8cbd5fbcbc9314b143f9b6625fe26427b97.json
Trim trailing whitespace from JS files and README
lib/packages.js
@@ -2,7 +2,7 @@ module.exports = { 'container': {trees: null, requirements: []}, 'ember-metal': {trees: null, vendorRequirements: ['backburner']}, 'ember-debug': {trees: null, requirements: ['ember-metal'], skipTests: true}, - 'ember-runtime': {trees: null, vendorRequirements: ['rsvp'], requirements: ['container', 'ember-metal']}, + 'ember-runtime': {trees: null, vendorRequirements: ['rsvp'], requirements: ['container', 'ember-metal']}, 'ember-views': {trees: null, requirements: ['ember-runtime']}, 'ember-extension-support': {trees: null, requirements: ['ember-application']}, 'ember-testing': {trees: null, requirements: ['ember-application', 'ember-routing']},
true
Other
emberjs
ember.js
aa2de8cbd5fbcbc9314b143f9b6625fe26427b97.json
Trim trailing whitespace from JS files and README
packages/ember-handlebars/lib/controls.js
@@ -313,7 +313,7 @@ export function inputHelper(options) { Internally, `{{textarea}}` creates an instance of `Ember.TextArea`, passing arguments from the helper to `Ember.TextArea`'s `create` method. You can extend the capabilities of text areas in your application by reopening this - class. For example, if you are building a Bootstrap project where `data-*` + class. For example, if you are building a Bootstrap project where `data-*` attributes are used, you can globally add support for a `data-*` attribute on all `{{textarea}}`s' in your app by reopening `Ember.TextArea` or `Ember.TextSupport` and adding it to the `attributeBindings` concatenated
true
Other
emberjs
ember.js
aa2de8cbd5fbcbc9314b143f9b6625fe26427b97.json
Trim trailing whitespace from JS files and README
packages/ember-handlebars/lib/helpers/loc.js
@@ -24,7 +24,7 @@ import { loc } from "ember-runtime/system/string"; Take note that `"welcome"` is a string and not an object reference. - See [Ember.String.loc](/api/classes/Ember.String.html#method_loc) for how to + See [Ember.String.loc](/api/classes/Ember.String.html#method_loc) for how to set up localized string references. @method loc
true
Other
emberjs
ember.js
aa2de8cbd5fbcbc9314b143f9b6625fe26427b97.json
Trim trailing whitespace from JS files and README
packages/ember-metal/lib/mixin.js
@@ -653,7 +653,7 @@ Alias.prototype = new Descriptor(); }); var goodGuy = App.Person.create(); - + goodGuy.name(); // 'Tomhuda Katzdale' goodGuy.moniker(); // 'Tomhuda Katzdale' ```
true
Other
emberjs
ember.js
aa2de8cbd5fbcbc9314b143f9b6625fe26427b97.json
Trim trailing whitespace from JS files and README
packages/ember-routing-handlebars/lib/helpers/link_to.js
@@ -290,7 +290,7 @@ var LinkView = Ember.LinkView = EmberComponent.extend({ or the application's current route is the route the `LinkView` would trigger transitions into. - The `currentWhen` property can match against multiple routes by separating + The `currentWhen` property can match against multiple routes by separating route names using the `|` character. @property active @@ -342,13 +342,13 @@ var LinkView = Ember.LinkView = EmberComponent.extend({ if (Ember.FEATURES.isEnabled("ember-routing-multi-current-when")) { currentWhen = currentWhen.split('|'); for (var i = 0, len = currentWhen.length; i < len; i++) { - if (isActiveForRoute(currentWhen[i])) { - return get(this, 'activeClass'); + if (isActiveForRoute(currentWhen[i])) { + return get(this, 'activeClass'); } } } else { - if (isActiveForRoute(currentWhen)) { - return get(this, 'activeClass'); + if (isActiveForRoute(currentWhen)) { + return get(this, 'activeClass'); } } }),
true
Other
emberjs
ember.js
aa2de8cbd5fbcbc9314b143f9b6625fe26427b97.json
Trim trailing whitespace from JS files and README
packages/ember-routing/tests/location/auto_location_test.js
@@ -232,7 +232,7 @@ if (Ember.FEATURES.isEnabled('ember-routing-auto-location-uses-replace-state-for createLocation(); equal(get(location, 'implementation'), 'history'); - }); + }); } else { test("AutoLocation.create() should transform the URL for pushState-supported browsers viewing a HashLocation-formatted url", function() { expect(4);
true
Other
emberjs
ember.js
aa2de8cbd5fbcbc9314b143f9b6625fe26427b97.json
Trim trailing whitespace from JS files and README
packages/ember-runtime/lib/computed/reduce_computed_macros.js
@@ -257,12 +257,12 @@ export var mapProperty = mapBy; }) }); - var hamster = Hamster.create({ + var hamster = Hamster.create({ chores: [ { name: 'cook', done: true }, { name: 'clean', done: true }, { name: 'write more unit tests', done: false } - ] + ] }); hamster.get('remainingChores'); // [{name: 'write more unit tests', done: false}]
true
Other
emberjs
ember.js
aa2de8cbd5fbcbc9314b143f9b6625fe26427b97.json
Trim trailing whitespace from JS files and README
packages/ember-runtime/lib/copy.js
@@ -16,7 +16,7 @@ function _copy(obj, deep, seen, copies) { return copies[loc]; } - Ember.assert('Cannot clone an Ember.Object that does not implement Ember.Copyable', + Ember.assert('Cannot clone an Ember.Object that does not implement Ember.Copyable', !(obj instanceof EmberObject) || (Copyable && Copyable.detect(obj))); // IMPORTANT: this specific test will detect a native array only. Any other
true
Other
emberjs
ember.js
aa2de8cbd5fbcbc9314b143f9b6625fe26427b97.json
Trim trailing whitespace from JS files and README
packages/ember/tests/helpers/link_to_test.js
@@ -325,7 +325,7 @@ if (Ember.FEATURES.isEnabled("ember-routing-multi-current-when")) { Ember.TEMPLATES['index/about'] = Ember.Handlebars.compile("{{#link-to 'item' id='link1' currentWhen='item|index'}}ITEM{{/link-to}}"); Ember.TEMPLATES['item'] = Ember.Handlebars.compile("{{#link-to 'item' id='link2' currentWhen='item|index'}}ITEM{{/link-to}}"); Ember.TEMPLATES['foo'] = Ember.Handlebars.compile("{{#link-to 'item' id='link3' currentWhen='item|index'}}ITEM{{/link-to}}"); - + bootApplication(); Ember.run(function() {
true
Other
emberjs
ember.js
a900cfcd95509487ba0f4fd98582d3c22592dc3a.json
Fix typo in tests
packages/ember-views/tests/views/view/transition_to_deprecation_test.js
@@ -23,7 +23,7 @@ test('deprecates when calling transitionTo', function() { }, ''); }); -test("doesn't deprecafte when calling _transitionTo", function() { +test("doesn't deprecate when calling _transitionTo", function() { expect(1); view = EmberView.create();
false
Other
emberjs
ember.js
26b4afc67bfad2eabe5abcf2599616c1139fa2a6.json
Update github user for bower.
bin/bower_ember_build
@@ -7,7 +7,7 @@ git config --global user.name "Tomster" COMPONENTS_EMBER_REPO_SLUG="components/ember" # This specifies the user who is associated to the GH_TOKEN -USER="rjackson" +USER="rwjblue" # This ensure that no directories within dist will be copied when script is run. INCLUDED_FILES=`find dist -maxdepth 1 -type f`
false
Other
emberjs
ember.js
44b99c9714fc3e53b1d8cf433cbcdbe47d0eae84.json
Update CHANGELOG for 1.7.0-beta.2.
CHANGELOG.md
@@ -1,5 +1,18 @@ # Ember Changelog +### Ember 1.7.0-beta.2 (July, 16, 2014) + +* [BUGFIX] Wrap es3 keywords in quotes. +* [BUGFIX] Use injected integration test helpers instead of local functions. +* [BUGFIX] Add alias descriptor, and replace `Ember.computed.alias` with new descriptor. +* [BUGFIX] Fix `{{#with view.foo as bar}}`. +* [BUGFIX] Force remove `required` attribute for IE8. +* [BUGFIX] Controller precendence for `Ember.Route.prototype.render` updated. +* [BUGFIX] fixes variable argument passing to triggerEvent helper. +* [BUGFIX] Use view:toplevel for {{view}} instead of view:default. +* [BUGFIX] Do not throw uncaught errors mid-transition. +* [BUGFIX] Don't assume that the router has a container. + ### Ember 1.7.0-beta.1 (July, 8, 2014) * Fix components inside group helper.
false
Other
emberjs
ember.js
f71243b709de012b2ffd389790072f4a7a16db2b.json
Add 1.6.1 to CHANGELOG.
CHANGELOG.md
@@ -13,6 +13,11 @@ caveats with model/content, and also sets a simple ground rule: Never set a controllers content, rather always set it's model and ember will do the right thing. +### Ember 1.6.1 (July, 15, 2014) + +* Fix error routes/templates. Changes in router promise logging caused errors to be + thrown mid-transition into the `error` route. See [#5166](https://github.com/emberjs/ember.js/pull/5166) for further details. + ### Ember 1.6.0 (July, 7, 2014) * [BREAKING BUGFIX] An empty array is treated as falsy value in `bind-attr` to be in consistent
false
Other
emberjs
ember.js
ea5ffe0adcc45488c0abd289df2a57a7384773ba.json
Remove duplicate feature flag.
features.json
@@ -13,7 +13,6 @@ "ember-metal-is-present": null, "property-brace-expansion-improvement": null, "ember-runtime-proxy-mixin": null, - "ember-routing-consistent-resources": null, "ember-routing-handlebars-action-with-key-code": null }, "debugStatements": [
false
Other
emberjs
ember.js
2cb6043feb4632bd7f45ef9a1470d37f1c4523d9.json
Update changelog and remove the duplicate log
CHANGELOG.md
@@ -9,17 +9,15 @@ * [FEATURE ember-routing-consistent-resources] * `uuid` is now consistently used across the project. * `Ember.uuid` is now an internal function instead of a property on `Ember` itself. -* [BUGFIX] sync back burner: workaround IE's issue with try/finally without Catch. - Also no longer force deoptimization of the run loop queue flush. -* [BREAKING BUGFIX] An empty array are treated as falsy value in `bind-attr` to be in consistent - with `if` helper. Breaking for apps that relies on the previous behaviour which treats an empty - array as truthy value in `bind-attr`. * [BREAKING BUGFIX] On Controllers, the content property is now derived from model. This reduces many caveats with model/content, and also sets a simple ground rule: Never set a controllers content, rather always set it's model and ember will do the right thing. ### Ember 1.6.0 (July, 7, 2014) +* [BREAKING BUGFIX] An empty array is treated as falsy value in `bind-attr` to be in consistent + with `if` helper. Breaking for apps that relies on the previous behaviour which treats an empty + array as truthy value in `bind-attr`. * [BUGFIX] Ensure itemController's do not leak by tying them to the parent controller lifecycle. * [BUGFIX] Spaces in brace expansion throws an error. * [BUGFIX] Fix `MutableEnumerable.removeObjects`.
false
Other
emberjs
ember.js
4a9298223813bf32f90082c53999cb04e7d1a49e.json
Remove duplicate changelog entry
CHANGELOG.md
@@ -35,7 +35,6 @@ * [BUGFIX] Make errors thrown by Ember use `Ember.Error` consistently. * [BUGFIX] Ensure controllers instantiated by the `{{render}}` helper are properly torn down. * [BUGFIX] sync back burner: workaround IE's issue with try/finally without Catch. Also no longer force deoptimization of the run loop queue flush. -* [BREAKING BUGFIX] An empty array are treated as falsy value in `bind-attr` to be in consistent with `if` helper. Breaking for apps that relies on the previous behaviour which treats an empty array as truthy value in `bind-attr`. * [BUGFIX] Ember.onerror now uses Backburner's error handler. * [BUGFIX] Do not rely on Array.prototype.map for logging version. * [BUGFIX] RSVP errors go to Ember.onerror if present.
false
Other
emberjs
ember.js
6222b5d46005cf70ad9ea66faf67bca1be9796f5.json
Update CHANGELOG for 1.7.0-beta.1.
CHANGELOG.md
@@ -1,15 +1,22 @@ # Ember Changelog +### Ember 1.7.0-beta.1 (July, 8, 2014) + +* Fix components inside group helper. +* [BUGFIX] Fix wrong view keyword in a component block. +* Update to RSVP 3.0.7. +* [FEATURE query-params-new] +* [FEATURE ember-routing-consistent-resources] * `uuid` is now consistently used across the project. * `Ember.uuid` is now an internal function instead of a property on `Ember` itself. -* [Bugfix beta] sync back burner: workaround IE's issue with try/finally - without Catch. Also no longer force deoptimization of the run loop - queue flush. -* [BREAKING BUGFIX] An empty array are treated as falsy value in `bind-attr` to be in consistent with `if` helper. Breaking for apps that relies on the previous behaviour which treats an empty array as truthy value in `bind-attr`. -* [Bugfix beta] On Controllers, the content property is now derived from - model. This reduces many caveats with model/content, and also sets a - simple ground rule: Never set a controllers content, rather always set - it's model and ember will do the right thing. +* [BUGFIX] sync back burner: workaround IE's issue with try/finally without Catch. + Also no longer force deoptimization of the run loop queue flush. +* [BREAKING BUGFIX] An empty array are treated as falsy value in `bind-attr` to be in consistent + with `if` helper. Breaking for apps that relies on the previous behaviour which treats an empty + array as truthy value in `bind-attr`. +* [BREAKING BUGFIX] On Controllers, the content property is now derived from model. This reduces many + caveats with model/content, and also sets a simple ground rule: Never set a controllers content, + rather always set it's model and ember will do the right thing. ### Ember 1.6.0 (July, 7, 2014)
false
Other
emberjs
ember.js
87cf065e48ca7d2db6e51b46252adda130d67ce9.json
Update CHANGELOG for 1.6.0.
CHANGELOG.md
@@ -11,7 +11,7 @@ simple ground rule: Never set a controllers content, rather always set it's model and ember will do the right thing. -### Ember 1.6.0-beta.5 (May 27, 2014) +### Ember 1.6.0 (July, 7, 2014) * [BUGFIX] Ensure itemController's do not leak by tying them to the parent controller lifecycle. * [BUGFIX] Spaces in brace expansion throws an error. @@ -24,15 +24,9 @@ * [BUGFIX] Update backburner.js to fix issue with IE8. * [BUGFIX] `Ember.computed.alias` returns value of aliased property upon set. * Provide better debugging information for view rendering. - -### Ember 1.6.0-beta.4 (May, 15, 2014) - * [BUGFIX] Don't fire redirect on parent routes during transitions from one child route to another. * [BUGFIX] Make errors thrown by Ember use `Ember.Error` consistently. * [BUGFIX] Ensure controllers instantiated by the `{{render}}` helper are properly torn down. - -### Ember 1.6.0-beta.3 (April, 29, 2014) - * [BUGFIX] sync back burner: workaround IE's issue with try/finally without Catch. Also no longer force deoptimization of the run loop queue flush. * [BREAKING BUGFIX] An empty array are treated as falsy value in `bind-attr` to be in consistent with `if` helper. Breaking for apps that relies on the previous behaviour which treats an empty array as truthy value in `bind-attr`. * [BUGFIX] Ember.onerror now uses Backburner's error handler. @@ -46,9 +40,6 @@ * [BUGFIX] reduceComputed detect retain:n better. Fixes issue with `Ember.computed.filterBy` erroring when items removed from dependent array. * [BUGFIX] Namespaces are now required to start with uppercase A-Z. * [BUGFIX] pass context to sortFunction to avoid calling `__nextSuper` on `undefined`. - -### Ember 1.6.0-beta.2 (April, 8, 2014) - * [BUGFIX] Allow setting of `undefined` value to a `content` property. * [BUGFIX] Resolve bound actionName in Handlebars context instead of direct lookup on target. * [BUGFIX] isEqual now supports dates. @@ -59,9 +50,6 @@ * [BUGFIX] Drop dead code for * in paths. * [BUGFIX] Route#render name vs viewName precedence fix. * [BUGFIX] Use parseFloat before incrementing via incrementProperty. - -### Ember 1.6.0-beta.1 (March 31, 2014) - * [BUGFIX] Add `which` attribute to event triggered by keyEvent test helper. * [Performance] Improve cache lookup throughput. * [FEATURE ember-routing-add-model-option]
false
Other
emberjs
ember.js
c40e9be34943c48f4bf796509472324ece5cdf84.json
Use Ember.Logger.info instead of console.log
packages/ember-handlebars/lib/helpers/debug.js
@@ -94,7 +94,7 @@ function debuggerHelper(options) { // These are helpful values you can inspect while debugging. var templateContext = this; var typeOfTemplateContext = inspect(templateContext); - console.log('Use `this` to access the context of the calling template'); + Ember.Logger.info('Use `this` to access the context of the calling template.'); debugger; }
false
Other
emberjs
ember.js
0b7e83b9f0eabe082837b63b6307c8e1096126be.json
Fix JSHint issue with _renderToBuffer refactor. This was introduced with fb098d761137744add367bb53a1c279a4a09ffb9.
packages/ember-views/lib/views/view.js
@@ -1678,7 +1678,7 @@ var View = CoreView.extend({ _renderToBuffer: function(buffer) { this.lengthBeforeRender = this._childViews.length; - var buffer = this._super(buffer); + buffer = this._super(buffer); this.lengthAfterRender = this._childViews.length; return buffer;
false
Other
emberjs
ember.js
9b7967dca1eb675aef59822ba626c4c004fc5835.json
Throw error if improperly defined factory
packages/container/lib/container.js
@@ -582,8 +582,10 @@ Container.prototype = { validateFullName(fullName); if (this.factoryCache.has(normalizedName)) { - throw new Error("Attempted to register a factoryInjection for a type that has already been looked up. ('" + normalizedName + "', '" + property + "', '" + injectionName + "')"); + throw new Error('Attempted to register a factoryInjection for a type that has already ' + + 'been looked up. (\'' + normalizedName + '\', \'' + property + '\', \'' + injectionName + '\')'); } + addInjection(this.factoryInjections, normalizedName, property, normalizedInjectionName); }, @@ -594,7 +596,7 @@ Container.prototype = { @method destroy */ destroy: function() { - for (var i=0, l=this.children.length; i<l; i++) { + for (var i = 0, length = this.children.length; i < length; i++) { this.children[i].destroy(); } @@ -612,9 +614,10 @@ Container.prototype = { @method reset */ reset: function() { - for (var i=0, l=this.children.length; i<l; i++) { + for (var i = 0, length = this.children.length; i < length; i++) { resetCache(this.children[i]); } + resetCache(this); } }; @@ -646,7 +649,7 @@ function lookup(container, fullName, options) { } function illegalChildOperation(operation) { - throw new Error(operation + " is not currently supported on child containers"); + throw new Error(operation + ' is not currently supported on child containers'); } function isSingleton(container, fullName) { @@ -662,7 +665,7 @@ function buildInjections(container, injections) { var injection, injectable; - for (var i=0, l=injections.length; i<l; i++) { + for (var i = 0, length = injections.length; i < length; i++) { injection = injections[i]; injectable = lookup(container, injection.fullName); @@ -683,7 +686,7 @@ function option(container, fullName, optionName) { return options[optionName]; } - var type = fullName.split(":")[0]; + var type = fullName.split(':')[0]; options = container._typeOptions.get(type); if (options) { @@ -696,7 +699,7 @@ function factoryFor(container, fullName) { var factory = container.resolve(name); var injectedFactory; var cache = container.factoryCache; - var type = fullName.split(":")[0]; + var type = fullName.split(':')[0]; if (factory === undefined) { return; } @@ -709,8 +712,7 @@ function factoryFor(container, fullName) { // for now just fallback to create time injection return factory; } else { - - var injections = injectionsFor(container, fullName); + var injections = injectionsFor(container, fullName); var factoryInjections = factoryInjectionsFor(container, fullName); factoryInjections._toString = container.makeToString(factory, fullName); @@ -725,7 +727,7 @@ function factoryFor(container, fullName) { } function injectionsFor(container, fullName) { - var splitName = fullName.split(":"), + var splitName = fullName.split(':'), type = splitName[0], injections = []; @@ -740,7 +742,7 @@ function injectionsFor(container, fullName) { } function factoryInjectionsFor(container, fullName) { - var splitName = fullName.split(":"), + var splitName = fullName.split(':'), type = splitName[0], factoryInjections = []; @@ -761,6 +763,11 @@ function instantiate(container, fullName) { } if (factory) { + if (typeof factory.create !== 'function') { + throw new Error('Failed to create an instance of \'' + fullName + '\'. ' + + 'Most likely an improperly defined class or an invalid module export.'); + } + if (typeof factory.extend === 'function') { // assume the factory was extendable and is already injected return factory.create();
true
Other
emberjs
ember.js
9b7967dca1eb675aef59822ba626c4c004fc5835.json
Throw error if improperly defined factory
packages/container/tests/container_test.js
@@ -51,7 +51,7 @@ test("A registered factory is returned from lookupFactory is the same factory ea deepEqual(container.lookupFactory('controller:post'), container.lookupFactory('controller:post'), 'The return of lookupFactory is always the same'); }); -test("A factory returned from lookupFactory has a debugkey", function(){ +test("A factory returned from lookupFactory has a debugkey", function() { var container = new Container(); var PostController = factory(); var instance; @@ -63,7 +63,7 @@ test("A factory returned from lookupFactory has a debugkey", function(){ equal(PostFactory._debugContainerKey, 'controller:post', 'factory instance receives _debugContainerKey'); }); -test("fallback for to create time injections if factory has no extend", function(){ +test("fallback for to create time injections if factory has no extend", function() { var container = new Container(); var AppleController = factory(); var PostController = factory(); @@ -280,6 +280,16 @@ test("A failed lookup returns undefined", function() { equal(container.lookup('doesnot:exist'), undefined); }); +test("An invalid factory throws an error", function() { + var container = new Container(); + + container.register('controller:foo', {}); + + throws(function() { + container.lookup('controller:foo'); + }, /Failed to create an instance of \'controller:foo\'/); +}); + test("Injecting a failed lookup raises an error", function() { Ember.MODEL_FACTORY_INJECTIONS = true; @@ -542,7 +552,7 @@ test('container.has should not accidentally cause injections on that factory to ok(container.has('controller:apple')); }); -test('once resolved, always return the same result', function(){ +test('once resolved, always return the same result', function() { expect(1); var container = new Container(); @@ -560,7 +570,7 @@ test('once resolved, always return the same result', function(){ equal(container.resolve('models:bar'), Bar); }); -test('once looked up, assert if an injection is registered for the entry', function(){ +test('once looked up, assert if an injection is registered for the entry', function() { expect(1); var container = new Container(),
true
Other
emberjs
ember.js
e751cd09930240155b3a51e23b3bd4831b06b4d3.json
fix typo in test
packages/ember-metal/tests/accessors/get_test.js
@@ -58,7 +58,7 @@ test('warn on attempts to get a property path of undefined', function() { }, /Cannot call get with 'aProperty.on.aPath' on an undefined object/); }); -test('warn on attemps to get a falsy property', function() { +test('warn on attempts to get a falsy property', function() { var obj = {}; expectAssertion(function() { get(obj, null);
false
Other
emberjs
ember.js
158809db1195e6082b71b134a56f30ffe2aa7e11.json
fix typo in test
packages/ember-metal/tests/accessors/get_test.js
@@ -58,7 +58,7 @@ test('warn on attempts to get a property path of undefined', function() { }, /Cannot call get with 'aProperty.on.aPath' on an undefined object/); }); -test('warn on attemps to get a falsy property', function() { +test('warn on attempts to get a falsy property', function() { var obj = {}; expectAssertion(function() { get(obj, null);
false
Other
emberjs
ember.js
6d9a2e5d4a042424f0f2f90c885c3d80224a6bc1.json
Fix components inside group helper Components (like `link-to`) end up with the wrong context when used inside a `#group` helper. And their templates don't get grouped. I understand that #group is experimental, but as long as the support for it remains in master, it makes sense to not leave it broken.
packages/ember-handlebars/lib/helpers/binding.js
@@ -118,6 +118,9 @@ function bind(property, options, preserveContext, shouldDisplay, valueNormalizer if ('object' === typeof this) { if (data.insideGroup) { observer = function() { + while (view._contextView) { + view = view._contextView; + } run.once(view, 'rerender'); }; @@ -197,6 +200,9 @@ function simpleBind(currentContext, property, options) { if (pathRoot && ('object' === typeof pathRoot)) { if (data.insideGroup) { observer = function() { + while (view._contextView) { + view = view._contextView; + } run.once(view, 'rerender'); };
true
Other
emberjs
ember.js
6d9a2e5d4a042424f0f2f90c885c3d80224a6bc1.json
Fix components inside group helper Components (like `link-to`) end up with the wrong context when used inside a `#group` helper. And their templates don't get grouped. I understand that #group is experimental, but as long as the support for it remains in master, it makes sense to not leave it broken.
packages/ember-handlebars/tests/helpers/group_test.js
@@ -9,6 +9,7 @@ import { A } from "ember-runtime/system/native_array"; import Container from "ember-runtime/system/container"; import { get } from "ember-metal/property_get"; import { set } from "ember-metal/property_set"; +import Component from "ember-views/views/component"; var trim = jQuery.trim; var container, view; @@ -226,6 +227,25 @@ test("an #each can be nested with a view inside", function() { equal(view.$().text(), 'ErikTom', "The updated object's view was rerendered"); }); +test("an #each can be nested with a component inside", function() { + var yehuda = {name: 'Yehuda'}; + container.register('view:test', Component.extend()); + createGroupedView( + '{{#each people}}{{#view "test"}}{{name}}{{/view}}{{/each}}', + {people: A([yehuda, {name: 'Tom'}])} + ); + + appendView(); + equal(view.$('script').length, 0, "No Metamorph markers are output"); + equal(view.$().text(), 'YehudaTom', "The content was rendered"); + + run(function() { + set(yehuda, 'name', 'Erik'); + }); + + equal(view.$().text(), 'ErikTom', "The updated object's view was rerendered"); +}); + test("#each with groupedRows=true behaves like a normal bound #each", function() { createGroupedView( '{{#each numbers groupedRows=true}}{{this}}{{/each}}',
true
Other
emberjs
ember.js
6d9a2e5d4a042424f0f2f90c885c3d80224a6bc1.json
Fix components inside group helper Components (like `link-to`) end up with the wrong context when used inside a `#group` helper. And their templates don't get grouped. I understand that #group is experimental, but as long as the support for it remains in master, it makes sense to not leave it broken.
packages/ember-views/lib/views/component.js
@@ -112,6 +112,7 @@ var Component = View.extend(TargetActionSupport, ComponentTemplateDeprecation, { init: function() { this._super(); + set(this, 'origContext', get(this, 'context')); set(this, 'context', this); set(this, 'controller', this); }, @@ -180,9 +181,9 @@ var Component = View.extend(TargetActionSupport, ComponentTemplateDeprecation, { tagName: '', _contextView: parentView, template: template, - context: get(parentView, 'context'), + context: options.data.insideGroup ? get(this, 'origContext') : get(parentView, 'context'), controller: get(parentView, 'controller'), - templateData: { keywords: parentView.cloneKeywords() } + templateData: { keywords: parentView.cloneKeywords(), insideGroup: options.data.insideGroup } }); } },
true
Other
emberjs
ember.js
c5aa7611fa025bbf7cf6c579198faabc24df831f.json
Fix spelling error.
packages/ember-runtime/tests/computed/reduce_computed_test.js
@@ -26,7 +26,7 @@ QUnit.module('arrayComputed', { otherNumbers: Ember.A([ 7, 8, 9 ]), // Users would obviously just use `Ember.computed.map` - // This implemantion is fine for these tests, but doesn't properly work as + // This implementation is fine for these tests, but doesn't properly work as // it's not index based. evenNumbers: arrayComputed('numbers', { addedItem: function (array, item) {
false
Other
emberjs
ember.js
cc150824a8e660a9bcbc112cc1163be9b8800923.json
Remove old/unused JSHint reporter. This is handled by `broccoli-jshint` now, and is no longer used.
tests/qunit_configuration.js
@@ -110,24 +110,6 @@ EmberDev.jsHint = !QUnit.urlParams.nojshint; - EmberDev.jsHintReporter = function (file, errors) { - if (!errors) { return ''; } - - var len = errors.length, - str = '', - error, idx; - - if (len === 0) { return ''; } - - for (idx=0; idx<len; idx++) { - error = errors[idx]; - str += file + ': line ' + error.line + ', col ' + - error.character + ', ' + error.reason + '\n'; - } - - return str + "\n" + len + ' error' + ((len === 1) ? '' : 's'); - }; - var o_create = Object.create || (function(){ function F(){}
false
Other
emberjs
ember.js
5ebcfae25a06797b964bf78094e1a5911ae126d5.json
Publish ember-runtime.js for builds.
Rakefile
@@ -160,7 +160,7 @@ namespace :release do end def files_to_publish - %w{ember.js ember-docs.json ember-tests.js ember-template-compiler.js} + %w{ember.js ember-docs.json ember-tests.js ember-template-compiler.js ember-runtime.js} end task :publish_build => [:docs] do
false
Other
emberjs
ember.js
6555b15af491c7d0633660218fb7f0a014ffee5f.json
Update CHANGELOG for 1.6.0-beta.5.
CHANGELOG.md
@@ -9,6 +9,20 @@ simple ground rule: Never set a controllers content, rather always set it's model and ember will do the right thing. +### Ember 1.6.0-beta.5 (May 27, 2014) + +* [BUGFIX] Ensure itemController's do not leak by tying them to the parent controller lifecycle. +* [BUGFIX] Spaces in brace expansion throws an error. +* [BUGFIX] Fix `MutableEnumerable.removeObjects`. +* [BUGFIX] Allow controller specified to `{{with}}` to be the target of an action. +* [BUGFIX] Ensure that using keywords syntax (`{{with foo as bar}}`) works when specifying a controller. +* [BUGFIX] Ensure that controllers instantiated by `{{with}}` are properly destroyed. +* [BUGFIX] Wrap the keyword specified in `{{with foo as bar}}` with the controller (if specified). +* [BUGFIX] Fix `Ember.isArray` on IE8. +* [BUGFIX] Update backburner.js to fix issue with IE8. +* [BUGFIX] `Ember.computed.alias` returns value of aliased property upon set. +* Provide better debugging information for view rendering. + ### Ember 1.6.0-beta.4 (May, 15, 2014) * [BUGFIX] Don't fire redirect on parent routes during transitions from one child route to another.
false
Other
emberjs
ember.js
7cd7df421d67c5a461e9dabf41d9670cbd4b6979.json
Update jQuery version in tests.
Brocfile.js
@@ -118,7 +118,7 @@ var bowerFiles = [ destDir: '/qunit' }), - pickFiles('bower_components/jquery', { + pickFiles('bower_components/jquery/dist', { files: ['jquery.js'], srcDir: '/', destDir: '/jquery'
true
Other
emberjs
ember.js
7cd7df421d67c5a461e9dabf41d9670cbd4b6979.json
Update jQuery version in tests.
bin/run-tests.js
@@ -102,6 +102,12 @@ function generateOldJQueryTests() { testFunctions.push(function() { return run('jquery=1.7.2&nojshint=true&enableoptionalfeatures=true'); }); + testFunctions.push(function() { + return run('jquery=1.8.3&nojshint=true'); + }); + testFunctions.push(function() { + return run('jquery=1.10.2&nojshint=true'); + }); } function generateExtendPrototypeTests() {
true
Other
emberjs
ember.js
7cd7df421d67c5a461e9dabf41d9670cbd4b6979.json
Update jQuery version in tests.
bower.json
@@ -2,7 +2,7 @@ "name": "ember", "dependencies": { "handlebars": "~1.3.0", - "jquery": "~1.9.1", + "jquery": "~1.11.1", "qunit": "~1.12.0", "loader": "git://github.com/stefanpenner/loader.js#1.0.0" }
true
Other
emberjs
ember.js
4e66ab623ac9dcc0722d801e9cc114668e3dfd04.json
Prevent non-js merge conflicts in Brocfile.js. Prior to this, a file named `.DS_Store` in both the lib and test directories of a single package would cause an error during the build. This doesn't completely fix the issue, but does prevent the majority of cases that are benign. If we end up having further merge conflicts where we have a file with the same name in both `lib/` and `test/` dirs we can address those individually. This fixes the majority of trivial scenarios for now.
Brocfile.js
@@ -167,6 +167,7 @@ function es6Package(packageName) { libTree = pickFiles('packages/' + packageName + '/lib', { srcDir: '/', + files: ['**/*.js'], destDir: packageName }); @@ -187,6 +188,7 @@ function es6Package(packageName) { var testTree = pickFiles('packages/' + packageName + '/tests', { srcDir: '/', + files: ['**/*.js'], destDir: '/' + packageName + '/tests' });
false
Other
emberjs
ember.js
fd7e526c5197166660dd1f6168d7e8930f93e165.json
Use production environment when building. The prod and min assets are now generated by default. NOTE: This does not affect running `npm start` (or `broccoli serve`).
bin/build.js
@@ -7,6 +7,8 @@ var ncp = RSVP.denodeify(require('ncp')); var mkdir = RSVP.denodeify(require('fs').mkdir); var chalk = require('chalk'); + +process.env.BROCCOLI_ENV = process.env.BROCCOLI_ENV || 'production'; var tree = broccoli.loadBrocfile(); var builder = new broccoli.Builder(tree);
false
Other
emberjs
ember.js
2e06f29f740cff0150c2467f0ddfb963b1f8c020.json
Use npm scripts for building and test.
.travis.yml
@@ -5,15 +5,12 @@ node_js: - "0.10" install: - "npm install" -before_script: - - rm -rf dist/ - - npm run-script build after_success: - bundle install --deployment --retry 3 --jobs 4 - bundle exec rake publish_build - bundle exec rake publish_to_bower script: - - bin/run-tests.js + - npm test env: global: - BROCCOLI_ENV=production
true
Other
emberjs
ember.js
2e06f29f740cff0150c2467f0ddfb963b1f8c020.json
Use npm scripts for building and test.
bin/build.js
@@ -0,0 +1,42 @@ +#!/usr/bin/env node + +var broccoli = require('broccoli'); +var RSVP = require('rsvp'); +var rimraf = RSVP.denodeify(require('rimraf')); +var ncp = RSVP.denodeify(require('ncp')); +var mkdir = RSVP.denodeify(require('fs').mkdir); +var chalk = require('chalk'); + +var tree = broccoli.loadBrocfile(); +var builder = new broccoli.Builder(tree); + +var buildPath = process.argv[2] || 'dist'; + +builder.build() + .then(function(results) { + return rimraf(buildPath) + .then(function() { + return mkdir(buildPath); + }) + .then(function() { + return ncp(results.directory, buildPath, { + clobber: true, + stopOnErr: true + }); + }); + }) + .then(function() { + console.log(chalk.green('Built project successfully. Stored in "' + buildPath + '/".\n')); + }) + .catch(function(err) { + console.log(chalk.red('Build failed.\n')); + + if (err.file) { + console.log('File: ' + err.file + '\n'); + } + console.log(err.stack); + }) + .finally(function() { + return builder.cleanup(); + }); +
true
Other
emberjs
ember.js
2e06f29f740cff0150c2467f0ddfb963b1f8c020.json
Use npm scripts for building and test.
package.json
@@ -3,9 +3,11 @@ "license": "MIT", "version": "1.7.0-beta.1+canary", "scripts": { + "build": "bin/build.js", "postinstall": "bower install", - "build": "broccoli build dist", - "test": "bin/run-tests.js" + "pretest": "bin/build.js", + "test": "bin/run-tests.js", + "start": "broccoli serve" }, "devDependencies": { "defeatureify": "~0.2.0", @@ -33,6 +35,8 @@ "broccoli-cli": "0.0.1", "broccoli-file-creator": "~0.1.0", "handlebars": "^1.3", - "broccoli-filter": "~0.1.6" + "broccoli-filter": "~0.1.6", + "ncp": "~0.5.1", + "rimraf": "~2.2.8" } }
true
Other
emberjs
ember.js
86e1b1355150d690a98cf077e29a853d7f034772.json
Fix usage with Chrome Harmony. Currently, the test suite fails when running with `chrome://flags/#enable-javascript-harmony` enabled. All of the failures were due to duplicate declarations, which apparently fails when running with Harmony features enabled...
packages_es6/ember-metal/lib/mixin.js
@@ -37,7 +37,7 @@ import { removeListener } from "ember-metal/events"; -var REQUIRED, Alias, +var REQUIRED, a_map = map, a_indexOf = indexOf, a_forEach = forEach,
true
Other
emberjs
ember.js
86e1b1355150d690a98cf077e29a853d7f034772.json
Fix usage with Chrome Harmony. Currently, the test suite fails when running with `chrome://flags/#enable-javascript-harmony` enabled. All of the failures were due to duplicate declarations, which apparently fails when running with Harmony features enabled...
packages_es6/ember-metal/lib/properties.js
@@ -29,8 +29,7 @@ var MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER; @private @constructor */ -function Descriptor() {} -export var Descriptor = Descriptor; +export function Descriptor() {} // .......................................................... // DEFINING PROPERTIES API
true
Other
emberjs
ember.js
86e1b1355150d690a98cf077e29a853d7f034772.json
Fix usage with Chrome Harmony. Currently, the test suite fails when running with `chrome://flags/#enable-javascript-harmony` enabled. All of the failures were due to duplicate declarations, which apparently fails when running with Harmony features enabled...
packages_es6/ember-runtime/lib/computed/reduce_computed_macros.js
@@ -222,7 +222,7 @@ export function map(dependentKey, callback) { @param {String} propertyKey @return {Ember.ComputedProperty} an array mapped to the specified key */ -function mapBy (dependentKey, propertyKey) { +export function mapBy (dependentKey, propertyKey) { var callback = function(item) { return get(item, propertyKey); }; return map(dependentKey + '.@each.' + propertyKey, callback); } @@ -235,7 +235,6 @@ function mapBy (dependentKey, propertyKey) { @param propertyKey */ export var mapProperty = mapBy; -export var mapBy = mapProperty; /** Filters the array by the callback. @@ -268,8 +267,7 @@ export var mapBy = mapProperty; @param {Function} callback @return {Ember.ComputedProperty} the filtered array */ -export var filter = filter; -function filter(dependentKey, callback) { +export function filter(dependentKey, callback) { var options = { initialize: function (array, changeMeta, instanceMeta) { instanceMeta.filteredArrayIndexes = new SubArray(); @@ -323,8 +321,7 @@ function filter(dependentKey, callback) { @param {*} value @return {Ember.ComputedProperty} the filtered array */ -export var filterBy = filterBy; -function filterBy (dependentKey, propertyKey, value) { +export function filterBy (dependentKey, propertyKey, value) { var callback; if (arguments.length === 2) { @@ -376,8 +373,7 @@ export var filterProperty = filterBy; @return {Ember.ComputedProperty} computes a new array with all the unique elements from the dependent array */ -export var uniq = uniq; -function uniq() { +export function uniq() { var args = a_slice.call(arguments); args.push({ initialize: function(array, changeMeta, instanceMeta) {
true
Other
emberjs
ember.js
e01b92b160b80cd036058c4e70b051bd4d5a197c.json
Fix JSHint issues.
.jshintrc
@@ -15,8 +15,6 @@ "notStrictEqual", "test", "asyncTest", - "testBoth", - "testWithDefault", "raises", "throws", "deepEqual", @@ -32,7 +30,7 @@ "ignoreDeprecation", // A safe subset of "browser:true": - "window", "location", "document", "XMLSerializer", + "window", "document", "setTimeout", "clearTimeout", "setInterval", "clearInterval" ], "esnext": true,
true
Other
emberjs
ember.js
e01b92b160b80cd036058c4e70b051bd4d5a197c.json
Fix JSHint issues.
packages_es6/container/tests/container_helper.js
@@ -1,5 +1,3 @@ -/*jshint validthis:true */ - var setProperties = function(object, properties) { for (var key in properties) { if (properties.hasOwnProperty(key)) { @@ -25,6 +23,8 @@ var guids = 0; var passedOptions; var factory = function() { + /*jshint validthis: true */ + var Klass = function(options) { setProperties(this, options); this._guid = guids++;
true
Other
emberjs
ember.js
e01b92b160b80cd036058c4e70b051bd4d5a197c.json
Fix JSHint issues.
packages_es6/ember-application/lib/main.js
@@ -9,7 +9,7 @@ Ember Application @requires ember-views, ember-routing */ -import DAG from "ember-application/system/dag" +import DAG from "ember-application/system/dag"; import {Resolver, DefaultResolver} from "ember-application/system/resolver"; import Application from "ember-application/system/application"; import "ember-application/ext/controller"; // side effect of extending ControllerMixin
true
Other
emberjs
ember.js
e01b92b160b80cd036058c4e70b051bd4d5a197c.json
Fix JSHint issues.
packages_es6/ember-application/lib/system/application.js
@@ -7,7 +7,7 @@ import Ember from "ember-metal"; // Ember.FEATURES, Ember.deprecate, Ember.asser import {get} from "ember-metal/property_get"; import {set} from "ember-metal/property_set"; import {runLoadHooks} from "ember-runtime/system/lazy_load"; -import DAG from "ember-application/system/dag" +import DAG from "ember-application/system/dag"; import Namespace from "ember-runtime/system/namespace"; import DeferredMixin from "ember-runtime/mixins/deferred"; import {DefaultResolver} from "ember-application/system/resolver";
true
Other
emberjs
ember.js
e01b92b160b80cd036058c4e70b051bd4d5a197c.json
Fix JSHint issues.
packages_es6/ember-application/lib/system/dag.js
@@ -1,3 +1,5 @@ +import EmberError from "ember-metal/error"; + function visit(vertex, fn, visited, path) { var name = vertex.name, vertices = vertex.incoming,
true
Other
emberjs
ember.js
e01b92b160b80cd036058c4e70b051bd4d5a197c.json
Fix JSHint issues.
packages_es6/ember-extension-support/lib/data_adapter.js
@@ -4,7 +4,7 @@ import run from "ember-metal/run_loop"; import {dasherize} from "ember-runtime/system/string"; import Namespace from "ember-runtime/system/namespace"; import EmberObject from "ember-runtime/system/object"; -import {A} from "ember-runtime/system/native_array"; +import {A as emberA} from "ember-runtime/system/native_array"; import Application from "ember-application/system/application"; /** @@ -56,7 +56,7 @@ import Application from "ember-application/system/application"; var DataAdapter = EmberObject.extend({ init: function() { this._super(); - this.releaseMethods = A(); + this.releaseMethods = emberA(); }, /** @@ -101,7 +101,7 @@ var DataAdapter = EmberObject.extend({ @property releaseMethods @since 1.3.0 */ - releaseMethods: A(), + releaseMethods: emberA(), /** Specifies how records can be filtered. @@ -114,7 +114,7 @@ var DataAdapter = EmberObject.extend({ The object should have a `name` and `desc` property. */ getFilters: function() { - return A(); + return emberA(); }, /** @@ -133,7 +133,7 @@ var DataAdapter = EmberObject.extend({ */ watchModelTypes: function(typesAdded, typesUpdated) { var modelTypes = this.getModelTypes(), - self = this, typesToSend, releaseMethods = A(); + self = this, typesToSend, releaseMethods = emberA(); typesToSend = modelTypes.map(function(type) { var klass = type.klass; @@ -182,7 +182,7 @@ var DataAdapter = EmberObject.extend({ @return {Function} Method to call to remove all observers */ watchRecords: function(type, recordsAdded, recordsUpdated, recordsRemoved) { - var self = this, releaseMethods = A(), records = this.getRecords(type), release; + var self = this, releaseMethods = emberA(), records = this.getRecords(type), release; var recordUpdated = function(updatedRecord) { recordsUpdated([updatedRecord]); @@ -260,7 +260,7 @@ var DataAdapter = EmberObject.extend({ desc: {String} Humanized description (what would show in a table column name) */ columnsForType: function(type) { - return A(); + return emberA(); }, /** @@ -365,7 +365,7 @@ var DataAdapter = EmberObject.extend({ @return {Array} Array of model type strings */ _getObjectsOnNamespaces: function() { - var namespaces = A(Namespace.NAMESPACES), types = A(); + var namespaces = emberA(Namespace.NAMESPACES), types = emberA(); namespaces.forEach(function(namespace) { for (var key in namespace) { @@ -390,7 +390,7 @@ var DataAdapter = EmberObject.extend({ so it should update when new records are added/removed. */ getRecords: function(type) { - return A(); + return emberA(); }, /** @@ -434,7 +434,7 @@ var DataAdapter = EmberObject.extend({ @return {Array} Relevant keywords for search. */ getRecordKeywords: function(record) { - return A(); + return emberA(); }, /**
true
Other
emberjs
ember.js
e01b92b160b80cd036058c4e70b051bd4d5a197c.json
Fix JSHint issues.
packages_es6/ember-handlebars-compiler/lib/main.js
@@ -1,3 +1,5 @@ +/* global Handlebars:true */ + /** @module ember @submodule ember-handlebars-compiler @@ -6,8 +8,8 @@ import Ember from "ember-metal/core"; // ES6Todo: you'll need to import debugger once debugger is es6'd. -if (typeof Ember.assert === 'undefined') { Ember.assert = function(){}; }; -if (typeof Ember.FEATURES === 'undefined') { Ember.FEATURES = { isEnabled: function(){} }; }; +if (typeof Ember.assert === 'undefined') { Ember.assert = function(){}; } +if (typeof Ember.FEATURES === 'undefined') { Ember.FEATURES = { isEnabled: function(){} }; } var objectCreate = Object.create || function(parent) { function F() {}
true
Other
emberjs
ember.js
e01b92b160b80cd036058c4e70b051bd4d5a197c.json
Fix JSHint issues.
packages_es6/ember-handlebars/lib/controls.js
@@ -344,4 +344,4 @@ function textareaHelper(options) { return helpers.view.call(this, TextArea, options); } -export {inputHelper, textareaHelper} +export {inputHelper, textareaHelper};
true
Other
emberjs
ember.js
e01b92b160b80cd036058c4e70b051bd4d5a197c.json
Fix JSHint issues.
packages_es6/ember-handlebars/lib/controls/select.js
@@ -1,5 +1,3 @@ -/*jshint eqeqeq:false newcap:false */ - /** @module ember @submodule ember-handlebars @@ -14,7 +12,7 @@ import CollectionView from "ember-views/views/collection_view"; import {isArray} from "ember-metal/utils"; import isNone from 'ember-metal/is_none'; import {computed} from "ember-metal/computed"; -import {A} from "ember-runtime/system/native_array"; +import {A as emberA} from "ember-runtime/system/native_array"; import {observer} from "ember-metal/mixin"; import {defineProperty} from "ember-metal/properties"; @@ -48,7 +46,7 @@ var SelectOption = View.extend({ } else { // Primitives get passed through bindings as objects... since // `new Number(4) !== 4`, we use `==` below - return content == selection; + return content == selection; // jshint ignore:line } }).property('content', 'parentView.selection'), @@ -381,7 +379,7 @@ var Select = View.extend({ ```javascript Ember.Select.create({ - content: A([ + content: Ember.A([ { id: 1, firstName: 'Yehuda' }, { id: 2, firstName: 'Tom' } ]), @@ -473,7 +471,7 @@ var Select = View.extend({ groupedContent: computed(function() { var groupPath = get(this, 'optionGroupPath'); - var groupedContent = A(); + var groupedContent = emberA(); var content = get(this, 'content') || []; forEach(content, function(item) { @@ -482,7 +480,7 @@ var Select = View.extend({ if (get(groupedContent, 'lastObject.label') !== label) { groupedContent.pushObject({ label: label, - content: A() + content: emberA() }); } @@ -513,7 +511,7 @@ var Select = View.extend({ var selection = get(this, 'selection'); if (get(this, 'multiple')) { if (!isArray(selection)) { - set(this, 'selection', A([selection])); + set(this, 'selection', emberA([selection])); return; } this._selectionDidChangeMultiple(); @@ -621,5 +619,5 @@ var Select = View.extend({ } }); -export default Select -export {Select, SelectOption, SelectOptgroup} +export default Select; +export {Select, SelectOption, SelectOptgroup};
true
Other
emberjs
ember.js
e01b92b160b80cd036058c4e70b051bd4d5a197c.json
Fix JSHint issues.
packages_es6/ember-handlebars/lib/ext.js
@@ -58,7 +58,7 @@ function normalizePath(root, path, data) { } return { root: root, path: path, isKeyword: isKeyword }; -}; +} /** @@ -131,7 +131,7 @@ function getEscaped(root, path, options) { } return result; -}; +} function resolveParams(context, params, options) { var resolvedParams = [], types = options.types, param, type; @@ -148,7 +148,7 @@ function resolveParams(context, params, options) { } return resolvedParams; -}; +} function resolveHash(context, hash, options) { var resolvedHash = {}, types = options.hashTypes, type; @@ -166,7 +166,7 @@ function resolveHash(context, hash, options) { } return resolvedHash; -}; +} /** Registers a helper in Handlebars that will be called if no property with the @@ -349,7 +349,7 @@ function registerBoundHelper(name, fn) { var boundHelperArgs = slice.call(arguments, 1), boundFn = makeBoundHelper.apply(this, boundHelperArgs); EmberHandlebars.registerHelper(name, boundFn); -}; +} /** A helper function used by `registerBoundHelper`. Takes the @@ -497,7 +497,7 @@ function makeBoundHelper(fn) { helper._rawFunction = fn; return helper; -}; +} /** Renders the unbound form of an otherwise bound helper function. @@ -551,6 +551,6 @@ function template(spec) { var t = originalTemplate(spec); t.isTop = true; return t; -}; +} -export {normalizePath, template, makeBoundHelper, registerBoundHelper, resolveHash, resolveParams, handlebarsGet, getEscaped, evaluateUnboundHelper, helperMissingHelper, blockHelperMissingHelper} +export {normalizePath, template, makeBoundHelper, registerBoundHelper, resolveHash, resolveParams, handlebarsGet, getEscaped, evaluateUnboundHelper, helperMissingHelper, blockHelperMissingHelper};
true
Other
emberjs
ember.js
e01b92b160b80cd036058c4e70b051bd4d5a197c.json
Fix JSHint issues.
packages_es6/ember-handlebars/lib/helpers/binding.js
@@ -840,6 +840,6 @@ function bindClasses(context, classBindings, view, bindAttrId, options) { }); return ret; -}; +} -export {bind, _triageMustacheHelper, resolveHelper, bindHelper, boundIfHelper, unboundIfHelper, withHelper, ifHelper, unlessHelper, bindAttrHelper, bindAttrHelperDeprecated, bindClasses} +export {bind, _triageMustacheHelper, resolveHelper, bindHelper, boundIfHelper, unboundIfHelper, withHelper, ifHelper, unlessHelper, bindAttrHelper, bindAttrHelperDeprecated, bindClasses};
true
Other
emberjs
ember.js
e01b92b160b80cd036058c4e70b051bd4d5a197c.json
Fix JSHint issues.
packages_es6/ember-handlebars/lib/helpers/debug.js
@@ -50,7 +50,7 @@ function logHelper() { } logger.apply(logger, values); -}; +} /** Execute the `debugger` statement in the current context.
true
Other
emberjs
ember.js
e01b92b160b80cd036058c4e70b051bd4d5a197c.json
Fix JSHint issues.
packages_es6/ember-handlebars/lib/helpers/each.js
@@ -138,7 +138,7 @@ function _addMetamorphCheck() { } // until ember-debug is es6ed -var runInDebug = function(f){f()}; +var runInDebug = function(f){ f(); }; runInDebug( function() { _addMetamorphCheck(); }); @@ -452,5 +452,5 @@ function eachHelper(path, options) { } } -export {EachView, GroupedEach, eachHelper} +export {EachView, GroupedEach, eachHelper};
true
Other
emberjs
ember.js
e01b92b160b80cd036058c4e70b051bd4d5a197c.json
Fix JSHint issues.
packages_es6/ember-handlebars/lib/loader.js
@@ -56,7 +56,7 @@ function bootstrap(ctx) { // Remove script tag from DOM script.remove(); }); -}; +} function _bootstrap() { bootstrap( jQuery(document) );
true
Other
emberjs
ember.js
e01b92b160b80cd036058c4e70b051bd4d5a197c.json
Fix JSHint issues.
packages_es6/ember-handlebars/lib/string.js
@@ -17,7 +17,7 @@ import EmberStringUtils from "ember-runtime/system/string"; */ function htmlSafe(str) { return new Handlebars.SafeString(str); -}; +} EmberStringUtils.htmlSafe = htmlSafe; if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.String) {
true
Other
emberjs
ember.js
e01b92b160b80cd036058c4e70b051bd4d5a197c.json
Fix JSHint issues.
packages_es6/ember-handlebars/lib/views/handlebars_bound_view.js
@@ -1,4 +1,4 @@ -/*globals Handlebars */ +/*globals Handlebars, Metamorph:true */ /*jshint newcap:false*/ @@ -11,7 +11,7 @@ import EmberHandlebars from "ember-handlebars-compiler"; // EmberHandlebars.Safe var SafeString = EmberHandlebars.SafeString; import Ember from "ember-metal/core"; // Ember.K -var K = Ember.K +var K = Ember.K; var Metamorph = requireModule('metamorph'); @@ -349,4 +349,4 @@ var _HandlebarsBoundView = _MetamorphView.extend({ } }); -export {_HandlebarsBoundView, SimpleHandlebarsView} +export {_HandlebarsBoundView, SimpleHandlebarsView};
true
Other
emberjs
ember.js
e01b92b160b80cd036058c4e70b051bd4d5a197c.json
Fix JSHint issues.
packages_es6/ember-handlebars/lib/views/metamorph_view.js
@@ -1,3 +1,5 @@ +/* global Metamorph:true */ + /*jshint newcap:false*/ import Ember from "ember-metal/core"; // Ember.deprecate // var emberDeprecate = Ember.deprecate; @@ -134,4 +136,4 @@ var _MetamorphView = View.extend(_Metamorph); */ var _SimpleMetamorphView = CoreView.extend(_Metamorph); -export {_SimpleMetamorphView, _MetamorphView, _Metamorph} +export {_SimpleMetamorphView, _MetamorphView, _Metamorph};
true
Other
emberjs
ember.js
e01b92b160b80cd036058c4e70b051bd4d5a197c.json
Fix JSHint issues.
packages_es6/ember-handlebars/tests/handlebars_test.js
@@ -1,4 +1,5 @@ -/*globals TemplateTests:true MyApp:true App:true */ +/*globals TemplateTests:true,MyApp:true,App:true,Ember:true */ + /*jshint newcap:false*/ import Ember from "ember-metal/core"; // Ember.lookup import jQuery from "ember-views/system/jquery";
true
Other
emberjs
ember.js
e01b92b160b80cd036058c4e70b051bd4d5a197c.json
Fix JSHint issues.
packages_es6/ember-handlebars/tests/views/collection_view_test.js
@@ -1,4 +1,4 @@ -/*globals TemplateTests:true App:true */ +/*globals TemplateTests:true,App:true */ /*jshint newcap:false*/ import {View as EmberView} from "ember-views/views/view";
true
Other
emberjs
ember.js
e01b92b160b80cd036058c4e70b051bd4d5a197c.json
Fix JSHint issues.
packages_es6/ember-metal/lib/binding.js
@@ -41,7 +41,7 @@ var IS_GLOBAL = /^([A-Z$]|([0-9][A-Z$]))/; */ function isGlobalPath(path) { return IS_GLOBAL.test(path); -}; +} function getWithGlobals(obj, path) { return get(isGlobalPath(path) ? Ember.lookup : obj, path); @@ -455,7 +455,7 @@ mixinProperties(Binding, { */ function bind(obj, to, from) { return new Binding(to, from).connect(obj); -}; +} /** @method oneWay @@ -469,6 +469,6 @@ function bind(obj, to, from) { */ function oneWay(obj, to, from) { return new Binding(to, from).oneWay().connect(obj); -}; +} -export {Binding, bind, oneWay, isGlobalPath} +export {Binding, bind, oneWay, isGlobalPath};
true
Other
emberjs
ember.js
e01b92b160b80cd036058c4e70b051bd4d5a197c.json
Fix JSHint issues.
packages_es6/ember-metal/lib/chains.js
@@ -26,7 +26,7 @@ function flushPendingChains() { forEach.call(queue, function(q) { q[0].add(q[1]); }); warn('Watching an undefined global, Ember expects watched globals to be setup by the time the run loop is flushed, check for typos', pendingQueue.length === 0); -}; +} function addChainWatcher(obj, keyName, node) { @@ -58,7 +58,7 @@ function removeChainWatcher(obj, keyName, node) { } } unwatchKey(obj, keyName, m); -}; +} // A ChainNode watches a single key on an object. If you provide a starting // value for the key then the node won't actually watch it. For a root node @@ -90,7 +90,7 @@ function ChainNode(parent, key, value) { if (this._parent && this._parent._key === '@each') { this.value(); } -}; +} var ChainNodePrototype = ChainNode.prototype; @@ -325,6 +325,6 @@ function finishChains(obj) { chains.didChange(null); } } -}; +} export {flushPendingChains, removeChainWatcher, ChainNode, finishChains};
true
Other
emberjs
ember.js
e01b92b160b80cd036058c4e70b051bd4d5a197c.json
Fix JSHint issues.
packages_es6/ember-metal/lib/computed.js
@@ -552,7 +552,7 @@ function computed(func) { } return cp; -}; +} /** Returns the cached value for a property, if one exists. @@ -574,7 +574,7 @@ function cacheFor(obj, key) { if (ret === UNDEFINED) { return undefined; } return ret; -}; +} cacheFor.set = function(cache, key, value) { if (value === undefined) { @@ -609,7 +609,7 @@ function registerComputed(name, macro) { return macro.apply(this, args); }); }; -}; +} function registerComputedWithProperties(name, macro) { computed[name] = function() { @@ -621,7 +621,7 @@ function registerComputedWithProperties(name, macro) { return computedFunc.property.apply(computedFunc, properties); }; -}; +} if (Ember.FEATURES.isEnabled('ember-metal-computed-empty-array')) { /**
true
Other
emberjs
ember.js
e01b92b160b80cd036058c4e70b051bd4d5a197c.json
Fix JSHint issues.
packages_es6/ember-metal/lib/core.js
@@ -1,4 +1,4 @@ -/*globals Em:true ENV EmberENV MetamorphENV:true */ +/*globals Ember:true,Em:true,ENV,EmberENV,MetamorphENV:true */ /** @module ember
true
Other
emberjs
ember.js
e01b92b160b80cd036058c4e70b051bd4d5a197c.json
Fix JSHint issues.
packages_es6/ember-metal/lib/events.js
@@ -400,6 +400,6 @@ function on(){ events = a_slice.call(arguments, 0, -1); func.__ember_listens__ = events; return func; -}; +} export {on, addListener, removeListener, suspendListener, suspendListeners, sendEvent, hasListeners, watchedEvents, listenersFor, listenersDiff, listenersUnion};
true