dist/ember-runtime.js in ember-source-2.10.0.beta.2 vs dist/ember-runtime.js in ember-source-2.10.0
- old
+ new
@@ -4,14 +4,14 @@
* @copyright Copyright 2011-2016 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 2.10.0-beta.2
+ * @version 2.10.0
*/
-var enifed, requireModule, require, Ember;
+var enifed, requireModule, Ember;
var mainContext = this;
(function() {
var isNode = typeof window === 'undefined' &&
typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';
@@ -38,18 +38,18 @@
}
registry[name] = value;
};
- require = requireModule = function(name) {
+ requireModule = function(name) {
return internalRequire(name, null);
};
// setup `require` module
- require['default'] = require;
+ requireModule['default'] = requireModule;
- require.has = function registryHas(moduleName) {
+ requireModule.has = function registryHas(moduleName) {
return !!registry[moduleName] || !!registry[moduleName + '/index'];
};
function missingModule(name, referrerName) {
if (referrerName) {
@@ -86,11 +86,11 @@
for (var i = 0; i < deps.length; i++) {
if (deps[i] === 'exports') {
reified[i] = exports;
} else if (deps[i] === 'require') {
- reified[i] = require;
+ reified[i] = requireModule;
} else {
reified[i] = internalRequire(deps[i], name);
}
}
@@ -101,16 +101,16 @@
requireModule._eak_seen = registry;
Ember.__loader = {
define: enifed,
- require: require,
+ require: requireModule,
registry: registry
};
} else {
enifed = Ember.__loader.define;
- require = requireModule = Ember.__loader.require;
+ requireModule = Ember.__loader.require;
}
})();
var babelHelpers;
@@ -3582,11 +3582,11 @@
addChainWatcher(this._object, this._key, this);
}
}
function lazyGet(obj, key) {
- if (!obj) {
+ if (!isObject(obj)) {
return;
}
var meta = _emberMetalMeta.peekMeta(obj);
@@ -4016,11 +4016,11 @@
*/
ComputedPropertyPrototype.property = function () {
var args = [];
function addArg(property) {
- _emberMetalDebug.warn('Dependent keys containing @each only work one level deep. ' + 'You cannot use nested forms like todos.@each.owner.name or todos.@each.owner.@each.name. ' + 'Please create an intermediary computed property.', DEEP_EACH_REGEX.test(property) === false, { id: 'ember-metal.computed-deep-each' });
+ _emberMetalDebug.warn('Dependent keys containing @each only work one level deep. ' + ('You used the key "' + property + '" which is invalid. ') + 'Please create an intermediary computed property.', DEEP_EACH_REGEX.test(property) === false, { id: 'ember-metal.computed-deep-each' });
args.push(property);
}
for (var i = 0; i < arguments.length; i++) {
_emberMetalExpand_properties.default(arguments[i], addArg);
@@ -5090,11 +5090,30 @@
*/
function expandProperties(pattern, callback) {
_emberMetalDebug.assert('A computed property key must be a string', typeof pattern === 'string');
_emberMetalDebug.assert('Brace expanded properties cannot contain spaces, e.g. "user.{firstName, lastName}" should be "user.{firstName,lastName}"', pattern.indexOf(' ') === -1);
+ _emberMetalDebug.assert('Brace expanded properties have to be balanced and cannot be nested, pattern: ' + pattern, (function (str) {
+ var inBrace = 0;
+ var char = undefined;
+ for (var i = 0; i < str.length; i++) {
+ char = str.charAt(i);
+ if (char === '{') {
+ inBrace++;
+ } else if (char === '}') {
+ inBrace--;
+ }
+
+ if (inBrace > 1 || inBrace < 0) {
+ return false;
+ }
+ }
+
+ return true;
+ })(pattern));
+
var parts = pattern.split(SPLIT_REGEX);
var properties = [parts];
for (var i = 0; i < parts.length; i++) {
var part = parts[i];
@@ -8973,10 +8992,11 @@
function get(obj, keyName) {
_emberMetalDebug.assert('Get must be called with two arguments; an object and a property key', arguments.length === 2);
_emberMetalDebug.assert('Cannot call get with \'' + keyName + '\' on an undefined object.', obj !== undefined && obj !== null);
_emberMetalDebug.assert('The key provided to get must be a string, you passed ' + keyName, typeof keyName === 'string');
_emberMetalDebug.assert('\'this\' in paths is not supported', !_emberMetalPath_cache.hasThis(keyName));
+ _emberMetalDebug.assert('Cannot call `Ember.get` with an empty string', keyName !== '');
var value = obj[keyName];
var desc = value !== null && typeof value === 'object' && value.isDescriptor ? value : undefined;
var ret = undefined;
@@ -9489,16 +9509,17 @@
@param {Object} [target] target object to use as the context when invoking a method.
@param {String|Function} method The method to invoke. If you pass a string it
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}
+ @return {*} Timer information for use in cancelling, see `run.cancel`.
@public
*/
run.schedule = function () /* queue, target, method */{
_emberMetalDebug.assert('You have turned on testing mode, which disabled the run-loop\'s autorun. ' + 'You will need to wrap any code with asynchronous side-effects in a run', run.currentRunLoop || !_emberMetalTesting.isTesting());
- backburner.schedule.apply(backburner, arguments);
+
+ return backburner.schedule.apply(backburner, arguments);
};
// Used by global test teardown
run.hasScheduledTimers = function () {
return backburner.hasTimers();
@@ -10151,10 +10172,13 @@
exports.unwatchKey = unwatchKey;
var handleMandatorySetter = undefined;
function watchKey(obj, keyName, meta) {
+ if (typeof obj !== 'object' || obj === null) {
+ return;
+ }
var m = meta || _emberMetalMeta.meta(obj);
// activate watching first time
if (!m.peekWatching(keyName)) {
m.writeWatching(keyName, 1);
@@ -10224,10 +10248,13 @@
};
})();
}
function unwatchKey(obj, keyName, _meta) {
+ if (typeof obj !== 'object' || obj === null) {
+ return;
+ }
var meta = _meta || _emberMetalMeta.meta(obj);
// do nothing of this object has already been destroyed
if (meta.isSourceDestroyed()) {
return;
@@ -10301,10 +10328,13 @@
function makeChainNode(obj) {
return new _emberMetalChains.ChainNode(null, null, obj);
}
function watchPath(obj, keyPath, meta) {
+ if (typeof obj !== 'object' || obj === null) {
+ return;
+ }
var m = meta || _emberMetalMeta.meta(obj);
var counter = m.peekWatching(keyPath) || 0;
if (!counter) {
// activate watching first time
m.writeWatching(keyPath, 1);
@@ -10313,10 +10343,13 @@
m.writeWatching(keyPath, counter + 1);
}
}
function unwatchPath(obj, keyPath, meta) {
+ if (typeof obj !== 'object' || obj === null) {
+ return;
+ }
var m = meta || _emberMetalMeta.meta(obj);
var counter = m.peekWatching(keyPath) || 0;
if (counter === 1) {
m.writeWatching(keyPath, 0);
@@ -10360,10 +10393,13 @@
}
exports.watch = watch;
function isWatching(obj, key) {
+ if (typeof obj !== 'object' || obj === null) {
+ return false;
+ }
var meta = _emberMetalMeta.peekMeta(obj);
return (meta && meta.peekWatching(key)) > 0;
}
function watcherCount(obj, key) {
@@ -16324,20 +16360,24 @@
isFulfilled: false,
isRejected: false
});
return promise.then(function (value) {
- _emberMetal.setProperties(proxy, {
- content: value,
- isFulfilled: true
- });
+ if (!proxy.isDestroyed && !proxy.isDestroying) {
+ _emberMetal.setProperties(proxy, {
+ content: value,
+ isFulfilled: true
+ });
+ }
return value;
}, function (reason) {
- _emberMetal.setProperties(proxy, {
- reason: reason,
- isRejected: true
- });
+ if (!proxy.isDestroyed && !proxy.isDestroying) {
+ _emberMetal.setProperties(proxy, {
+ reason: reason,
+ isRejected: true
+ });
+ }
throw reason;
}, 'Ember: PromiseProxy');
}
/**
@@ -19225,11 +19265,12 @@
'[object String]': 'string',
'[object Function]': 'function',
'[object Array]': 'array',
'[object Date]': 'date',
'[object RegExp]': 'regexp',
- '[object Object]': 'object'
+ '[object Object]': 'object',
+ '[object FileList]': 'filelist'
};
var toString = Object.prototype.toString;
/**
@@ -19294,10 +19335,11 @@
| 'undefined' | Undefined value |
| 'function' | A function |
| 'array' | An instance of Array |
| 'regexp' | An instance of RegExp |
| 'date' | An instance of Date |
+ | 'filelist' | An instance of FileList |
| 'class' | An Ember class (created using Ember.Object.extend()) |
| 'instance' | An Ember object instance |
| 'error' | An instance of the Error object |
| 'object' | A JavaScript object not inheriting from Ember.Object |
@@ -19315,10 +19357,11 @@
Ember.typeOf(new Boolean(true)); // 'boolean'
Ember.typeOf(Ember.makeArray); // 'function'
Ember.typeOf([1, 2, 90]); // 'array'
Ember.typeOf(/abc/); // 'regexp'
Ember.typeOf(new Date()); // 'date'
+ Ember.typeOf(event.target.files); // 'filelist'
Ember.typeOf(Ember.Object.extend()); // 'class'
Ember.typeOf(Ember.Object.create()); // 'instance'
Ember.typeOf(new Error('teamocil')); // 'error'
// 'normal' JavaScript object
@@ -19364,10 +19407,10 @@
exports.default = { "features-stripped-test": false, "ember-libraries-isregistered": false, "ember-runtime-computed-uniq-by": true, "ember-improved-instrumentation": false, "ember-runtime-enumerable-includes": true, "ember-string-ishtmlsafe": true, "ember-testing-check-waiters": true, "ember-metal-weakmap": false, "ember-glimmer-allow-backtracking-rerender": false, "ember-testing-resume-test": false, "mandatory-setter": true, "ember-glimmer-detect-backtracking-rerender": true };
});
enifed("ember/version", ["exports"], function (exports) {
"use strict";
- exports.default = "2.10.0-beta.2";
+ exports.default = "2.10.0";
});
/*!
* @overview RSVP - a tiny implementation of Promises/A+.
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors
* @license Licensed under MIT license