dist/ember-template-compiler.js in ember-source-1.12.1 vs dist/ember-template-compiler.js in ember-source-1.12.2
- old
+ new
@@ -3,11 +3,11 @@
* @copyright Copyright 2011-2015 Tilde Inc. and contributors
* Portions Copyright 2006-2011 Strobe Inc.
* Portions Copyright 2008-2011 Apple Inc. All rights reserved.
* @license Licensed under MIT license
* See https://raw.github.com/emberjs/ember.js/master/LICENSE
- * @version 1.12.1
+ * @version 1.12.2
*/
(function() {
var enifed, requireModule, eriuqer, requirejs, Ember;
var mainContext = this;
@@ -117,11 +117,11 @@
exports._warnIfUsingStrippedFeatureFlags = _warnIfUsingStrippedFeatureFlags;
Ember['default'].assert = function (desc, test) {
var throwAssertion;
- if (utils.typeOf(test) === "function") {
+ if (utils.typeOf(test) === 'function') {
throwAssertion = !test();
} else {
throwAssertion = !test;
}
@@ -140,11 +140,11 @@
will be displayed.
*/
Ember['default'].warn = function (message, test) {
if (!test) {
Logger['default'].warn("WARNING: " + message);
- if ("trace" in Logger['default']) {
+ if ('trace' in Logger['default']) {
Logger['default'].trace();
}
}
};
@@ -177,11 +177,11 @@
in a `url` to the transition guide on the emberjs.com website.
*/
Ember['default'].deprecate = function (message, test, options) {
var noDeprecation;
- if (typeof test === "function") {
+ if (typeof test === 'function') {
noDeprecation = test();
} else {
noDeprecation = test;
}
@@ -201,27 +201,27 @@
} catch (e) {
error = e;
}
if (arguments.length === 3) {
- Ember['default'].assert("options argument to Ember.deprecate should be an object", options && typeof options === "object");
+ Ember['default'].assert('options argument to Ember.deprecate should be an object', options && typeof options === 'object');
if (options.url) {
- message += " See " + options.url + " for more details.";
+ message += ' See ' + options.url + ' for more details.';
}
}
if (Ember['default'].LOG_STACKTRACE_ON_DEPRECATION && error.stack) {
var stack;
- var stackStr = "";
+ var stackStr = '';
- if (error["arguments"]) {
+ if (error['arguments']) {
// Chrome
- stack = error.stack.replace(/^\s+at\s+/gm, "").replace(/^([^\(]+?)([\n$])/gm, "{anonymous}($1)$2").replace(/^Object.<anonymous>\s*\(([^\)]+)\)/gm, "{anonymous}($1)").split("\n");
+ stack = error.stack.replace(/^\s+at\s+/gm, '').replace(/^([^\(]+?)([\n$])/gm, '{anonymous}($1)$2').replace(/^Object.<anonymous>\s*\(([^\)]+)\)/gm, '{anonymous}($1)').split('\n');
stack.shift();
} else {
// Firefox
- stack = error.stack.replace(/(?:\n@:0)?\s+$/m, "").replace(/^\(/gm, "{anonymous}(").split("\n");
+ stack = error.stack.replace(/(?:\n@:0)?\s+$/m, '').replace(/^\(/gm, '{anonymous}(').split('\n');
}
stackStr = "\n " + stack.slice(2).join("\n ");
message = message + stackStr;
}
@@ -284,48 +284,49 @@
@private
@method _warnIfUsingStrippedFeatureFlags
@return {void}
*/
+
function _warnIfUsingStrippedFeatureFlags(FEATURES, featuresWereStripped) {
if (featuresWereStripped) {
- Ember['default'].warn("Ember.ENV.ENABLE_ALL_FEATURES is only available in canary builds.", !Ember['default'].ENV.ENABLE_ALL_FEATURES);
- Ember['default'].warn("Ember.ENV.ENABLE_OPTIONAL_FEATURES is only available in canary builds.", !Ember['default'].ENV.ENABLE_OPTIONAL_FEATURES);
+ Ember['default'].warn('Ember.ENV.ENABLE_ALL_FEATURES is only available in canary builds.', !Ember['default'].ENV.ENABLE_ALL_FEATURES);
+ Ember['default'].warn('Ember.ENV.ENABLE_OPTIONAL_FEATURES is only available in canary builds.', !Ember['default'].ENV.ENABLE_OPTIONAL_FEATURES);
for (var key in FEATURES) {
- if (FEATURES.hasOwnProperty(key) && key !== "isEnabled") {
- Ember['default'].warn("FEATURE[\"" + key + "\"] is set as enabled, but FEATURE flags are only available in canary builds.", !FEATURES[key]);
+ if (FEATURES.hasOwnProperty(key) && key !== 'isEnabled') {
+ Ember['default'].warn('FEATURE["' + key + '"] is set as enabled, but FEATURE flags are only available in canary builds.', !FEATURES[key]);
}
}
}
}
if (!Ember['default'].testing) {
// Complain if they're using FEATURE flags in builds other than canary
- Ember['default'].FEATURES["features-stripped-test"] = true;
+ Ember['default'].FEATURES['features-stripped-test'] = true;
var featuresWereStripped = true;
- delete Ember['default'].FEATURES["features-stripped-test"];
+ delete Ember['default'].FEATURES['features-stripped-test'];
_warnIfUsingStrippedFeatureFlags(Ember['default'].ENV.FEATURES, featuresWereStripped);
// Inform the developer about the Ember Inspector if not installed.
- var isFirefox = typeof InstallTrigger !== "undefined";
+ var isFirefox = typeof InstallTrigger !== 'undefined';
var isChrome = environment['default'].isChrome;
- if (typeof window !== "undefined" && (isFirefox || isChrome) && window.addEventListener) {
+ if (typeof window !== 'undefined' && (isFirefox || isChrome) && window.addEventListener) {
window.addEventListener("load", function () {
if (document.documentElement && document.documentElement.dataset && !document.documentElement.dataset.emberExtension) {
var downloadURL;
if (isChrome) {
- downloadURL = "https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi";
+ downloadURL = 'https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi';
} else if (isFirefox) {
- downloadURL = "https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/";
+ downloadURL = 'https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/';
}
- Ember['default'].debug("For more advanced debugging, install the Ember Inspector from " + downloadURL);
+ Ember['default'].debug('For more advanced debugging, install the Ember Inspector from ' + downloadURL);
}
}, false);
}
}
@@ -337,11 +338,11 @@
so that if `ember.js` (which must be output for backwards compat reasons) is
used a nice helpful warning message will be printed out.
*/
var runningNonEmberDebugJS = false;
if (runningNonEmberDebugJS) {
- Ember['default'].warn("Please use `ember.debug.js` instead of `ember.js` for development and debugging.");
+ Ember['default'].warn('Please use `ember.debug.js` instead of `ember.js` for development and debugging.');
}
exports.runningNonEmberDebugJS = runningNonEmberDebugJS;
});
@@ -375,14 +376,11 @@
computed.computed.defaultTo = computed_macros.defaultTo;
computed.computed.deprecatingAlias = computed_macros.deprecatingAlias;
computed.computed.and = computed_macros.and;
computed.computed.or = computed_macros.or;
computed.computed.any = computed_macros.any;
- computed.computed.collect = computed_macros.collect; // END IMPORTS
-
- // BEGIN EXPORTS
- var EmberInstrumentation = Ember['default'].Instrumentation = {};
+ computed.computed.collect = computed_macros.collect;var EmberInstrumentation = Ember['default'].Instrumentation = {};
EmberInstrumentation.instrument = instrumentation.instrument;
EmberInstrumentation.subscribe = instrumentation.subscribe;
EmberInstrumentation.unsubscribe = instrumentation.unsubscribe;
EmberInstrumentation.reset = instrumentation.reset;
@@ -525,11 +523,11 @@
* @private
*/
Ember['default'].Backburner = Backburner['default'];
Ember['default'].libraries = new Libraries['default']();
- Ember['default'].libraries.registerCoreLibrary("Ember", Ember['default'].VERSION);
+ Ember['default'].libraries.registerCoreLibrary('Ember', Ember['default'].VERSION);
Ember['default'].isNone = isNone['default'];
Ember['default'].isEmpty = isEmpty['default'];
Ember['default'].isBlank = isBlank['default'];
Ember['default'].isPresent = isPresent['default'];
@@ -560,12 +558,12 @@
Ember['default'].onerror = null;
// END EXPORTS
// do this for side-effects of updating Ember.assert, warn, etc when
// ember-debug is present
- if (Ember['default'].__loader.registry["ember-debug"]) {
- requireModule("ember-debug");
+ if (Ember['default'].__loader.registry['ember-debug']) {
+ requireModule('ember-debug');
}
exports['default'] = Ember['default'];
});
@@ -656,11 +654,11 @@
// Testing this is not ideal, but we want to use native functions
// if available, but not to use versions created by libraries like Prototype
var isNativeFunc = function (func) {
// This should probably work in all browsers likely to have ES5 array methods
- return func && Function.prototype.toString.call(func).indexOf("[native code]") > -1;
+ return func && Function.prototype.toString.call(func).indexOf('[native code]') > -1;
};
var defineNativeShim = function (nativeFunc, shim) {
if (isNativeFunc(nativeFunc)) {
return nativeFunc;
@@ -890,11 +888,11 @@
/**
@method toString
@return {String} string representation of binding
*/
toString: function () {
- var oneWay = this._oneWay ? "[oneWay]" : "";
+ var oneWay = this._oneWay ? '[oneWay]' : '';
return "Ember.Binding<" + utils.guidFor(this) + ">(" + this._from + " -> " + this._to + ")" + oneWay;
},
// ..........................................................
// CONNECT AND SYNC
@@ -907,11 +905,11 @@
@method connect
@param {Object} obj The root object for this binding.
@return {Ember.Binding} `this`
*/
connect: function (obj) {
- Ember['default'].assert("Must pass a valid object to Ember.Binding.connect()", !!obj);
+ Ember['default'].assert('Must pass a valid object to Ember.Binding.connect()', !!obj);
var fromPath = this._from;
var toPath = this._to;
property_set.trySet(obj, toPath, getWithGlobals(obj, fromPath));
@@ -934,11 +932,11 @@
@method disconnect
@param {Object} obj The root object you passed when connecting the binding.
@return {Ember.Binding} `this`
*/
disconnect: function (obj) {
- Ember['default'].assert("Must pass a valid object to Ember.Binding.disconnect()", !!obj);
+ Ember['default'].assert('Must pass a valid object to Ember.Binding.disconnect()', !!obj);
var twoWay = !this._oneWay;
// remove an observer on the object so we're no longer notified of
// changes that should update bindings.
@@ -957,31 +955,31 @@
// PRIVATE
//
/* called when the from side changes */
fromDidChange: function (target) {
- this._scheduleSync(target, "fwd");
+ this._scheduleSync(target, 'fwd');
},
/* called when the to side changes */
toDidChange: function (target) {
- this._scheduleSync(target, "back");
+ this._scheduleSync(target, 'back');
},
_scheduleSync: function (obj, dir) {
var existingDir = this._direction;
// if we haven't scheduled the binding yet, schedule it
if (existingDir === undefined) {
- run['default'].schedule("sync", this, this._sync, obj);
+ run['default'].schedule('sync', this, this._sync, obj);
this._direction = dir;
}
// If both a 'back' and 'fwd' sync have been scheduled on the same object,
// default to a 'fwd' sync so that it remains deterministic.
- if (existingDir === "back" && dir === "fwd") {
- this._direction = "fwd";
+ if (existingDir === 'back' && dir === 'fwd') {
+ this._direction = 'fwd';
}
},
_sync: function (obj) {
var log = Ember['default'].LOG_BINDINGS;
@@ -999,32 +997,32 @@
var toPath = this._to;
this._direction = undefined;
// if we're synchronizing from the remote object...
- if (direction === "fwd") {
+ if (direction === 'fwd') {
var fromValue = getWithGlobals(obj, this._from);
if (log) {
- Ember['default'].Logger.log(" ", this.toString(), "->", fromValue, obj);
+ Ember['default'].Logger.log(' ', this.toString(), '->', fromValue, obj);
}
if (this._oneWay) {
property_set.trySet(obj, toPath, fromValue);
} else {
observer._suspendObserver(obj, toPath, this, this.toDidChange, function () {
property_set.trySet(obj, toPath, fromValue);
});
}
// if we're synchronizing *to* the remote object
- } else if (direction === "back") {
- var toValue = property_get.get(obj, this._to);
- if (log) {
- Ember['default'].Logger.log(" ", this.toString(), "<-", toValue, obj);
+ } else if (direction === 'back') {
+ var toValue = property_get.get(obj, this._to);
+ if (log) {
+ Ember['default'].Logger.log(' ', this.toString(), '<-', toValue, obj);
+ }
+ observer._suspendObserver(obj, fromPath, this, this.fromDidChange, function () {
+ property_set.trySet(path_cache.isGlobal(fromPath) ? Ember['default'].lookup : obj, fromPath, toValue);
+ });
}
- observer._suspendObserver(obj, fromPath, this, this.fromDidChange, function () {
- property_set.trySet(path_cache.isGlobal(fromPath) ? Ember['default'].lookup : obj, fromPath, toValue);
- });
- }
}
};
function mixinProperties(to, from) {
@@ -1219,10 +1217,11 @@
Must be relative to obj.
@param {String} from The path to the 'from' side of the binding.
Must be relative to obj or a global path.
@return {Ember.Binding} binding instance
*/
+
function bind(obj, to, from) {
return new Binding(to, from).connect(obj);
}
/**
@@ -1233,10 +1232,11 @@
Must be relative to obj.
@param {String} from The path to the 'from' side of the binding.
Must be relative to obj or a global path.
@return {Ember.Binding} binding instance
*/
+
function oneWay(obj, to, from) {
return new Binding(to, from).oneWay().connect(obj);
}
exports.isGlobalPath = path_cache.isGlobal;
@@ -1314,11 +1314,11 @@
function firstKey(path) {
return path.match(FIRST_KEY)[0];
}
function isObject(obj) {
- return obj && typeof obj === "object";
+ return obj && typeof obj === 'object';
}
var pendingQueue = [];
// attempts to add the pendingQueue chains again. If some of them end up
@@ -1335,22 +1335,22 @@
array.forEach.call(queue, function (q) {
q[0].add(q[1]);
});
- warn("Watching an undefined global, Ember expects watched globals to be" + " setup by the time the run loop is flushed, check for typos", pendingQueue.length === 0);
+ warn('Watching an undefined global, Ember expects watched globals to be' + ' setup by the time the run loop is flushed, check for typos', pendingQueue.length === 0);
}
function addChainWatcher(obj, keyName, node) {
if (!isObject(obj)) {
return;
}
var m = utils.meta(obj);
var nodes = m.chainWatchers;
- if (!m.hasOwnProperty("chainWatchers")) {
+ if (!m.hasOwnProperty('chainWatchers')) {
// FIXME?!
nodes = m.chainWatchers = {};
}
if (!nodes[keyName]) {
@@ -1363,12 +1363,12 @@
function removeChainWatcher(obj, keyName, node) {
if (!isObject(obj)) {
return;
}
- var m = obj["__ember_meta__"];
- if (m && !m.hasOwnProperty("chainWatchers")) {
+ var m = obj['__ember_meta__'];
+ if (m && !m.hasOwnProperty('chainWatchers')) {
return;
}
var nodes = m && m.chainWatchers;
@@ -1411,21 +1411,21 @@
// Special-case: the EachProxy relies on immediate evaluation to
// establish its observers.
//
// TODO: Replace this with an efficient callback that the EachProxy
// can implement.
- if (this._parent && this._parent._key === "@each") {
+ if (this._parent && this._parent._key === '@each') {
this.value();
}
}
function lazyGet(obj, key) {
if (!obj) {
return;
}
- var meta = obj["__ember_meta__"];
+ var meta = obj['__ember_meta__'];
// check if object meant only to be a prototype
if (meta && meta.proto === obj) {
return;
}
@@ -1433,11 +1433,11 @@
return property_get.get(obj, key);
}
// if a CP only return cached value
var possibleDesc = obj[key];
- var desc = possibleDesc !== null && typeof possibleDesc === "object" && possibleDesc.isDescriptor ? possibleDesc : undefined;
+ var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined;
if (desc && desc._cacheable) {
if (meta.cache && key in meta.cache) {
return meta.cache[key];
} else {
return;
@@ -1500,20 +1500,20 @@
path = path.slice(key.length + 1);
// global path, but object does not exist yet.
// put into a queue and try to connect later.
} else if (!tuple[0]) {
- pendingQueue.push([this, path]);
- tuple.length = 0;
- return;
+ pendingQueue.push([this, path]);
+ tuple.length = 0;
+ return;
- // global path, and object already exists
- } else {
- src = tuple[0];
- key = path.slice(0, 0 - (tuple[1].length + 1));
- path = tuple[1];
- }
+ // global path, and object already exists
+ } else {
+ src = tuple[0];
+ key = path.slice(0, 0 - (tuple[1].length + 1));
+ path = tuple[1];
+ }
tuple.length = 0;
this.chain(key, path, src);
},
@@ -1601,38 +1601,38 @@
}
},
chainWillChange: function (chain, path, depth, events) {
if (this._key) {
- path = this._key + "." + path;
+ path = this._key + '.' + path;
}
if (this._parent) {
this._parent.chainWillChange(this, path, depth + 1, events);
} else {
if (depth > 1) {
events.push(this.value(), path);
}
- path = "this." + path;
+ path = 'this.' + path;
if (this._paths[path] > 0) {
events.push(this.value(), path);
}
}
},
chainDidChange: function (chain, path, depth, events) {
if (this._key) {
- path = this._key + "." + path;
+ path = this._key + '.' + path;
}
if (this._parent) {
this._parent.chainDidChange(this, path, depth + 1, events);
} else {
if (depth > 1) {
events.push(this.value(), path);
}
- path = "this." + path;
+ path = 'this.' + path;
if (this._paths[path] > 0) {
events.push(this.value(), path);
}
}
},
@@ -1648,11 +1648,11 @@
}
this._value = undefined;
// Special-case: the EachProxy relies on immediate evaluation to
// establish its observers.
- if (this._parent && this._parent._key === "@each") {
+ if (this._parent && this._parent._key === '@each') {
this.value();
}
}
// then notify chains...
@@ -1675,13 +1675,14 @@
if (this._parent) {
this._parent.chainDidChange(this, this._key, 1, events);
}
}
};
+
function finishChains(obj) {
// We only create meta if we really have to
- var m = obj["__ember_meta__"];
+ var m = obj['__ember_meta__'];
var chains, chainWatchers, chainNodes;
if (m) {
// finish any current chains node watchers that reference obj
chainWatchers = m.chainWatchers;
@@ -1826,14 +1827,14 @@
this._dependentKeys = undefined;
this._suspended = undefined;
this._meta = undefined;
- Ember.deprecate("Passing opts.cacheable to the CP constructor is deprecated. Invoke `volatile()` on the CP instead.", !opts || !opts.hasOwnProperty("cacheable"));
+ Ember.deprecate("Passing opts.cacheable to the CP constructor is deprecated. Invoke `volatile()` on the CP instead.", !opts || !opts.hasOwnProperty('cacheable'));
this._cacheable = opts && opts.cacheable !== undefined ? opts.cacheable : true; // TODO: Set always to `true` once this deprecation is gone.
this._dependentKeys = opts && opts.dependentKeys;
- Ember.deprecate("Passing opts.readOnly to the CP constructor is deprecated. All CPs are writable by default. You can invoke `readOnly()` on the CP to change this.", !opts || !opts.hasOwnProperty("readOnly"));
+ Ember.deprecate("Passing opts.readOnly to the CP constructor is deprecated. All CPs are writable by default. You can invoke `readOnly()` on the CP to change this.", !opts || !opts.hasOwnProperty('readOnly'));
this._readOnly = opts && (opts.readOnly !== undefined || !!opts.readOnly) || false; // TODO: Set always to `false` once this deprecation is gone.
}
ComputedProperty.prototype = new properties.Descriptor();
@@ -1854,11 +1855,11 @@
@return {Ember.ComputedProperty} this
@chainable
@deprecated All computed properties are cacheble by default. Use `volatile()` instead to opt-out to caching.
*/
ComputedPropertyPrototype.cacheable = function (aFlag) {
- Ember.deprecate("ComputedProperty.cacheable() is deprecated. All computed properties are cacheable by default.");
+ Ember.deprecate('ComputedProperty.cacheable() is deprecated. All computed properties are cacheable by default.');
this._cacheable = aFlag !== false;
return this;
};
/**
@@ -1901,11 +1902,11 @@
@method readOnly
@return {Ember.ComputedProperty} this
@chainable
*/
ComputedPropertyPrototype.readOnly = function (readOnly) {
- Ember.deprecate("Passing arguments to ComputedProperty.readOnly() is deprecated.", arguments.length === 0);
+ Ember.deprecate('Passing arguments to ComputedProperty.readOnly() is deprecated.', arguments.length === 0);
this._readOnly = readOnly === undefined || !!readOnly; // Force to true once this deprecation is gone
Ember.assert("Computed properties that define a setter using the new syntax cannot be read-only", !(this._readOnly && this._setter && this._setter !== this._getter));
return this;
};
@@ -2274,10 +2275,12 @@
}
var cp = new ComputedProperty(func);
// jscs:disable
+ // Empty block on purpose
+
if (args) {
cp.property.apply(cp, args);
}
return cp;
@@ -2295,11 +2298,11 @@
@param {String} key the name of the property whose cached value you want
to return
@return {Object} the cached value
*/
function cacheFor(obj, key) {
- var meta = obj["__ember_meta__"];
+ var meta = obj['__ember_meta__'];
var cache = meta && meta.cache;
var ret = cache && cache[key];
if (ret === UNDEFINED) {
return undefined;
@@ -2395,12 +2398,13 @@
@for Ember.computed
@param {String} dependentKey
@return {Ember.ComputedProperty} computed property which negate
the original value for property
*/
+
function empty(dependentKey) {
- return computed.computed(dependentKey + ".length", function () {
+ return computed.computed(dependentKey + '.length', function () {
return isEmpty['default'](property_get.get(this, dependentKey));
});
}
/**
@@ -2425,12 +2429,13 @@
@for Ember.computed
@param {String} dependentKey
@return {Ember.ComputedProperty} computed property which returns true if
original value for property is not empty.
*/
+
function notEmpty(dependentKey) {
- return computed.computed(dependentKey + ".length", function () {
+ return computed.computed(dependentKey + '.length', function () {
return !isEmpty['default'](property_get.get(this, dependentKey));
});
}
/**
@@ -2458,10 +2463,11 @@
@for Ember.computed
@param {String} dependentKey
@return {Ember.ComputedProperty} computed property which
returns true if original value for property is null or undefined.
*/
+
function none(dependentKey) {
return computed.computed(dependentKey, function () {
return isNone['default'](property_get.get(this, dependentKey));
});
}
@@ -2488,10 +2494,11 @@
@for Ember.computed
@param {String} dependentKey
@return {Ember.ComputedProperty} computed property which returns
inverse of the original value for property
*/
+
function not(dependentKey) {
return computed.computed(dependentKey, function () {
return !property_get.get(this, dependentKey);
});
}
@@ -2520,10 +2527,11 @@
@for Ember.computed
@param {String} dependentKey
@return {Ember.ComputedProperty} computed property which converts
to boolean the original value for property
*/
+
function bool(dependentKey) {
return computed.computed(dependentKey, function () {
return !!property_get.get(this, dependentKey);
});
}
@@ -2554,15 +2562,16 @@
@param {String} dependentKey
@param {RegExp} regexp
@return {Ember.ComputedProperty} computed property which match
the original value for property against a given RegExp
*/
+
function match(dependentKey, regexp) {
return computed.computed(dependentKey, function () {
var value = property_get.get(this, dependentKey);
- return typeof value === "string" ? regexp.test(value) : false;
+ return typeof value === 'string' ? regexp.test(value) : false;
});
}
/**
A computed property that returns true if the provided dependent property
@@ -2589,10 +2598,11 @@
@param {String} dependentKey
@param {String|Number|Object} value
@return {Ember.ComputedProperty} computed property which returns true if
the original value for property is equal to the given value.
*/
+
function equal(dependentKey, value) {
return computed.computed(dependentKey, function () {
return property_get.get(this, dependentKey) === value;
});
}
@@ -2622,10 +2632,11 @@
@param {String} dependentKey
@param {Number} value
@return {Ember.ComputedProperty} computed property which returns true if
the original value for property is greater than given value.
*/
+
function gt(dependentKey, value) {
return computed.computed(dependentKey, function () {
return property_get.get(this, dependentKey) > value;
});
}
@@ -2655,10 +2666,11 @@
@param {String} dependentKey
@param {Number} value
@return {Ember.ComputedProperty} computed property which returns true if
the original value for property is greater or equal then given value.
*/
+
function gte(dependentKey, value) {
return computed.computed(dependentKey, function () {
return property_get.get(this, dependentKey) >= value;
});
}
@@ -2688,10 +2700,11 @@
@param {String} dependentKey
@param {Number} value
@return {Ember.ComputedProperty} computed property which returns true if
the original value for property is less then given value.
*/
+
function lt(dependentKey, value) {
return computed.computed(dependentKey, function () {
return property_get.get(this, dependentKey) < value;
});
}
@@ -2721,10 +2734,11 @@
@param {String} dependentKey
@param {Number} value
@return {Ember.ComputedProperty} computed property which returns true if
the original value for property is less or equal than given value.
*/
+
function lte(dependentKey, value) {
return computed.computed(dependentKey, function () {
return property_get.get(this, dependentKey) <= value;
});
}
@@ -2847,10 +2861,11 @@
@param {String} dependentKey
@return {Ember.ComputedProperty} computed property which creates a
one way computed property to the original value for property.
@since 1.5.0
*/
+
function readOnly(dependentKey) {
return alias['default'](dependentKey).readOnly();
}
/**
@@ -2878,19 +2893,20 @@
@param {String} defaultPath
@return {Ember.ComputedProperty} computed property which acts like
a standard getter and setter, but defaults to the value from `defaultPath`.
@deprecated Use `Ember.computed.oneWay` or custom CP with default instead.
*/
+
function defaultTo(defaultPath) {
return computed.computed({
get: function (key) {
- Ember['default'].deprecate("Usage of Ember.computed.defaultTo is deprecated, use `Ember.computed.oneWay` instead.");
+ Ember['default'].deprecate('Usage of Ember.computed.defaultTo is deprecated, use `Ember.computed.oneWay` instead.');
return property_get.get(this, defaultPath);
},
set: function (key, newValue, cachedValue) {
- Ember['default'].deprecate("Usage of Ember.computed.defaultTo is deprecated, use `Ember.computed.oneWay` instead.");
+ Ember['default'].deprecate('Usage of Ember.computed.defaultTo is deprecated, use `Ember.computed.oneWay` instead.');
return newValue != null ? newValue : property_get.get(this, defaultPath);
}
});
}
@@ -2905,10 +2921,11 @@
@param {String} dependentKey
@return {Ember.ComputedProperty} computed property which creates an
alias with a deprecation to the original value for property.
@since 1.7.0
*/
+
function deprecatingAlias(dependentKey) {
return computed.computed(dependentKey, {
get: function (key) {
Ember['default'].deprecate("Usage of `" + key + "` is deprecated, use `" + dependentKey + "` instead.");
return property_get.get(this, dependentKey);
@@ -2955,11 +2972,11 @@
The core Runtime framework is based on the jQuery API with a number of
performance optimizations.
@class Ember
@static
- @version 1.12.1
+ @version 1.12.2
*/
if ('undefined' === typeof Ember) {
// Create core object. Make it act like an instance of Ember.Namespace so that
// objects assigned to it are given a sane string representation.
@@ -2984,14 +3001,14 @@
};
/**
@property VERSION
@type String
- @default '1.12.1'
+ @default '1.12.2'
@static
*/
- Ember.VERSION = '1.12.1';
+ Ember.VERSION = '1.12.2';
/**
Standard environmental variables. You can define these in a global `EmberENV`
variable before loading Ember to control various configuration settings.
@@ -3028,11 +3045,11 @@
@class FEATURES
@namespace Ember
@static
@since 1.1.0
*/
- Ember.FEATURES = { 'features-stripped-test': false, 'ember-routing-named-substates': true, 'mandatory-setter': true, 'ember-htmlbars-component-generation': false, 'ember-htmlbars-component-helper': true, 'ember-htmlbars-inline-if-helper': true, 'ember-htmlbars-attribute-syntax': true, 'ember-routing-transitioning-classes': true, 'new-computed-syntax': true, 'ember-testing-checkbox-helpers': false, 'ember-metal-stream': false, 'ember-application-instance-initializers': true, 'ember-application-initializer-context': true, 'ember-router-willtransition': true, 'ember-application-visit': false, 'ember-views-component-block-info': false, 'ember-routing-core-outlet': false, 'ember-libraries-isregistered': false }; //jshint ignore:line
+ Ember.FEATURES = { "features-stripped-test": false, "ember-routing-named-substates": true, "mandatory-setter": true, "ember-htmlbars-component-generation": false, "ember-htmlbars-component-helper": true, "ember-htmlbars-inline-if-helper": true, "ember-htmlbars-attribute-syntax": true, "ember-routing-transitioning-classes": true, "new-computed-syntax": true, "ember-testing-checkbox-helpers": false, "ember-metal-stream": false, "ember-application-instance-initializers": true, "ember-application-initializer-context": true, "ember-router-willtransition": true, "ember-application-visit": false, "ember-views-component-block-info": false, "ember-routing-core-outlet": false, "ember-libraries-isregistered": false }; //jshint ignore:line
if (Ember.ENV.FEATURES) {
for (var feature in Ember.ENV.FEATURES) {
if (Ember.ENV.FEATURES.hasOwnProperty(feature)) {
Ember.FEATURES[feature] = Ember.ENV.FEATURES[feature];
@@ -3166,30 +3183,11 @@
exports.addDependentKeys = addDependentKeys;
exports.removeDependentKeys = removeDependentKeys;
- "REMOVE_USE_STRICT: true"; /**
- @module ember-metal
- */
-
- // ..........................................................
- // DEPENDENT KEYS
- //
-
- // data structure:
- // meta.deps = {
- // 'depKey': {
- // 'keyName': count,
- // }
- // }
-
- /*
- This function returns a map of unique dependencies for a
- given object and key.
- */
- function keysForDep(depsMeta, depKey) {
+ "REMOVE_USE_STRICT: true";function keysForDep(depsMeta, depKey) {
var keys = depsMeta[depKey];
if (!keys) {
// if there are no dependencies yet for a the given key
// create a new empty list of dependencies for the key
keys = depsMeta[depKey] = {};
@@ -3200,12 +3198,13 @@
}
return keys;
}
function metaForDeps(meta) {
- return keysForDep(meta, "deps");
+ return keysForDep(meta, 'deps');
}
+
function addDependentKeys(desc, obj, keyName, meta) {
// the descriptor has a list of dependent keys, so
// add all of its dependent keys.
var depsMeta, idx, len, depKey, keys;
var depKeys = desc._dependentKeys;
@@ -3326,10 +3325,11 @@
* @param {Function} callback The callback to execute
* @param {Object} thisArg Value to use as this when executing *callback*
*
* @return {Array} An array of mapped values.
*/
+
function map(obj, callback, thisArg) {
return obj.map ? obj.map(callback, thisArg) : ember_metal__array.map.call(obj, callback, thisArg);
}
/**
@@ -3340,10 +3340,11 @@
* @param {Object} obj The object to call forEach on
* @param {Function} callback The callback to execute
* @param {Object} thisArg Value to use as this when executing *callback*
*
*/
+
function forEach(obj, callback, thisArg) {
return obj.forEach ? obj.forEach(callback, thisArg) : ember_metal__array.forEach.call(obj, callback, thisArg);
}
/**
@@ -3356,10 +3357,11 @@
* @param {Object} thisArg Value to use as this when executing *callback*
*
* @return {Array} An array containing the filtered values
* @since 1.4.0
*/
+
function filter(obj, callback, thisArg) {
return obj.filter ? obj.filter(callback, thisArg) : ember_metal__array.filter.call(obj, callback, thisArg);
}
/**
@@ -3370,10 +3372,11 @@
* @param {Object} obj The object to call indexOn on
* @param {Function} callback The callback to execute
* @param {Object} index The index to start searching from
*
*/
+
function indexOf(obj, element, index) {
return obj.indexOf ? obj.indexOf(element, index) : ember_metal__array.indexOf.call(obj, element, index);
}
/**
@@ -3393,10 +3396,11 @@
* @param {Array} elements The elements to search for on *obj*
*
* @return {Array} An array of indexes.
*
*/
+
function indexesOf(obj, elements) {
return elements === undefined ? [] : map(elements, function (item) {
return indexOf(obj, item);
});
}
@@ -3409,10 +3413,11 @@
* @param {Array} array The array the passed item should be added to
* @param {Object} item The item to add to the passed array
*
* @return 'undefined'
*/
+
function addObject(array, item) {
var index = indexOf(array, item);
if (index === -1) {
array.push(item);
}
@@ -3426,10 +3431,11 @@
* @param {Array} array The array to remove the item from.
* @param {Object} item The item to remove from the passed array.
*
* @return 'undefined'
*/
+
function removeObject(array, item) {
var index = indexOf(array, item);
if (index !== -1) {
array.splice(index, 1);
}
@@ -3484,10 +3490,11 @@
* @param {Array} objects An array of zero or more objects that should be
* inserted into the array at *idx*
*
* @return {Array} The modified array.
*/
+
function replace(array, idx, amt, objects) {
if (array.replace) {
return array.replace(idx, amt, objects);
} else {
return _replace(array, idx, amt, objects);
@@ -3515,10 +3522,11 @@
* @param {Array} array1 The first array
* @param {Array} array2 The second array
*
* @return {Array} The intersection of the two passed arrays.
*/
+
function intersection(array1, array2) {
var result = [];
forEach(array1, function (element) {
if (indexOf(array2, element) >= 0) {
result.push(element);
@@ -3569,11 +3577,11 @@
environment = {
hasDOM: false,
isChrome: false,
location: null,
history: null,
- userAgent: 'Lynx (textmode)',
+ userAgent: "Lynx (textmode)",
global: null
};
}
exports['default'] = environment;
@@ -3629,12 +3637,11 @@
exports.hasListeners = hasListeners;
exports.listenersFor = listenersFor;
exports.on = on;
exports.removeListener = removeListener;
- "REMOVE_USE_STRICT: true"; /* listener flags */
- var ONCE = 1;
+ "REMOVE_USE_STRICT: true";var ONCE = 1;
var SUSPENDED = 2;
/*
The event system uses a series of nested hashes to store listeners on an
object. When a listener is registered, or when an event arrives, these
@@ -3692,12 +3699,13 @@
actions.__source__ = obj;
}
return actions;
}
+
function accumulateListeners(obj, eventName, otherActions) {
- var meta = obj["__ember_meta__"];
+ var meta = obj['__ember_meta__'];
var actions = meta && meta.listeners && meta.listeners[eventName];
if (!actions) {
return;
}
@@ -3728,14 +3736,15 @@
@param {String} eventName
@param {Object|Function} target A target object or a function
@param {Function|String} method A function or the name of a function to be called on `target`
@param {Boolean} once A flag whether a function should only be called once
*/
+
function addListener(obj, eventName, target, method, once) {
Ember['default'].assert("You must pass at least an object and event name to Ember.addListener", !!obj && !!eventName);
- if (!method && "function" === typeof target) {
+ if (!method && 'function' === typeof target) {
method = target;
target = null;
}
var actions = actionsFor(obj, eventName);
@@ -3750,11 +3759,11 @@
return;
}
actions.push(target, method, flags);
- if ("function" === typeof obj.didAddListener) {
+ if ('function' === typeof obj.didAddListener) {
obj.didAddListener(eventName, target, method);
}
}
/**
@@ -3770,11 +3779,11 @@
@param {Function|String} method A function or the name of a function to be called on `target`
*/
function removeListener(obj, eventName, target, method) {
Ember['default'].assert("You must pass at least an object and event name to Ember.removeListener", !!obj && !!eventName);
- if (!method && "function" === typeof target) {
+ if (!method && 'function' === typeof target) {
method = target;
target = null;
}
function _removeListener(target, method) {
@@ -3786,19 +3795,19 @@
return;
}
actions.splice(actionIndex, 3);
- if ("function" === typeof obj.didRemoveListener) {
+ if ('function' === typeof obj.didRemoveListener) {
obj.didRemoveListener(eventName, target, method);
}
}
if (method) {
_removeListener(target, method);
} else {
- var meta = obj["__ember_meta__"];
+ var meta = obj['__ember_meta__'];
var actions = meta && meta.listeners && meta.listeners[eventName];
if (!actions) {
return;
}
@@ -3824,12 +3833,13 @@
@param {String} eventName
@param {Object|Function} target A target object or a function
@param {Function|String} method A function or the name of a function to be called on `target`
@param {Function} callback
*/
+
function suspendListener(obj, eventName, target, method, callback) {
- if (!method && "function" === typeof target) {
+ if (!method && 'function' === typeof target) {
method = target;
target = null;
}
var actions = actionsFor(obj, eventName);
@@ -3862,12 +3872,13 @@
@param {Array} eventNames Array of event names
@param {Object|Function} target A target object or a function
@param {Function|String} method A function or the name of a function to be called on `target`
@param {Function} callback
*/
+
function suspendListeners(obj, eventNames, target, method, callback) {
- if (!method && "function" === typeof target) {
+ if (!method && 'function' === typeof target) {
method = target;
target = null;
}
var suspendedActions = [];
@@ -3906,17 +3917,18 @@
@private
@method watchedEvents
@for Ember
@param obj
*/
+
function watchedEvents(obj) {
- var listeners = obj["__ember_meta__"].listeners;
+ var listeners = obj['__ember_meta__'].listeners;
var ret = [];
if (listeners) {
for (var eventName in listeners) {
- if (eventName !== "__source__" && listeners[eventName]) {
+ if (eventName !== '__source__' && listeners[eventName]) {
ret.push(eventName);
}
}
}
return ret;
@@ -3934,18 +3946,19 @@
@param {String} eventName
@param {Array} params Optional parameters for each listener.
@param {Array} actions Optional array of actions (listeners).
@return true
*/
+
function sendEvent(obj, eventName, params, actions) {
// first give object a chance to handle it
- if (obj !== Ember['default'] && "function" === typeof obj.sendEvent) {
+ if (obj !== Ember['default'] && 'function' === typeof obj.sendEvent) {
obj.sendEvent(eventName, params);
}
if (!actions) {
- var meta = obj["__ember_meta__"];
+ var meta = obj['__ember_meta__'];
actions = meta && meta.listeners && meta.listeners[eventName];
}
if (!actions) {
return;
@@ -3967,11 +3980,11 @@
removeListener(obj, eventName, target, method);
}
if (!target) {
target = obj;
}
- if ("string" === typeof method) {
+ if ('string' === typeof method) {
if (params) {
utils.applyStr(target, method, params);
} else {
target[method]();
}
@@ -3991,12 +4004,13 @@
@method hasListeners
@for Ember
@param obj
@param {String} eventName
*/
+
function hasListeners(obj, eventName) {
- var meta = obj["__ember_meta__"];
+ var meta = obj['__ember_meta__'];
var actions = meta && meta.listeners && meta.listeners[eventName];
return !!(actions && actions.length);
}
@@ -4005,13 +4019,14 @@
@method listenersFor
@for Ember
@param obj
@param {String} eventName
*/
+
function listenersFor(obj, eventName) {
var ret = [];
- var meta = obj["__ember_meta__"];
+ var meta = obj['__ember_meta__'];
var actions = meta && meta.listeners && meta.listeners[eventName];
if (!actions) {
return ret;
}
@@ -4046,10 +4061,11 @@
@for Ember
@param {String} eventNames*
@param {Function} func
@return func
*/
+
function on() {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
@@ -4142,11 +4158,11 @@
function getProperties(obj) {
var ret = {};
var propertyNames = arguments;
var i = 1;
- if (arguments.length === 2 && utils.typeOf(arguments[1]) === "array") {
+ if (arguments.length === 2 && utils.typeOf(arguments[1]) === 'array') {
i = 0;
propertyNames = arguments[1];
}
for (var len = propertyNames.length; i < len; i++) {
ret[propertyNames[i]] = property_get.get(obj, propertyNames[i]);
@@ -4167,15 +4183,15 @@
AliasedPropertyPrototype.oneWay.call(this);
}
function injectedPropertyGet(keyName) {
var possibleDesc = this[keyName];
- var desc = possibleDesc !== null && typeof possibleDesc === "object" && possibleDesc.isDescriptor ? possibleDesc : undefined;
+ var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined;
Ember['default'].assert("Attempting to lookup an injected property on an object without a container, ensure that the object was instantiated via a container.", this.container);
- return this.container.lookup(desc.type + ":" + (desc.name || keyName));
+ return this.container.lookup(desc.type + ':' + (desc.name || keyName));
}
InjectedProperty.prototype = create['default'](properties.Descriptor.prototype);
var InjectedPropertyPrototype = InjectedProperty.prototype;
@@ -4219,11 +4235,11 @@
cache[name] = listeners;
return listeners;
};
var time = (function () {
- var perf = "undefined" !== typeof window ? window.performance || {} : {};
+ var perf = 'undefined' !== typeof window ? window.performance || {} : {};
var fn = perf.now || perf.mozNow || perf.webkitNow || perf.msNow || perf.oNow;
// fn.bind will be available in all the browsers that support the advanced window.performance... ;-)
return fn ? fn.bind(perf) : function () {
return +new Date();
};
@@ -4238,12 +4254,13 @@
@param {String} [name] Namespaced event name.
@param {Object} payload
@param {Function} callback Function that you're instrumenting.
@param {Object} binding Context that instrument function is called with.
*/
+
function instrument(name, _payload, callback, binding) {
- if (arguments.length <= 3 && typeof _payload === "function") {
+ if (arguments.length <= 3 && typeof _payload === 'function') {
binding = callback;
callback = _payload;
_payload = undefined;
}
if (subscribers.length === 0) {
@@ -4320,10 +4337,11 @@
@param {String} [pattern] Namespaced event name.
@param {Object} [object] Before and After hooks.
@return {Subscriber}
*/
+
function subscribe(pattern, object) {
var paths = pattern.split(".");
var path;
var regex = [];
@@ -4357,10 +4375,11 @@
@method unsubscribe
@namespace Ember.Instrumentation
@param {Object} [subscriber]
*/
+
function unsubscribe(subscriber) {
var index;
for (var i = 0, l = subscribers.length; i < l; i++) {
if (subscribers[i] === subscriber) {
@@ -4376,10 +4395,11 @@
Resets `Ember.Instrumentation` by flushing list of subscribers.
@method reset
@namespace Ember.Instrumentation
*/
+
function reset() {
subscribers.length = 0;
cache = {};
}
@@ -4571,11 +4591,11 @@
this._registry.splice(index, 1);
}
},
each: function (callback) {
- Ember['default'].deprecate("Using Ember.libraries.each() is deprecated. Access to a list of registered libraries is currently a private API. If you are not knowingly accessing this method, your out-of-date Ember Inspector may be doing so.");
+ Ember['default'].deprecate('Using Ember.libraries.each() is deprecated. Access to a list of registered libraries is currently a private API. If you are not knowingly accessing this method, your out-of-date Ember Inspector may be doing so.');
enumerable_utils.forEach(this._registry, function (lib) {
callback(lib.name, lib.version);
});
}
};
@@ -4594,31 +4614,31 @@
function consoleMethod(name) {
var consoleObj, logToConsole;
if (Ember['default'].imports.console) {
consoleObj = Ember['default'].imports.console;
- } else if (typeof console !== "undefined") {
+ } else if (typeof console !== 'undefined') {
consoleObj = console;
}
- var method = typeof consoleObj === "object" ? consoleObj[name] : null;
+ var method = typeof consoleObj === 'object' ? consoleObj[name] : null;
if (method) {
// Older IE doesn't support bind, but Chrome needs it
- if (typeof method.bind === "function") {
+ if (typeof method.bind === 'function') {
logToConsole = method.bind(consoleObj);
- logToConsole.displayName = "console." + name;
+ logToConsole.displayName = 'console.' + name;
return logToConsole;
- } else if (typeof method.apply === "function") {
+ } else if (typeof method.apply === 'function') {
logToConsole = function () {
method.apply(consoleObj, arguments);
};
- logToConsole.displayName = "console." + name;
+ logToConsole.displayName = 'console.' + name;
return logToConsole;
} else {
return function () {
- var message = Array.prototype.join.call(arguments, ", ");
+ var message = Array.prototype.join.call(arguments, ', ');
method(message);
};
}
}
}
@@ -4654,11 +4674,11 @@
```
@method log
@for Ember.Logger
@param {*} arguments
*/
- log: consoleMethod("log") || K,
+ log: consoleMethod('log') || K,
/**
Prints the arguments to the console with a warning icon.
You can pass as many arguments as you want and they will be joined together with a space.
```javascript
@@ -4667,11 +4687,11 @@
```
@method warn
@for Ember.Logger
@param {*} arguments
*/
- warn: consoleMethod("warn") || K,
+ warn: consoleMethod('warn') || K,
/**
Prints the arguments to the console with an error icon, red text and a stack trace.
You can pass as many arguments as you want and they will be joined together with a space.
```javascript
@@ -4680,11 +4700,11 @@
```
@method error
@for Ember.Logger
@param {*} arguments
*/
- error: consoleMethod("error") || K,
+ error: consoleMethod('error') || K,
/**
Logs the arguments to the console.
You can pass as many arguments as you want and they will be joined together with a space.
```javascript
@@ -4694,11 +4714,11 @@
```
@method info
@for Ember.Logger
@param {*} arguments
*/
- info: consoleMethod("info") || K,
+ info: consoleMethod('info') || K,
/**
Logs the arguments to the console in blue text.
You can pass as many arguments as you want and they will be joined together with a space.
```javascript
@@ -4708,11 +4728,11 @@
```
@method debug
@for Ember.Logger
@param {*} arguments
*/
- debug: consoleMethod("debug") || consoleMethod("info") || K,
+ debug: consoleMethod('debug') || consoleMethod('info') || K,
/**
If the value passed into `Ember.Logger.assert` is not truthy it will throw an error with a stack trace.
```javascript
Ember.Logger.assert(true); // undefined
@@ -4720,11 +4740,11 @@
```
@method assert
@for Ember.Logger
@param {Boolean} bool Value to test
*/
- assert: consoleMethod("assert") || assertPolyfill
+ assert: consoleMethod('assert') || assertPolyfill
};
});
enifed('ember-metal/map', ['exports', 'ember-metal/utils', 'ember-metal/array', 'ember-metal/platform/create', 'ember-metal/deprecate_property'], function (exports, utils, array, create, deprecate_property) {
@@ -4755,11 +4775,11 @@
Map is mocked out to look like an Ember object, so you can do
`Ember.Map.create()` for symmetry with other Ember classes.
*/
function missingFunction(fn) {
- throw new TypeError("" + Object.prototype.toString.call(fn) + " is not a function");
+ throw new TypeError(Object.prototype.toString.call(fn) + " is not a function");
}
function missingNew(name) {
throw new TypeError("Constructor " + name + " requires 'new'");
}
@@ -4853,11 +4873,11 @@
@param obj
@param _guid (optional and for internal use only)
@return {Boolean}
*/
remove: function (obj, _guid) {
- Ember.deprecate("Calling `OrderedSet.prototype.remove` has been deprecated, please use `OrderedSet.prototype.delete` instead.", this._silenceRemoveDeprecation);
+ Ember.deprecate('Calling `OrderedSet.prototype.remove` has been deprecated, please use `OrderedSet.prototype.delete` instead.', this._silenceRemoveDeprecation);
return this["delete"](obj, _guid);
},
/**
@@ -4913,11 +4933,11 @@
@method forEach
@param {Function} fn
@param self
*/
forEach: function (fn /*, ...thisArg*/) {
- if (typeof fn !== "function") {
+ if (typeof fn !== 'function') {
missingFunction(fn);
}
if (this.size === 0) {
return;
@@ -4961,11 +4981,11 @@
return set;
}
};
- deprecate_property.deprecateProperty(OrderedSet.prototype, "length", "size");
+ deprecate_property.deprecateProperty(OrderedSet.prototype, 'length', 'size');
/**
A Map stores values indexed by keys. Unlike JavaScript's
default Objects, the keys of a Map can be any JavaScript
object.
@@ -5067,11 +5087,11 @@
@method remove
@param {*} key
@return {Boolean} true if an item was removed, false otherwise
*/
remove: function (key) {
- Ember.deprecate("Calling `Map.prototype.remove` has been deprecated, please use `Map.prototype.delete` instead.");
+ Ember.deprecate('Calling `Map.prototype.remove` has been deprecated, please use `Map.prototype.delete` instead.');
return this["delete"](key);
},
/**
@@ -5119,11 +5139,11 @@
@param {Function} callback
@param {*} self if passed, the `this` value inside the
callback. By default, `this` is the map.
*/
forEach: function (callback /*, ...thisArg*/) {
- if (typeof callback !== "function") {
+ if (typeof callback !== 'function') {
missingFunction(callback);
}
if (this.size === 0) {
return;
@@ -5163,11 +5183,11 @@
copy: function () {
return copyMap(this, new Map());
}
};
- deprecate_property.deprecateProperty(Map.prototype, "length", "size");
+ deprecate_property.deprecateProperty(Map.prototype, 'length', 'size');
/**
@class MapWithDefault
@namespace Ember
@extends Ember.Map
@@ -5308,18 +5328,18 @@
function mixinsMeta(obj) {
var m = utils.meta(obj, true);
var ret = m.mixins;
if (!ret) {
ret = m.mixins = {};
- } else if (!m.hasOwnProperty("mixins")) {
+ } else if (!m.hasOwnProperty('mixins')) {
ret = m.mixins = o_create['default'](ret);
}
return ret;
}
function isMethod(obj) {
- return "function" === typeof obj && obj.isMethod !== false && obj !== Boolean && obj !== Object && obj !== Number && obj !== Array && obj !== Date && obj !== String;
+ return 'function' === typeof obj && obj.isMethod !== false && obj !== Boolean && obj !== Object && obj !== Number && obj !== Array && obj !== Date && obj !== String;
}
var CONTINUE = {};
function mixinProperties(mixinsMeta, mixin) {
@@ -5360,11 +5380,11 @@
// If we didn't find the original descriptor in a parent mixin, find
// it on the original object.
if (!superProperty) {
var possibleDesc = base[key];
- var superDesc = possibleDesc !== null && typeof possibleDesc === "object" && possibleDesc.isDescriptor ? possibleDesc : undefined;
+ var superDesc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined;
superProperty = superDesc;
}
if (superProperty === undefined || !(superProperty instanceof computed.ComputedProperty)) {
@@ -5387,11 +5407,11 @@
return property;
}
var sourceAvailable = (function () {
return this;
- }).toString().indexOf("return this;") > -1;
+ }).toString().indexOf('return this;') > -1;
function giveMethodSuper(obj, key, method, values, descs) {
var superMethod;
// Methods overwrite computed properties, and do not call super to them.
@@ -5403,20 +5423,20 @@
// If we didn't find the original value in a parent mixin, find it in
// the original object
superMethod = superMethod || obj[key];
// Only wrap the new method if the original method was a function
- if (superMethod === undefined || "function" !== typeof superMethod) {
+ if (superMethod === undefined || 'function' !== typeof superMethod) {
return method;
}
var hasSuper;
if (sourceAvailable) {
hasSuper = method.__hasSuper;
if (hasSuper === undefined) {
- hasSuper = method.toString().indexOf("_super") > -1;
+ hasSuper = method.toString().indexOf('_super') > -1;
method.__hasSuper = hasSuper;
}
}
if (sourceAvailable === false || hasSuper) {
@@ -5428,11 +5448,11 @@
function applyConcatenatedProperties(obj, key, value, values) {
var baseValue = values[key] || obj[key];
if (baseValue) {
- if ("function" === typeof baseValue.concat) {
+ if ('function' === typeof baseValue.concat) {
if (value === null || value === undefined) {
return baseValue;
} else {
return baseValue.concat(value);
}
@@ -5491,11 +5511,11 @@
}
descs[key] = value;
values[key] = undefined;
} else {
- if (concats && array.indexOf.call(concats, key) >= 0 || key === "concatenatedProperties" || key === "mergedProperties") {
+ if (concats && array.indexOf.call(concats, key) >= 0 || key === 'concatenatedProperties' || key === 'mergedProperties') {
value = applyConcatenatedProperties(base, key, value, values);
} else if (mergings && array.indexOf.call(mergings, key) >= 0) {
value = applyMergedProperties(base, key, value, values);
} else if (isMethod(value)) {
value = giveMethodSuper(base, key, value, values, descs);
@@ -5514,11 +5534,11 @@
delete values[keyName];
}
for (var i = 0, l = mixins.length; i < l; i++) {
currentMixin = mixins[i];
- Ember['default'].assert("Expected hash or Mixin instance, got " + Object.prototype.toString.call(currentMixin), typeof currentMixin === "object" && currentMixin !== null && Object.prototype.toString.call(currentMixin) !== "[object Array]");
+ Ember['default'].assert("Expected hash or Mixin instance, got " + Object.prototype.toString.call(currentMixin), typeof currentMixin === 'object' && currentMixin !== null && Object.prototype.toString.call(currentMixin) !== '[object Array]');
props = mixinProperties(m, currentMixin);
if (props === CONTINUE) {
continue;
}
@@ -5526,23 +5546,23 @@
if (props) {
meta = utils.meta(base);
if (base.willMergeMixin) {
base.willMergeMixin(props);
}
- concats = concatenatedMixinProperties("concatenatedProperties", props, values, base);
- mergings = concatenatedMixinProperties("mergedProperties", props, values, base);
+ concats = concatenatedMixinProperties('concatenatedProperties', props, values, base);
+ mergings = concatenatedMixinProperties('mergedProperties', props, values, base);
for (key in props) {
if (!props.hasOwnProperty(key)) {
continue;
}
keys.push(key);
addNormalizedProperty(base, key, props[key], meta, descs, values, concats, mergings);
}
// manually copy toString() because some JS engines do not enumerate it
- if (props.hasOwnProperty("toString")) {
+ if (props.hasOwnProperty('toString')) {
base.toString = props.toString;
}
} else if (currentMixin.mixins) {
mergeMixins(currentMixin.mixins, m, descs, values, base, keys);
if (currentMixin._without) {
@@ -5557,11 +5577,11 @@
function detectBinding(obj, key, value, m) {
if (IS_BINDING.test(key)) {
var bindings = m.bindings;
if (!bindings) {
bindings = m.bindings = {};
- } else if (!m.hasOwnProperty("bindings")) {
+ } else if (!m.hasOwnProperty('bindings')) {
bindings = m.bindings = o_create['default'](m.bindings);
}
bindings[key] = value;
}
}
@@ -5629,11 +5649,11 @@
var value;
var possibleDesc;
if (descs[altKey] || values[altKey]) {
value = values[altKey];
desc = descs[altKey];
- } else if ((possibleDesc = obj[altKey]) && possibleDesc !== null && typeof possibleDesc === "object" && possibleDesc.isDescriptor) {
+ } else if ((possibleDesc = obj[altKey]) && possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor) {
desc = possibleDesc;
value = undefined;
} else {
desc = undefined;
value = obj[altKey];
@@ -5653,20 +5673,20 @@
}
function replaceObserversAndListeners(obj, key, observerOrListener) {
var prev = obj[key];
- if ("function" === typeof prev) {
- updateObserversAndListeners(obj, key, prev, "__ember_observesBefore__", ember_metal__observer.removeBeforeObserver);
- updateObserversAndListeners(obj, key, prev, "__ember_observes__", ember_metal__observer.removeObserver);
- updateObserversAndListeners(obj, key, prev, "__ember_listens__", events.removeListener);
+ if ('function' === typeof prev) {
+ updateObserversAndListeners(obj, key, prev, '__ember_observesBefore__', ember_metal__observer.removeBeforeObserver);
+ updateObserversAndListeners(obj, key, prev, '__ember_observes__', ember_metal__observer.removeObserver);
+ updateObserversAndListeners(obj, key, prev, '__ember_listens__', events.removeListener);
}
- if ("function" === typeof observerOrListener) {
- updateObserversAndListeners(obj, key, observerOrListener, "__ember_observesBefore__", ember_metal__observer.addBeforeObserver);
- updateObserversAndListeners(obj, key, observerOrListener, "__ember_observes__", ember_metal__observer.addObserver);
- updateObserversAndListeners(obj, key, observerOrListener, "__ember_listens__", events.addListener);
+ if ('function' === typeof observerOrListener) {
+ updateObserversAndListeners(obj, key, observerOrListener, '__ember_observesBefore__', ember_metal__observer.addBeforeObserver);
+ updateObserversAndListeners(obj, key, observerOrListener, '__ember_observes__', ember_metal__observer.addObserver);
+ updateObserversAndListeners(obj, key, observerOrListener, '__ember_listens__', events.addListener);
}
}
function applyMixin(obj, mixins, partial) {
var descs = {};
@@ -5686,11 +5706,11 @@
// * Copying `toString` in broken browsers
mergeMixins(mixins, mixinsMeta(obj), descs, values, obj, keys);
for (var i = 0, l = keys.length; i < l; i++) {
key = keys[i];
- if (key === "constructor" || !values.hasOwnProperty(key)) {
+ if (key === 'constructor' || !values.hasOwnProperty(key)) {
continue;
}
desc = descs[key];
value = values[key];
@@ -5727,10 +5747,11 @@
@for Ember
@param obj
@param mixins*
@return obj
*/
+
function mixin(obj) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
@@ -5833,17 +5854,18 @@
@method create
@static
@param arguments*
*/
Mixin.create = function () {
+ // ES6TODO: this relies on a global state?
+ Ember['default'].anyUnprocessedMixins = true;
+ var M = this;
+
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
- // ES6TODO: this relies on a global state?
- Ember['default'].anyUnprocessedMixins = true;
- var M = this;
return new M(args, undefined);
};
var MixinPrototype = Mixin.prototype;
@@ -5866,11 +5888,11 @@
var mixins = this.mixins;
var idx;
for (idx = 0; idx < len; idx++) {
currentMixin = arguments[idx];
- Ember['default'].assert("Expected hash or Mixin instance, got " + Object.prototype.toString.call(currentMixin), typeof currentMixin === "object" && currentMixin !== null && Object.prototype.toString.call(currentMixin) !== "[object Array]");
+ Ember['default'].assert("Expected hash or Mixin instance, got " + Object.prototype.toString.call(currentMixin), typeof currentMixin === 'object' && currentMixin !== null && Object.prototype.toString.call(currentMixin) !== '[object Array]');
if (currentMixin instanceof Mixin) {
mixins.push(currentMixin);
} else {
mixins.push(new Mixin(undefined, currentMixin));
@@ -5924,24 +5946,25 @@
return false;
}
if (obj instanceof Mixin) {
return _detect(obj, this, {});
}
- var m = obj["__ember_meta__"];
+ var m = obj['__ember_meta__'];
var mixins = m && m.mixins;
if (mixins) {
return !!mixins[utils.guidFor(this)];
}
return false;
};
MixinPrototype.without = function () {
+ var ret = new Mixin([this]);
+
for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
args[_key3] = arguments[_key3];
}
- var ret = new Mixin([this]);
ret._without = args;
return ret;
};
function _keys(ret, mixin, seen) {
@@ -5978,11 +6001,11 @@
};
// returns the mixins currently applied to the specified object
// TODO: Make Ember.mixin
Mixin.mixins = function (obj) {
- var m = obj["__ember_meta__"];
+ var m = obj['__ember_meta__'];
var mixins = m && m.mixins;
var ret = [];
if (!mixins) {
return ret;
@@ -6000,21 +6023,22 @@
return ret;
};
REQUIRED = new ember_metal__properties.Descriptor();
REQUIRED.toString = function () {
- return "(Required Property)";
+ return '(Required Property)';
};
/**
Denotes a required property for a mixin
@method required
@for Ember
*/
+
function required() {
- Ember['default'].deprecate("Ember.required is deprecated as its behavior is inconsistent and unreliable.", false);
+ Ember['default'].deprecate('Ember.required is deprecated as its behavior is inconsistent and unreliable.', false);
return REQUIRED;
}
function Alias(methodName) {
this.isDescriptor = true;
@@ -6042,10 +6066,11 @@
@method aliasMethod
@for Ember
@param {String} methodName name of the method to alias
*/
+
function aliasMethod(methodName) {
return new Alias(methodName);
}
// ..........................................................
@@ -6073,10 +6098,11 @@
@for Ember
@param {String} propertyNames*
@param {Function} func
@return func
*/
+
function observer() {
for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
args[_key4] = arguments[_key4];
}
@@ -6130,14 +6156,15 @@
@for Ember
@param {String} propertyNames*
@param {Function} func
@return func
*/
+
function immediateObserver() {
for (var i = 0, l = arguments.length; i < l; i++) {
var arg = arguments[i];
- Ember['default'].assert("Immediate observers must observe internal properties only, not properties on other objects.", typeof arg !== "string" || arg.indexOf(".") === -1);
+ Ember['default'].assert("Immediate observers must observe internal properties only, not properties on other objects.", typeof arg !== "string" || arg.indexOf('.') === -1);
}
return observer.apply(this, arguments);
}
@@ -6181,10 +6208,11 @@
@for Ember
@param {String} propertyNames*
@param {Function} func
@return func
*/
+
function beforeObserver() {
for (var _len5 = arguments.length, args = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
args[_key5] = arguments[_key5];
}
@@ -6235,12 +6263,12 @@
exports._suspendBeforeObservers = _suspendBeforeObservers;
exports._suspendObservers = _suspendObservers;
exports.beforeObserversFor = beforeObserversFor;
exports.removeBeforeObserver = removeBeforeObserver;
- var AFTER_OBSERVERS = ":change";
- var BEFORE_OBSERVERS = ":before";
+ var AFTER_OBSERVERS = ':change';
+ var BEFORE_OBSERVERS = ':before';
function changeEvent(keyName) {
return keyName + AFTER_OBSERVERS;
}
@@ -6254,10 +6282,11 @@
@param obj
@param {String} path
@param {Object|Function} targetOrMethod
@param {Function|String} [method]
*/
+
function addObserver(obj, _path, target, method) {
ember_metal__events.addListener(obj, changeEvent(_path), target, method);
watching.watch(obj, _path);
return this;
@@ -6273,10 +6302,11 @@
@param obj
@param {String} path
@param {Object|Function} target
@param {Function|String} [method]
*/
+
function removeObserver(obj, path, target, method) {
watching.unwatch(obj, path);
ember_metal__events.removeListener(obj, changeEvent(path), target, method);
return this;
@@ -6288,10 +6318,11 @@
@param obj
@param {String} path
@param {Object|Function} target
@param {Function|String} [method]
*/
+
function addBeforeObserver(obj, path, target, method) {
ember_metal__events.addListener(obj, beforeEvent(path), target, method);
watching.watch(obj, path);
return this;
@@ -6330,10 +6361,11 @@
@param obj
@param {String} path
@param {Object|Function} target
@param {Function|String} [method]
*/
+
function removeBeforeObserver(obj, path, target, method) {
watching.unwatch(obj, path);
ember_metal__events.removeListener(obj, beforeEvent(path), target, method);
return this;
@@ -6444,11 +6476,13 @@
isGlobalPathCache: isGlobalPathCache,
hasThisCache: hasThisCache,
firstDotIndexCache: firstDotIndexCache,
firstKeyCache: firstKeyCache,
tailPathCache: tailPathCache
- };function isGlobal(path) {
+ };
+
+ function isGlobal(path) {
return isGlobalCache.get(path);
}
function isGlobalPath(path) {
return isGlobalPathCache.get(path);
@@ -6476,24 +6510,11 @@
enifed('ember-metal/platform/create', ['exports', 'ember-metal/platform/define_properties'], function (exports, defineProperties) {
- 'REMOVE_USE_STRICT: true'; /**
- @class platform
- @namespace Ember
- @static
- */
-
- /**
- Identical to `Object.create()`. Implements if not available natively.
-
- @since 1.8.0
- @method create
- @for Ember
- */
- var create;
+ "REMOVE_USE_STRICT: true";var create;
// ES5 15.2.3.5
// http://es5.github.com/#x15.2.3.5
if (!(Object.create && !Object.create(null).hasOwnProperty)) {
/* jshint scripturl:true, proto:true */
// Contributed by Brandon Benvie, October, 2012
@@ -6502,11 +6523,11 @@
// the following produces false positives
// in Opera Mini => not a reliable check
// Object.prototype.__proto__ === null
if (supportsProto || typeof document === 'undefined') {
createEmpty = function () {
- return { '__proto__': null };
+ return { "__proto__": null };
};
} else {
// In old IE __proto__ can't be used to manually set `null`, nor does
// any other method exist to make an object that inherits from nothing,
// aside from Object.prototype itself. Instead, create a new global
@@ -6545,17 +6566,17 @@
function Type() {} // An empty constructor.
if (prototype === null) {
object = createEmpty();
} else {
- if (typeof prototype !== 'object' && typeof prototype !== 'function') {
+ if (typeof prototype !== "object" && typeof prototype !== "function") {
// In the native implementation `parent` can be `null`
// OR *any* `instanceof Object` (Object|Function|Array|RegExp|etc)
// Use `typeof` tho, b/c in old IE, DOM elements are not `instanceof Object`
// like they are in modern browsers. Using `Object.create` on DOM elements
// is...err...probably inappropriate, but the native version allows for it.
- throw new TypeError('Object prototype may only be an Object or null'); // same msg as Chrome
+ throw new TypeError("Object prototype may only be an Object or null"); // same msg as Chrome
}
Type.prototype = prototype;
object = new Type();
@@ -6706,14 +6727,14 @@
if (!canDefinePropertyOnDOM) {
defineProperty = function (obj, keyName, desc) {
var isNode;
- if (typeof Node === 'object') {
+ if (typeof Node === "object") {
isNode = obj instanceof Node;
} else {
- isNode = typeof obj === 'object' && typeof obj.nodeType === 'number' && typeof obj.nodeName === 'string';
+ isNode = typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string";
}
if (isNode) {
// TODO: Should we have a warning here?
return obj[keyName] = desc.value;
@@ -6764,11 +6785,11 @@
};
}
function DEFAULT_GETTER_FUNCTION(name) {
return function GETTER_FUNCTION() {
- var meta = this["__ember_meta__"];
+ var meta = this['__ember_meta__'];
return meta && meta.values[name];
};
}
/**
@@ -6814,19 +6835,20 @@
computed property) or an ES5 descriptor.
You must provide this or `data` but not both.
@param {*} [data] something other than a descriptor, that will
become the explicit value of this property.
*/
+
function defineProperty(obj, keyName, desc, data, meta) {
var possibleDesc, existingDesc, watching, value;
if (!meta) {
meta = utils.meta(obj);
}
var watchEntry = meta.watching[keyName];
possibleDesc = obj[keyName];
- existingDesc = possibleDesc !== null && typeof possibleDesc === "object" && possibleDesc.isDescriptor ? possibleDesc : undefined;
+ existingDesc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined;
watching = watchEntry !== undefined && watchEntry > 0;
if (existingDesc) {
existingDesc.teardown(obj, keyName);
@@ -6922,15 +6944,15 @@
@param {Object} obj The object with the property that will change
@param {String} keyName The property key (or path) that will change.
@return {void}
*/
function propertyWillChange(obj, keyName) {
- var m = obj["__ember_meta__"];
- var watching = m && m.watching[keyName] > 0 || keyName === "length";
+ var m = obj['__ember_meta__'];
+ var watching = m && m.watching[keyName] > 0 || keyName === 'length';
var proto = m && m.proto;
var possibleDesc = obj[keyName];
- var desc = possibleDesc !== null && typeof possibleDesc === "object" && possibleDesc.isDescriptor ? possibleDesc : undefined;
+ var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined;
if (!watching) {
return;
}
@@ -6961,26 +6983,26 @@
@param {Object} obj The object with the property that will change
@param {String} keyName The property key (or path) that will change.
@return {void}
*/
function propertyDidChange(obj, keyName) {
- var m = obj["__ember_meta__"];
- var watching = m && m.watching[keyName] > 0 || keyName === "length";
+ var m = obj['__ember_meta__'];
+ var watching = m && m.watching[keyName] > 0 || keyName === 'length';
var proto = m && m.proto;
var possibleDesc = obj[keyName];
- var desc = possibleDesc !== null && typeof possibleDesc === "object" && possibleDesc.isDescriptor ? possibleDesc : undefined;
+ var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined;
if (proto === obj) {
return;
}
// shouldn't this mean that we're watching this key?
if (desc && desc.didChange) {
desc.didChange(obj, keyName);
}
- if (!watching && keyName !== "length") {
+ if (!watching && keyName !== 'length') {
return;
}
if (m && m.deps && m.deps[keyName]) {
dependentKeysDidChange(obj, keyName, m);
@@ -7065,11 +7087,11 @@
if (deps) {
keys = keysOf(deps);
for (i = 0; i < keys.length; i++) {
key = keys[i];
possibleDesc = obj[key];
- desc = possibleDesc !== null && typeof possibleDesc === "object" && possibleDesc.isDescriptor ? possibleDesc : undefined;
+ desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined;
if (desc && desc._suspended === obj) {
continue;
}
@@ -7077,11 +7099,11 @@
}
}
}
function chainsWillChange(obj, keyName, m) {
- if (!(m.hasOwnProperty("chainWatchers") && m.chainWatchers[keyName])) {
+ if (!(m.hasOwnProperty('chainWatchers') && m.chainWatchers[keyName])) {
return;
}
var nodes = m.chainWatchers[keyName];
var events = [];
@@ -7095,11 +7117,11 @@
propertyWillChange(events[i], events[i + 1]);
}
}
function chainsDidChange(obj, keyName, m, suppressEvents) {
- if (!(m && m.hasOwnProperty("chainWatchers") && m.chainWatchers[keyName])) {
+ if (!(m && m.hasOwnProperty('chainWatchers') && m.chainWatchers[keyName])) {
return;
}
var nodes = m.chainWatchers[keyName];
var events = suppressEvents ? null : [];
@@ -7166,11 +7188,11 @@
function notifyBeforeObservers(obj, keyName) {
if (obj.isDestroying) {
return;
}
- var eventName = keyName + ":before";
+ var eventName = keyName + ':before';
var listeners, added;
if (deferred) {
listeners = beforeObserverSet.add(obj, keyName, eventName);
added = ember_metal__events.accumulateListeners(obj, eventName, listeners);
ember_metal__events.sendEvent(obj, eventName, [obj, keyName], added);
@@ -7182,11 +7204,11 @@
function notifyObservers(obj, keyName) {
if (obj.isDestroying) {
return;
}
- var eventName = keyName + ":change";
+ var eventName = keyName + ':change';
var listeners;
if (deferred) {
listeners = observerSet.add(obj, keyName, eventName);
ember_metal__events.accumulateListeners(obj, eventName, listeners);
} else {
@@ -7235,17 +7257,18 @@
@for Ember
@param {Object} obj The object to retrieve from.
@param {String} keyName The property key to retrieve
@return {Object} the property value or `null`.
*/
+
function get(obj, keyName) {
// Helpers that operate with 'this' within an #each
- if (keyName === "") {
+ if (keyName === '') {
return obj;
}
- if (!keyName && "string" === typeof obj) {
+ if (!keyName && 'string' === typeof obj) {
keyName = obj;
obj = Ember['default'].lookup;
}
Ember['default'].assert("Cannot call get with " + keyName + " key.", !!keyName);
@@ -7253,13 +7276,13 @@
if (isNone['default'](obj)) {
return _getPath(obj, keyName);
}
- var meta = obj["__ember_meta__"];
+ var meta = obj['__ember_meta__'];
var possibleDesc = obj[keyName];
- var desc = possibleDesc !== null && typeof possibleDesc === "object" && possibleDesc.isDescriptor ? possibleDesc : undefined;
+ var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined;
var ret;
if (desc === undefined && path_cache.isPath(keyName)) {
return _getPath(obj, keyName);
}
@@ -7272,11 +7295,11 @@
ret = meta.values[keyName];
} else {
ret = obj[keyName];
}
- if (ret === undefined && "object" === typeof obj && !(keyName in obj) && "function" === typeof obj.unknownProperty) {
+ if (ret === undefined && 'object' === typeof obj && !(keyName in obj) && 'function' === typeof obj.unknownProperty) {
return obj.unknownProperty(keyName);
}
return ret;
}
@@ -7293,17 +7316,18 @@
@for Ember
@param {Object} target The current target. May be `null`.
@param {String} path A path on the target or a global property path.
@return {Array} a temporary array with the normalized target/path pair.
*/
+
function normalizeTuple(target, path) {
var hasThis = path_cache.hasThis(path);
var isGlobal = !hasThis && path_cache.isGlobal(path);
var key;
if (!target && !isGlobal) {
- return [undefined, ""];
+ return [undefined, ''];
}
if (hasThis) {
path = path.slice(5);
}
@@ -7327,10 +7351,11 @@
function validateIsPath(path) {
if (!path || path.length === 0) {
throw new EmberError['default']("Object in path " + path + " could not be found or was destroyed.");
}
}
+
function _getPath(root, path) {
var hasThis, parts, tuple, idx, len;
// detect complicated paths and normalize them
hasThis = path_cache.hasThis(path);
@@ -7371,11 +7396,11 @@
exports.set = set;
exports.trySet = trySet;
function set(obj, keyName, value, tolerant) {
- if (typeof obj === "string") {
+ if (typeof obj === 'string') {
Ember['default'].assert("Path '" + obj + "' must be global if no obj is given.", path_cache.isGlobalPath(obj));
value = keyName;
keyName = obj;
obj = Ember['default'].lookup;
}
@@ -7386,37 +7411,37 @@
return setPath(obj, keyName, value, tolerant);
}
var meta, possibleDesc, desc;
if (obj) {
- meta = obj["__ember_meta__"];
+ meta = obj['__ember_meta__'];
possibleDesc = obj[keyName];
- desc = possibleDesc !== null && typeof possibleDesc === "object" && possibleDesc.isDescriptor ? possibleDesc : undefined;
+ desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined;
}
var isUnknown, currentValue;
if ((!obj || desc === undefined) && path_cache.isPath(keyName)) {
return setPath(obj, keyName, value, tolerant);
}
Ember['default'].assert("You need to provide an object and key to `set`.", !!obj && keyName !== undefined);
- Ember['default'].assert("calling set on destroyed object", !obj.isDestroyed);
+ Ember['default'].assert('calling set on destroyed object', !obj.isDestroyed);
if (desc) {
desc.set(obj, keyName, value);
} else {
- if (obj !== null && value !== undefined && typeof obj === "object" && obj[keyName] === value) {
+ if (obj !== null && value !== undefined && typeof obj === 'object' && obj[keyName] === value) {
return value;
}
- isUnknown = "object" === typeof obj && !(keyName in obj);
+ isUnknown = 'object' === typeof obj && !(keyName in obj);
// setUnknownProperty is called if `obj` is an object,
// the property does not already exist, and the
// `setUnknownProperty` method exists on the object
- if (isUnknown && "function" === typeof obj.setUnknownProperty) {
+ if (isUnknown && 'function' === typeof obj.setUnknownProperty) {
obj.setUnknownProperty(keyName, value);
} else if (meta && meta.watching[keyName] > 0) {
if (meta.proto !== obj) {
if (define_property.hasPropertyAccessors) {
@@ -7431,12 +7456,12 @@
if (define_property.hasPropertyAccessors) {
if (currentValue === undefined && !(keyName in obj) || !Object.prototype.propertyIsEnumerable.call(obj, keyName)) {
properties.defineProperty(obj, keyName, null, value); // setup mandatory setter
} else {
- meta.values[keyName] = value;
- }
+ meta.values[keyName] = value;
+ }
} else {
obj[keyName] = value;
}
property_events.propertyDidChange(obj, keyName);
}
@@ -7449,30 +7474,30 @@
function setPath(root, path, value, tolerant) {
var keyName;
// get the last part of the path
- keyName = path.slice(path.lastIndexOf(".") + 1);
+ keyName = path.slice(path.lastIndexOf('.') + 1);
// get the first part of the part
path = path === keyName ? keyName : path.slice(0, path.length - (keyName.length + 1));
// unless the path is this, look up the first part to
// get the root
- if (path !== "this") {
+ if (path !== 'this') {
root = property_get._getPath(root, path);
}
if (!keyName || keyName.length === 0) {
- throw new EmberError['default']("Property set failed: You passed an empty path");
+ throw new EmberError['default']('Property set failed: You passed an empty path');
}
if (!root) {
if (tolerant) {
return;
} else {
- throw new EmberError['default']("Property set failed: object in path \"" + path + "\" could not be found or was destroyed.");
+ throw new EmberError['default']('Property set failed: object in path "' + path + '" could not be found or was destroyed.');
}
}
return set(root, keyName, value);
}
@@ -7488,10 +7513,11 @@
@for Ember
@param {Object} obj The object to modify.
@param {String} path The property path to set
@param {Object} value The value to set
*/
+
function trySet(root, path, value) {
return set(root, path, value, true);
}
});
@@ -7747,11 +7773,11 @@
will be resolved on the target object at the time the scheduled item is
invoked allowing you to change the target function.
@param {Object} [arguments*] Optional arguments to be passed to the queued method.
@return {void}
*/
- run.schedule = function () {
+ run.schedule = function () /* queue, target, method */{
checkAutoRun();
backburner.schedule.apply(backburner, arguments);
};
// Used by global test teardown
@@ -7809,11 +7835,11 @@
target at the time the method is invoked.
@param {Object} [args*] Optional arguments to pass to the timeout.
@param {Number} wait Number of milliseconds to wait.
@return {*} Timer information for use in cancelling, see `run.cancel`.
*/
- run.later = function () {
+ run.later = function () /*target, method*/{
return backburner.later.apply(backburner, arguments);
};
/**
Schedule a function to run one time during the current RunLoop. This is equivalent
@@ -7826,15 +7852,16 @@
target at the time the method is invoked.
@param {Object} [args*] Optional arguments to pass to the timeout.
@return {Object} Timer information for use in cancelling, see `run.cancel`.
*/
run.once = function () {
+ checkAutoRun();
+
for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
args[_key3] = arguments[_key3];
}
- checkAutoRun();
args.unshift('actions');
return backburner.scheduleOnce.apply(backburner, args);
};
/**
@@ -7886,11 +7913,11 @@
If you pass a string it will be resolved on the
target at the time the method is invoked.
@param {Object} [args*] Optional arguments to pass to the timeout.
@return {Object} Timer information for use in cancelling, see `run.cancel`.
*/
- run.scheduleOnce = function () {
+ run.scheduleOnce = function () /*queue, target, method*/{
checkAutoRun();
return backburner.scheduleOnce.apply(backburner, arguments);
};
/**
@@ -8146,11 +8173,10 @@
run._addQueue = function (name, after) {
if (array.indexOf.call(run.queues, name) === -1) {
run.queues.splice(array.indexOf.call(run.queues, after) + 1, 0, name);
}
};
- /* queue, target, method */ /*target, method*/ /*queue, target, method*/
});
enifed('ember-metal/set_properties', ['exports', 'ember-metal/property_events', 'ember-metal/property_set', 'ember-metal/keys'], function (exports, property_events, property_set, keys) {
'use strict';
@@ -8339,11 +8365,11 @@
Stream.prototype = {
isStream: true,
init: function () {
- this.state = "dirty";
+ this.state = 'dirty';
this.cache = undefined;
this.subscriberHead = null;
this.subscriberTail = null;
this.children = undefined;
this._label = undefined;
@@ -8370,14 +8396,14 @@
return keyStream.get(tailPath);
}
},
value: function () {
- if (this.state === "clean") {
+ if (this.state === 'clean') {
return this.cache;
- } else if (this.state === "dirty") {
- this.state = "clean";
+ } else if (this.state === 'dirty') {
+ this.state = 'clean';
return this.cache = this.valueFn();
}
// TODO: Ensure value is never called on a destroyed stream
// so that we can uncomment this assertion.
//
@@ -8395,12 +8421,12 @@
notify: function () {
this.notifyExcept();
},
notifyExcept: function (callbackToSkip, contextToSkip) {
- if (this.state === "clean") {
- this.state = "dirty";
+ if (this.state === 'clean') {
+ this.state = 'dirty';
this._notifySubscribers(callbackToSkip, contextToSkip);
}
},
subscribe: function (callback, context) {
@@ -8454,12 +8480,12 @@
}
}
},
destroy: function () {
- if (this.state !== "destroyed") {
- this.state = "destroyed";
+ if (this.state !== 'destroyed') {
+ this.state = 'destroyed';
var children = this.children;
for (var key in children) {
children[key].destroy();
}
@@ -8518,20 +8544,20 @@
_scheduleSync: function (value, callback, context) {
if (this.senderCallback === undefined && this.senderContext === undefined) {
this.senderCallback = callback;
this.senderContext = context;
this.senderValue = value;
- run['default'].schedule("sync", this, this._sync);
+ run['default'].schedule('sync', this, this._sync);
} else if (this.senderContext !== this) {
this.senderCallback = callback;
this.senderContext = context;
this.senderValue = value;
}
},
_sync: function () {
- if (this.state === "destroyed") {
+ if (this.state === 'destroyed') {
return;
}
if (this.senderContext !== this) {
this.stream.setValue(this.senderValue);
@@ -8542,11 +8568,11 @@
this.senderCallback = undefined;
this.senderContext = undefined;
this.senderValue = undefined;
// Force StreamBindings to always notify
- this.state = "clean";
+ this.state = 'clean';
this.notifyExcept(senderCallback, senderContext);
},
_super$destroy: Stream['default'].prototype.destroy,
@@ -8591,10 +8617,11 @@
@param {Object|Stream} object object or stream to potentially subscribe to
@param {Function} callback function to run when stream value changes
@param {Object} [context] the callback will be executed with this context if it
is provided
*/
+
function subscribe(object, callback, context) {
if (object && object.isStream) {
object.subscribe(callback, context);
}
}
@@ -8608,10 +8635,11 @@
@function unsubscribe
@param {Object|Stream} object object or stream to potentially unsubscribe from
@param {Function} callback function originally passed to `subscribe()`
@param {Object} [context] object originally passed to `subscribe()`
*/
+
function unsubscribe(object, callback, context) {
if (object && object.isStream) {
object.unsubscribe(callback, context);
}
}
@@ -8624,10 +8652,11 @@
@for Ember.stream
@function read
@param {Object|Stream} object object to return the value of
@return the stream's current value, or the non-stream object itself
*/
+
function read(object) {
if (object && object.isStream) {
return object.value();
} else {
return object;
@@ -8644,10 +8673,11 @@
@return {Array} a new array of the same length with the values of non-stream
objects mapped from their original positions untouched, and
the values of stream objects retaining their original position
and replaced with the stream's current value.
*/
+
function readArray(array) {
var length = array.length;
var ret = new Array(length);
for (var i = 0; i < length; i++) {
ret[i] = read(array[i]);
@@ -8666,10 +8696,11 @@
@return {Object} a new object with the same keys as the passed object. The
property values in the new object are the original values in
the case of non-stream objects, and the streams' current
values in the case of stream objects.
*/
+
function readHash(object) {
var ret = {};
for (var key in object) {
ret[key] = read(object[key]);
}
@@ -8684,10 +8715,11 @@
@function scanArray
@param {Array} array array given to a handlebars helper
@return {Boolean} `true` if the array contains a stream/bound value, `false`
otherwise
*/
+
function scanArray(array) {
var length = array.length;
var containsStream = false;
for (var i = 0; i < length; i++) {
@@ -8708,10 +8740,11 @@
@function scanHash
@param {Object} hash "hash" argument given to a handlebars helper
@return {Boolean} `true` if the object contains a stream/bound value, `false`
otherwise
*/
+
function scanHash(hash) {
var containsStream = false;
for (var prop in hash) {
if (isStream(hash[prop])) {
@@ -8734,10 +8767,11 @@
@param {String} separator string to be used to join array elements
@return {String} String with array elements concatenated and joined by the
provided separator, and any stream array members having been
replaced by the current value of the stream
*/
+
function concat(array, separator) {
// TODO: Create subclass ConcatStream < Stream. Defer
// subscribing to streams until the value() is called.
var hasStream = scanArray(array);
if (hasStream) {
@@ -8786,10 +8820,11 @@
stream that will be updated with the return value of
the provided function `fn`. In the case of a
non-stream object, the return value of the provided
function `fn`.
*/
+
function chain(value, fn) {
if (isStream(value)) {
var stream = new Stream['default'](fn);
subscribe(value, stream.notify, stream);
return stream;
@@ -8817,32 +8852,22 @@
exports.meta = meta;
exports.typeOf = typeOf;
exports.isArray = isArray;
exports.canInvoke = canInvoke;
- "REMOVE_USE_STRICT: true"; /**
- @module ember-metal
- */
+ "REMOVE_USE_STRICT: true";var _uuid = 0;
/**
- Previously we used `Ember.$.uuid`, however `$.uuid` has been removed from
- jQuery master. We'll just bootstrap our own uuid now.
-
- @private
- @return {Number} the uuid
- */
- var _uuid = 0;
-
- /**
Generates a universally unique identifier. This method
is used internally by Ember for assisting with
the generation of GUID's and other unique identifiers
such as `bind-attr` data attributes.
@public
@return {Number} [description]
*/
+
function uuid() {
return ++_uuid;
}
/**
@@ -8851,11 +8876,11 @@
@property GUID_PREFIX
@for Ember
@type String
@final
*/
- var GUID_PREFIX = "ember";
+ var GUID_PREFIX = 'ember';
// Used for guid generation...
var numberCache = [];
var stringCache = {};
@@ -8921,11 +8946,11 @@
@property GUID_KEY
@for Ember
@type String
@final
*/
- var GUID_KEY = intern("__ember" + +new Date());
+ var GUID_KEY = intern('__ember' + +new Date());
var GUID_DESC = {
writable: true,
configurable: true,
enumerable: false,
@@ -8952,21 +8977,21 @@
enumerable: false,
value: null
};
var EMBER_META_PROPERTY = {
- name: "__ember_meta__",
+ name: '__ember_meta__',
descriptor: META_DESC
};
var GUID_KEY_PROPERTY = {
name: GUID_KEY,
descriptor: nullDescriptor
};
var NEXT_SUPER_PROPERTY = {
- name: "__nextSuper",
+ name: '__nextSuper',
descriptor: undefinedDescriptor
};
function generateGuid(obj, prefix) {
if (!prefix) {
@@ -9001,10 +9026,11 @@
@method guidFor
@for Ember
@param {Object} obj any object, string, number, Element, or primitive
@return {String} the unique guid for this instance.
*/
+
function guidFor(obj) {
// special cases where we don't want to add a key to object
if (obj === undefined) {
return "(undefined)";
@@ -9017,42 +9043,42 @@
var ret;
var type = typeof obj;
// Don't allow prototype changes to String etc. to change the guidFor
switch (type) {
- case "number":
+ case 'number':
ret = numberCache[obj];
if (!ret) {
- ret = numberCache[obj] = "nu" + obj;
+ ret = numberCache[obj] = 'nu' + obj;
}
return ret;
- case "string":
+ case 'string':
ret = stringCache[obj];
if (!ret) {
- ret = stringCache[obj] = "st" + uuid();
+ ret = stringCache[obj] = 'st' + uuid();
}
return ret;
- case "boolean":
- return obj ? "(true)" : "(false)";
+ case 'boolean':
+ return obj ? '(true)' : '(false)';
default:
if (obj[GUID_KEY]) {
return obj[GUID_KEY];
}
if (obj === Object) {
- return "(Object)";
+ return '(Object)';
}
if (obj === Array) {
- return "(Array)";
+ return '(Array)';
}
ret = GUID_PREFIX + uuid();
if (obj[GUID_KEY] === null) {
@@ -9139,11 +9165,11 @@
if (!ret) {
if (define_property.canDefineNonEnumerableProperties) {
if (obj.__defineNonEnumerable) {
obj.__defineNonEnumerable(EMBER_META_PROPERTY);
} else {
- define_property.defineProperty(obj, "__ember_meta__", META_DESC);
+ define_property.defineProperty(obj, '__ember_meta__', META_DESC);
}
}
ret = new Meta(obj);
@@ -9156,11 +9182,11 @@
obj.__ember_meta__ = ret;
} else if (ret.source !== obj) {
if (obj.__defineNonEnumerable) {
obj.__defineNonEnumerable(EMBER_META_PROPERTY);
} else {
- define_property.defineProperty(obj, "__ember_meta__", META_DESC);
+ define_property.defineProperty(obj, '__ember_meta__', META_DESC);
}
ret = o_create['default'](ret);
ret.watching = o_create['default'](ret.watching);
ret.cache = undefined;
@@ -9171,14 +9197,15 @@
if (define_property.hasPropertyAccessors) {
ret.values = o_create['default'](ret.values);
}
- obj["__ember_meta__"] = ret;
+ obj['__ember_meta__'] = ret;
}
return ret;
}
+
function getMeta(obj, property) {
var _meta = meta(obj, false);
return _meta[property];
}
@@ -9219,10 +9246,11 @@
@param {Array} path An array of keys to walk down
@param {Boolean} writable whether or not to create a new meta
(or meta property) if one does not already exist or if it's
shared with its constructor
*/
+
function metaPath(obj, path, writable) {
Ember['default'].deprecate("Ember.metaPath is deprecated and will be removed from future releases.");
var _meta = meta(obj, writable);
var keyName, value;
@@ -9259,10 +9287,11 @@
@for Ember
@param {Function} func The function to call
@param {Function} superFunc The super function.
@return {Function} wrapped function.
*/
+
function wrap(func, superFunc) {
function superWrapper() {
var ret;
var sup = this && this.__nextSuper;
var length = arguments.length;
@@ -9328,13 +9357,13 @@
// ES6TODO: Move up to runtime? This is only use in ember-metal by concatenatedProperties
function isArray(obj) {
var modulePath, type;
if (typeof EmberArray === "undefined") {
- modulePath = "ember-runtime/mixins/array";
+ modulePath = 'ember-runtime/mixins/array';
if (Ember['default'].__loader.registry[modulePath]) {
- EmberArray = Ember['default'].__loader.require(modulePath)["default"];
+ EmberArray = Ember['default'].__loader.require(modulePath)['default'];
}
}
if (!obj || obj.setInterval) {
return false;
@@ -9345,14 +9374,14 @@
if (EmberArray && EmberArray.detect(obj)) {
return true;
}
type = typeOf(obj);
- if ("array" === type) {
+ if ('array' === type) {
return true;
}
- if (obj.length !== undefined && "object" === type) {
+ if (obj.length !== undefined && 'object' === type) {
return true;
}
return false;
}
@@ -9376,10 +9405,11 @@
@method makeArray
@for Ember
@param {Object} obj the object
@return {Array}
*/
+
function makeArray(obj) {
if (obj === null || obj === undefined) {
return [];
}
return isArray(obj) ? obj : [obj];
@@ -9401,11 +9431,11 @@
@param {Object} obj The object to check for the method
@param {String} methodName The method name to check for
@return {Boolean}
*/
function canInvoke(obj, methodName) {
- return !!(obj && typeof obj[methodName] === "function");
+ return !!(obj && typeof obj[methodName] === 'function');
}
/**
Checks to see if the `methodName` exists on the `obj`,
and if it does, invokes it with the arguments passed.
@@ -9423,10 +9453,11 @@
@param {Object} obj The object to check for the method
@param {String} methodName The method name to check for
@param {Array} [args] The arguments to pass to the method
@return {*} the return value of the invoked method or undefined if it cannot be invoked
*/
+
function tryInvoke(obj, methodName, args) {
if (canInvoke(obj, methodName)) {
return args ? applyStr(obj, methodName, args) : applyStr(obj, methodName);
}
}
@@ -9436,11 +9467,11 @@
var count = 0;
try {
// jscs:disable
try {} finally {
count++;
- throw new Error("needsFinallyFixTest");
+ throw new Error('needsFinallyFixTest');
}
// jscs:enable
} catch (e) {}
return count !== 1;
@@ -9675,29 +9706,29 @@
function typeOf(item) {
var ret, modulePath;
// ES6TODO: Depends on Ember.Object which is defined in runtime.
if (typeof EmberObject === "undefined") {
- modulePath = "ember-runtime/system/object";
+ modulePath = 'ember-runtime/system/object';
if (Ember['default'].__loader.registry[modulePath]) {
- EmberObject = Ember['default'].__loader.require(modulePath)["default"];
+ EmberObject = Ember['default'].__loader.require(modulePath)['default'];
}
}
- ret = item === null || item === undefined ? String(item) : TYPE_MAP[toString.call(item)] || "object";
+ ret = item === null || item === undefined ? String(item) : TYPE_MAP[toString.call(item)] || 'object';
- if (ret === "function") {
+ if (ret === 'function') {
if (EmberObject && EmberObject.detect(item)) {
- ret = "class";
+ ret = 'class';
}
- } else if (ret === "object") {
+ } else if (ret === 'object') {
if (item instanceof Error) {
- ret = "error";
+ ret = 'error';
} else if (EmberObject && item instanceof EmberObject) {
- ret = "instance";
+ ret = 'instance';
} else if (item instanceof Date) {
- ret = "date";
+ ret = 'date';
}
}
return ret;
}
@@ -9713,32 +9744,33 @@
@for Ember
@param {Object} obj The object you want to inspect.
@return {String} A description of the object
@since 1.4.0
*/
+
function inspect(obj) {
var type = typeOf(obj);
- if (type === "array") {
- return "[" + obj + "]";
+ if (type === 'array') {
+ return '[' + obj + ']';
}
- if (type !== "object") {
- return obj + "";
+ if (type !== 'object') {
+ return obj + '';
}
var v;
var ret = [];
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
v = obj[key];
- if (v === "toString") {
+ if (v === 'toString') {
continue;
} // ignore useless items
- if (typeOf(v) === "function") {
+ if (typeOf(v) === 'function') {
v = "function() { ... }";
}
- if (v && typeof v.toString !== "function") {
+ if (v && typeof v.toString !== 'function') {
ret.push(key + ": " + toString.call(v));
} else {
ret.push(key + ": " + v);
}
}
@@ -9751,10 +9783,11 @@
/**
@param {Object} target
@param {Function} method
@param {Array} args
*/
+
function apply(t, m, a) {
var l = a && a.length;
if (!a || !l) {
return m.call(t);
}
@@ -9777,10 +9810,11 @@
/**
@param {Object} target
@param {String} method
@param {Array} args
*/
+
function applyStr(t, m, a) {
var l = a && a.length;
if (!a || !l) {
return t[m]();
}
@@ -9820,11 +9854,11 @@
exports.watchKey = watchKey;
exports.unwatchKey = unwatchKey;
function watchKey(obj, keyName, meta) {
// can't watch length on Array - it is special...
- if (keyName === "length" && utils.typeOf(obj) === "array") {
+ if (keyName === 'length' && utils.typeOf(obj) === 'array') {
return;
}
var m = meta || utils.meta(obj);
var watching = m.watching;
@@ -9832,16 +9866,16 @@
// activate watching first time
if (!watching[keyName]) {
watching[keyName] = 1;
var possibleDesc = obj[keyName];
- var desc = possibleDesc !== null && typeof possibleDesc === "object" && possibleDesc.isDescriptor ? possibleDesc : undefined;
+ var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined;
if (desc && desc.willWatch) {
desc.willWatch(obj, keyName);
}
- if ("function" === typeof obj.willWatchProperty) {
+ if ('function' === typeof obj.willWatchProperty) {
obj.willWatchProperty(keyName);
}
if (define_property.hasPropertyAccessors) {
@@ -9856,13 +9890,13 @@
var handleMandatorySetter = function handleMandatorySetter(m, obj, keyName) {
var descriptor = Object.getOwnPropertyDescriptor && Object.getOwnPropertyDescriptor(obj, keyName);
var configurable = descriptor ? descriptor.configurable : true;
var isWritable = descriptor ? descriptor.writable : true;
- var hasValue = descriptor ? "value" in descriptor : true;
+ var hasValue = descriptor ? 'value' in descriptor : true;
var possibleDesc = descriptor && descriptor.value;
- var isDescriptor = possibleDesc !== null && typeof possibleDesc === "object" && possibleDesc.isDescriptor;
+ var isDescriptor = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor;
if (isDescriptor) {
return;
}
@@ -9889,16 +9923,16 @@
if (watching[keyName] === 1) {
watching[keyName] = 0;
var possibleDesc = obj[keyName];
- var desc = possibleDesc !== null && typeof possibleDesc === "object" && possibleDesc.isDescriptor ? possibleDesc : undefined;
+ var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined;
if (desc && desc.didUnwatch) {
desc.didUnwatch(obj, keyName);
}
- if ("function" === typeof obj.didUnwatchProperty) {
+ if ('function' === typeof obj.didUnwatchProperty) {
obj.didUnwatchProperty(keyName);
}
if (!desc && define_property.hasPropertyAccessors && keyName in obj) {
@@ -9940,13 +9974,14 @@
} else if (ret.value() !== obj) {
ret = m.chains = ret.copy(obj);
}
return ret;
}
+
function watchPath(obj, keyPath, meta) {
// can't watch length on Array - it is special...
- if (keyPath === "length" && utils.typeOf(obj) === "array") {
+ if (keyPath === 'length' && utils.typeOf(obj) === 'array') {
return;
}
var m = meta || utils.meta(obj);
var watching = m.watching;
@@ -9982,11 +10017,11 @@
exports.destroy = destroy;
exports.watch = watch;
function watch(obj, _keyPath, m) {
// can't watch length on Array - it is special...
- if (_keyPath === "length" && utils.typeOf(obj) === "array") {
+ if (_keyPath === 'length' && utils.typeOf(obj) === 'array') {
return;
}
if (!path_cache.isPath(_keyPath)) {
watch_key.watchKey(obj, _keyPath, m);
@@ -9994,18 +10029,19 @@
watch_path.watchPath(obj, _keyPath, m);
}
}
function isWatching(obj, key) {
- var meta = obj["__ember_meta__"];
+ var meta = obj['__ember_meta__'];
return (meta && meta.watching[key]) > 0;
}
watch.flushPending = chains.flushPendingChains;
+
function unwatch(obj, _keyPath, m) {
// can't watch length on Array - it is special...
- if (_keyPath === "length" && utils.typeOf(obj) === "array") {
+ if (_keyPath === 'length' && utils.typeOf(obj) === 'array') {
return;
}
if (!path_cache.isPath(_keyPath)) {
watch_key.unwatchKey(obj, _keyPath, m);
@@ -10023,16 +10059,17 @@
@method destroy
@for Ember
@param {Object} obj the object to destroy
@return {void}
*/
+
function destroy(obj) {
- var meta = obj["__ember_meta__"];
+ var meta = obj['__ember_meta__'];
var node, nodes, key, nodeObject;
if (meta) {
- obj["__ember_meta__"] = null;
+ obj['__ember_meta__'] = null;
// remove chainWatchers to remove circular references that would prevent GC
node = meta.chains;
if (node) {
NODE_STACK.push(node);
// process tree
@@ -10062,12 +10099,12 @@
});
enifed('ember-template-compiler', ['exports', 'ember-metal/core', 'ember-template-compiler/system/precompile', 'ember-template-compiler/system/compile', 'ember-template-compiler/system/template', 'ember-template-compiler/plugins', 'ember-template-compiler/plugins/transform-each-in-to-hash', 'ember-template-compiler/plugins/transform-with-as-to-hash', 'ember-template-compiler/compat'], function (exports, _Ember, precompile, compile, template, plugins, TransformEachInToHash, TransformWithAsToHash) {
'use strict';
- plugins.registerPlugin("ast", TransformWithAsToHash['default']);
- plugins.registerPlugin("ast", TransformEachInToHash['default']);
+ plugins.registerPlugin('ast', TransformWithAsToHash['default']);
+ plugins.registerPlugin('ast', TransformEachInToHash['default']);
exports._Ember = _Ember['default'];
exports.precompile = precompile['default'];
exports.compile = compile['default'];
exports.template = template['default'];
@@ -10128,10 +10165,11 @@
Adds an AST plugin to be used by Ember.HTMLBars.compile.
@private
@method registerASTPlugin
*/
+
function registerPlugin(type, Plugin) {
if (!plugins[type]) {
throw new Error('Attempting to register "' + Plugin + '" as "' + type + '" which is not a valid HTMLBars plugin type.');
}
@@ -10258,11 +10296,11 @@
walker.visit(ast, function (node) {
if (pluginContext.validate(node)) {
if (node.program && node.program.blockParams.length) {
- throw new Error("You cannot use keyword (`{{with foo as bar}}`) and block params (`{{with foo as |bar|}}`) at the same time.");
+ throw new Error('You cannot use keyword (`{{with foo as bar}}`) and block params (`{{with foo as |bar|}}`) at the same time.');
}
Ember.deprecate("Using {{with}} without block syntax is deprecated. " + "Please use standard block form (`{{#with foo as |bar|}}`) " + (moduleName ? " in `" + moduleName + "` " : "") + "instead.", false, { url: "http://emberjs.com/deprecations/v1.x/#toc_code-as-code-sytnax-for-code-with-code" });
var removedParams = node.sexpr.params.splice(1, 2);
@@ -10273,38 +10311,28 @@
return ast;
};
TransformWithAsToHash.prototype.validate = function TransformWithAsToHash_validate(node) {
- return node.type === "BlockStatement" && node.sexpr.path.original === "with" && node.sexpr.params.length === 3 && node.sexpr.params[1].type === "PathExpression" && node.sexpr.params[1].original === "as";
+ return node.type === 'BlockStatement' && node.sexpr.path.original === 'with' && node.sexpr.params.length === 3 && node.sexpr.params[1].type === 'PathExpression' && node.sexpr.params[1].original === 'as';
};
exports['default'] = TransformWithAsToHash;
});
enifed('ember-template-compiler/system/compile', ['exports', 'ember-template-compiler/system/compile_options', 'ember-template-compiler/system/template'], function (exports, compileOptions, template) {
'use strict';
- var compile; /**
- Uses HTMLBars `compile` function to process a string into a compiled template.
-
- This is not present in production builds.
-
- @private
- @method compile
- @param {String} templateString This is the string to be compiled by HTMLBars.
- @param {Object} options This is an options hash to augment the compiler options.
- */
- exports['default'] = function (templateString, options) {
- if (!compile && Ember.__loader.registry["htmlbars-compiler/compiler"]) {
- compile = requireModule("htmlbars-compiler/compiler").compile;
+ var compile;exports['default'] = function (templateString, options) {
+ if (!compile && Ember.__loader.registry['htmlbars-compiler/compiler']) {
+ compile = requireModule('htmlbars-compiler/compiler').compile;
}
if (!compile) {
- throw new Error("Cannot call `compile` without the template compiler loaded. Please load `ember-template-compiler.js` prior to calling `compile`.");
+ throw new Error('Cannot call `compile` without the template compiler loaded. Please load `ember-template-compiler.js` prior to calling `compile`.');
}
var templateSpec = compile(templateString, compileOptions['default'](options));
return template['default'](templateSpec);
@@ -10329,11 +10357,11 @@
// `options` being true, and causing an error during compilation.
if (options === true) {
options = {};
}
- options.revision = "Ember@1.12.1";
+ options.revision = 'Ember@1.12.2';
options.disableComponentGeneration = disableComponentGeneration;
options.plugins = plugins['default'];
return options;
}
@@ -10380,26 +10408,25 @@
/**
@module ember
@submodule ember-template-compiler
*/
+ exports['default'] = function (templateSpec) {
+ templateSpec.isTop = true;
+ templateSpec.isMethod = false;
+
+ return templateSpec;
+ }
/**
Augments the default precompiled output of an HTMLBars template with
additional information needed by Ember.
@private
@method template
@param {Function} templateSpec This is the compiled HTMLBars template spec.
*/
- exports['default'] = function (templateSpec) {
- templateSpec.isTop = true;
- templateSpec.isMethod = false;
-
- return templateSpec;
- }
-
});
enifed("htmlbars-compiler",
["./htmlbars-compiler/compiler","exports"],
function(__dependency1__, __exports__) {
"use strict";
@@ -11288,10 +11315,10 @@
var processOpcodes = __dependency6__.processOpcodes;
var repeat = __dependency7__.repeat;
function TemplateCompiler(options) {
this.options = options || {};
- this.revision = this.options.revision || "HTMLBars@v0.11.3";
+ this.revision = this.options.revision || "HTMLBars@0.11.4.d11ed3e4";
this.fragmentOpcodeCompiler = new FragmentOpcodeCompiler();
this.fragmentCompiler = new FragmentJavaScriptCompiler();
this.hydrationOpcodeCompiler = new HydrationOpcodeCompiler();
this.hydrationCompiler = new HydrationJavaScriptCompiler();
this.templates = [];
\ No newline at end of file