_id
stringlengths
2
6
title
stringlengths
0
58
partition
stringclasses
3 values
text
stringlengths
52
373k
language
stringclasses
1 value
meta_information
dict
q63000
test
function(fullName, factory, options) { validateFullName(fullName); if (factory === undefined) { throw new TypeError('Attempting to register an unknown factory: `' + fullName + '`'); } var normalizedName = this.normalize(fullName); if (this.cache.has(normalizedName)) ...
javascript
{ "resource": "" }
q63001
test
function(fullName) { validateFullName(fullName); var normalizedName = this.normalize(fullName); this.registry.remove(normalizedName); this.cache.remove(normalizedName); this.factoryCache.remove(normalizedName); this.resolveCache.remove(normalizedName); this._opt...
javascript
{ "resource": "" }
q63002
test
function(fullName) { validateFullName(fullName); var normalizedName = this.normalize(fullName); var cached = this.resolveCache.get(normalizedName); if (cached) { return cached; } var resolved = this.resolver(normalizedName) || this.registry.get(normalizedName); this.r...
javascript
{ "resource": "" }
q63003
test
function(type, property, fullName) { validateFullName(fullName); if (this.parent) { illegalChildOperation('typeInjection'); } addTypeInjection(this.typeInjections, type, property, fullName); }
javascript
{ "resource": "" }
q63004
test
function(fullName, property, injectionName) { if (this.parent) { illegalChildOperation('injection'); } validateFullName(injectionName); var normalizedInjectionName = this.normalize(injectionName); if (fullName.indexOf(':') === -1) { return this.typeInjection(fullName, propert...
javascript
{ "resource": "" }
q63005
test
function(type, property, fullName) { if (this.parent) { illegalChildOperation('factoryTypeInjection'); } addTypeInjection(this.factoryTypeInjections, type, property, this.normalize(fullName)); }
javascript
{ "resource": "" }
q63006
test
function(key) { var dict = this.dict; if (dict.hasOwnProperty(key)) { return dict[key]; } if (this.parent) { return this.parent.get(key); } }
javascript
{ "resource": "" }
q63007
test
function(key) { var dict = this.dict; if (dict.hasOwnProperty(key)) { return true; } if (this.parent) { return this.parent.has(key); } return false; }
javascript
{ "resource": "" }
q63008
test
function(callback, binding) { var dict = this.dict; for (var prop in dict) { if (dict.hasOwnProperty(prop)) { callback.call(binding, prop, dict[prop]); } } }
javascript
{ "resource": "" }
q63009
test
function(str) { var cache = STRING_DASHERIZE_CACHE, hit = cache.hasOwnProperty(str), ret; if (hit) { return cache[str]; } else { ret = Ember.String.decamelize(str).replace(STRING_DASHERIZE_REGEXP,'-'); cache[str] = ret; } return ret; }
javascript
{ "resource": "" }
q63010
test
function(keyName, increment) { if (Ember.isNone(increment)) { increment = 1; } Ember.assert("Must pass a numeric value to incrementProperty", (!isNaN(parseFloat(increment)) && isFinite(increment))); set(this, keyName, (get(this, keyName) || 0) + increment); return get(this, keyName); }
javascript
{ "resource": "" }
q63011
test
function(keyName, decrement) { if (Ember.isNone(decrement)) { decrement = 1; } Ember.assert("Must pass a numeric value to decrementProperty", (!isNaN(parseFloat(decrement)) && isFinite(decrement))); set(this, keyName, (get(this, keyName) || 0) - decrement); return get(this, keyName); }
javascript
{ "resource": "" }
q63012
test
function() { var Class = makeCtor(), proto; Class.ClassMixin = Mixin.create(this.ClassMixin); Class.PrototypeMixin = Mixin.create(this.PrototypeMixin); Class.ClassMixin.ownerConstructor = Class; Class.PrototypeMixin.ownerConstructor = Class; reopen.apply(Class.PrototypeMixin, arguments); ...
javascript
{ "resource": "" }
q63013
test
function(key) { var meta = this.proto()[META_KEY], desc = meta && meta.descs[key]; Ember.assert("metaForProperty() could not find a computed property with key '"+key+"'.", !!desc && desc instanceof Ember.ComputedProperty); return desc._meta || {}; }
javascript
{ "resource": "" }
q63014
test
function(key, value) { var exactValue = function(item) { return get(item, key) === value; }, hasValue = function(item) { return !!get(item, key); }, use = (arguments.length === 2 ? exactValue : hasValue); return this.reject(use); }
javascript
{ "resource": "" }
q63015
test
function(value) { if (!this.contains(value)) return this; // nothing to do var ret = Ember.A(); this.forEach(function(k) { if (k !== value) ret[ret.length] = k; }) ; return ret ; }
javascript
{ "resource": "" }
q63016
test
function() { var ret = Ember.A(); this.forEach(function(k) { if (a_indexOf(ret, k)<0) ret.push(k); }); return ret; }
javascript
{ "resource": "" }
q63017
test
function(startIdx, removeAmt, addAmt) { // if no args are passed assume everything changes if (startIdx===undefined) { startIdx = 0; removeAmt = addAmt = -1; } else { if (removeAmt === undefined) removeAmt=-1; if (addAmt === undefined) addAmt=-1; } // Make sure the @each...
javascript
{ "resource": "" }
q63018
test
function(startIdx, removeAmt, addAmt) { // if no args are passed assume everything changes if (startIdx===undefined) { startIdx = 0; removeAmt = addAmt = -1; } else { if (removeAmt === undefined) removeAmt=-1; if (addAmt === undefined) addAmt=-1; } var adding, lim; i...
javascript
{ "resource": "" }
q63019
ReduceComputedProperty
test
function ReduceComputedProperty(options) { var cp = this; this.options = options; this._dependentKeys = null; // A map of dependentKey -> [itemProperty, ...] that tracks what properties of // items in the array we must track to update this property. this._itemPropertyKeys = {}; this._previousItemPropert...
javascript
{ "resource": "" }
q63020
test
function(objects) { Ember.beginPropertyChanges(this); forEach(objects, function(obj) { this.addObject(obj); }, this); Ember.endPropertyChanges(this); return this; }
javascript
{ "resource": "" }
q63021
test
function(objects) { Ember.beginPropertyChanges(this); forEach(objects, function(obj) { this.removeObject(obj); }, this); Ember.endPropertyChanges(this); return this; }
javascript
{ "resource": "" }
q63022
test
function(name) { var args = [], i, l; for (i = 1, l = arguments.length; i < l; i++) { args.push(arguments[i]); } Ember.sendEvent(this, name, args); }
javascript
{ "resource": "" }
q63023
test
function(resolve, reject, label) { var deferred, promise, entity; entity = this; deferred = get(this, '_deferred'); promise = deferred.promise; function fulfillmentHandler(fulfillment) { if (fulfillment === promise) { return resolve(entity); } else { return resolve(fulf...
javascript
{ "resource": "" }
q63024
test
function(value) { var deferred, promise; deferred = get(this, '_deferred'); promise = deferred.promise; if (value === this) { deferred.resolve(promise); } else { deferred.resolve(value); } }
javascript
{ "resource": "" }
q63025
test
function(props) { var hashName; if (!props._actions) { Ember.assert("'actions' should not be a function", typeof(props.actions) !== 'function'); if (typeOf(props.actions) === 'object') { hashName = 'actions'; } else if (typeOf(props.events) === 'object') { Ember.deprecate('Ac...
javascript
{ "resource": "" }
q63026
test
function(actionName) { var args = [].slice.call(arguments, 1), target; if (this._actions && this._actions[actionName]) { if (this._actions[actionName].apply(this, args) === true) { // handler returned true, so this action will bubble } else { return; } } else if (!Ember.FE...
javascript
{ "resource": "" }
q63027
test
function (index, newItems) { var count = get(newItems, 'length'); if (count < 1) { return; } var match = this._findArrayOperation(index), arrayOperation = match.operation, arrayOperationIndex = match.index, arrayOperationRangeStart = match.rangeStart, composeIndex, s...
javascript
{ "resource": "" }
q63028
test
function (index, count) { if (count < 1) { return; } var match = this._findArrayOperation(index), arrayOperation = match.operation, arrayOperationIndex = match.index, arrayOperationRangeStart = match.rangeStart, newArrayOperation, composeIndex; newArrayOperation = n...
javascript
{ "resource": "" }
q63029
test
function (index) { var newArrayOperation = this._operations[index], leftArrayOperation = this._operations[index-1], // may be undefined rightArrayOperation = this._operations[index+1], // may be undefined leftOp = leftArrayOperation && leftArrayOperation.type, rightOp = rightArrayOpe...
javascript
{ "resource": "" }
q63030
ArrayOperation
test
function ArrayOperation (operation, count, items) { this.type = operation; // RETAIN | INSERT | DELETE this.count = count; this.items = items; }
javascript
{ "resource": "" }
q63031
ArrayOperationMatch
test
function ArrayOperationMatch(operation, index, split, rangeStart) { this.operation = operation; this.index = index; this.split = split; this.rangeStart = rangeStart; }
javascript
{ "resource": "" }
q63032
test
function(index, match) { var returnValue = -1, itemType = match ? RETAIN : FILTER, self = this; this._findOperation(index, function(operation, operationIndex, rangeStart, rangeEnd, seenInSubArray) { var newOperation, splitOperation; if (itemType === operation.type) { ++oper...
javascript
{ "resource": "" }
q63033
test
function(index) { var returnValue = -1, self = this; this._findOperation(index, function (operation, operationIndex, rangeStart, rangeEnd, seenInSubArray) { if (operation.type === RETAIN) { returnValue = seenInSubArray + (index - rangeStart); } if (operation.count > 1) { ...
javascript
{ "resource": "" }
q63034
test
function(keyName, value) { var ret; ret = new EachArray(this._content, keyName, this); Ember.defineProperty(this, keyName, null, ret); this.beginObservingContentKey(keyName); return ret; }
javascript
{ "resource": "" }
q63035
test
function(idx, amt, objects) { if (this.isFrozen) throw Ember.FROZEN_ERROR; // if we replaced exactly the same number of items, then pass only the // replaced range. Otherwise, pass the full remaining array length // since everything has shifted var len = objects ? get(objects, 'length') : 0; t...
javascript
{ "resource": "" }
q63036
test
function() { if (this.isFrozen) { throw new Ember.Error(Ember.FROZEN_ERROR); } var len = get(this, 'length'); if (len === 0) { return this; } var guid; this.enumerableContentWillChange(len, 0); Ember.propertyWillChange(this, 'firstObject'); Ember.propertyWillChange(this, 'lastObject'); ...
javascript
{ "resource": "" }
q63037
test
function() { if (get(this, 'isFrozen')) throw new Ember.Error(Ember.FROZEN_ERROR); var obj = this.length > 0 ? this[this.length-1] : null; this.remove(obj); return obj; }
javascript
{ "resource": "" }
q63038
test
function(element, id) { if (element.getAttribute('id') === id) { return element; } var len = element.childNodes.length, idx, node, found; for (idx=0; idx<len; idx++) { node = element.childNodes[idx]; found = node.nodeType === 1 && findChildById(node, id); if (found) { return found; } } }
javascript
{ "resource": "" }
q63039
test
function(className) { // lazily create elementClasses this.elementClasses = (this.elementClasses || new ClassSet()); this.elementClasses.add(className); this.classes = this.elementClasses.list; return this; }
javascript
{ "resource": "" }
q63040
test
function(name, value) { var attributes = this.elementAttributes = (this.elementAttributes || {}); if (arguments.length === 1) { return attributes[name]; } else { attributes[name] = value; } return this; }
javascript
{ "resource": "" }
q63041
test
function(name, value) { var properties = this.elementProperties = (this.elementProperties || {}); if (arguments.length === 1) { return properties[name]; } else { properties[name] = value; } return this; }
javascript
{ "resource": "" }
q63042
test
function() { if (this._hasElement && this._element) { // Firefox versions < 11 do not have support for element.outerHTML. var thisElement = this.element(), outerHTML = thisElement.outerHTML; if (typeof outerHTML === 'undefined') { return Ember.$('<div/>').append(thisElement).html(); ...
javascript
{ "resource": "" }
q63043
test
function(addedEvents, rootElement) { var event, events = get(this, 'events'); Ember.$.extend(events, addedEvents || {}); if (!Ember.isNone(rootElement)) { set(this, 'rootElement', rootElement); } rootElement = Ember.$(get(this, 'rootElement')); Ember.assert(fmt('You cannot use the sam...
javascript
{ "resource": "" }
q63044
test
function(rootElement, event, eventName) { var self = this; rootElement.on(event + '.ember', '.ember-view', function(evt, triggeringManager) { var view = Ember.View.views[this.id], result = true, manager = null; manager = self._findNearestEventManager(view, eventName); if (manager ...
javascript
{ "resource": "" }
q63045
test
function(klass) { Ember.deprecate("nearestInstanceOf is deprecated and will be removed from future releases. Use nearestOfType."); var view = get(this, 'parentView'); while (view) { if (view instanceof klass) { return view; } view = get(view, 'parentView'); } }
javascript
{ "resource": "" }
q63046
test
function(property) { var view = get(this, 'parentView'); while (view) { if (property in view) { return view; } view = get(view, 'parentView'); } }
javascript
{ "resource": "" }
q63047
test
function(klass) { var view = get(this, 'parentView'); while (view) { if (get(view, 'parentView') instanceof klass) { return view; } view = get(view, 'parentView'); } }
javascript
{ "resource": "" }
q63048
test
function(buffer) { // If this view has a layout, it is the responsibility of the // the layout to render the view's template. Otherwise, render the template // directly. var template = get(this, 'layout') || get(this, 'template'); if (template) { var context = get(this, 'context'); var ...
javascript
{ "resource": "" }
q63049
test
function() { // Get the current value of the property newClass = this._classStringForProperty(binding); elem = this.$(); // If we had previously added a class to the element, remove it. if (oldClass) { elem.removeClass(oldClass); // Also remove from className...
javascript
{ "resource": "" }
q63050
test
function(buffer, attributeBindings) { var attributeValue, unspecifiedAttributeBindings = this._unspecifiedAttributeBindings = this._unspecifiedAttributeBindings || {}; a_forEach(attributeBindings, function(binding) { var split = binding.split(':'), property = split[0], attribu...
javascript
{ "resource": "" }
q63051
test
function(key, value) { var attributeName = this._unspecifiedAttributeBindings && this._unspecifiedAttributeBindings[key]; if (attributeName) { this._setupAttributeBindingObservation(key, attributeName); } defineProperty(this, key); return set(this, key, value); }
javascript
{ "resource": "" }
q63052
test
function(path) { var split = path.split(':'), propertyPath = split[0], classNames = "", className, falsyClassName; // check if the property is defined as prop:class or prop:trueClass:falseClass if (split.length > 1) { className = split[1]; if (split.length === 3)...
javascript
{ "resource": "" }
q63053
test
function(view, childView, options) { var buffer = view.buffer, _childViews = view._childViews; childView = view.createChildView(childView, options); if (!_childViews.length) { _childViews = view._childViews = _childViews.slice(); } _childViews.push(childView); childView.renderToBuffer(buffer); ...
javascript
{ "resource": "" }
q63054
test
function(view) { view.clearBuffer(); var viewCollection = view._notifyWillDestroyElement(); viewCollection.transitionTo('preRender', false); return view; }
javascript
{ "resource": "" }
q63055
test
function(view) { view.triggerRecursively('willClearRender'); view.clearRenderedChildren(); view.domManager.replace(view); return view; }
javascript
{ "resource": "" }
q63056
test
function(view) { view._notifyWillDestroyElement(); view.domManager.remove(view); set(view, 'element', null); if (view._scheduledInsert) { Ember.run.cancel(view._scheduledInsert); view._scheduledInsert = null; } return view; }
javascript
{ "resource": "" }
q63057
test
function(view, eventName, evt) { if (view.has(eventName)) { // Handler should be able to re-dispatch events, so we don't // preventDefault or stopPropagation. return view.trigger(eventName, evt); } else { return true; // continue event propagation } }
javascript
{ "resource": "" }
q63058
test
function(views, start, removed) { this.propertyWillChange('childViews'); if (removed > 0) { var changedViews = views.slice(start, start+removed); // transition to preRender before clearing parentView this.currentState.childViewsWillChange(this, views, start, removed); this.initializeVie...
javascript
{ "resource": "" }
q63059
test
function(views, start, removed, added) { if (added > 0) { var changedViews = views.slice(start, start+added); this.initializeViews(changedViews, this, get(this, 'templateData')); this.currentState.childViewsDidChange(this, views, start, added); } this.propertyDidChange('childViews'); }
javascript
{ "resource": "" }
q63060
test
function(content, start, removedCount) { // If the contents were empty before and this template collection has an // empty view remove it now. var emptyView = get(this, 'emptyView'); if (emptyView && emptyView instanceof Ember.View) { emptyView.removeFromParent(); } // Loop through child ...
javascript
{ "resource": "" }
q63061
test
function(content, start, removed, added) { var addedViews = [], view, item, idx, len, itemViewClass, emptyView; len = content ? get(content, 'length') : 0; if (len) { itemViewClass = get(this, 'itemViewClass'); if ('string' === typeof itemViewClass) { itemViewClass = get(itemVie...
javascript
{ "resource": "" }
q63062
test
function(action) { var actionName, contexts = a_slice.call(arguments, 1); // Send the default action if (action === undefined) { actionName = get(this, 'action'); Ember.assert("The default action was triggered on the component " + this.toString() + ", but the action n...
javascript
{ "resource": "" }
q63063
evaluateUnboundHelper
test
function evaluateUnboundHelper(context, fn, normalizedProperties, options) { var args = [], hash = options.hash, boundOptions = hash.boundOptions, types = slice.call(options.types, 1), loc, len, property, propertyType, boundOption; for (boundOption in boundOptions) { if (!boundOptions.h...
javascript
{ "resource": "" }
q63064
test
function(view) { var morph = view.morph; view.transitionTo('preRender'); Ember.run.schedule('render', this, function renderMetamorphView() { if (view.isDestroying) { return; } view.clearRenderedChildren(); var buffer = view.renderToBuffer(); view.invokeRecursively(function(view) ...
javascript
{ "resource": "" }
q63065
bind
test
function bind(property, options, preserveContext, shouldDisplay, valueNormalizer, childProperties) { var data = options.data, fn = options.fn, inverse = options.inverse, view = data.view, currentContext = this, normalized, observer, i; normalized = normalizePath(currentContext, proper...
javascript
{ "resource": "" }
q63066
_addMetamorphCheck
test
function _addMetamorphCheck() { Ember.Handlebars.EachView.reopen({ _checkMetamorph: Ember.on('didInsertElement', function() { Ember.assert("The metamorph tags, " + this.morph.start + " and " + this.morph.end + ", have different parents.\nThe browser has fixed your templ...
javascript
{ "resource": "" }
q63067
test
function() { if (this.state) { forEach(this.state.handlerInfos, function(handlerInfo) { var handler = handlerInfo.handler; if (handler.exit) { handler.exit(); } }); } this.state = new TransitionState(); this.currentHa...
javascript
{ "resource": "" }
q63068
test
function() { this.router = this.router || this.constructor.map(Ember.K); var router = this.router, location = get(this, 'location'), container = this.container, self = this, initialURL = get(this, 'initialURL'); // Allow the Location class to cancel the router setup ...
javascript
{ "resource": "" }
q63069
test
function(context, transition) { var controllerName = this.controllerName || this.routeName, controller = this.controllerFor(controllerName, true); if (!controller) { controller = this.generateController(controllerName, context); } // Assign the route's controller so that it can more easi...
javascript
{ "resource": "" }
q63070
test
function(params, transition) { var match, name, sawParams, value; for (var prop in params) { if (prop === 'queryParams') { continue; } if (match = prop.match(/^(.*)_id$/)) { name = match[1]; value = params[prop]; } sawParams = true; } if (!name && sawParams) { ...
javascript
{ "resource": "" }
q63071
test
function(model, params) { if (params.length < 1) { return; } if (!model) { return; } var name = params[0], object = {}; if (/_id$/.test(name) && params.length === 1) { object[name] = get(model, "id"); } else { object = getProperties(model, params); } return object; }
javascript
{ "resource": "" }
q63072
test
function(name, _skipAssert) { var container = this.container, route = container.lookup('route:'+name), controller; if (route && route.controllerName) { name = route.controllerName; } controller = container.lookup('controller:' + name); // NOTE: We're specifically checking th...
javascript
{ "resource": "" }
q63073
test
function(options) { if (!options || typeof options === "string") { var outletName = options; options = {}; options.outlet = outletName; } options.parentView = options.parentView ? options.parentView.replace(/\//g, '.') : parentTemplate(this); options.outlet = options.outlet || 'main'; ...
javascript
{ "resource": "" }
q63074
test
function(){ var helperParameters = this.parameters, linkTextPath = helperParameters.options.linkTextPath, paths = getResolvedPaths(helperParameters), length = paths.length, path, i, normalizedPath; if (linkTextPath) { normalizedPath = Ember.Handlebars.nor...
javascript
{ "resource": "" }
q63075
test
function(event) { if (!isSimpleClick(event)) { return true; } if (this.preventDefault !== false) { event.preventDefault(); } if (this.bubbles === false) { event.stopPropagation(); } if (get(this, '_isDisabled')) { return false; } if (get(this, 'loading')) { Ember.Logger.warn("Th...
javascript
{ "resource": "" }
q63076
test
function() { // target may be either another controller or a router var target = get(this, 'target'), method = target.replaceRoute || target.replaceWith; return method.apply(target, arguments); }
javascript
{ "resource": "" }
q63077
test
function(outletName, view) { var existingView = get(this, '_outlets.'+outletName); return existingView && existingView.constructor === view.constructor && existingView.get('template') === view.get('template') && existingView.get('context') === view.get('context'); }
javascript
{ "resource": "" }
q63078
test
function() { if (this.isDestroyed) return; // _outlets will be gone anyway var outlets = get(this, '_outlets'); var pendingDisconnections = this._pendingDisconnections; this._pendingDisconnections = null; for (var outletName in pendingDisconnections) { set(outlets, outletName, null); } ...
javascript
{ "resource": "" }
q63079
test
function () { // AutoLocation has it at _location, HashLocation at .location. // Being nice and not changing var href = (this._location || this.location).href, hashIndex = href.indexOf('#'); if (hashIndex === -1) { return ''; } else { return href.substr(hashIndex); } }
javascript
{ "resource": "" }
q63080
test
function(path) { var state = { path: path }; get(this, 'history').replaceState(state, null, path); // store state if browser doesn't support `history.state` if (!supportsHistoryState) { this._historyState = state; } // used for webkit workaround this._previousURL = this.getURL(); ...
javascript
{ "resource": "" }
q63081
test
function(callback) { var guid = Ember.guidFor(this), self = this; Ember.$(window).on('popstate.ember-location-'+guid, function(e) { // Ignore initial page load popstate event in Chrome if (!popstateFired) { popstateFired = true; if (self.getURL() === self._previousURL) { ret...
javascript
{ "resource": "" }
q63082
test
function (options) { if (options && options.rootURL) { Ember.assert('rootURL must end with a trailing forward slash e.g. "/app/"', options.rootURL.charAt(options.rootURL.length-1) === '/'); this.rootURL = options.rootURL; } var historyPath, hashPath, cancelRouterSetup = fals...
javascript
{ "resource": "" }
q63083
test
function(fullName) { var parsedName = this.parseName(fullName), resolveMethodName = parsedName.resolveMethodName; if (!(parsedName.name && parsedName.type)) { throw new TypeError("Invalid fullName: `" + fullName + "`, must be of the form `type:name` "); } if (this[resolveMethodName]) { ...
javascript
{ "resource": "" }
q63084
test
function(parsedName) { var templateName = parsedName.fullNameWithoutType.replace(/\./g, '/'); if (Ember.TEMPLATES[templateName]) { return Ember.TEMPLATES[templateName]; } templateName = decamelize(templateName); if (Ember.TEMPLATES[templateName]) { return Ember.TEMPLATES[templateName];...
javascript
{ "resource": "" }
q63085
test
function() { if (this.Router === false) { return; } var container = this.__container__; if (this.Router) { container.unregister('router:main'); container.register('router:main', this.Router); } return container.lookupFactory('router:main'); }
javascript
{ "resource": "" }
q63086
test
function() { var self = this; if (!this.$ || this.$.isReady) { Ember.run.schedule('actions', self, '_initialize'); } else { this.$().ready(function runInitialize() { Ember.run(self, '_initialize'); }); } }
javascript
{ "resource": "" }
q63087
test
function() { Ember.assert("You must call advanceReadiness on an instance of Ember.Application", this instanceof Ember.Application); this._readinessDeferrals--; if (this._readinessDeferrals === 0) { Ember.run.once(this, this.didBecomeReady); } }
javascript
{ "resource": "" }
q63088
test
function() { var customEvents = get(this, 'customEvents'), rootElement = get(this, 'rootElement'), dispatcher = this.__container__.lookup('event_dispatcher:main'); set(this, 'eventDispatcher', dispatcher); dispatcher.setup(customEvents, rootElement); }
javascript
{ "resource": "" }
q63089
test
function(namespace) { var container = new Ember.Container(); Ember.Container.defaultContainer = new DeprecatedContainer(container); container.set = Ember.set; container.resolver = resolverFor(namespace); container.normalize = container.resolver.normalize; container.describe = container.resol...
javascript
{ "resource": "" }
q63090
test
function(type, recordsAdded, recordsUpdated, recordsRemoved) { var self = this, releaseMethods = Ember.A(), records = this.getRecords(type), release; var recordUpdated = function(updatedRecord) { recordsUpdated([updatedRecord]); }; var recordsToSend = records.map(function(record) { release...
javascript
{ "resource": "" }
q63091
test
function(type, typesUpdated) { var self = this, records = this.getRecords(type); var onChange = function() { typesUpdated([self.wrapModelType(type)]); }; var observer = { didChange: function() { Ember.run.scheduleOnce('actions', this, onChange); }, willChange: Ember.K ...
javascript
{ "resource": "" }
q63092
test
function() { var namespaces = Ember.A(Ember.Namespace.NAMESPACES), types = Ember.A(); namespaces.forEach(function(namespace) { for (var key in namespace) { if (!namespace.hasOwnProperty(key)) { continue; } var name = Ember.String.dasherize(key); if (!(namespace instanceof Ember.Ap...
javascript
{ "resource": "" }
q63093
test
function(context, callback) { if (arguments.length === 1) { callback = context; context = null; } if (!this.waiters) { this.waiters = Ember.A(); } this.waiters.push([context, callback]); }
javascript
{ "resource": "" }
q63094
test
function(context, callback) { var pair; if (!this.waiters) { return; } if (arguments.length === 1) { callback = context; context = null; } pair = [context, callback]; this.waiters = Ember.A(this.waiters.filter(function(elt) { return Ember.compare(elt, pair)!==0; })); }
javascript
{ "resource": "" }
q63095
test
function() { for (var name in helpers) { this.helperContainer[name] = this.originalMethods[name]; delete this.testHelpers[name]; delete this.originalMethods[name]; } }
javascript
{ "resource": "" }
q63096
protoWrap
test
function protoWrap(proto, name, callback, isAsync) { proto[name] = function() { var args = arguments; if (isAsync) { return callback.apply(this, args); } else { return this.then(function() { return callback.apply(this, args); }); } }; }
javascript
{ "resource": "" }
q63097
toPropertyDescriptor
test
function toPropertyDescriptor(obj) { if (Object(obj) !== obj) { throw new TypeError("property descriptor should be an Object, given: "+ obj); } var desc = {}; if ('enumerable' in obj) { desc.enumerable = !!obj.enumerable; } if ('configurable' in obj) { desc.configurable = !!obj.con...
javascript
{ "resource": "" }
q63098
normalizePropertyDescriptor
test
function normalizePropertyDescriptor(attributes) { var desc = toPropertyDescriptor(attributes); // Note: no need to call FromGenericPropertyDescriptor(desc), as we represent // "internal" property descriptors as proper Objects from the start for (var name in attributes) { if (!isStandardAttribute(name)) { ...
javascript
{ "resource": "" }
q63099
isCompatibleDescriptor
test
function isCompatibleDescriptor(extensible, current, desc) { if (current === undefined && extensible === false) { return false; } if (current === undefined && extensible === true) { return true; } if (isEmptyDescriptor(desc)) { return true; } if (isEquivalentDescriptor(current, desc)) { re...
javascript
{ "resource": "" }