dist/ember-template-compiler.js in ember-source-1.13.3 vs dist/ember-template-compiler.js in ember-source-1.13.4
- 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.13.3
+ * @version 1.13.4
*/
(function() {
var enifed, requireModule, eriuqer, requirejs, Ember;
var mainContext = this;
@@ -295,30 +295,61 @@
Ember.oldMethod = Ember.deprecateFunc('Please use the new, updated method', Ember.newMethod);
```
@method deprecateFunc
@param {String} message A description of the deprecation.
+ @param {Object} [options] The options object for Ember.deprecate.
@param {Function} func The new function called to replace its deprecated counterpart.
@return {Function} a new function that wrapped the original function with a deprecation warning
@private
*/
- _emberMetalCore["default"].deprecateFunc = function (message, func) {
- return function () {
- _emberMetalCore["default"].deprecate(message);
- return func.apply(this, arguments);
- };
+ _emberMetalCore["default"].deprecateFunc = function () {
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
+ args[_key] = arguments[_key];
+ }
+
+ if (args.length === 3) {
+ var _ret = (function () {
+ var message = args[0];
+ var options = args[1];
+ var func = args[2];
+
+ return {
+ v: function () {
+ _emberMetalCore["default"].deprecate(message, false, options);
+ return func.apply(this, arguments);
+ }
+ };
+ })();
+
+ if (typeof _ret === "object") return _ret.v;
+ } else {
+ var _ret2 = (function () {
+ var message = args[0];
+ var func = args[1];
+
+ return {
+ v: function () {
+ _emberMetalCore["default"].deprecate(message);
+ return func.apply(this, arguments);
+ }
+ };
+ })();
+
+ if (typeof _ret2 === "object") return _ret2.v;
+ }
};
/**
Run a function meant for debugging. Ember build tools will remove any calls to
`Ember.runInDebug()` when doing a production build.
```javascript
- Ember.runInDebug(function() {
- Ember.Handlebars.EachView.reopen({
- didInsertElement: function() {
- console.log('I\'m happy');
+ Ember.runInDebug(() => {
+ Ember.Component.reopen({
+ didInsertElement() {
+ console.log("I'm happy");
}
});
});
```
@@ -572,24 +603,24 @@
_emberMetalCore["default"].cacheFor = _emberMetalComputed.cacheFor;
_emberMetalCore["default"].addObserver = _emberMetalObserver.addObserver;
_emberMetalCore["default"].observersFor = _emberMetalObserver.observersFor;
_emberMetalCore["default"].removeObserver = _emberMetalObserver.removeObserver;
- _emberMetalCore["default"].addBeforeObserver = _emberMetalObserver.addBeforeObserver;
+ _emberMetalCore["default"].addBeforeObserver = _emberMetalCore["default"].deprecateFunc("Ember.addBeforeObserver is deprecated and will be removed in the near future.", { url: "http://emberjs.com/deprecations/v1.x/#toc_beforeobserver" }, _emberMetalObserver._addBeforeObserver);
_emberMetalCore["default"]._suspendBeforeObserver = _emberMetalObserver._suspendBeforeObserver;
_emberMetalCore["default"]._suspendBeforeObservers = _emberMetalObserver._suspendBeforeObservers;
_emberMetalCore["default"]._suspendObserver = _emberMetalObserver._suspendObserver;
_emberMetalCore["default"]._suspendObservers = _emberMetalObserver._suspendObservers;
- _emberMetalCore["default"].beforeObserversFor = _emberMetalObserver.beforeObserversFor;
- _emberMetalCore["default"].removeBeforeObserver = _emberMetalObserver.removeBeforeObserver;
+ _emberMetalCore["default"].beforeObserversFor = _emberMetalCore["default"].deprecateFunc("Ember.beforeObserversFor is deprecated and will be removed in the near future.", { url: "http://emberjs.com/deprecations/v1.x/#toc_beforeobserver" }, _emberMetalObserver._beforeObserversFor);
+ _emberMetalCore["default"].removeBeforeObserver = _emberMetalCore["default"].deprecateFunc("Ember.removeBeforeObserver is deprecated and will be removed in the near future.", { url: "http://emberjs.com/deprecations/v1.x/#toc_beforeobserver" }, _emberMetalObserver._removeBeforeObserver);
_emberMetalCore["default"].IS_BINDING = _emberMetalMixin.IS_BINDING;
_emberMetalCore["default"].required = _emberMetalMixin.required;
_emberMetalCore["default"].aliasMethod = _emberMetalMixin.aliasMethod;
_emberMetalCore["default"].observer = _emberMetalMixin.observer;
- _emberMetalCore["default"].immediateObserver = _emberMetalMixin.immediateObserver;
- _emberMetalCore["default"].beforeObserver = _emberMetalMixin.beforeObserver;
+ _emberMetalCore["default"].immediateObserver = _emberMetalMixin._immediateObserver;
+ _emberMetalCore["default"].beforeObserver = _emberMetalCore["default"].deprecateFunc("Ember.beforeObserver is deprecated and will be removed in the near future.", { url: "http://emberjs.com/deprecations/v1.x/#toc_beforeobserver" }, _emberMetalMixin._beforeObserver);
_emberMetalCore["default"].mixin = _emberMetalMixin.mixin;
_emberMetalCore["default"].Mixin = _emberMetalMixin.Mixin;
_emberMetalCore["default"].oneWay = _emberMetalBinding.oneWay;
_emberMetalCore["default"].bind = _emberMetalBinding.bind;
@@ -3261,11 +3292,11 @@
cross-platform libraries such as jQuery. For more details, see
[Ember-Runtime](http://emberjs.com/api/modules/ember-runtime.html).
@class Ember
@static
- @version 1.13.3
+ @version 1.13.4
@public
*/
if ('undefined' === typeof Ember) {
// Create core object. Make it act like an instance of Ember.Namespace so that
@@ -3293,15 +3324,15 @@
/**
The semantic version.
@property VERSION
@type String
- @default '1.13.3'
+ @default '1.13.4'
@static
@public
*/
- Ember.VERSION = '1.13.3';
+ Ember.VERSION = '1.13.4';
/**
The hash of environment variables used to control various configuration
settings. To specify your own or override default settings, add the
desired properties to a global hash named `EmberENV` (or `ENV` for
@@ -5894,12 +5925,12 @@
enifed("ember-metal/mixin", ["exports", "ember-metal/core", "ember-metal/merge", "ember-metal/array", "ember-metal/platform/create", "ember-metal/property_get", "ember-metal/property_set", "ember-metal/utils", "ember-metal/expand_properties", "ember-metal/properties", "ember-metal/computed", "ember-metal/binding", "ember-metal/observer", "ember-metal/events", "ember-metal/streams/utils"], function (exports, _emberMetalCore, _emberMetalMerge, _emberMetalArray, _emberMetalPlatformCreate, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalUtils, _emberMetalExpand_properties, _emberMetalProperties, _emberMetalComputed, _emberMetalBinding, _emberMetalObserver, _emberMetalEvents, _emberMetalStreamsUtils) {
exports.mixin = mixin;
exports.required = required;
exports.aliasMethod = aliasMethod;
exports.observer = observer;
- exports.immediateObserver = immediateObserver;
- exports.beforeObserver = beforeObserver;
+ exports._immediateObserver = _immediateObserver;
+ exports._beforeObserver = _beforeObserver;
// Remove "use strict"; from transpiled module until
// https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed
//
"REMOVE_USE_STRICT: true";
@@ -6287,17 +6318,17 @@
function replaceObserversAndListeners(obj, key, observerOrListener) {
var prev = obj[key];
if ("function" === typeof prev) {
- updateObserversAndListeners(obj, key, prev, "__ember_observesBefore__", _emberMetalObserver.removeBeforeObserver);
+ updateObserversAndListeners(obj, key, prev, "__ember_observesBefore__", _emberMetalObserver._removeBeforeObserver);
updateObserversAndListeners(obj, key, prev, "__ember_observes__", _emberMetalObserver.removeObserver);
updateObserversAndListeners(obj, key, prev, "__ember_listens__", _emberMetalEvents.removeListener);
}
if ("function" === typeof observerOrListener) {
- updateObserversAndListeners(obj, key, observerOrListener, "__ember_observesBefore__", _emberMetalObserver.addBeforeObserver);
+ updateObserversAndListeners(obj, key, observerOrListener, "__ember_observesBefore__", _emberMetalObserver._addBeforeObserver);
updateObserversAndListeners(obj, key, observerOrListener, "__ember_observes__", _emberMetalObserver.addObserver);
updateObserversAndListeners(obj, key, observerOrListener, "__ember_listens__", _emberMetalEvents.addListener);
}
}
@@ -6770,20 +6801,20 @@
`Ember.immediateObserver` will maintain the synchronous behavior.
Also available as `Function.prototype.observesImmediately` if prototype extensions are
enabled.
- @method immediateObserver
+ @method _immediateObserver
@for Ember
@param {String} propertyNames*
@param {Function} func
@deprecated Use `Ember.observer` instead.
@return func
@private
*/
- function immediateObserver() {
+ function _immediateObserver() {
_emberMetalCore["default"].deprecate("Usage of `Ember.immediateObserver` is deprecated, use `Ember.observer` instead.");
for (var i = 0, l = arguments.length; i < l; i++) {
var arg = arguments[i];
_emberMetalCore["default"].assert("Immediate observers must observe internal properties only, not properties on other objects.", typeof arg !== "string" || arg.indexOf(".") === -1);
@@ -6796,13 +6827,13 @@
When observers fire, they are called with the arguments `obj`, `keyName`.
Note, `@each.property` observer is called per each add or replace of an element
and it's not called with a specific enumeration item.
- A `beforeObserver` fires before a property changes.
+ A `_beforeObserver` fires before a property changes.
- A `beforeObserver` is an alternative form of `.observesBefore()`.
+ A `_beforeObserver` is an alternative form of `.observesBefore()`.
```javascript
App.PersonView = Ember.View.extend({
friends: [{ name: 'Tom' }, { name: 'Stefan' }, { name: 'Kris' }],
@@ -6831,14 +6862,15 @@
@method beforeObserver
@for Ember
@param {String} propertyNames*
@param {Function} func
@return func
+ @deprecated
@private
*/
- function beforeObserver() {
+ function _beforeObserver() {
for (var _len5 = arguments.length, args = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
args[_key5] = arguments[_key5];
}
var func = args.slice(-1)[0];
@@ -6884,17 +6916,17 @@
// warn, assert, wrap, et;
enifed("ember-metal/observer", ["exports", "ember-metal/watching", "ember-metal/array", "ember-metal/events"], function (exports, _emberMetalWatching, _emberMetalArray, _emberMetalEvents) {
exports.addObserver = addObserver;
exports.observersFor = observersFor;
exports.removeObserver = removeObserver;
- exports.addBeforeObserver = addBeforeObserver;
+ exports._addBeforeObserver = _addBeforeObserver;
exports._suspendBeforeObserver = _suspendBeforeObserver;
exports._suspendObserver = _suspendObserver;
exports._suspendBeforeObservers = _suspendBeforeObservers;
exports._suspendObservers = _suspendObservers;
- exports.beforeObserversFor = beforeObserversFor;
- exports.removeBeforeObserver = removeBeforeObserver;
+ exports._beforeObserversFor = _beforeObserversFor;
+ exports._removeBeforeObserver = _removeBeforeObserver;
/**
@module ember-metal
*/
@@ -6946,20 +6978,21 @@
return this;
}
/**
- @method addBeforeObserver
+ @method _addBeforeObserver
@for Ember
@param obj
@param {String} path
@param {Object|Function} target
@param {Function|String} [method]
+ @deprecated
@private
*/
- function addBeforeObserver(obj, path, target, method) {
+ function _addBeforeObserver(obj, path, target, method) {
_emberMetalEvents.addListener(obj, beforeEvent(path), target, method);
_emberMetalWatching.watch(obj, path);
return this;
}
@@ -6985,25 +7018,26 @@
function _suspendObservers(obj, paths, target, method, callback) {
var events = _emberMetalArray.map.call(paths, changeEvent);
return _emberMetalEvents.suspendListeners(obj, events, target, method, callback);
}
- function beforeObserversFor(obj, path) {
+ function _beforeObserversFor(obj, path) {
return _emberMetalEvents.listenersFor(obj, beforeEvent(path));
}
/**
@method removeBeforeObserver
@for Ember
@param obj
@param {String} path
@param {Object|Function} target
@param {Function|String} [method]
+ @deprecated
@private
*/
- function removeBeforeObserver(obj, path, target, method) {
+ function _removeBeforeObserver(obj, path, target, method) {
_emberMetalWatching.unwatch(obj, path);
_emberMetalEvents.removeListener(obj, beforeEvent(path), target, method);
return this;
}
@@ -12406,11 +12440,11 @@
}
options.plugins = plugins;
options.buildMeta = function buildMeta(program) {
return {
- revision: "Ember@1.13.3",
+ revision: "Ember@1.13.4",
loc: program.loc,
moduleName: options.moduleName
};
};
@@ -14600,10 +14634,10 @@
`{{yield}}` is used. Optionally provide a non-default block name
that can be targeted by `{{yield to=blockName}}`.
*/
function bindBlock(env, scope, block) {
- var name = arguments[3] === undefined ? "default" : arguments[3];
+ var name = arguments.length <= 3 || arguments[3] === undefined ? "default" : arguments[3];
scope.blocks[name] = block;
}
/**
\ No newline at end of file