id
int32
0
58k
repo
stringlengths
5
67
path
stringlengths
4
116
func_name
stringlengths
0
58
original_string
stringlengths
52
373k
language
stringclasses
1 value
code
stringlengths
52
373k
code_tokens
list
docstring
stringlengths
4
11.8k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
86
226
24,000
ember-cli/loader.js
benchmarks/scenarios/ember.js
function (eventName, arg1, arg2) { var callbacks = this._eventCallbacks[eventName]; if (callbacks) { for (var i = 0; i < callbacks.length; i++) { callbacks[i](arg1, arg2); } } }
javascript
function (eventName, arg1, arg2) { var callbacks = this._eventCallbacks[eventName]; if (callbacks) { for (var i = 0; i < callbacks.length; i++) { callbacks[i](arg1, arg2); } } }
[ "function", "(", "eventName", ",", "arg1", ",", "arg2", ")", "{", "var", "callbacks", "=", "this", ".", "_eventCallbacks", "[", "eventName", "]", ";", "if", "(", "callbacks", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "callbacks", "...
Trigger an event. Supports up to two arguments. Designed around triggering transition events from one run loop instance to the next, which requires an argument for the first instance and then an argument for the next instance. @private @method _trigger @param {String} eventName @param {any} arg1 @param {any} arg2
[ "Trigger", "an", "event", ".", "Supports", "up", "to", "two", "arguments", ".", "Designed", "around", "triggering", "transition", "events", "from", "one", "run", "loop", "instance", "to", "the", "next", "which", "requires", "an", "argument", "for", "the", "f...
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L489-L496
24,001
ember-cli/loader.js
benchmarks/scenarios/ember.js
Container
function Container(registry, options) { this.registry = registry; this.owner = options && options.owner ? options.owner : null; this.cache = _emberMetalDictionary.default(options && options.cache ? options.cache : null); this.factoryCache = _emberMetalDictionary.default(options && options.factoryCache ?...
javascript
function Container(registry, options) { this.registry = registry; this.owner = options && options.owner ? options.owner : null; this.cache = _emberMetalDictionary.default(options && options.cache ? options.cache : null); this.factoryCache = _emberMetalDictionary.default(options && options.factoryCache ?...
[ "function", "Container", "(", "registry", ",", "options", ")", "{", "this", ".", "registry", "=", "registry", ";", "this", ".", "owner", "=", "options", "&&", "options", ".", "owner", "?", "options", ".", "owner", ":", "null", ";", "this", ".", "cache"...
A container used to instantiate and cache objects. Every `Container` must be associated with a `Registry`, which is referenced to determine the factory and options that should be used to instantiate objects. The public API for `Container` is still in flux and should not be considered stable. @private @class Containe...
[ "A", "container", "used", "to", "instantiate", "and", "cache", "objects", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L1075-L1083
24,002
ember-cli/loader.js
benchmarks/scenarios/ember.js
function (fullName, options) { _emberMetalDebug.assert('fullName must be a proper full name', this.registry.validateFullName(fullName)); return factoryFor(this, this.registry.normalize(fullName), options); }
javascript
function (fullName, options) { _emberMetalDebug.assert('fullName must be a proper full name', this.registry.validateFullName(fullName)); return factoryFor(this, this.registry.normalize(fullName), options); }
[ "function", "(", "fullName", ",", "options", ")", "{", "_emberMetalDebug", ".", "assert", "(", "'fullName must be a proper full name'", ",", "this", ".", "registry", ".", "validateFullName", "(", "fullName", ")", ")", ";", "return", "factoryFor", "(", "this", ",...
Given a fullName, return the corresponding factory. @private @method lookupFactory @param {String} fullName @param {Object} [options] @param {String} [options.source] The fullname of the request source (used for local lookup) @return {any}
[ "Given", "a", "fullName", "return", "the", "corresponding", "factory", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L1168-L1171
24,003
ember-cli/loader.js
benchmarks/scenarios/ember.js
Registry
function Registry(options) { this.fallback = options && options.fallback ? options.fallback : null; if (options && options.resolver) { this.resolver = options.resolver; if (typeof this.resolver === 'function') { deprecateResolverFunction(this); } } this.registrations = _embe...
javascript
function Registry(options) { this.fallback = options && options.fallback ? options.fallback : null; if (options && options.resolver) { this.resolver = options.resolver; if (typeof this.resolver === 'function') { deprecateResolverFunction(this); } } this.registrations = _embe...
[ "function", "Registry", "(", "options", ")", "{", "this", ".", "fallback", "=", "options", "&&", "options", ".", "fallback", "?", "options", ".", "fallback", ":", "null", ";", "if", "(", "options", "&&", "options", ".", "resolver", ")", "{", "this", "....
A registry used to store factory and option information keyed by type. A `Registry` stores the factory and option information needed by a `Container` to instantiate and cache objects. The API for `Registry` is still in flux and should not be considered stable. @private @class Registry @since 1.11.0
[ "A", "registry", "used", "to", "store", "factory", "and", "option", "information", "keyed", "by", "type", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L1592-L1617
24,004
ember-cli/loader.js
benchmarks/scenarios/ember.js
function (fullName) { if (this.resolver && this.resolver.normalize) { return this.resolver.normalize(fullName); } else if (this.fallback) { return this.fallback.normalizeFullName(fullName); } else { return fullName; } }
javascript
function (fullName) { if (this.resolver && this.resolver.normalize) { return this.resolver.normalize(fullName); } else if (this.fallback) { return this.fallback.normalizeFullName(fullName); } else { return fullName; } }
[ "function", "(", "fullName", ")", "{", "if", "(", "this", ".", "resolver", "&&", "this", ".", "resolver", ".", "normalize", ")", "{", "return", "this", ".", "resolver", ".", "normalize", "(", "fullName", ")", ";", "}", "else", "if", "(", "this", ".",...
A hook to enable custom fullName normalization behaviour @private @method normalizeFullName @param {String} fullName @return {string} normalized fullName
[ "A", "hook", "to", "enable", "custom", "fullName", "normalization", "behaviour" ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L1838-L1846
24,005
ember-cli/loader.js
benchmarks/scenarios/ember.js
function (fullName, options) { _emberMetalDebug.assert('fullName must be a proper full name', this.validateFullName(fullName)); var source = undefined; source = options && options.source && this.normalize(options.source); return has(this, this.normalize(fullName), source); }
javascript
function (fullName, options) { _emberMetalDebug.assert('fullName must be a proper full name', this.validateFullName(fullName)); var source = undefined; source = options && options.source && this.normalize(options.source); return has(this, this.normalize(fullName), source); }
[ "function", "(", "fullName", ",", "options", ")", "{", "_emberMetalDebug", ".", "assert", "(", "'fullName must be a proper full name'", ",", "this", ".", "validateFullName", "(", "fullName", ")", ")", ";", "var", "source", "=", "undefined", ";", "source", "=", ...
Given a fullName check if the container is aware of its factory or singleton instance. @private @method has @param {String} fullName @param {Object} [options] @param {String} [options.source] the fullname of the request source (used for local lookups) @return {Boolean}
[ "Given", "a", "fullName", "check", "if", "the", "container", "is", "aware", "of", "its", "factory", "or", "singleton", "instance", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L1886-L1894
24,006
ember-cli/loader.js
benchmarks/scenarios/ember.js
function () { var _this = this; var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; if (this._bootPromise) { return this._bootPromise; } this._bootPromise = new _emberRuntimeExtRsvp.default.Promise(function (resolve) { return resolve(_t...
javascript
function () { var _this = this; var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; if (this._bootPromise) { return this._bootPromise; } this._bootPromise = new _emberRuntimeExtRsvp.default.Promise(function (resolve) { return resolve(_t...
[ "function", "(", ")", "{", "var", "_this", "=", "this", ";", "var", "options", "=", "arguments", ".", "length", "<=", "0", "||", "arguments", "[", "0", "]", "===", "undefined", "?", "{", "}", ":", "arguments", "[", "0", "]", ";", "if", "(", "this...
Initialize the `Ember.ApplicationInstance` and return a promise that resolves with the instance itself when the boot process is complete. The primary task here is to run any registered instance initializers. See the documentation on `BootOptions` for the options it takes. @private @method boot @param options @return {P...
[ "Initialize", "the", "Ember", ".", "ApplicationInstance", "and", "return", "a", "promise", "that", "resolves", "with", "the", "instance", "itself", "when", "the", "boot", "process", "is", "complete", ".", "The", "primary", "task", "here", "is", "to", "run", ...
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L3758-L3772
24,007
ember-cli/loader.js
benchmarks/scenarios/ember.js
function () { var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; options.base = this; options.application = this; return _emberApplicationSystemApplicationInstance.default.create(options); }
javascript
function () { var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; options.base = this; options.application = this; return _emberApplicationSystemApplicationInstance.default.create(options); }
[ "function", "(", ")", "{", "var", "options", "=", "arguments", ".", "length", "<=", "0", "||", "arguments", "[", "0", "]", "===", "undefined", "?", "{", "}", ":", "arguments", "[", "0", "]", ";", "options", ".", "base", "=", "this", ";", "options",...
Create an ApplicationInstance for this application. @private @method buildInstance @return {Ember.ApplicationInstance} the application instance
[ "Create", "an", "ApplicationInstance", "for", "this", "application", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L4500-L4506
24,008
ember-cli/loader.js
benchmarks/scenarios/ember.js
function () { this._super.apply(this, arguments); _emberMetal.default.BOOTED = false; this._booted = false; this._bootPromise = null; this._bootResolver = null; if (_emberRuntimeSystemLazy_load._loaded.application === this) { _emberRuntimeSystemLazy_load._loaded.application ...
javascript
function () { this._super.apply(this, arguments); _emberMetal.default.BOOTED = false; this._booted = false; this._bootPromise = null; this._bootResolver = null; if (_emberRuntimeSystemLazy_load._loaded.application === this) { _emberRuntimeSystemLazy_load._loaded.application ...
[ "function", "(", ")", "{", "this", ".", "_super", ".", "apply", "(", "this", ",", "arguments", ")", ";", "_emberMetal", ".", "default", ".", "BOOTED", "=", "false", ";", "this", ".", "_booted", "=", "false", ";", "this", ".", "_bootPromise", "=", "nu...
This method must be moved to the application instance object
[ "This", "method", "must", "be", "moved", "to", "the", "application", "instance", "object" ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L4863-L4877
24,009
ember-cli/loader.js
benchmarks/scenarios/ember.js
function () { var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; options.base = this; return _emberApplicationSystemEngineInstance.default.create(options); }
javascript
function () { var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; options.base = this; return _emberApplicationSystemEngineInstance.default.create(options); }
[ "function", "(", ")", "{", "var", "options", "=", "arguments", ".", "length", "<=", "0", "||", "arguments", "[", "0", "]", "===", "undefined", "?", "{", "}", ":", "arguments", "[", "0", "]", ";", "options", ".", "base", "=", "this", ";", "return", ...
Create an EngineInstance for this application. @private @method buildInstance @return {Ember.EngineInstance} the application instance
[ "Create", "an", "EngineInstance", "for", "this", "application", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L5372-L5377
24,010
ember-cli/loader.js
benchmarks/scenarios/ember.js
function () { var _constructor$buildRegistry; var registry = this.__registry__ = this.constructor.buildRegistry(this, (_constructor$buildRegistry = {}, _constructor$buildRegistry[GLIMMER] = this[GLIMMER], _constructor$buildRegistry)); return registry; }
javascript
function () { var _constructor$buildRegistry; var registry = this.__registry__ = this.constructor.buildRegistry(this, (_constructor$buildRegistry = {}, _constructor$buildRegistry[GLIMMER] = this[GLIMMER], _constructor$buildRegistry)); return registry; }
[ "function", "(", ")", "{", "var", "_constructor$buildRegistry", ";", "var", "registry", "=", "this", ".", "__registry__", "=", "this", ".", "constructor", ".", "buildRegistry", "(", "this", ",", "(", "_constructor$buildRegistry", "=", "{", "}", ",", "_construc...
Build and configure the registry for the current application. @private @method buildRegistry @return {Ember.Registry} the configured registry
[ "Build", "and", "configure", "the", "registry", "for", "the", "current", "application", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L5385-L5391
24,011
ember-cli/loader.js
benchmarks/scenarios/ember.js
function (fullName) { var parsedName = this.parseName(fullName); var description; if (parsedName.type === 'template') { return 'template at ' + parsedName.fullNameWithoutType.replace(/\./g, '/'); } description = parsedName.root + '.' + _emberRuntimeSystemString.classify(parsedNam...
javascript
function (fullName) { var parsedName = this.parseName(fullName); var description; if (parsedName.type === 'template') { return 'template at ' + parsedName.fullNameWithoutType.replace(/\./g, '/'); } description = parsedName.root + '.' + _emberRuntimeSystemString.classify(parsedNam...
[ "function", "(", "fullName", ")", "{", "var", "parsedName", "=", "this", ".", "parseName", "(", "fullName", ")", ";", "var", "description", ";", "if", "(", "parsedName", ".", "type", "===", "'template'", ")", "{", "return", "'template at '", "+", "parsedNa...
Returns a human-readable description for a fullName. Used by the Application namespace in assertions to describe the precise name of the class that Ember is looking for, rather than container keys. @protected @param {String} fullName the lookup string @method lookupDescription @public
[ "Returns", "a", "human", "-", "readable", "description", "for", "a", "fullName", ".", "Used", "by", "the", "Application", "namespace", "in", "assertions", "to", "describe", "the", "precise", "name", "of", "the", "class", "that", "Ember", "is", "looking", "fo...
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L5947-L5962
24,012
ember-cli/loader.js
benchmarks/scenarios/ember.js
function (parsedName) { var templateName = parsedName.fullNameWithoutType.replace(/\./g, '/'); return _emberHtmlbarsTemplate_registry.get(templateName) || _emberHtmlbarsTemplate_registry.get(_emberRuntimeSystemString.decamelize(templateName)); }
javascript
function (parsedName) { var templateName = parsedName.fullNameWithoutType.replace(/\./g, '/'); return _emberHtmlbarsTemplate_registry.get(templateName) || _emberHtmlbarsTemplate_registry.get(_emberRuntimeSystemString.decamelize(templateName)); }
[ "function", "(", "parsedName", ")", "{", "var", "templateName", "=", "parsedName", ".", "fullNameWithoutType", ".", "replace", "(", "/", "\\.", "/", "g", ",", "'/'", ")", ";", "return", "_emberHtmlbarsTemplate_registry", ".", "get", "(", "templateName", ")", ...
Look up the template in Ember.TEMPLATES @protected @param {Object} parsedName a parseName object with the parsed fullName lookup string @method resolveTemplate @public
[ "Look", "up", "the", "template", "in", "Ember", ".", "TEMPLATES" ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L5991-L5995
24,013
ember-cli/loader.js
benchmarks/scenarios/ember.js
function (parsedName) { var className = _emberRuntimeSystemString.classify(parsedName.name); var factory = _emberMetalProperty_get.get(parsedName.root, className); if (factory) { return factory; } }
javascript
function (parsedName) { var className = _emberRuntimeSystemString.classify(parsedName.name); var factory = _emberMetalProperty_get.get(parsedName.root, className); if (factory) { return factory; } }
[ "function", "(", "parsedName", ")", "{", "var", "className", "=", "_emberRuntimeSystemString", ".", "classify", "(", "parsedName", ".", "name", ")", ";", "var", "factory", "=", "_emberMetalProperty_get", ".", "get", "(", "parsedName", ".", "root", ",", "classN...
Lookup the model on the Application namespace @protected @param {Object} parsedName a parseName object with the parsed fullName lookup string @method resolveModel @public
[ "Lookup", "the", "model", "on", "the", "Application", "namespace" ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L6043-L6050
24,014
ember-cli/loader.js
benchmarks/scenarios/ember.js
function (type) { var namespace = _emberMetalProperty_get.get(this, 'namespace'); var suffix = _emberRuntimeSystemString.classify(type); var typeRegexp = new RegExp(suffix + '$'); var known = _emberMetalDictionary.default(null); var knownKeys = Object.keys(namespace); for (var index...
javascript
function (type) { var namespace = _emberMetalProperty_get.get(this, 'namespace'); var suffix = _emberRuntimeSystemString.classify(type); var typeRegexp = new RegExp(suffix + '$'); var known = _emberMetalDictionary.default(null); var knownKeys = Object.keys(namespace); for (var index...
[ "function", "(", "type", ")", "{", "var", "namespace", "=", "_emberMetalProperty_get", ".", "get", "(", "this", ",", "'namespace'", ")", ";", "var", "suffix", "=", "_emberRuntimeSystemString", ".", "classify", "(", "type", ")", ";", "var", "typeRegexp", "=",...
Used to iterate all items of a given type. @method knownForType @param {String} type the type to search for @private
[ "Used", "to", "iterate", "all", "items", "of", "a", "given", "type", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L6115-L6133
24,015
ember-cli/loader.js
benchmarks/scenarios/ember.js
function (typesAdded, typesUpdated) { var _this = this; var modelTypes = this.getModelTypes(); var releaseMethods = _emberRuntimeSystemNative_array.A(); var typesToSend; typesToSend = modelTypes.map(function (type) { var klass = type.klass; var wrapped = _this.wrapModelTy...
javascript
function (typesAdded, typesUpdated) { var _this = this; var modelTypes = this.getModelTypes(); var releaseMethods = _emberRuntimeSystemNative_array.A(); var typesToSend; typesToSend = modelTypes.map(function (type) { var klass = type.klass; var wrapped = _this.wrapModelTy...
[ "function", "(", "typesAdded", ",", "typesUpdated", ")", "{", "var", "_this", "=", "this", ";", "var", "modelTypes", "=", "this", ".", "getModelTypes", "(", ")", ";", "var", "releaseMethods", "=", "_emberRuntimeSystemNative_array", ".", "A", "(", ")", ";", ...
Fetch the model types and observe them for changes. @public @method watchModelTypes @param {Function} typesAdded Callback to call to add types. Takes an array of objects containing wrapped types (returned from `wrapModelType`). @param {Function} typesUpdated Callback to call when a type has changed. Takes an array of o...
[ "Fetch", "the", "model", "types", "and", "observe", "them", "for", "changes", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L7147-L7171
24,016
ember-cli/loader.js
benchmarks/scenarios/ember.js
function (modelName, recordsAdded, recordsUpdated, recordsRemoved) { var _this2 = this; var releaseMethods = _emberRuntimeSystemNative_array.A(); var klass = this._nameToClass(modelName); var records = this.getRecords(klass, modelName); var release; var recordUpdated = function (up...
javascript
function (modelName, recordsAdded, recordsUpdated, recordsRemoved) { var _this2 = this; var releaseMethods = _emberRuntimeSystemNative_array.A(); var klass = this._nameToClass(modelName); var records = this.getRecords(klass, modelName); var release; var recordUpdated = function (up...
[ "function", "(", "modelName", ",", "recordsAdded", ",", "recordsUpdated", ",", "recordsRemoved", ")", "{", "var", "_this2", "=", "this", ";", "var", "releaseMethods", "=", "_emberRuntimeSystemNative_array", ".", "A", "(", ")", ";", "var", "klass", "=", "this",...
Fetch the records of a given type and observe them for changes. @public @method watchRecords @param {String} modelName The model name. @param {Function} recordsAdded Callback to call to add records. Takes an array of objects containing wrapped records. The object should have the following properties: columnValues: {Obj...
[ "Fetch", "the", "records", "of", "a", "given", "type", "and", "observe", "them", "for", "changes", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L7198-L7245
24,017
ember-cli/loader.js
benchmarks/scenarios/ember.js
function (modelName, typesUpdated) { var _this3 = this; var klass = this._nameToClass(modelName); var records = this.getRecords(klass, modelName); var onChange = function () { typesUpdated([_this3.wrapModelType(klass, modelName)]); }; var observer = { didChange: fun...
javascript
function (modelName, typesUpdated) { var _this3 = this; var klass = this._nameToClass(modelName); var records = this.getRecords(klass, modelName); var onChange = function () { typesUpdated([_this3.wrapModelType(klass, modelName)]); }; var observer = { didChange: fun...
[ "function", "(", "modelName", ",", "typesUpdated", ")", "{", "var", "_this3", "=", "this", ";", "var", "klass", "=", "this", ".", "_nameToClass", "(", "modelName", ")", ";", "var", "records", "=", "this", ".", "getRecords", "(", "klass", ",", "modelName"...
Adds observers to a model type class. @private @method observeModelType @param {String} modelName The model type name. @param {Function} typesUpdated Called when a type is modified. @return {Function} The function to call to remove observers.
[ "Adds", "observers", "to", "a", "model", "type", "class", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L7294-L7319
24,018
ember-cli/loader.js
benchmarks/scenarios/ember.js
function () { var _this5 = this; var namespaces = _emberRuntimeSystemNative_array.A(_emberRuntimeSystemNamespace.default.NAMESPACES); var types = _emberRuntimeSystemNative_array.A(); namespaces.forEach(function (namespace) { for (var key in namespace) { if (!namespace.hasOwnP...
javascript
function () { var _this5 = this; var namespaces = _emberRuntimeSystemNative_array.A(_emberRuntimeSystemNamespace.default.NAMESPACES); var types = _emberRuntimeSystemNative_array.A(); namespaces.forEach(function (namespace) { for (var key in namespace) { if (!namespace.hasOwnP...
[ "function", "(", ")", "{", "var", "_this5", "=", "this", ";", "var", "namespaces", "=", "_emberRuntimeSystemNative_array", ".", "A", "(", "_emberRuntimeSystemNamespace", ".", "default", ".", "NAMESPACES", ")", ";", "var", "types", "=", "_emberRuntimeSystemNative_a...
Loops over all namespaces and all objects attached to them. @private @method _getObjectsOnNamespaces @return {Array} Array of model type strings.
[ "Loops", "over", "all", "namespaces", "and", "all", "objects", "attached", "to", "them", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L7390-L7415
24,019
ember-cli/loader.js
benchmarks/scenarios/ember.js
function (record) { var recordToSend = { object: record }; recordToSend.columnValues = this.getRecordColumnValues(record); recordToSend.searchKeywords = this.getRecordKeywords(record); recordToSend.filterValues = this.getRecordFilterValues(record); recordToSend.color = this.getRecordColor...
javascript
function (record) { var recordToSend = { object: record }; recordToSend.columnValues = this.getRecordColumnValues(record); recordToSend.searchKeywords = this.getRecordKeywords(record); recordToSend.filterValues = this.getRecordFilterValues(record); recordToSend.color = this.getRecordColor...
[ "function", "(", "record", ")", "{", "var", "recordToSend", "=", "{", "object", ":", "record", "}", ";", "recordToSend", ".", "columnValues", "=", "this", ".", "getRecordColumnValues", "(", "record", ")", ";", "recordToSend", ".", "searchKeywords", "=", "thi...
Wraps a record and observers changes to it. @private @method wrapRecord @param {Object} record The record instance. @return {Object} The wrapped record. Format: columnValues: {Array} searchKeywords: {Array}
[ "Wraps", "a", "record", "and", "observers", "changes", "to", "it", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L7438-L7447
24,020
ember-cli/loader.js
benchmarks/scenarios/ember.js
unlessHelper
function unlessHelper(params, hash, options) { return ifUnless(params, hash, options, !_emberViewsStreamsShould_display.default(params[0])); }
javascript
function unlessHelper(params, hash, options) { return ifUnless(params, hash, options, !_emberViewsStreamsShould_display.default(params[0])); }
[ "function", "unlessHelper", "(", "params", ",", "hash", ",", "options", ")", "{", "return", "ifUnless", "(", "params", ",", "hash", ",", "options", ",", "!", "_emberViewsStreamsShould_display", ".", "default", "(", "params", "[", "0", "]", ")", ")", ";", ...
The `unless` helper is the inverse of the `if` helper. Its block will be rendered if the expression contains a falsey value. All forms of the `if` helper can also be used with `unless`. @method unless @for Ember.Templates.helpers @public
[ "The", "unless", "helper", "is", "the", "inverse", "of", "the", "if", "helper", ".", "Its", "block", "will", "be", "rendered", "if", "the", "expression", "contains", "a", "falsey", "value", ".", "All", "forms", "of", "the", "if", "helper", "can", "also",...
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L10647-L10649
24,021
ember-cli/loader.js
benchmarks/scenarios/ember.js
ComponentNodeManager
function ComponentNodeManager(component, isAngleBracket, scope, renderNode, attrs, block, expectElement) { this.component = component; this.isAngleBracket = isAngleBracket; this.scope = scope; this.renderNode = renderNode; this.attrs = attrs; this.block = block; this.expectElement = expectEl...
javascript
function ComponentNodeManager(component, isAngleBracket, scope, renderNode, attrs, block, expectElement) { this.component = component; this.isAngleBracket = isAngleBracket; this.scope = scope; this.renderNode = renderNode; this.attrs = attrs; this.block = block; this.expectElement = expectEl...
[ "function", "ComponentNodeManager", "(", "component", ",", "isAngleBracket", ",", "scope", ",", "renderNode", ",", "attrs", ",", "block", ",", "expectElement", ")", "{", "this", ".", "component", "=", "component", ";", "this", ".", "isAngleBracket", "=", "isAn...
In theory this should come through the env, but it should be safe to import this until we make the hook system public and it gets actively used in addons or other downstream libraries.
[ "In", "theory", "this", "should", "come", "through", "the", "env", "but", "it", "should", "be", "safe", "to", "import", "this", "until", "we", "make", "the", "hook", "system", "public", "and", "it", "gets", "actively", "used", "in", "addons", "or", "othe...
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L13984-L13992
24,022
ember-cli/loader.js
benchmarks/scenarios/ember.js
getArrayValues
function getArrayValues(params) { var l = params.length; var out = new Array(l); for (var i = 0; i < l; i++) { out[i] = _emberHtmlbarsHooksGetValue.default(params[i]); } return out; }
javascript
function getArrayValues(params) { var l = params.length; var out = new Array(l); for (var i = 0; i < l; i++) { out[i] = _emberHtmlbarsHooksGetValue.default(params[i]); } return out; }
[ "function", "getArrayValues", "(", "params", ")", "{", "var", "l", "=", "params", ".", "length", ";", "var", "out", "=", "new", "Array", "(", "l", ")", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "l", ";", "i", "++", ")", "{", "out"...
We don't want to leak mutable cells into helpers, which are pure functions that can only work with values.
[ "We", "don", "t", "want", "to", "leak", "mutable", "cells", "into", "helpers", "which", "are", "pure", "functions", "that", "can", "only", "work", "with", "values", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L14628-L14637
24,023
ember-cli/loader.js
benchmarks/scenarios/ember.js
instrument
function instrument(component, callback, context) { var instrumentName, val, details, end; // Only instrument if there's at least one subscriber. if (_emberMetalInstrumentation.subscribers.length) { if (component) { instrumentName = component.instrumentName; } else { instrumentNa...
javascript
function instrument(component, callback, context) { var instrumentName, val, details, end; // Only instrument if there's at least one subscriber. if (_emberMetalInstrumentation.subscribers.length) { if (component) { instrumentName = component.instrumentName; } else { instrumentNa...
[ "function", "instrument", "(", "component", ",", "callback", ",", "context", ")", "{", "var", "instrumentName", ",", "val", ",", "details", ",", "end", ";", "// Only instrument if there's at least one subscriber.", "if", "(", "_emberMetalInstrumentation", ".", "subscr...
Provides instrumentation for node managers. Wrap your node manager's render and re-render methods with this function. @param {Object} component Component or View instance (optional). @param {Function} callback The function to instrument. @param {Object} context The context to call the function with. @return {Object} ...
[ "Provides", "instrumentation", "for", "node", "managers", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L14818-L14842
24,024
ember-cli/loader.js
benchmarks/scenarios/ember.js
makeBoundHelper
function makeBoundHelper(fn) { _emberMetalDebug.deprecate('Using `Ember.HTMLBars.makeBoundHelper` is deprecated. Please refactor to use `Ember.Helper` or `Ember.Helper.helper`.', false, { id: 'ember-htmlbars.make-bound-helper', until: '3.0.0' }); return _emberHtmlbarsHelper.helper(fn); }
javascript
function makeBoundHelper(fn) { _emberMetalDebug.deprecate('Using `Ember.HTMLBars.makeBoundHelper` is deprecated. Please refactor to use `Ember.Helper` or `Ember.Helper.helper`.', false, { id: 'ember-htmlbars.make-bound-helper', until: '3.0.0' }); return _emberHtmlbarsHelper.helper(fn); }
[ "function", "makeBoundHelper", "(", "fn", ")", "{", "_emberMetalDebug", ".", "deprecate", "(", "'Using `Ember.HTMLBars.makeBoundHelper` is deprecated. Please refactor to use `Ember.Helper` or `Ember.Helper.helper`.'", ",", "false", ",", "{", "id", ":", "'ember-htmlbars.make-bound-h...
Create a bound helper. Accepts a function that receives the ordered and hash parameters from the template. If a bound property was provided in the template, it will be resolved to its value and any changes to the bound property cause the helper function to be re-run with the updated values. `params` - An array of reso...
[ "Create", "a", "bound", "helper", ".", "Accepts", "a", "function", "that", "receives", "the", "ordered", "and", "hash", "parameters", "from", "the", "template", ".", "If", "a", "bound", "property", "was", "provided", "in", "the", "template", "it", "will", ...
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L15005-L15008
24,025
ember-cli/loader.js
benchmarks/scenarios/ember.js
htmlSafe
function htmlSafe(str) { if (str === null || str === undefined) { str = ''; } else if (typeof str !== 'string') { str = '' + str; } return new _htmlbarsUtil.SafeString(str); }
javascript
function htmlSafe(str) { if (str === null || str === undefined) { str = ''; } else if (typeof str !== 'string') { str = '' + str; } return new _htmlbarsUtil.SafeString(str); }
[ "function", "htmlSafe", "(", "str", ")", "{", "if", "(", "str", "===", "null", "||", "str", "===", "undefined", ")", "{", "str", "=", "''", ";", "}", "else", "if", "(", "typeof", "str", "!==", "'string'", ")", "{", "str", "=", "''", "+", "str", ...
Mark a string as safe for unescaped output with Ember templates. If you return HTML from a helper, use this function to ensure Ember's rendering layer does not escape the HTML. ```javascript Ember.String.htmlSafe('<div>someString</div>') ``` @method htmlSafe @for Ember.String @static @return {Handlebars.SafeString} A...
[ "Mark", "a", "string", "as", "safe", "for", "unescaped", "output", "with", "Ember", "templates", ".", "If", "you", "return", "HTML", "from", "a", "helper", "use", "this", "function", "to", "ensure", "Ember", "s", "rendering", "layer", "does", "not", "escap...
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L15557-L15564
24,026
ember-cli/loader.js
benchmarks/scenarios/ember.js
function () { _emberMetalDebug.assert('Must pass a valid object to Ember.Binding.disconnect()', !!this._toObj); // Remove an observer on the object so we're no longer notified of // changes that should update bindings. _emberMetalObserver.removeObserver(this._fromObj, this._fromPath, this, 'fro...
javascript
function () { _emberMetalDebug.assert('Must pass a valid object to Ember.Binding.disconnect()', !!this._toObj); // Remove an observer on the object so we're no longer notified of // changes that should update bindings. _emberMetalObserver.removeObserver(this._fromObj, this._fromPath, this, 'fro...
[ "function", "(", ")", "{", "_emberMetalDebug", ".", "assert", "(", "'Must pass a valid object to Ember.Binding.disconnect()'", ",", "!", "!", "this", ".", "_toObj", ")", ";", "// Remove an observer on the object so we're no longer notified of", "// changes that should update bind...
Disconnects the binding instance. Changes will no longer be relayed. You will not usually need to call this method. @method disconnect @return {Ember.Binding} `this` @public
[ "Disconnects", "the", "binding", "instance", ".", "Changes", "will", "no", "longer", "be", "relayed", ".", "You", "will", "not", "usually", "need", "to", "call", "this", "method", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L15923-L15937
24,027
ember-cli/loader.js
benchmarks/scenarios/ember.js
ChainNode
function ChainNode(parent, key, value) { this._parent = parent; this._key = key; // _watching is true when calling get(this._parent, this._key) will // return the value of this node. // // It is false for the root of a chain (because we have no parent) // and for global paths (because the p...
javascript
function ChainNode(parent, key, value) { this._parent = parent; this._key = key; // _watching is true when calling get(this._parent, this._key) will // return the value of this node. // // It is false for the root of a chain (because we have no parent) // and for global paths (because the p...
[ "function", "ChainNode", "(", "parent", ",", "key", ",", "value", ")", "{", "this", ".", "_parent", "=", "parent", ";", "this", ".", "_key", "=", "key", ";", "// _watching is true when calling get(this._parent, this._key) will", "// return the value of this node.", "/...
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 pass null for parent and key and object for value.
[ "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", "pass", ...
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L16395-L16419
24,028
ember-cli/loader.js
benchmarks/scenarios/ember.js
function (path) { var paths = this._paths; paths[path] = (paths[path] || 0) + 1; var key = firstKey(path); var tail = path.slice(key.length + 1); this.chain(key, tail); }
javascript
function (path) { var paths = this._paths; paths[path] = (paths[path] || 0) + 1; var key = firstKey(path); var tail = path.slice(key.length + 1); this.chain(key, tail); }
[ "function", "(", "path", ")", "{", "var", "paths", "=", "this", ".", "_paths", ";", "paths", "[", "path", "]", "=", "(", "paths", "[", "path", "]", "||", "0", ")", "+", "1", ";", "var", "key", "=", "firstKey", "(", "path", ")", ";", "var", "t...
called on the root node of a chain to setup watchers on the specified path.
[ "called", "on", "the", "root", "node", "of", "a", "chain", "to", "setup", "watchers", "on", "the", "specified", "path", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L16482-L16490
24,029
ember-cli/loader.js
benchmarks/scenarios/ember.js
match
function match(dependentKey, regexp) { return _emberMetalComputed.computed(dependentKey, function () { var value = _emberMetalProperty_get.get(this, dependentKey); return typeof value === 'string' ? regexp.test(value) : false; }); }
javascript
function match(dependentKey, regexp) { return _emberMetalComputed.computed(dependentKey, function () { var value = _emberMetalProperty_get.get(this, dependentKey); return typeof value === 'string' ? regexp.test(value) : false; }); }
[ "function", "match", "(", "dependentKey", ",", "regexp", ")", "{", "return", "_emberMetalComputed", ".", "computed", "(", "dependentKey", ",", "function", "(", ")", "{", "var", "value", "=", "_emberMetalProperty_get", ".", "get", "(", "this", ",", "dependentKe...
A computed property which matches the original value for the dependent property against a given RegExp, returning `true` if the value matches the RegExp and `false` if it does not. Example ```javascript var User = Ember.Object.extend({ hasValidEmail: Ember.computed.match('email', /^.+@.+\..+$/) }); var user = User.c...
[ "A", "computed", "property", "which", "matches", "the", "original", "value", "for", "the", "dependent", "property", "against", "a", "given", "RegExp", "returning", "true", "if", "the", "value", "matches", "the", "RegExp", "and", "false", "if", "it", "does", ...
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L17455-L17461
24,030
ember-cli/loader.js
benchmarks/scenarios/ember.js
equal
function equal(dependentKey, value) { return _emberMetalComputed.computed(dependentKey, function () { return _emberMetalProperty_get.get(this, dependentKey) === value; }); }
javascript
function equal(dependentKey, value) { return _emberMetalComputed.computed(dependentKey, function () { return _emberMetalProperty_get.get(this, dependentKey) === value; }); }
[ "function", "equal", "(", "dependentKey", ",", "value", ")", "{", "return", "_emberMetalComputed", ".", "computed", "(", "dependentKey", ",", "function", "(", ")", "{", "return", "_emberMetalProperty_get", ".", "get", "(", "this", ",", "dependentKey", ")", "==...
A computed property that returns true if the provided dependent property is equal to the given value. Example ```javascript var Hamster = Ember.Object.extend({ napTime: Ember.computed.equal('state', 'sleepy') }); var hamster = Hamster.create(); hamster.get('napTime'); // false hamster.set('state', 'sleepy'); hamste...
[ "A", "computed", "property", "that", "returns", "true", "if", "the", "provided", "dependent", "property", "is", "equal", "to", "the", "given", "value", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L17492-L17496
24,031
ember-cli/loader.js
benchmarks/scenarios/ember.js
gt
function gt(dependentKey, value) { return _emberMetalComputed.computed(dependentKey, function () { return _emberMetalProperty_get.get(this, dependentKey) > value; }); }
javascript
function gt(dependentKey, value) { return _emberMetalComputed.computed(dependentKey, function () { return _emberMetalProperty_get.get(this, dependentKey) > value; }); }
[ "function", "gt", "(", "dependentKey", ",", "value", ")", "{", "return", "_emberMetalComputed", ".", "computed", "(", "dependentKey", ",", "function", "(", ")", "{", "return", "_emberMetalProperty_get", ".", "get", "(", "this", ",", "dependentKey", ")", ">", ...
A computed property that returns true if the provided dependent property is greater than the provided value. Example ```javascript var Hamster = Ember.Object.extend({ hasTooManyBananas: Ember.computed.gt('numBananas', 10) }); var hamster = Hamster.create(); hamster.get('hasTooManyBananas'); // false hamster.set('nu...
[ "A", "computed", "property", "that", "returns", "true", "if", "the", "provided", "dependent", "property", "is", "greater", "than", "the", "provided", "value", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L17527-L17531
24,032
ember-cli/loader.js
benchmarks/scenarios/ember.js
gte
function gte(dependentKey, value) { return _emberMetalComputed.computed(dependentKey, function () { return _emberMetalProperty_get.get(this, dependentKey) >= value; }); }
javascript
function gte(dependentKey, value) { return _emberMetalComputed.computed(dependentKey, function () { return _emberMetalProperty_get.get(this, dependentKey) >= value; }); }
[ "function", "gte", "(", "dependentKey", ",", "value", ")", "{", "return", "_emberMetalComputed", ".", "computed", "(", "dependentKey", ",", "function", "(", ")", "{", "return", "_emberMetalProperty_get", ".", "get", "(", "this", ",", "dependentKey", ")", ">=",...
A computed property that returns true if the provided dependent property is greater than or equal to the provided value. Example ```javascript var Hamster = Ember.Object.extend({ hasTooManyBananas: Ember.computed.gte('numBananas', 10) }); var hamster = Hamster.create(); hamster.get('hasTooManyBananas'); // false ha...
[ "A", "computed", "property", "that", "returns", "true", "if", "the", "provided", "dependent", "property", "is", "greater", "than", "or", "equal", "to", "the", "provided", "value", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L17562-L17566
24,033
ember-cli/loader.js
benchmarks/scenarios/ember.js
lt
function lt(dependentKey, value) { return _emberMetalComputed.computed(dependentKey, function () { return _emberMetalProperty_get.get(this, dependentKey) < value; }); }
javascript
function lt(dependentKey, value) { return _emberMetalComputed.computed(dependentKey, function () { return _emberMetalProperty_get.get(this, dependentKey) < value; }); }
[ "function", "lt", "(", "dependentKey", ",", "value", ")", "{", "return", "_emberMetalComputed", ".", "computed", "(", "dependentKey", ",", "function", "(", ")", "{", "return", "_emberMetalProperty_get", ".", "get", "(", "this", ",", "dependentKey", ")", "<", ...
A computed property that returns true if the provided dependent property is less than the provided value. Example ```javascript var Hamster = Ember.Object.extend({ needsMoreBananas: Ember.computed.lt('numBananas', 3) }); var hamster = Hamster.create(); hamster.get('needsMoreBananas'); // true hamster.set('numBanana...
[ "A", "computed", "property", "that", "returns", "true", "if", "the", "provided", "dependent", "property", "is", "less", "than", "the", "provided", "value", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L17597-L17601
24,034
ember-cli/loader.js
benchmarks/scenarios/ember.js
lte
function lte(dependentKey, value) { return _emberMetalComputed.computed(dependentKey, function () { return _emberMetalProperty_get.get(this, dependentKey) <= value; }); }
javascript
function lte(dependentKey, value) { return _emberMetalComputed.computed(dependentKey, function () { return _emberMetalProperty_get.get(this, dependentKey) <= value; }); }
[ "function", "lte", "(", "dependentKey", ",", "value", ")", "{", "return", "_emberMetalComputed", ".", "computed", "(", "dependentKey", ",", "function", "(", ")", "{", "return", "_emberMetalProperty_get", ".", "get", "(", "this", ",", "dependentKey", ")", "<=",...
A computed property that returns true if the provided dependent property is less than or equal to the provided value. Example ```javascript var Hamster = Ember.Object.extend({ needsMoreBananas: Ember.computed.lte('numBananas', 3) }); var hamster = Hamster.create(); hamster.get('needsMoreBananas'); // true hamster.s...
[ "A", "computed", "property", "that", "returns", "true", "if", "the", "provided", "dependent", "property", "is", "less", "than", "or", "equal", "to", "the", "provided", "value", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L17632-L17636
24,035
ember-cli/loader.js
benchmarks/scenarios/ember.js
deprecatingAlias
function deprecatingAlias(dependentKey, options) { return _emberMetalComputed.computed(dependentKey, { get: function (key) { _emberMetalDebug.deprecate('Usage of `' + key + '` is deprecated, use `' + dependentKey + '` instead.', false, options); return _emberMetalProperty_get.get(this, depende...
javascript
function deprecatingAlias(dependentKey, options) { return _emberMetalComputed.computed(dependentKey, { get: function (key) { _emberMetalDebug.deprecate('Usage of `' + key + '` is deprecated, use `' + dependentKey + '` instead.', false, options); return _emberMetalProperty_get.get(this, depende...
[ "function", "deprecatingAlias", "(", "dependentKey", ",", "options", ")", "{", "return", "_emberMetalComputed", ".", "computed", "(", "dependentKey", ",", "{", "get", ":", "function", "(", "key", ")", "{", "_emberMetalDebug", ".", "deprecate", "(", "'Usage of `'...
Creates a new property that is an alias for another property on an object. Calls to `get` or `set` this property behave as though they were called on the original property, but also print a deprecation warning. @method deprecatingAlias @for Ember.computed @param {String} dependentKey @return {Ember.ComputedProperty} c...
[ "Creates", "a", "new", "property", "that", "is", "an", "alias", "for", "another", "property", "on", "an", "object", ".", "Calls", "to", "get", "or", "set", "this", "property", "behave", "as", "though", "they", "were", "called", "on", "the", "original", "...
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L17867-L17879
24,036
ember-cli/loader.js
benchmarks/scenarios/ember.js
suspendListener
function suspendListener(obj, eventName, target, method, callback) { return suspendListeners(obj, [eventName], target, method, callback); }
javascript
function suspendListener(obj, eventName, target, method, callback) { return suspendListeners(obj, [eventName], target, method, callback); }
[ "function", "suspendListener", "(", "obj", ",", "eventName", ",", "target", ",", "method", ",", "callback", ")", "{", "return", "suspendListeners", "(", "obj", ",", "[", "eventName", "]", ",", "target", ",", "method", ",", "callback", ")", ";", "}" ]
Suspend listener during callback. This should only be used by the target of the event listener when it is taking an action that would cause the event, e.g. an object might suspend its property change listener while it is setting that property. @method suspendListener @for Ember @private @param obj @param {String} ev...
[ "Suspend", "listener", "during", "callback", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L18380-L18382
24,037
ember-cli/loader.js
benchmarks/scenarios/ember.js
sendEvent
function sendEvent(obj, eventName, params, actions) { if (!actions) { var meta = _emberMetalMeta.peekMeta(obj); actions = meta && meta.matchingListeners(eventName); } if (!actions || actions.length === 0) { return; } for (var i = actions.length - 3; i >= 0; i -= 3) { // loo...
javascript
function sendEvent(obj, eventName, params, actions) { if (!actions) { var meta = _emberMetalMeta.peekMeta(obj); actions = meta && meta.matchingListeners(eventName); } if (!actions || actions.length === 0) { return; } for (var i = actions.length - 3; i >= 0; i -= 3) { // loo...
[ "function", "sendEvent", "(", "obj", ",", "eventName", ",", "params", ",", "actions", ")", "{", "if", "(", "!", "actions", ")", "{", "var", "meta", "=", "_emberMetalMeta", ".", "peekMeta", "(", "obj", ")", ";", "actions", "=", "meta", "&&", "meta", "...
Send an event. The execution of suspended listeners is skipped, and once listeners are removed. A listener without a target is executed on the passed object. If an array of actions is not passed, the actions stored on the passed object are invoked. @method sendEvent @for Ember @param obj @param {String} eventName @par...
[ "Send", "an", "event", ".", "The", "execution", "of", "suspended", "listeners", "is", "skipped", "and", "once", "listeners", "are", "removed", ".", "A", "listener", "without", "a", "target", "is", "executed", "on", "the", "passed", "object", ".", "If", "an...
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L18435-L18478
24,038
ember-cli/loader.js
benchmarks/scenarios/ember.js
on
function on() { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } var func = args.pop(); var events = args; func.__ember_listens__ = events; return func; }
javascript
function on() { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } var func = args.pop(); var events = args; func.__ember_listens__ = events; return func; }
[ "function", "on", "(", ")", "{", "for", "(", "var", "_len", "=", "arguments", ".", "length", ",", "args", "=", "Array", "(", "_len", ")", ",", "_key", "=", "0", ";", "_key", "<", "_len", ";", "_key", "++", ")", "{", "args", "[", "_key", "]", ...
Define a property as a function that should be executed when a specified event or events are triggered. ``` javascript var Job = Ember.Object.extend({ logCompleted: Ember.on('completed', function() { console.log('Job completed!'); }) }); var job = Job.create(); Ember.sendEvent(job, 'completed'); // Logs 'Job comple...
[ "Define", "a", "property", "as", "a", "function", "that", "should", "be", "executed", "when", "a", "specified", "event", "or", "events", "are", "triggered", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L18547-L18556
24,039
ember-cli/loader.js
benchmarks/scenarios/ember.js
expandProperties
function expandProperties(pattern, callback) { _emberMetalDebug.assert('A computed property key must be a string', typeof pattern === 'string'); _emberMetalDebug.assert('Brace expanded properties cannot contain spaces, e.g. "user.{firstName, lastName}" should be "user.{firstName,lastName}"', pattern.indexOf(' '...
javascript
function expandProperties(pattern, callback) { _emberMetalDebug.assert('A computed property key must be a string', typeof pattern === 'string'); _emberMetalDebug.assert('Brace expanded properties cannot contain spaces, e.g. "user.{firstName, lastName}" should be "user.{firstName,lastName}"', pattern.indexOf(' '...
[ "function", "expandProperties", "(", "pattern", ",", "callback", ")", "{", "_emberMetalDebug", ".", "assert", "(", "'A computed property key must be a string'", ",", "typeof", "pattern", "===", "'string'", ")", ";", "_emberMetalDebug", ".", "assert", "(", "'Brace expa...
Expands `pattern`, invoking `callback` for each expansion. The only pattern supported is brace-expansion, anything else will be passed once to `callback` directly. Example ```js function echo(arg){ console.log(arg); } Ember.expandProperties('foo.bar', echo); //=> 'foo.bar' Ember.expandProperties('{foo,...
[ "Expands", "pattern", "invoking", "callback", "for", "each", "expansion", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L18600-L18617
24,040
ember-cli/loader.js
benchmarks/scenarios/ember.js
InjectedProperty
function InjectedProperty(type, name) { this.type = type; this.name = name; this._super$Constructor(injectedPropertyGet); AliasedPropertyPrototype.oneWay.call(this); }
javascript
function InjectedProperty(type, name) { this.type = type; this.name = name; this._super$Constructor(injectedPropertyGet); AliasedPropertyPrototype.oneWay.call(this); }
[ "function", "InjectedProperty", "(", "type", ",", "name", ")", "{", "this", ".", "type", "=", "type", ";", "this", ".", "name", "=", "name", ";", "this", ".", "_super$Constructor", "(", "injectedPropertyGet", ")", ";", "AliasedPropertyPrototype", ".", "oneWa...
Read-only property that returns the result of a container lookup. @class InjectedProperty @namespace Ember @constructor @param {String} type The container type the property will lookup @param {String} name (optional) The name the property will lookup, defaults to the property's name @private
[ "Read", "-", "only", "property", "that", "returns", "the", "result", "of", "a", "container", "lookup", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L19032-L19038
24,041
ember-cli/loader.js
benchmarks/scenarios/ember.js
_instrumentStart
function _instrumentStart(name, _payload) { var listeners = cache[name]; if (!listeners) { listeners = populateListeners(name); } if (listeners.length === 0) { return; } var payload = _payload(); var STRUCTURED_PROFILE = _emberMetalCore.default.STRUCTURED_PROFILE; var tim...
javascript
function _instrumentStart(name, _payload) { var listeners = cache[name]; if (!listeners) { listeners = populateListeners(name); } if (listeners.length === 0) { return; } var payload = _payload(); var STRUCTURED_PROFILE = _emberMetalCore.default.STRUCTURED_PROFILE; var tim...
[ "function", "_instrumentStart", "(", "name", ",", "_payload", ")", "{", "var", "listeners", "=", "cache", "[", "name", "]", ";", "if", "(", "!", "listeners", ")", "{", "listeners", "=", "populateListeners", "(", "name", ")", ";", "}", "if", "(", "liste...
private for now
[ "private", "for", "now" ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L19209-L19252
24,042
ember-cli/loader.js
benchmarks/scenarios/ember.js
subscribe
function subscribe(pattern, object) { var paths = pattern.split('.'); var path; var regex = []; for (var i = 0, l = paths.length; i < l; i++) { path = paths[i]; if (path === '*') { regex.push('[^\\.]*'); } else { regex.push(path); } } regex = regex.join(...
javascript
function subscribe(pattern, object) { var paths = pattern.split('.'); var path; var regex = []; for (var i = 0, l = paths.length; i < l; i++) { path = paths[i]; if (path === '*') { regex.push('[^\\.]*'); } else { regex.push(path); } } regex = regex.join(...
[ "function", "subscribe", "(", "pattern", ",", "object", ")", "{", "var", "paths", "=", "pattern", ".", "split", "(", "'.'", ")", ";", "var", "path", ";", "var", "regex", "=", "[", "]", ";", "for", "(", "var", "i", "=", "0", ",", "l", "=", "path...
Subscribes to a particular event or instrumented block of code. @method subscribe @namespace Ember.Instrumentation @param {String} [pattern] Namespaced event name. @param {Object} [object] Before and After hooks. @return {Subscriber} @private
[ "Subscribes", "to", "a", "particular", "event", "or", "instrumented", "block", "of", "code", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L19267-L19294
24,043
ember-cli/loader.js
benchmarks/scenarios/ember.js
unsubscribe
function unsubscribe(subscriber) { var index; for (var i = 0, l = subscribers.length; i < l; i++) { if (subscribers[i] === subscriber) { index = i; } } subscribers.splice(index, 1); cache = {}; }
javascript
function unsubscribe(subscriber) { var index; for (var i = 0, l = subscribers.length; i < l; i++) { if (subscribers[i] === subscriber) { index = i; } } subscribers.splice(index, 1); cache = {}; }
[ "function", "unsubscribe", "(", "subscriber", ")", "{", "var", "index", ";", "for", "(", "var", "i", "=", "0", ",", "l", "=", "subscribers", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "{", "if", "(", "subscribers", "[", "i", "]", "...
Unsubscribes from a particular event or instrumented block of code. @method unsubscribe @namespace Ember.Instrumentation @param {Object} [subscriber] @private
[ "Unsubscribes", "from", "a", "particular", "event", "or", "instrumented", "block", "of", "code", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L19306-L19317
24,044
ember-cli/loader.js
benchmarks/scenarios/ember.js
function (key) { if (this.size === 0) { return; } var values = this._values; var guid = _emberMetalUtils.guidFor(key); return values[guid]; }
javascript
function (key) { if (this.size === 0) { return; } var values = this._values; var guid = _emberMetalUtils.guidFor(key); return values[guid]; }
[ "function", "(", "key", ")", "{", "if", "(", "this", ".", "size", "===", "0", ")", "{", "return", ";", "}", "var", "values", "=", "this", ".", "_values", ";", "var", "guid", "=", "_emberMetalUtils", ".", "guidFor", "(", "key", ")", ";", "return", ...
Retrieve the value associated with a given key. @method get @param {*} key @return {*} the value associated with the key, or `undefined` @private
[ "Retrieve", "the", "value", "associated", "with", "a", "given", "key", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L20011-L20020
24,045
ember-cli/loader.js
benchmarks/scenarios/ember.js
function (callback /*, ...thisArg*/) { if (typeof callback !== 'function') { missingFunction(callback); } if (this.size === 0) { return; } var length = arguments.length; var map = this; var cb, thisArg; if (length === 2) { thisArg = arguments[1]...
javascript
function (callback /*, ...thisArg*/) { if (typeof callback !== 'function') { missingFunction(callback); } if (this.size === 0) { return; } var length = arguments.length; var map = this; var cb, thisArg; if (length === 2) { thisArg = arguments[1]...
[ "function", "(", "callback", "/*, ...thisArg*/", ")", "{", "if", "(", "typeof", "callback", "!==", "'function'", ")", "{", "missingFunction", "(", "callback", ")", ";", "}", "if", "(", "this", ".", "size", "===", "0", ")", "{", "return", ";", "}", "var...
Iterate over all the keys and values. Calls the function once for each key, passing in value, key, and the map being iterated over, in that order. The keys are guaranteed to be iterated over in insertion order. @method forEach @param {Function} callback @param {*} self if passed, the `this` value inside the callback. B...
[ "Iterate", "over", "all", "the", "keys", "and", "values", ".", "Calls", "the", "function", "once", "for", "each", "key", "passing", "in", "value", "key", "and", "the", "map", "being", "iterated", "over", "in", "that", "order", ".", "The", "keys", "are", ...
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L20097-L20122
24,046
ember-cli/loader.js
benchmarks/scenarios/ember.js
ownMap
function ownMap(name, Meta) { var key = memberProperty(name); var capitalized = capitalize(name); Meta.prototype['writable' + capitalized] = function () { return this._getOrCreateOwnMap(key); }; Meta.prototype['readable' + capitalized] = function () { return this[key]; }; }
javascript
function ownMap(name, Meta) { var key = memberProperty(name); var capitalized = capitalize(name); Meta.prototype['writable' + capitalized] = function () { return this._getOrCreateOwnMap(key); }; Meta.prototype['readable' + capitalized] = function () { return this[key]; }; }
[ "function", "ownMap", "(", "name", ",", "Meta", ")", "{", "var", "key", "=", "memberProperty", "(", "name", ")", ";", "var", "capitalized", "=", "capitalize", "(", "name", ")", ";", "Meta", ".", "prototype", "[", "'writable'", "+", "capitalized", "]", ...
Implements a member that is a lazily created, non-inheritable POJO.
[ "Implements", "a", "member", "that", "is", "a", "lazily", "created", "non", "-", "inheritable", "POJO", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L20345-L20354
24,047
ember-cli/loader.js
benchmarks/scenarios/ember.js
inheritedMap
function inheritedMap(name, Meta) { var key = memberProperty(name); var capitalized = capitalize(name); Meta.prototype['write' + capitalized] = function (subkey, value) { var map = this._getOrCreateOwnMap(key); map[subkey] = value; }; Meta.prototype['peek' + capitalized] = function (su...
javascript
function inheritedMap(name, Meta) { var key = memberProperty(name); var capitalized = capitalize(name); Meta.prototype['write' + capitalized] = function (subkey, value) { var map = this._getOrCreateOwnMap(key); map[subkey] = value; }; Meta.prototype['peek' + capitalized] = function (su...
[ "function", "inheritedMap", "(", "name", ",", "Meta", ")", "{", "var", "key", "=", "memberProperty", "(", "name", ")", ";", "var", "capitalized", "=", "capitalize", "(", "name", ")", ";", "Meta", ".", "prototype", "[", "'write'", "+", "capitalized", "]",...
Implements a member that is a lazily created POJO with inheritable values.
[ "Implements", "a", "member", "that", "is", "a", "lazily", "created", "POJO", "with", "inheritable", "values", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L20366-L20407
24,048
ember-cli/loader.js
benchmarks/scenarios/ember.js
inheritedMapOfMaps
function inheritedMapOfMaps(name, Meta) { var key = memberProperty(name); var capitalized = capitalize(name); Meta.prototype['write' + capitalized] = function (subkey, itemkey, value) { var outerMap = this._getOrCreateOwnMap(key); var innerMap = outerMap[subkey]; if (!innerMap) { ...
javascript
function inheritedMapOfMaps(name, Meta) { var key = memberProperty(name); var capitalized = capitalize(name); Meta.prototype['write' + capitalized] = function (subkey, itemkey, value) { var outerMap = this._getOrCreateOwnMap(key); var innerMap = outerMap[subkey]; if (!innerMap) { ...
[ "function", "inheritedMapOfMaps", "(", "name", ",", "Meta", ")", "{", "var", "key", "=", "memberProperty", "(", "name", ")", ";", "var", "capitalized", "=", "capitalize", "(", "name", ")", ";", "Meta", ".", "prototype", "[", "'write'", "+", "capitalized", ...
Implements a member that provides a lazily created map of maps, with inheritance at both levels.
[ "Implements", "a", "member", "that", "provides", "a", "lazily", "created", "map", "of", "maps", "with", "inheritance", "at", "both", "levels", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L20435-L20478
24,049
ember-cli/loader.js
benchmarks/scenarios/ember.js
ownCustomObject
function ownCustomObject(name, Meta) { var key = memberProperty(name); var capitalized = capitalize(name); Meta.prototype['writable' + capitalized] = function (create) { var ret = this[key]; if (!ret) { ret = this[key] = create(this.source); } return ret; }; Meta.prot...
javascript
function ownCustomObject(name, Meta) { var key = memberProperty(name); var capitalized = capitalize(name); Meta.prototype['writable' + capitalized] = function (create) { var ret = this[key]; if (!ret) { ret = this[key] = create(this.source); } return ret; }; Meta.prot...
[ "function", "ownCustomObject", "(", "name", ",", "Meta", ")", "{", "var", "key", "=", "memberProperty", "(", "name", ")", ";", "var", "capitalized", "=", "capitalize", "(", "name", ")", ";", "Meta", ".", "prototype", "[", "'writable'", "+", "capitalized", ...
Implements a member that provides a non-heritable, lazily-created object using the method you provide.
[ "Implements", "a", "member", "that", "provides", "a", "non", "-", "heritable", "lazily", "-", "created", "object", "using", "the", "method", "you", "provide", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L20510-L20523
24,050
ember-cli/loader.js
benchmarks/scenarios/ember.js
function (obj, meta) { // if `null` already, just set it to the new value // otherwise define property first if (obj[META_FIELD] !== null) { if (obj.__defineNonEnumerable) { obj.__defineNonEnumerable(EMBER_META_PROPERTY); } else { Object.defineProperty(obj, META_FIELD, META_DESC)...
javascript
function (obj, meta) { // if `null` already, just set it to the new value // otherwise define property first if (obj[META_FIELD] !== null) { if (obj.__defineNonEnumerable) { obj.__defineNonEnumerable(EMBER_META_PROPERTY); } else { Object.defineProperty(obj, META_FIELD, META_DESC)...
[ "function", "(", "obj", ",", "meta", ")", "{", "// if `null` already, just set it to the new value", "// otherwise define property first", "if", "(", "obj", "[", "META_FIELD", "]", "!==", "null", ")", "{", "if", "(", "obj", ".", "__defineNonEnumerable", ")", "{", ...
choose the one appropriate for given platform
[ "choose", "the", "one", "appropriate", "for", "given", "platform" ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L20573-L20585
24,051
ember-cli/loader.js
benchmarks/scenarios/ember.js
Mixin
function Mixin(args, properties) { this.properties = properties; var length = args && args.length; if (length > 0) { var m = new Array(length); for (var i = 0; i < length; i++) { var x = args[i]; if (x instanceof Mixin) { m[i] = x; } else { m[i] = n...
javascript
function Mixin(args, properties) { this.properties = properties; var length = args && args.length; if (length > 0) { var m = new Array(length); for (var i = 0; i < length; i++) { var x = args[i]; if (x instanceof Mixin) { m[i] = x; } else { m[i] = n...
[ "function", "Mixin", "(", "args", ",", "properties", ")", "{", "this", ".", "properties", "=", "properties", ";", "var", "length", "=", "args", "&&", "args", ".", "length", ";", "if", "(", "length", ">", "0", ")", "{", "var", "m", "=", "new", "Arra...
The `Ember.Mixin` class allows you to create mixins, whose properties can be added to other classes. For instance, ```javascript App.Editable = Ember.Mixin.create({ edit: function() { console.log('starting to edit'); this.set('isEditing', true); }, isEditing: false }); Mix mixins into classes by passing them as the f...
[ "The", "Ember", ".", "Mixin", "class", "allows", "you", "to", "create", "mixins", "whose", "properties", "can", "be", "added", "to", "other", "classes", ".", "For", "instance" ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L21288-L21314
24,052
ember-cli/loader.js
benchmarks/scenarios/ember.js
_immediateObserver
function _immediateObserver() { _emberMetalDebug.deprecate('Usage of `Ember.immediateObserver` is deprecated, use `Ember.observer` instead.', false, { id: 'ember-metal.immediate-observer', until: '3.0.0' }); for (var i = 0, l = arguments.length; i < l; i++) { var arg = arguments[i]; _emberMetalDebu...
javascript
function _immediateObserver() { _emberMetalDebug.deprecate('Usage of `Ember.immediateObserver` is deprecated, use `Ember.observer` instead.', false, { id: 'ember-metal.immediate-observer', until: '3.0.0' }); for (var i = 0, l = arguments.length; i < l; i++) { var arg = arguments[i]; _emberMetalDebu...
[ "function", "_immediateObserver", "(", ")", "{", "_emberMetalDebug", ".", "deprecate", "(", "'Usage of `Ember.immediateObserver` is deprecated, use `Ember.observer` instead.'", ",", "false", ",", "{", "id", ":", "'ember-metal.immediate-observer'", ",", "until", ":", "'3.0.0'"...
Specify a method that observes property changes. ```javascript Ember.Object.extend({ valueObserver: Ember.immediateObserver('value', function() { Executes whenever the "value" property changes }) }); ``` In the future, `Ember.observer` may become asynchronous. In this event, `Ember.immediateObserver` will maintain th...
[ "Specify", "a", "method", "that", "observes", "property", "changes", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L21640-L21649
24,053
ember-cli/loader.js
benchmarks/scenarios/ember.js
_beforeObserver
function _beforeObserver() { for (var _len5 = arguments.length, args = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { args[_key5] = arguments[_key5]; } var func = args.slice(-1)[0]; var paths; var addWatchedProperty = function (path) { paths.push(path); }; var _paths = arg...
javascript
function _beforeObserver() { for (var _len5 = arguments.length, args = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { args[_key5] = arguments[_key5]; } var func = args.slice(-1)[0]; var paths; var addWatchedProperty = function (path) { paths.push(path); }; var _paths = arg...
[ "function", "_beforeObserver", "(", ")", "{", "for", "(", "var", "_len5", "=", "arguments", ".", "length", ",", "args", "=", "Array", "(", "_len5", ")", ",", "_key5", "=", "0", ";", "_key5", "<", "_len5", ";", "_key5", "++", ")", "{", "args", "[", ...
When observers fire, they are called with the arguments `obj`, `keyName`. Note, `@each.property` observer is called per each add or replace of an element and it's not called with a specific enumeration item. A `_beforeObserver` fires before a property changes. A `_beforeObserver` is an alternative form of `.observes...
[ "When", "observers", "fire", "they", "are", "called", "with", "the", "arguments", "obj", "keyName", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L21692-L21725
24,054
ember-cli/loader.js
benchmarks/scenarios/ember.js
changeProperties
function changeProperties(callback, binding) { beginPropertyChanges(); try { callback.call(binding); } finally { endPropertyChanges.call(binding); } }
javascript
function changeProperties(callback, binding) { beginPropertyChanges(); try { callback.call(binding); } finally { endPropertyChanges.call(binding); } }
[ "function", "changeProperties", "(", "callback", ",", "binding", ")", "{", "beginPropertyChanges", "(", ")", ";", "try", "{", "callback", ".", "call", "(", "binding", ")", ";", "}", "finally", "{", "endPropertyChanges", ".", "call", "(", "binding", ")", ";...
Make a series of property changes together in an exception-safe way. ```javascript Ember.changeProperties(function() { obj1.set('foo', mayBlowUpWhenSet); obj2.set('bar', baz); }); ``` @method changeProperties @param {Function} callback @param [binding] @private
[ "Make", "a", "series", "of", "property", "changes", "together", "in", "an", "exception", "-", "safe", "way", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L22443-L22450
24,055
ember-cli/loader.js
benchmarks/scenarios/ember.js
chain
function chain(value, fn, label) { _emberMetalDebug.assert('Must call chain with a label', !!label); if (isStream(value)) { var stream = new _emberMetalStreamsStream.Stream(fn, function () { return label + '(' + labelFor(value) + ')'; }); stream.addDependency(value); return strea...
javascript
function chain(value, fn, label) { _emberMetalDebug.assert('Must call chain with a label', !!label); if (isStream(value)) { var stream = new _emberMetalStreamsStream.Stream(fn, function () { return label + '(' + labelFor(value) + ')'; }); stream.addDependency(value); return strea...
[ "function", "chain", "(", "value", ",", "fn", ",", "label", ")", "{", "_emberMetalDebug", ".", "assert", "(", "'Must call chain with a label'", ",", "!", "!", "label", ")", ";", "if", "(", "isStream", "(", "value", ")", ")", "{", "var", "stream", "=", ...
Generate a new stream by providing a source stream and a function that can be used to transform the stream's value. In the case of a non-stream object, returns the result of the function. The value to transform would typically be available to the function you pass to `chain()` via scope. For example: ```javascript va...
[ "Generate", "a", "new", "stream", "by", "providing", "a", "source", "stream", "and", "a", "function", "that", "can", "be", "used", "to", "transform", "the", "stream", "s", "value", ".", "In", "the", "case", "of", "a", "non", "-", "stream", "object", "r...
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L24510-L24521
24,056
ember-cli/loader.js
benchmarks/scenarios/ember.js
guidFor
function guidFor(obj) { if (obj && obj[GUID_KEY]) { return obj[GUID_KEY]; } // special cases where we don't want to add a key to object if (obj === undefined) { return '(undefined)'; } if (obj === null) { return '(null)'; } var ret; var type = typeof obj; //...
javascript
function guidFor(obj) { if (obj && obj[GUID_KEY]) { return obj[GUID_KEY]; } // special cases where we don't want to add a key to object if (obj === undefined) { return '(undefined)'; } if (obj === null) { return '(null)'; } var ret; var type = typeof obj; //...
[ "function", "guidFor", "(", "obj", ")", "{", "if", "(", "obj", "&&", "obj", "[", "GUID_KEY", "]", ")", "{", "return", "obj", "[", "GUID_KEY", "]", ";", "}", "// special cases where we don't want to add a key to object", "if", "(", "obj", "===", "undefined", ...
Returns a unique id for the object. If the object does not yet have a guid, one will be assigned to it. You can call this on any object, `Ember.Object`-based or not, but be aware that it will add a `_guid` property. You can also use this method on DOM Element objects. @public @method guidFor @for Ember @param {Object...
[ "Returns", "a", "unique", "id", "for", "the", "object", ".", "If", "the", "object", "does", "not", "yet", "have", "a", "guid", "one", "will", "be", "assigned", "to", "it", ".", "You", "can", "call", "this", "on", "any", "object", "Ember", ".", "Objec...
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L24791-L24855
24,057
ember-cli/loader.js
benchmarks/scenarios/ember.js
tryInvoke
function tryInvoke(obj, methodName, args) { if (canInvoke(obj, methodName)) { return args ? applyStr(obj, methodName, args) : applyStr(obj, methodName); } }
javascript
function tryInvoke(obj, methodName, args) { if (canInvoke(obj, methodName)) { return args ? applyStr(obj, methodName, args) : applyStr(obj, methodName); } }
[ "function", "tryInvoke", "(", "obj", ",", "methodName", ",", "args", ")", "{", "if", "(", "canInvoke", "(", "obj", ",", "methodName", ")", ")", "{", "return", "args", "?", "applyStr", "(", "obj", ",", "methodName", ",", "args", ")", ":", "applyStr", ...
Checks to see if the `methodName` exists on the `obj`, and if it does, invokes it with the arguments passed. ```javascript var d = new Date('03/15/2013'); Ember.tryInvoke(d, 'getTime'); // 1363320000000 Ember.tryInvoke(d, 'setFullYear', [2014]); // 1394856000000 Ember.tryInvoke(d, 'noSuchMethod', [2014]...
[ "Checks", "to", "see", "if", "the", "methodName", "exists", "on", "the", "obj", "and", "if", "it", "does", "invokes", "it", "with", "the", "arguments", "passed", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L24994-L24998
24,058
ember-cli/loader.js
benchmarks/scenarios/ember.js
apply
function apply(t, m, a) { var l = a && a.length; if (!a || !l) { return m.call(t); } switch (l) { case 1: return m.call(t, a[0]); case 2: return m.call(t, a[0], a[1]); case 3: return m.call(t, a[0], a[1], a[2]); case 4: return m.call(t, a[0],...
javascript
function apply(t, m, a) { var l = a && a.length; if (!a || !l) { return m.call(t); } switch (l) { case 1: return m.call(t, a[0]); case 2: return m.call(t, a[0], a[1]); case 3: return m.call(t, a[0], a[1], a[2]); case 4: return m.call(t, a[0],...
[ "function", "apply", "(", "t", ",", "m", ",", "a", ")", "{", "var", "l", "=", "a", "&&", "a", ".", "length", ";", "if", "(", "!", "a", "||", "!", "l", ")", "{", "return", "m", ".", "call", "(", "t", ")", ";", "}", "switch", "(", "l", ")...
The following functions are intentionally minified to keep the functions below Chrome's function body size inlining limit of 600 chars. @param {Object} t target @param {Function} m method @param {Array} a args @private
[ "The", "following", "functions", "are", "intentionally", "minified", "to", "keep", "the", "functions", "below", "Chrome", "s", "function", "body", "size", "inlining", "limit", "of", "600", "chars", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L25104-L25123
24,059
ember-cli/loader.js
benchmarks/scenarios/ember.js
destroy
function destroy(obj) { var meta = _emberMetalMeta.peekMeta(obj); var node, nodes, key, nodeObject; if (meta) { _emberMetalMeta.deleteMeta(obj); // remove chainWatchers to remove circular references that would prevent GC node = meta.readableChains(); if (node) { NODE_STACK.p...
javascript
function destroy(obj) { var meta = _emberMetalMeta.peekMeta(obj); var node, nodes, key, nodeObject; if (meta) { _emberMetalMeta.deleteMeta(obj); // remove chainWatchers to remove circular references that would prevent GC node = meta.readableChains(); if (node) { NODE_STACK.p...
[ "function", "destroy", "(", "obj", ")", "{", "var", "meta", "=", "_emberMetalMeta", ".", "peekMeta", "(", "obj", ")", ";", "var", "node", ",", "nodes", ",", "key", ",", "nodeObject", ";", "if", "(", "meta", ")", "{", "_emberMetalMeta", ".", "deleteMeta...
Tears down the meta on an object so that it can be garbage collected. Multiple calls will have no effect. @method destroy @for Ember @param {Object} obj the object to destroy @return {void} @private
[ "Tears", "down", "the", "meta", "on", "an", "object", "so", "that", "it", "can", "be", "garbage", "collected", ".", "Multiple", "calls", "will", "have", "no", "effect", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L25427-L25459
24,060
ember-cli/loader.js
benchmarks/scenarios/ember.js
function (controller, _prop) { var prop = _prop.substr(0, _prop.length - 3); var delegate = controller._qpDelegate; var value = _emberMetalProperty_get.get(controller, prop); delegate(prop, value); }
javascript
function (controller, _prop) { var prop = _prop.substr(0, _prop.length - 3); var delegate = controller._qpDelegate; var value = _emberMetalProperty_get.get(controller, prop); delegate(prop, value); }
[ "function", "(", "controller", ",", "_prop", ")", "{", "var", "prop", "=", "_prop", ".", "substr", "(", "0", ",", "_prop", ".", "length", "-", "3", ")", ";", "var", "delegate", "=", "controller", ".", "_qpDelegate", ";", "var", "value", "=", "_emberM...
set by route @method _qpChanged @private
[ "set", "by", "route" ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L25915-L25921
24,061
ember-cli/loader.js
benchmarks/scenarios/ember.js
function () { var rootURL = this.rootURL; _emberMetalDebug.assert('rootURL must end with a trailing forward slash e.g. "/app/"', rootURL.charAt(rootURL.length - 1) === '/'); var implementation = detectImplementation({ location: this.location, history: this.history, userAgent:...
javascript
function () { var rootURL = this.rootURL; _emberMetalDebug.assert('rootURL must end with a trailing forward slash e.g. "/app/"', rootURL.charAt(rootURL.length - 1) === '/'); var implementation = detectImplementation({ location: this.location, history: this.history, userAgent:...
[ "function", "(", ")", "{", "var", "rootURL", "=", "this", ".", "rootURL", ";", "_emberMetalDebug", ".", "assert", "(", "'rootURL must end with a trailing forward slash e.g. \"/app/\"'", ",", "rootURL", ".", "charAt", "(", "rootURL", ".", "length", "-", "1", ")", ...
Called by the router to instruct the location to do any feature detection necessary. In the case of AutoLocation, we detect whether to use history or hash concrete implementations. @private
[ "Called", "by", "the", "router", "to", "instruct", "the", "location", "to", "do", "any", "feature", "detection", "necessary", ".", "In", "the", "case", "of", "AutoLocation", "we", "detect", "whether", "to", "use", "history", "or", "hash", "concrete", "implem...
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L26344-L26369
24,062
ember-cli/loader.js
benchmarks/scenarios/ember.js
function () { var history = _emberMetalProperty_get.get(this, 'history') || window.history; _emberMetalProperty_set.set(this, 'history', history); if (history && 'state' in history) { this.supportsHistory = true; } this.replaceState(this.formatURL(this.getURL())); }
javascript
function () { var history = _emberMetalProperty_get.get(this, 'history') || window.history; _emberMetalProperty_set.set(this, 'history', history); if (history && 'state' in history) { this.supportsHistory = true; } this.replaceState(this.formatURL(this.getURL())); }
[ "function", "(", ")", "{", "var", "history", "=", "_emberMetalProperty_get", ".", "get", "(", "this", ",", "'history'", ")", "||", "window", ".", "history", ";", "_emberMetalProperty_set", ".", "set", "(", "this", ",", "'history'", ",", "history", ")", ";"...
Used to set state on first call to setURL @private @method initState
[ "Used", "to", "set", "state", "on", "first", "call", "to", "setURL" ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L26706-L26715
24,063
ember-cli/loader.js
benchmarks/scenarios/ember.js
function () { var location = _emberMetalProperty_get.get(this, 'location'); var path = location.pathname; var rootURL = _emberMetalProperty_get.get(this, 'rootURL'); var baseURL = _emberMetalProperty_get.get(this, 'baseURL'); // remove trailing slashes if they exists rootURL = root...
javascript
function () { var location = _emberMetalProperty_get.get(this, 'location'); var path = location.pathname; var rootURL = _emberMetalProperty_get.get(this, 'rootURL'); var baseURL = _emberMetalProperty_get.get(this, 'baseURL'); // remove trailing slashes if they exists rootURL = root...
[ "function", "(", ")", "{", "var", "location", "=", "_emberMetalProperty_get", ".", "get", "(", "this", ",", "'location'", ")", ";", "var", "path", "=", "location", ".", "pathname", ";", "var", "rootURL", "=", "_emberMetalProperty_get", ".", "get", "(", "th...
Returns the current `location.pathname` without `rootURL` or `baseURL` @private @method getURL @return url {String}
[ "Returns", "the", "current", "location", ".", "pathname", "without", "rootURL", "or", "baseURL" ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L26731-L26750
24,064
ember-cli/loader.js
benchmarks/scenarios/ember.js
function (path) { var state = this.getState(); path = this.formatURL(path); if (!state || state.path !== path) { this.pushState(path); } }
javascript
function (path) { var state = this.getState(); path = this.formatURL(path); if (!state || state.path !== path) { this.pushState(path); } }
[ "function", "(", "path", ")", "{", "var", "state", "=", "this", ".", "getState", "(", ")", ";", "path", "=", "this", ".", "formatURL", "(", "path", ")", ";", "if", "(", "!", "state", "||", "state", ".", "path", "!==", "path", ")", "{", "this", ...
Uses `history.pushState` to update the url without a page reload. @private @method setURL @param path {String}
[ "Uses", "history", ".", "pushState", "to", "update", "the", "url", "without", "a", "page", "reload", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L26758-L26765
24,065
ember-cli/loader.js
benchmarks/scenarios/ember.js
function (path) { var state = this.getState(); path = this.formatURL(path); if (!state || state.path !== path) { this.replaceState(path); } }
javascript
function (path) { var state = this.getState(); path = this.formatURL(path); if (!state || state.path !== path) { this.replaceState(path); } }
[ "function", "(", "path", ")", "{", "var", "state", "=", "this", ".", "getState", "(", ")", ";", "path", "=", "this", ".", "formatURL", "(", "path", ")", ";", "if", "(", "!", "state", "||", "state", ".", "path", "!==", "path", ")", "{", "this", ...
Uses `history.replaceState` to update the url without a page reload or history modification. @private @method replaceURL @param path {String}
[ "Uses", "history", ".", "replaceState", "to", "update", "the", "url", "without", "a", "page", "reload", "or", "history", "modification", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L26774-L26781
24,066
ember-cli/loader.js
benchmarks/scenarios/ember.js
function (callback) { var _this = this; var guid = _emberMetalUtils.guidFor(this); _emberViewsSystemJquery.default(window).on('popstate.ember-location-' + guid, function (e) { // Ignore initial page load popstate event in Chrome if (!popstateFired) { popstateFired = true; ...
javascript
function (callback) { var _this = this; var guid = _emberMetalUtils.guidFor(this); _emberViewsSystemJquery.default(window).on('popstate.ember-location-' + guid, function (e) { // Ignore initial page load popstate event in Chrome if (!popstateFired) { popstateFired = true; ...
[ "function", "(", "callback", ")", "{", "var", "_this", "=", "this", ";", "var", "guid", "=", "_emberMetalUtils", ".", "guidFor", "(", "this", ")", ";", "_emberViewsSystemJquery", ".", "default", "(", "window", ")", ".", "on", "(", "'popstate.ember-location-'...
Register a callback to be invoked whenever the browser history changes, including using forward and back buttons. @private @method onUpdateURL @param callback {Function}
[ "Register", "a", "callback", "to", "be", "invoked", "whenever", "the", "browser", "history", "changes", "including", "using", "forward", "and", "back", "buttons", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L26840-L26855
24,067
ember-cli/loader.js
benchmarks/scenarios/ember.js
generateController
function generateController(owner, controllerName, context) { generateControllerFactory(owner, controllerName, context); var fullName = 'controller:' + controllerName; var instance = owner.lookup(fullName); if (_emberMetalProperty_get.get(instance, 'namespace.LOG_ACTIVE_GENERATION')) { _emberMet...
javascript
function generateController(owner, controllerName, context) { generateControllerFactory(owner, controllerName, context); var fullName = 'controller:' + controllerName; var instance = owner.lookup(fullName); if (_emberMetalProperty_get.get(instance, 'namespace.LOG_ACTIVE_GENERATION')) { _emberMet...
[ "function", "generateController", "(", "owner", ",", "controllerName", ",", "context", ")", "{", "generateControllerFactory", "(", "owner", ",", "controllerName", ",", "context", ")", ";", "var", "fullName", "=", "'controller:'", "+", "controllerName", ";", "var",...
Generates and instantiates a controller. The type of the generated controller factory is derived from the context. If the context is an array an array controller is generated, if an object, an object controller otherwise, a basic controller is generated. @for Ember @method generateController @private @since 1.3.0
[ "Generates", "and", "instantiates", "a", "controller", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L27460-L27471
24,068
ember-cli/loader.js
benchmarks/scenarios/ember.js
function (name) { var route = _containerOwner.getOwner(this).lookup('route:' + name); if (!route) { return {}; } var transition = this.router.router.activeTransition; var state = transition ? transition.state : this.router.router.state; var params = {}; _emberMetalAs...
javascript
function (name) { var route = _containerOwner.getOwner(this).lookup('route:' + name); if (!route) { return {}; } var transition = this.router.router.activeTransition; var state = transition ? transition.state : this.router.router.state; var params = {}; _emberMetalAs...
[ "function", "(", "name", ")", "{", "var", "route", "=", "_containerOwner", ".", "getOwner", "(", "this", ")", ".", "lookup", "(", "'route:'", "+", "name", ")", ";", "if", "(", "!", "route", ")", "{", "return", "{", "}", ";", "}", "var", "transition...
Retrieves parameters, for current route using the state.params variable and getQueryParamsFor, using the supplied routeName. @method paramsFor @param {String} name @public
[ "Retrieves", "parameters", "for", "current", "route", "using", "the", "state", ".", "params", "variable", "and", "getQueryParamsFor", "using", "the", "supplied", "routeName", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L27809-L27824
24,069
ember-cli/loader.js
benchmarks/scenarios/ember.js
function (value, urlKey, defaultValueType) { // urlKey isn't used here, but anyone overriding // can use it to provide deserialization specific // to a certain query param. // Use the defaultValueType of the default value (the initial value assigned to a // controller query param property...
javascript
function (value, urlKey, defaultValueType) { // urlKey isn't used here, but anyone overriding // can use it to provide deserialization specific // to a certain query param. // Use the defaultValueType of the default value (the initial value assigned to a // controller query param property...
[ "function", "(", "value", ",", "urlKey", ",", "defaultValueType", ")", "{", "// urlKey isn't used here, but anyone overriding", "// can use it to provide deserialization specific", "// to a certain query param.", "// Use the defaultValueType of the default value (the initial value assigned t...
Deserializes value of the query parameter based on defaultValueType @method deserializeQueryParam @param {Object} value @param {String} urlKey @param {String} defaultValueType @private
[ "Deserializes", "value", "of", "the", "query", "parameter", "based", "on", "defaultValueType" ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L27862-L27877
24,070
ember-cli/loader.js
benchmarks/scenarios/ember.js
function (oldInfos, newInfos, transition) { _emberMetalRun_loop.default.once(this, this.trigger, 'willTransition', transition); if (_emberMetalProperty_get.get(this, 'namespace').LOG_TRANSITIONS) { _emberMetalLogger.default.log('Preparing to transition from \'' + EmberRouter._routePath(oldInfos) + ...
javascript
function (oldInfos, newInfos, transition) { _emberMetalRun_loop.default.once(this, this.trigger, 'willTransition', transition); if (_emberMetalProperty_get.get(this, 'namespace').LOG_TRANSITIONS) { _emberMetalLogger.default.log('Preparing to transition from \'' + EmberRouter._routePath(oldInfos) + ...
[ "function", "(", "oldInfos", ",", "newInfos", ",", "transition", ")", "{", "_emberMetalRun_loop", ".", "default", ".", "once", "(", "this", ",", "this", ".", "trigger", ",", "'willTransition'", ",", "transition", ")", ";", "if", "(", "_emberMetalProperty_get",...
Handles notifying any listeners of an impending URL change. Triggers the router level `willTransition` hook. @method willTransition @public @since 1.11.0
[ "Handles", "notifying", "any", "listeners", "of", "an", "impending", "URL", "change", ".", "Triggers", "the", "router", "level", "willTransition", "hook", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L29844-L29850
24,071
ember-cli/loader.js
benchmarks/scenarios/ember.js
function (leafRouteName) { if (this._qpCache[leafRouteName]) { return this._qpCache[leafRouteName]; } var map = {}; var qps = []; this._qpCache[leafRouteName] = { map: map, qps: qps }; var routerjs = this.router; var recogHandlerInfos = routerjs....
javascript
function (leafRouteName) { if (this._qpCache[leafRouteName]) { return this._qpCache[leafRouteName]; } var map = {}; var qps = []; this._qpCache[leafRouteName] = { map: map, qps: qps }; var routerjs = this.router; var recogHandlerInfos = routerjs....
[ "function", "(", "leafRouteName", ")", "{", "if", "(", "this", ".", "_qpCache", "[", "leafRouteName", "]", ")", "{", "return", "this", ".", "_qpCache", "[", "leafRouteName", "]", ";", "}", "var", "map", "=", "{", "}", ";", "var", "qps", "=", "[", "...
Returns a merged query params meta object for a given route. Useful for asking a route what its known query params are. @private
[ "Returns", "a", "merged", "query", "params", "meta", "object", "for", "a", "given", "route", ".", "Useful", "for", "asking", "a", "route", "what", "its", "known", "query", "params", "are", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L30228-L30260
24,072
ember-cli/loader.js
benchmarks/scenarios/ember.js
queryParamsHelper
function queryParamsHelper(params, hash) { _emberMetalDebug.assert('The `query-params` helper only accepts hash parameters, e.g. (query-params queryParamPropertyName=\'foo\') as opposed to just (query-params \'foo\')', params.length === 0); return _emberRoutingSystemQuery_params.default.create({ values: ...
javascript
function queryParamsHelper(params, hash) { _emberMetalDebug.assert('The `query-params` helper only accepts hash parameters, e.g. (query-params queryParamPropertyName=\'foo\') as opposed to just (query-params \'foo\')', params.length === 0); return _emberRoutingSystemQuery_params.default.create({ values: ...
[ "function", "queryParamsHelper", "(", "params", ",", "hash", ")", "{", "_emberMetalDebug", ".", "assert", "(", "'The `query-params` helper only accepts hash parameters, e.g. (query-params queryParamPropertyName=\\'foo\\') as opposed to just (query-params \\'foo\\')'", ",", "params", "....
This is a helper to be used in conjunction with the link-to helper. It will supply url query parameters to the target route. Example ```handlebars {{#link-to 'posts' (query-params direction="asc")}}Sort{{/link-to}} ``` @method query-params @for Ember.Templates.helpers @param {Object} hash takes a hash of query param...
[ "This", "is", "a", "helper", "to", "be", "used", "in", "conjunction", "with", "the", "link", "-", "to", "helper", ".", "It", "will", "supply", "url", "query", "parameters", "to", "the", "target", "route", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L31045-L31051
24,073
ember-cli/loader.js
benchmarks/scenarios/ember.js
max
function max(dependentKey) { return reduceMacro(dependentKey, function (max, item) { return Math.max(max, item); }, -Infinity); }
javascript
function max(dependentKey) { return reduceMacro(dependentKey, function (max, item) { return Math.max(max, item); }, -Infinity); }
[ "function", "max", "(", "dependentKey", ")", "{", "return", "reduceMacro", "(", "dependentKey", ",", "function", "(", "max", ",", "item", ")", "{", "return", "Math", ".", "max", "(", "max", ",", "item", ")", ";", "}", ",", "-", "Infinity", ")", ";", ...
A computed property that calculates the maximum value in the dependent array. This will return `-Infinity` when the dependent array is empty. ```javascript var Person = Ember.Object.extend({ childAges: Ember.computed.mapBy('children', 'age'), maxChildAge: Ember.computed.max('childAges') }); var lordByron = Person.cre...
[ "A", "computed", "property", "that", "calculates", "the", "maximum", "value", "in", "the", "dependent", "array", ".", "This", "will", "return", "-", "Infinity", "when", "the", "dependent", "array", "is", "empty", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L33017-L33021
24,074
ember-cli/loader.js
benchmarks/scenarios/ember.js
filterBy
function filterBy(dependentKey, propertyKey, value) { var callback; if (arguments.length === 2) { callback = function (item) { return _emberMetalProperty_get.get(item, propertyKey); }; } else { callback = function (item) { return _emberMetalProperty_get.get(item, propertyK...
javascript
function filterBy(dependentKey, propertyKey, value) { var callback; if (arguments.length === 2) { callback = function (item) { return _emberMetalProperty_get.get(item, propertyKey); }; } else { callback = function (item) { return _emberMetalProperty_get.get(item, propertyK...
[ "function", "filterBy", "(", "dependentKey", ",", "propertyKey", ",", "value", ")", "{", "var", "callback", ";", "if", "(", "arguments", ".", "length", "===", "2", ")", "{", "callback", "=", "function", "(", "item", ")", "{", "return", "_emberMetalProperty...
Filters the array by the property and value ```javascript var Hamster = Ember.Object.extend({ remainingChores: Ember.computed.filterBy('chores', 'done', false) }); var hamster = Hamster.create({ chores: [ { name: 'cook', done: true }, { name: 'clean', done: true }, { name: 'write more unit tests', done: false } ] });...
[ "Filters", "the", "array", "by", "the", "property", "and", "value" ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L33216-L33230
24,075
ember-cli/loader.js
benchmarks/scenarios/ember.js
setDiff
function setDiff(setAProperty, setBProperty) { if (arguments.length !== 2) { throw new _emberMetalError.default('setDiff requires exactly two dependent arrays.'); } return _emberMetalComputed.computed(setAProperty + '.[]', setBProperty + '.[]', function () { var setA = this.get(setAProperty); ...
javascript
function setDiff(setAProperty, setBProperty) { if (arguments.length !== 2) { throw new _emberMetalError.default('setDiff requires exactly two dependent arrays.'); } return _emberMetalComputed.computed(setAProperty + '.[]', setBProperty + '.[]', function () { var setA = this.get(setAProperty); ...
[ "function", "setDiff", "(", "setAProperty", ",", "setBProperty", ")", "{", "if", "(", "arguments", ".", "length", "!==", "2", ")", "{", "throw", "new", "_emberMetalError", ".", "default", "(", "'setDiff requires exactly two dependent arrays.'", ")", ";", "}", "r...
A computed property which returns a new array with all the properties from the first dependent array that are not in the second dependent array. Example ```javascript var Hamster = Ember.Object.extend({ likes: ['banana', 'grape', 'kale'], wants: Ember.computed.setDiff('likes', 'fruits') }); var hamster = Hamster.cre...
[ "A", "computed", "property", "which", "returns", "a", "new", "array", "with", "all", "the", "properties", "from", "the", "first", "dependent", "array", "that", "are", "not", "in", "the", "second", "dependent", "array", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L33441-L33461
24,076
ember-cli/loader.js
benchmarks/scenarios/ember.js
collect
function collect() { for (var _len3 = arguments.length, dependentKeys = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { dependentKeys[_key3] = arguments[_key3]; } return multiArrayMacro(dependentKeys, function () { var properties = _emberMetalGet_properties.default(this, dependentKeys); ...
javascript
function collect() { for (var _len3 = arguments.length, dependentKeys = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { dependentKeys[_key3] = arguments[_key3]; } return multiArrayMacro(dependentKeys, function () { var properties = _emberMetalGet_properties.default(this, dependentKeys); ...
[ "function", "collect", "(", ")", "{", "for", "(", "var", "_len3", "=", "arguments", ".", "length", ",", "dependentKeys", "=", "Array", "(", "_len3", ")", ",", "_key3", "=", "0", ";", "_key3", "<", "_len3", ";", "_key3", "++", ")", "{", "dependentKeys...
A computed property that returns the array of values for the provided dependent properties. Example ```javascript var Hamster = Ember.Object.extend({ clothes: Ember.computed.collect('hat', 'shirt') }); var hamster = Hamster.create(); hamster.get('clothes'); // [null, null] hamster.set('hat', 'Camp Hat'); hamster.se...
[ "A", "computed", "property", "that", "returns", "the", "array", "of", "values", "for", "the", "provided", "dependent", "properties", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L33490-L33509
24,077
ember-cli/loader.js
benchmarks/scenarios/ember.js
copy
function copy(obj, deep) { // fast paths if ('object' !== typeof obj || obj === null) { return obj; // can't copy primitives } if (_emberRuntimeMixinsCopyable.default && _emberRuntimeMixinsCopyable.default.detect(obj)) { return obj.copy(deep); } return _copy(obj, deep, deep ? [] : ...
javascript
function copy(obj, deep) { // fast paths if ('object' !== typeof obj || obj === null) { return obj; // can't copy primitives } if (_emberRuntimeMixinsCopyable.default && _emberRuntimeMixinsCopyable.default.detect(obj)) { return obj.copy(deep); } return _copy(obj, deep, deep ? [] : ...
[ "function", "copy", "(", "obj", ",", "deep", ")", "{", "// fast paths", "if", "(", "'object'", "!==", "typeof", "obj", "||", "obj", "===", "null", ")", "{", "return", "obj", ";", "// can't copy primitives", "}", "if", "(", "_emberRuntimeMixinsCopyable", ".",...
Creates a shallow copy of the passed object. A deep copy of the object is returned if the optional `deep` argument is `true`. If the passed object implements the `Ember.Copyable` interface, then this function will delegate to the object's `copy()` method and return the result. See `Ember.Copyable` for further details....
[ "Creates", "a", "shallow", "copy", "of", "the", "passed", "object", ".", "A", "deep", "copy", "of", "the", "object", "is", "returned", "if", "the", "optional", "deep", "argument", "is", "true", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L33824-L33835
24,078
ember-cli/loader.js
benchmarks/scenarios/ember.js
createInjectionHelper
function createInjectionHelper(type, validator) { typeValidators[type] = validator; inject[type] = function (name) { return new _emberMetalInjected_property.default(type, name); }; }
javascript
function createInjectionHelper(type, validator) { typeValidators[type] = validator; inject[type] = function (name) { return new _emberMetalInjected_property.default(type, name); }; }
[ "function", "createInjectionHelper", "(", "type", ",", "validator", ")", "{", "typeValidators", "[", "type", "]", "=", "validator", ";", "inject", "[", "type", "]", "=", "function", "(", "name", ")", "{", "return", "new", "_emberMetalInjected_property", ".", ...
This method allows other Ember modules to register injection helpers for a given container type. Helpers are exported to the `inject` namespace as the container type itself. @private @method createInjectionHelper @since 1.10.0 @for Ember @param {String} type The container type the helper will inject @param {Function} ...
[ "This", "method", "allows", "other", "Ember", "modules", "to", "register", "injection", "helpers", "for", "a", "given", "container", "type", ".", "Helpers", "are", "exported", "to", "the", "inject", "namespace", "as", "the", "container", "type", "itself", "." ...
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L34357-L34363
24,079
ember-cli/loader.js
benchmarks/scenarios/ember.js
validatePropertyInjections
function validatePropertyInjections(factory) { var proto = factory.proto(); var types = []; var key, desc, validator, i, l; for (key in proto) { desc = proto[key]; if (desc instanceof _emberMetalInjected_property.default && types.indexOf(desc.type) === -1) { types.push(desc.type); ...
javascript
function validatePropertyInjections(factory) { var proto = factory.proto(); var types = []; var key, desc, validator, i, l; for (key in proto) { desc = proto[key]; if (desc instanceof _emberMetalInjected_property.default && types.indexOf(desc.type) === -1) { types.push(desc.type); ...
[ "function", "validatePropertyInjections", "(", "factory", ")", "{", "var", "proto", "=", "factory", ".", "proto", "(", ")", ";", "var", "types", "=", "[", "]", ";", "var", "key", ",", "desc", ",", "validator", ",", "i", ",", "l", ";", "for", "(", "...
Validation function that runs per-type validation functions once for each injected type encountered. @private @method validatePropertyInjections @since 1.10.0 @for Ember @param {Object} factory The factory object
[ "Validation", "function", "that", "runs", "per", "-", "type", "validation", "functions", "once", "for", "each", "injected", "type", "encountered", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L34376-L34399
24,080
ember-cli/loader.js
benchmarks/scenarios/ember.js
function () { _emberMetalDebug.deprecate('`frozenCopy` is deprecated, use `Object.freeze` instead.', false, { id: 'ember-runtime.frozen-copy', until: '3.0.0' }); if (_emberRuntimeMixinsFreezable.Freezable && _emberRuntimeMixinsFreezable.Freezable.detect(this)) { return _emberMetalProperty_get.get(th...
javascript
function () { _emberMetalDebug.deprecate('`frozenCopy` is deprecated, use `Object.freeze` instead.', false, { id: 'ember-runtime.frozen-copy', until: '3.0.0' }); if (_emberRuntimeMixinsFreezable.Freezable && _emberRuntimeMixinsFreezable.Freezable.detect(this)) { return _emberMetalProperty_get.get(th...
[ "function", "(", ")", "{", "_emberMetalDebug", ".", "deprecate", "(", "'`frozenCopy` is deprecated, use `Object.freeze` instead.'", ",", "false", ",", "{", "id", ":", "'ember-runtime.frozen-copy'", ",", "until", ":", "'3.0.0'", "}", ")", ";", "if", "(", "_emberRunti...
If the object implements `Ember.Freezable`, then this will return a new copy if the object is not frozen and the receiver if the object is frozen. Raises an exception if you try to call this method on a object that does not support freezing. You should use this method whenever you want a copy of a freezable object sinc...
[ "If", "the", "object", "implements", "Ember", ".", "Freezable", "then", "this", "will", "return", "a", "new", "copy", "if", "the", "object", "is", "not", "frozen", "and", "the", "receiver", "if", "the", "object", "is", "frozen", ".", "Raises", "an", "exc...
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L35560-L35567
24,081
ember-cli/loader.js
benchmarks/scenarios/ember.js
function () { var sortKeys = arguments; return this.toArray().sort(function (a, b) { for (var i = 0; i < sortKeys.length; i++) { var key = sortKeys[i]; var propA = _emberMetalProperty_get.get(a, key); var propB = _emberMetalProperty_get.get(b, key); // return...
javascript
function () { var sortKeys = arguments; return this.toArray().sort(function (a, b) { for (var i = 0; i < sortKeys.length; i++) { var key = sortKeys[i]; var propA = _emberMetalProperty_get.get(a, key); var propB = _emberMetalProperty_get.get(b, key); // return...
[ "function", "(", ")", "{", "var", "sortKeys", "=", "arguments", ";", "return", "this", ".", "toArray", "(", ")", ".", "sort", "(", "function", "(", "a", ",", "b", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "sortKeys", ".", "leng...
Converts the enumerable into an array and sorts by the keys specified in the argument. You may provide multiple arguments to sort by multiple properties. @method sortBy @param {String} property name(s) to sort on @return {Array} The sorted array. @since 1.2.0 @public
[ "Converts", "the", "enumerable", "into", "an", "array", "and", "sorts", "by", "the", "keys", "specified", "in", "the", "argument", ".", "You", "may", "provide", "multiple", "arguments", "to", "sort", "by", "multiple", "properties", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L36528-L36545
24,082
ember-cli/loader.js
benchmarks/scenarios/ember.js
function (objects) { var _this = this; _emberMetalProperty_events.beginPropertyChanges(this); objects.forEach(function (obj) { return _this.addObject(obj); }); _emberMetalProperty_events.endPropertyChanges(this); return this; }
javascript
function (objects) { var _this = this; _emberMetalProperty_events.beginPropertyChanges(this); objects.forEach(function (obj) { return _this.addObject(obj); }); _emberMetalProperty_events.endPropertyChanges(this); return this; }
[ "function", "(", "objects", ")", "{", "var", "_this", "=", "this", ";", "_emberMetalProperty_events", ".", "beginPropertyChanges", "(", "this", ")", ";", "objects", ".", "forEach", "(", "function", "(", "obj", ")", "{", "return", "_this", ".", "addObject", ...
Adds each object in the passed enumerable to the receiver. @method addObjects @param {Ember.Enumerable} objects the objects to add. @return {Object} receiver @public
[ "Adds", "each", "object", "in", "the", "passed", "enumerable", "to", "the", "receiver", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L37256-L37265
24,083
ember-cli/loader.js
benchmarks/scenarios/ember.js
function (key, value) { var ret; // = this.reducedProperty(key, value); if (value !== undefined && ret === undefined) { ret = this[key] = value; } return ret; }
javascript
function (key, value) { var ret; // = this.reducedProperty(key, value); if (value !== undefined && ret === undefined) { ret = this[key] = value; } return ret; }
[ "function", "(", "key", ",", "value", ")", "{", "var", "ret", ";", "// = this.reducedProperty(key, value);", "if", "(", "value", "!==", "undefined", "&&", "ret", "===", "undefined", ")", "{", "ret", "=", "this", "[", "key", "]", "=", "value", ";", "}", ...
If you ask for an unknown property, then try to collect the value from member items.
[ "If", "you", "ask", "for", "an", "unknown", "property", "then", "try", "to", "collect", "the", "value", "from", "member", "items", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L40058-L40064
24,084
ember-cli/loader.js
benchmarks/scenarios/ember.js
typeOf
function typeOf(item) { if (item === null) { return 'null'; } if (item === undefined) { return 'undefined'; } var ret = TYPE_MAP[toString.call(item)] || 'object'; if (ret === 'function') { if (_emberRuntimeSystemObject.default.detect(item)) { ret = 'class'; } ...
javascript
function typeOf(item) { if (item === null) { return 'null'; } if (item === undefined) { return 'undefined'; } var ret = TYPE_MAP[toString.call(item)] || 'object'; if (ret === 'function') { if (_emberRuntimeSystemObject.default.detect(item)) { ret = 'class'; } ...
[ "function", "typeOf", "(", "item", ")", "{", "if", "(", "item", "===", "null", ")", "{", "return", "'null'", ";", "}", "if", "(", "item", "===", "undefined", ")", "{", "return", "'undefined'", ";", "}", "var", "ret", "=", "TYPE_MAP", "[", "toString",...
Returns a consistent type for the passed object. Use this instead of the built-in `typeof` to get the type of an item. It will return the same result across all browsers and includes a bit more detail. Here is what will be returned: | Return Value | Meaning | |-----------...
[ "Returns", "a", "consistent", "type", "for", "the", "passed", "object", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L40726-L40750
24,085
ember-cli/loader.js
benchmarks/scenarios/ember.js
function (context, callback) { if (!this.waiters) { return; } if (arguments.length === 1) { callback = context; context = null; } this.waiters = _emberRuntimeSystemNative_array.A(this.waiters.filter(function (elt) { return !(elt[0] === context && elt[1] === ...
javascript
function (context, callback) { if (!this.waiters) { return; } if (arguments.length === 1) { callback = context; context = null; } this.waiters = _emberRuntimeSystemNative_array.A(this.waiters.filter(function (elt) { return !(elt[0] === context && elt[1] === ...
[ "function", "(", "context", ",", "callback", ")", "{", "if", "(", "!", "this", ".", "waiters", ")", "{", "return", ";", "}", "if", "(", "arguments", ".", "length", "===", "1", ")", "{", "callback", "=", "context", ";", "context", "=", "null", ";", ...
`unregisterWaiter` is used to unregister a callback that was registered with `registerWaiter`. @public @method unregisterWaiter @param {Object} context (optional) @param {Function} callback @since 1.2.0
[ "unregisterWaiter", "is", "used", "to", "unregister", "a", "callback", "that", "was", "registered", "with", "registerWaiter", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L43206-L43217
24,086
ember-cli/loader.js
benchmarks/scenarios/ember.js
protoWrap
function protoWrap(proto, name, callback, isAsync) { proto[name] = function () { for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } if (isAsync) { return callback.apply(this, args); } else { ...
javascript
function protoWrap(proto, name, callback, isAsync) { proto[name] = function () { for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } if (isAsync) { return callback.apply(this, args); } else { ...
[ "function", "protoWrap", "(", "proto", ",", "name", ",", "callback", ",", "isAsync", ")", "{", "proto", "[", "name", "]", "=", "function", "(", ")", "{", "for", "(", "var", "_len2", "=", "arguments", ".", "length", ",", "args", "=", "Array", "(", "...
This method is no longer needed But still here for backwards compatibility of helper chaining
[ "This", "method", "is", "no", "longer", "needed", "But", "still", "here", "for", "backwards", "compatibility", "of", "helper", "chaining" ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L43405-L43419
24,087
ember-cli/loader.js
benchmarks/scenarios/ember.js
isolate
function isolate(fn, val) { var value, lastPromise; // Reset lastPromise for nested helpers Test.lastPromise = null; value = fn(val); lastPromise = Test.lastPromise; Test.lastPromise = null; // If the method returned a promise // return that promise. If not, // return the last as...
javascript
function isolate(fn, val) { var value, lastPromise; // Reset lastPromise for nested helpers Test.lastPromise = null; value = fn(val); lastPromise = Test.lastPromise; Test.lastPromise = null; // If the method returned a promise // return that promise. If not, // return the last as...
[ "function", "isolate", "(", "fn", ",", "val", ")", "{", "var", "value", ",", "lastPromise", ";", "// Reset lastPromise for nested helpers", "Test", ".", "lastPromise", "=", "null", ";", "value", "=", "fn", "(", "val", ")", ";", "lastPromise", "=", "Test", ...
This method isolates nested async methods so that they don't conflict with other last promises. 1. Set `Ember.Test.lastPromise` to null 2. Invoke method 3. Return the last promise created during method
[ "This", "method", "isolates", "nested", "async", "methods", "so", "that", "they", "don", "t", "conflict", "with", "other", "last", "promises", ".", "1", ".", "Set", "Ember", ".", "Test", ".", "lastPromise", "to", "null", "2", ".", "Invoke", "method", "3"...
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L43445-L43468
24,088
ember-cli/loader.js
benchmarks/scenarios/ember.js
function (klass) { _emberMetalDebug.deprecate('nearestChildOf has been deprecated.', false, { id: 'ember-views.nearest-child-of', until: '3.0.0' }); var view = _emberMetalProperty_get.get(this, 'parentView'); while (view) { if (_emberMetalProperty_get.get(view, 'parentView') instanceof klass...
javascript
function (klass) { _emberMetalDebug.deprecate('nearestChildOf has been deprecated.', false, { id: 'ember-views.nearest-child-of', until: '3.0.0' }); var view = _emberMetalProperty_get.get(this, 'parentView'); while (view) { if (_emberMetalProperty_get.get(view, 'parentView') instanceof klass...
[ "function", "(", "klass", ")", "{", "_emberMetalDebug", ".", "deprecate", "(", "'nearestChildOf has been deprecated.'", ",", "false", ",", "{", "id", ":", "'ember-views.nearest-child-of'", ",", "until", ":", "'3.0.0'", "}", ")", ";", "var", "view", "=", "_emberM...
Return the nearest ancestor whose parent is an instance of `klass`. @method nearestChildOf @param {Class} klass Subclass of Ember.View (or Ember.View itself) @return Ember.View @deprecated @private
[ "Return", "the", "nearest", "ancestor", "whose", "parent", "is", "an", "instance", "of", "klass", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L44394-L44405
24,089
ember-cli/loader.js
benchmarks/scenarios/ember.js
function (block, renderNode) { if (_renderView === undefined) { _renderView = require('ember-htmlbars/system/render-view'); } return _renderView.renderHTMLBarsBlock(this, block, renderNode); }
javascript
function (block, renderNode) { if (_renderView === undefined) { _renderView = require('ember-htmlbars/system/render-view'); } return _renderView.renderHTMLBarsBlock(this, block, renderNode); }
[ "function", "(", "block", ",", "renderNode", ")", "{", "if", "(", "_renderView", "===", "undefined", ")", "{", "_renderView", "=", "require", "(", "'ember-htmlbars/system/render-view'", ")", ";", "}", "return", "_renderView", ".", "renderHTMLBarsBlock", "(", "th...
Called on your view when it should push strings of HTML into a `Ember.RenderBuffer`. Most users will want to override the `template` or `templateName` properties instead of this method. By default, `Ember.View` will look for a function in the `template` property and invoke it with the value of `context`. The value of `...
[ "Called", "on", "your", "view", "when", "it", "should", "push", "strings", "of", "HTML", "into", "a", "Ember", ".", "RenderBuffer", ".", "Most", "users", "will", "want", "to", "override", "the", "template", "or", "templateName", "properties", "instead", "of"...
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L44472-L44478
24,090
ember-cli/loader.js
benchmarks/scenarios/ember.js
function (property) { var view = _emberMetalProperty_get.get(this, 'parentView'); while (view) { if (property in view) { return view; } view = _emberMetalProperty_get.get(view, 'parentView'); } }
javascript
function (property) { var view = _emberMetalProperty_get.get(this, 'parentView'); while (view) { if (property in view) { return view; } view = _emberMetalProperty_get.get(view, 'parentView'); } }
[ "function", "(", "property", ")", "{", "var", "view", "=", "_emberMetalProperty_get", ".", "get", "(", "this", ",", "'parentView'", ")", ";", "while", "(", "view", ")", "{", "if", "(", "property", "in", "view", ")", "{", "return", "view", ";", "}", "...
Return the nearest ancestor that has a given property. @method nearestWithProperty @param {String} property A property name @return Ember.View @private
[ "Return", "the", "nearest", "ancestor", "that", "has", "a", "given", "property", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L45221-L45230
24,091
ember-cli/loader.js
benchmarks/scenarios/ember.js
function (selector) { var target = _emberViewsSystemJquery.default(selector); _emberMetalDebug.assert('You tried to replace in (' + selector + ') but that isn\'t in the DOM', target.length > 0); _emberMetalDebug.assert('You cannot replace an existing Ember.View.', !target.is('.ember-view') && !target...
javascript
function (selector) { var target = _emberViewsSystemJquery.default(selector); _emberMetalDebug.assert('You tried to replace in (' + selector + ') but that isn\'t in the DOM', target.length > 0); _emberMetalDebug.assert('You cannot replace an existing Ember.View.', !target.is('.ember-view') && !target...
[ "function", "(", "selector", ")", "{", "var", "target", "=", "_emberViewsSystemJquery", ".", "default", "(", "selector", ")", ";", "_emberMetalDebug", ".", "assert", "(", "'You tried to replace in ('", "+", "selector", "+", "') but that isn\\'t in the DOM'", ",", "t...
Replaces the content of the specified parent element with this view's element. If the view does not have an HTML representation yet, the element will be generated automatically. Note that this method just schedules the view to be appended; the DOM element will not be appended to the given element until all bindings hav...
[ "Replaces", "the", "content", "of", "the", "specified", "parent", "element", "with", "this", "view", "s", "element", ".", "If", "the", "view", "does", "not", "have", "an", "HTML", "representation", "yet", "the", "element", "will", "be", "generated", "automat...
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L45390-L45399
24,092
ember-cli/loader.js
benchmarks/scenarios/ember.js
normalizeComponentAttributes
function normalizeComponentAttributes(component, isAngleBracket, attrs) { var normalized = {}; var attributeBindings = component.attributeBindings; var streamBasePath = component.isComponent ? '' : 'view.'; var i, l; if (attrs.id && _emberHtmlbarsHooksGetValue.default(attrs.id)) { // Do not a...
javascript
function normalizeComponentAttributes(component, isAngleBracket, attrs) { var normalized = {}; var attributeBindings = component.attributeBindings; var streamBasePath = component.isComponent ? '' : 'view.'; var i, l; if (attrs.id && _emberHtmlbarsHooksGetValue.default(attrs.id)) { // Do not a...
[ "function", "normalizeComponentAttributes", "(", "component", ",", "isAngleBracket", ",", "attrs", ")", "{", "var", "normalized", "=", "{", "}", ";", "var", "attributeBindings", "=", "component", ".", "attributeBindings", ";", "var", "streamBasePath", "=", "compon...
Takes a component and builds a normalized set of attribute bindings consumable by HTMLBars' `attribute` hook.
[ "Takes", "a", "component", "and", "builds", "a", "normalized", "set", "of", "attribute", "bindings", "consumable", "by", "HTMLBars", "attribute", "hook", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L46417-L46494
24,093
ember-cli/loader.js
benchmarks/scenarios/ember.js
function (addedEvents, rootElement) { var event; var events = this._finalEvents = _emberMetalAssign.default({}, _emberMetalProperty_get.get(this, 'events'), addedEvents); if (!_emberMetalIs_none.default(rootElement)) { _emberMetalProperty_set.set(this, 'rootElement', rootElement); } ...
javascript
function (addedEvents, rootElement) { var event; var events = this._finalEvents = _emberMetalAssign.default({}, _emberMetalProperty_get.get(this, 'events'), addedEvents); if (!_emberMetalIs_none.default(rootElement)) { _emberMetalProperty_set.set(this, 'rootElement', rootElement); } ...
[ "function", "(", "addedEvents", ",", "rootElement", ")", "{", "var", "event", ";", "var", "events", "=", "this", ".", "_finalEvents", "=", "_emberMetalAssign", ".", "default", "(", "{", "}", ",", "_emberMetalProperty_get", ".", "get", "(", "this", ",", "'e...
Sets up event listeners for standard browser events. This will be called after the browser sends a `DOMContentReady` event. By default, it will set up all of the listeners on the document body. If you would like to register the listeners on a different element, set the event dispatcher's `root` property. @private @meth...
[ "Sets", "up", "event", "listeners", "for", "standard", "browser", "events", ".", "This", "will", "be", "called", "after", "the", "browser", "sends", "a", "DOMContentReady", "event", ".", "By", "default", "it", "will", "set", "up", "all", "of", "the", "list...
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L46700-L46723
24,094
ember-cli/loader.js
benchmarks/scenarios/ember.js
function (rootElement, event, eventName) { var self = this; var owner = _containerOwner.getOwner(this); var viewRegistry = owner && owner.lookup('-view-registry:main') || _emberViewsViewsView.default.views; if (eventName === null) { return; } rootElement.on(event + '.ember...
javascript
function (rootElement, event, eventName) { var self = this; var owner = _containerOwner.getOwner(this); var viewRegistry = owner && owner.lookup('-view-registry:main') || _emberViewsViewsView.default.views; if (eventName === null) { return; } rootElement.on(event + '.ember...
[ "function", "(", "rootElement", ",", "event", ",", "eventName", ")", "{", "var", "self", "=", "this", ";", "var", "owner", "=", "_containerOwner", ".", "getOwner", "(", "this", ")", ";", "var", "viewRegistry", "=", "owner", "&&", "owner", ".", "lookup", ...
Registers an event listener on the rootElement. If the given event is triggered, the provided event handler will be triggered on the target view. If the target view does not implement the event handler, or if the handler returns `false`, the parent view will be called. The event will continue to bubble to each successi...
[ "Registers", "an", "event", "listener", "on", "the", "rootElement", ".", "If", "the", "given", "event", "is", "triggered", "the", "provided", "event", "handler", "will", "be", "triggered", "on", "the", "target", "view", ".", "If", "the", "target", "view", ...
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L46737-L46781
24,095
ember-cli/loader.js
benchmarks/scenarios/ember.js
function () { this._super.apply(this, arguments); var name = arguments[0]; var method = this[name]; if (method) { var length = arguments.length; var args = new Array(length - 1); for (var i = 1; i < length; i++) { args[i - 1] = arguments[i]; } re...
javascript
function () { this._super.apply(this, arguments); var name = arguments[0]; var method = this[name]; if (method) { var length = arguments.length; var args = new Array(length - 1); for (var i = 1; i < length; i++) { args[i - 1] = arguments[i]; } re...
[ "function", "(", ")", "{", "this", ".", "_super", ".", "apply", "(", "this", ",", "arguments", ")", ";", "var", "name", "=", "arguments", "[", "0", "]", ";", "var", "method", "=", "this", "[", "name", "]", ";", "if", "(", "method", ")", "{", "v...
Override the default event firing from `Ember.Evented` to also call methods with the given name. @method trigger @param name {String} @private
[ "Override", "the", "default", "event", "firing", "from", "Ember", ".", "Evented", "to", "also", "call", "methods", "with", "the", "given", "name", "." ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L47121-L47133
24,096
ember-cli/loader.js
benchmarks/scenarios/ember.js
function (view, eventName, event) { if (view.has(eventName)) { // Handler should be able to re-dispatch events, so we don't // preventDefault or stopPropagation. return _emberMetalInstrumentation.flaggedInstrument('interaction.' + eventName, { event: event, view: view }, function () { ...
javascript
function (view, eventName, event) { if (view.has(eventName)) { // Handler should be able to re-dispatch events, so we don't // preventDefault or stopPropagation. return _emberMetalInstrumentation.flaggedInstrument('interaction.' + eventName, { event: event, view: view }, function () { ...
[ "function", "(", "view", ",", "eventName", ",", "event", ")", "{", "if", "(", "view", ".", "has", "(", "eventName", ")", ")", "{", "// Handler should be able to re-dispatch events, so we don't", "// preventDefault or stopPropagation.", "return", "_emberMetalInstrumentatio...
Handle events from `Ember.EventDispatcher`
[ "Handle", "events", "from", "Ember", ".", "EventDispatcher" ]
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L47294-L47304
24,097
ember-cli/loader.js
benchmarks/scenarios/ember.js
function (parsedPath) { return View._classStringForValue(parsedPath.path, parsedPath.stream.value(), parsedPath.className, parsedPath.falsyClassName); }
javascript
function (parsedPath) { return View._classStringForValue(parsedPath.path, parsedPath.stream.value(), parsedPath.className, parsedPath.falsyClassName); }
[ "function", "(", "parsedPath", ")", "{", "return", "View", ".", "_classStringForValue", "(", "parsedPath", ".", "path", ",", "parsedPath", ".", "stream", ".", "value", "(", ")", ",", "parsedPath", ".", "className", ",", "parsedPath", ".", "falsyClassName", "...
Given a property name, returns a dasherized version of that property name if the property evaluates to a non-falsy value. For example, if the view has property `isUrgent` that evaluates to true, passing `isUrgent` to this method will return `"is-urgent"`. @method _classStringForProperty @param property @private
[ "Given", "a", "property", "name", "returns", "a", "dasherized", "version", "of", "that", "property", "name", "if", "the", "property", "evaluates", "to", "a", "non", "-", "falsy", "value", ".", "For", "example", "if", "the", "view", "has", "property", "isUr...
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L48225-L48227
24,098
ember-cli/loader.js
benchmarks/scenarios/ember.js
wrap
function wrap(template) { if (template === null) { return null; } return { meta: template.meta, arity: template.arity, raw: template, render: function (self, env, options, blockArguments) { var scope = env.hooks.createFreshScope(); var contextualElement = opti...
javascript
function wrap(template) { if (template === null) { return null; } return { meta: template.meta, arity: template.arity, raw: template, render: function (self, env, options, blockArguments) { var scope = env.hooks.createFreshScope(); var contextualElement = opti...
[ "function", "wrap", "(", "template", ")", "{", "if", "(", "template", "===", "null", ")", "{", "return", "null", ";", "}", "return", "{", "meta", ":", "template", ".", "meta", ",", "arity", ":", "template", ".", "arity", ",", "raw", ":", "template", ...
HTMLBars delegates the runtime behavior of a template to hooks provided by the host environment. These hooks explain the lexical environment of a Handlebars template, the internal representation of references, and the interaction between an HTMLBars template and the DOM it is managing. While HTMLBars host hooks have a...
[ "HTMLBars", "delegates", "the", "runtime", "behavior", "of", "a", "template", "to", "hooks", "provided", "by", "the", "host", "environment", ".", "These", "hooks", "explain", "the", "lexical", "environment", "of", "a", "Handlebars", "template", "the", "internal"...
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L48486-L48504
24,099
ember-cli/loader.js
benchmarks/scenarios/ember.js
advanceToKey
function advanceToKey(key) { var seek = currentMorph; while (seek.key !== key) { candidates[seek.key] = seek; seek = seek.nextMorph; } currentMorph = seek.nextMorph; return seek; }
javascript
function advanceToKey(key) { var seek = currentMorph; while (seek.key !== key) { candidates[seek.key] = seek; seek = seek.nextMorph; } currentMorph = seek.nextMorph; return seek; }
[ "function", "advanceToKey", "(", "key", ")", "{", "var", "seek", "=", "currentMorph", ";", "while", "(", "seek", ".", "key", "!==", "key", ")", "{", "candidates", "[", "seek", ".", "key", "]", "=", "seek", ";", "seek", "=", "seek", ".", "nextMorph", ...
Advances the currentMorph pointer to the morph in the previously-rendered list that matches the yielded key. While doing so, it marks any morphs that it advances past as candidates for deletion. Assuming those morphs are not yielded in later, they will be removed in the prune step during cleanup. Note that this helper ...
[ "Advances", "the", "currentMorph", "pointer", "to", "the", "morph", "in", "the", "previously", "-", "rendered", "list", "that", "matches", "the", "yielded", "key", ".", "While", "doing", "so", "it", "marks", "any", "morphs", "that", "it", "advances", "past",...
4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101
https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L48594-L48604