dist/ember.prod.js in ember-source-1.7.0.beta.4 vs dist/ember.prod.js in ember-source-1.7.0.beta.5
- old
+ new
@@ -3,11 +3,11 @@
* @copyright Copyright 2011-2014 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.7.0-beta.4
+ * @version 1.7.0-beta.5
*/
(function() {
var define, requireModule, require, requirejs, Ember;
@@ -4681,28 +4681,37 @@
});
__exports__["default"] = ComponentLookup;
});
define("ember-handlebars/controls",
- ["ember-handlebars/controls/checkbox","ember-handlebars/controls/text_field","ember-handlebars/controls/text_area","ember-metal/core","ember-handlebars-compiler","exports"],
- function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __exports__) {
+ ["ember-handlebars/controls/checkbox","ember-handlebars/controls/text_field","ember-handlebars/controls/text_area","ember-metal/core","ember-handlebars-compiler","ember-handlebars/ext","exports"],
+ function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __exports__) {
"use strict";
var Checkbox = __dependency1__["default"];
var TextField = __dependency2__["default"];
var TextArea = __dependency3__["default"];
var Ember = __dependency4__["default"];
// Ember.assert
// var emberAssert = Ember.assert;
var EmberHandlebars = __dependency5__["default"];
+ var handlebarsGet = __dependency6__.handlebarsGet;
var helpers = EmberHandlebars.helpers;
/**
@module ember
@submodule ember-handlebars-compiler
*/
+ function _resolveOption(context, options, key) {
+ if (options.hashTypes[key] === "ID") {
+ return handlebarsGet(context, options.hash[key], options);
+ } else {
+ return options.hash[key];
+ }
+ }
+
/**
The `{{input}}` helper inserts an HTML `<input>` tag into the template,
with a `type` value of either `text` or `checkbox`. If no `type` is provided,
`text` will be the default value applied. The attributes of `{{input}}`
@@ -4878,11 +4887,11 @@
*/
function inputHelper(options) {
var hash = options.hash,
types = options.hashTypes,
- inputType = hash.type,
+ inputType = _resolveOption(this, options, 'type'),
onEvent = hash.on;
delete hash.type;
delete hash.on;
@@ -6594,18 +6603,21 @@
currentContext = (contexts && contexts.length) ? contexts[0] : this,
prefixPathForDependentKeys = '',
loc, len, hashOption,
boundOption, property,
normalizedValue = SimpleHandlebarsView.prototype.normalizedValue;
+ var hashTypes = options.hashTypes;
// Detect bound options (e.g. countBinding="otherCount")
var boundOptions = hash.boundOptions = {};
for (hashOption in hash) {
if (IS_BINDING.test(hashOption)) {
// Lop off 'Binding' suffix.
boundOptions[hashOption.slice(0, -7)] = hash[hashOption];
+ } else if (hashTypes[hashOption] === 'ID') {
+ boundOptions[hashOption] = hash[hashOption];
}
}
// Expose property names on data.properties object.
var watchedProperties = [];
@@ -10002,10 +10014,11 @@
var tryInvoke = __dependency4__.tryInvoke;
var tryFinally = __dependency4__.tryFinally;
var wrap = __dependency4__.wrap;
var apply = __dependency4__.apply;
var applyStr = __dependency4__.applyStr;
+ var uuid = __dependency4__.uuid;
var EmberError = __dependency5__["default"];
var EnumerableUtils = __dependency6__["default"];
var create = __dependency7__.create;
var platform = __dependency7__.platform;
@@ -10142,10 +10155,11 @@
Ember.tryInvoke = tryInvoke;
Ember.tryFinally = tryFinally;
Ember.wrap = wrap;
Ember.apply = apply;
Ember.applyStr = applyStr;
+ Ember.uuid = uuid;
Ember.Logger = Logger;
Ember.get = get;
Ember.getWithDefault = getWithDefault;
@@ -12567,11 +12581,11 @@
The core Runtime framework is based on the jQuery API with a number of
performance optimizations.
@class Ember
@static
- @version 1.7.0-beta.4
+ @version 1.7.0-beta.5
*/
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.
@@ -12594,14 +12608,14 @@
/**
@property VERSION
@type String
- @default '1.7.0-beta.4'
+ @default '1.7.0-beta.5'
@static
*/
- Ember.VERSION = '1.7.0-beta.4';
+ Ember.VERSION = '1.7.0-beta.5';
/**
Standard environmental variables. You can define these in a global `EmberENV`
variable before loading Ember to control various configuration settings.
@@ -17166,10 +17180,19 @@
@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;
}
__exports__.uuid = uuid;/**
@@ -20157,11 +20180,11 @@
var m = meta(this);
if (m.proto !== this) {
return get(m.proto, '_normalizedQueryParams');
}
- var queryParams = this.queryParams;
+ var queryParams = get(this, 'queryParams');
if (queryParams._qpMap) {
return queryParams._qpMap;
}
var qpMap = queryParams._qpMap = {};
@@ -20211,13 +20234,15 @@
var propMeta = cacheMeta[prop];
propMeta.values = params;
var cacheKey = this._calculateCacheKey(propMeta.prefix, propMeta.parts, propMeta.values);
var cache = this._bucketCache;
- var value = cache.lookup(cacheKey, prop, propMeta.def);
- set(this, prop, value);
+ if (cache) {
+ var value = cache.lookup(cacheKey, prop, propMeta.def);
+ set(this, prop, value);
+ }
}
},
_qpChanged: function(controller, _prop) {
var prop = _prop.substr(0, _prop.length-3);
@@ -20225,11 +20250,14 @@
var propCache = cacheMeta[prop];
var cacheKey = controller._calculateCacheKey(propCache.prefix || "", propCache.parts, propCache.values);
var value = get(controller, prop);
// 1. Update model-dep cache
- controller._bucketCache.stash(cacheKey, prop, value);
+ var cache = this._bucketCache;
+ if (cache) {
+ controller._bucketCache.stash(cacheKey, prop, value);
+ }
// 2. Notify a delegate (e.g. to fire a qp transition)
var delegate = controller._qpDelegate;
if (delegate) {
delegate(controller, prop);
@@ -21819,11 +21847,11 @@
/**
@private
@method reset
*/
- reset: function(isExiting, transition) {
+ _reset: function(isExiting, transition) {
var controller = this.controller;
controller._qpDelegate = get(this, '_qp.states.inactive');
this.resetController(this.controller, isExiting, transition);
@@ -22118,24 +22146,21 @@
// Do a reverse lookup to see if the changed query
// param URL key corresponds to a QP property on
// this controller.
var value, svalue;
if (changes && qp.urlKey in changes) {
- // Controller overrode this value in setupController
+ // Value updated in/before setupController
value = get(controller, qp.prop);
svalue = route.serializeQueryParam(value, qp.urlKey, qp.type);
} else {
if (presentKey) {
svalue = params[presentKey];
value = route.deserializeQueryParam(svalue, qp.urlKey, qp.type);
} else {
// No QP provided; use default value.
svalue = qp.sdef;
- value = qp.def;
- if (isArray(value)) {
- value = Ember.A(value.slice());
- }
+ value = copyDefaultValue(qp.def);
}
}
controller._qpDelegate = get(this, '_qp.states.inactive');
@@ -22479,10 +22504,14 @@
controller._qpDelegate = states.changingKeys;
controller._updateCacheParams(transition.params);
}
controller._qpDelegate = states.allowOverrides;
+ if (transition) {
+ controller.setProperties(getQueryParamsFor(this, transition.state));
+ }
+
this.setupController(controller, context, transition);
}
if (this.renderTemplates) {
this.renderTemplates(context);
@@ -22622,10 +22651,11 @@
both the resolved model and attempted entry into this route
are considered to be fully validated.
@method redirect
@param {Object} model the model for this route
+ @param {Transition} transition the transition object associated with the current transition
*/
redirect: Ember.K,
/**
Called when the context is changed by router.js.
@@ -23151,18 +23181,18 @@
By default the controller's `model` will be the route's model, so it does not
need to be passed unless you wish to change which model is being used.
@method render
@param {String} name the name of the template to render
- @param {Object} options the options
- @param {String} options.into the template to render into,
+ @param {Object} [options] the options
+ @param {String} [options.into] the template to render into,
referenced by name. Defaults to the parent template
- @param {String} options.outlet the outlet inside `options.template` to render into.
+ @param {String} [options.outlet] the outlet inside `options.template` to render into.
Defaults to 'main'
- @param {String} options.controller the controller to use for this template,
+ @param {String} [options.controller] the controller to use for this template,
referenced by name. Defaults to the Route's paired controller
- @param {String} options.model the model object to set on `options.controller`
+ @param {String} [options.model] the model object to set on `options.controller`
Defaults to the return value of the Route's model hook
*/
render: function(name, options) {
var namePassed = typeof name === 'string' && !!name;
@@ -23438,13 +23468,10 @@
var value = get(controller, qp.prop);
this.router._queuedQPChanges[qp.fprop] = value;
run.once(this, this._fireQueryParamTransition);
},
- //_inactiveQPChanged: function(controller, qp) {
- //},
-
_updatingQPChanged: function(controller, qp) {
var router = this.router;
if (!router._qpUpdates) {
router._qpUpdates = {};
}
@@ -23460,40 +23487,15 @@
return {};
}
var transition = this.router.router.activeTransition;
var state = transition ? transition.state : this.router.router.state;
- var params = {};
+ var params = {};
merge(params, state.params[name]);
+ merge(params, getQueryParamsFor(route, state));
- if (!state.fullQueryParams) {
- state.fullQueryParams = {};
- merge(state.fullQueryParams, state.queryParams);
-
- var targetRouteName = state.handlerInfos[state.handlerInfos.length-1].name;
- this.router._deserializeQueryParams(targetRouteName, state.fullQueryParams);
- }
-
- var qpMeta = get(route, '_qp');
-
- if (!qpMeta) {
- // No query params specified on the controller.
- return params;
- }
-
- // Copy over all the query params for this route/controller into params hash.
- // TODO: is this correct? I think this won't do model dep state.
- var qps = qpMeta.qps;
- for (var i = 0, len = qps.length; i < len; ++i) {
- // Put deserialized qp on params hash.
- var qp = qps[i];
- if (!(qp.prop in params)) {
- params[qp.prop] = state.fullQueryParams[qp.prop] || qp.def;
- }
- }
-
return params;
},
serializeQueryParamKey: function(controllerPropertyName) {
return controllerPropertyName;
@@ -23670,10 +23672,54 @@
function generateOutletTeardown(parentView, outlet) {
return function() { parentView.disconnectOutlet(outlet); };
}
+ function getFullQueryParams(router, state) {
+ if (state.fullQueryParams) { return state.fullQueryParams; }
+
+ state.fullQueryParams = {};
+ merge(state.fullQueryParams, state.queryParams);
+
+ var targetRouteName = state.handlerInfos[state.handlerInfos.length-1].name;
+ router._deserializeQueryParams(targetRouteName, state.fullQueryParams);
+ return state.fullQueryParams;
+ }
+
+ function getQueryParamsFor(route, state) {
+ state.queryParamsFor = state.queryParamsFor || {};
+ var name = route.routeName;
+
+ if (state.queryParamsFor[name]) { return state.queryParamsFor[name]; }
+
+ var fullQueryParams = getFullQueryParams(route.router, state);
+
+ var params = state.queryParamsFor[name] = {};
+
+ // Copy over all the query params for this route/controller into params hash.
+ var qpMeta = get(route, '_qp');
+ var qps = qpMeta.qps;
+ for (var i = 0, len = qps.length; i < len; ++i) {
+ // Put deserialized qp on params hash.
+ var qp = qps[i];
+
+ var qpValueWasPassedIn = (qp.prop in fullQueryParams);
+ params[qp.prop] = qpValueWasPassedIn ?
+ fullQueryParams[qp.prop] :
+ copyDefaultValue(qp.def);
+ }
+
+ return params;
+ }
+
+ function copyDefaultValue(value) {
+ if (isArray(value)) {
+ return Ember.A(value.slice());
+ }
+ return value;
+ }
+
__exports__["default"] = Route;
});
define("ember-routing/system/router",
["ember-metal/core","ember-metal/error","ember-metal/property_get","ember-metal/property_set","ember-metal/properties","ember-metal/computed","ember-metal/merge","ember-metal/run_loop","ember-metal/enumerable_utils","ember-runtime/system/string","ember-runtime/system/object","ember-runtime/mixins/evented","ember-routing/system/dsl","ember-views/views/view","ember-routing/location/api","ember-handlebars/views/metamorph_view","ember-routing-handlebars/helpers/shared","exports"],
function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __dependency16__, __dependency17__, __exports__) {
@@ -24281,13 +24327,10 @@
// Check for top-level error state to enter.
if (routeHasBeenDefined(originRoute.router, 'application_error')) {
router.intermediateTransitionTo('application_error', error);
return;
}
- } else {
- // Don't fire an assertion if we found an error substate.
- return;
}
logError(error, 'Error while processing route: ' + transition.targetName);
},
@@ -24500,16 +24543,11 @@
function listenForTransitionErrors(transition) {
transition.then(null, function(error) {
if (!error || !error.name) { return; }
if (error.name === "UnrecognizedURLError") {
- } else if (error.name === 'TransitionAborted') {
- // just ignore TransitionAborted here
- } else {
- logError(error);
- }
-
+ }
return error;
}, 'Ember: Process errors from Router');
}
function resemblesURL(str) {
@@ -38239,10 +38277,13 @@
@extends Ember.View
*/
var ContainerView = View.extend(MutableArray, {
_states: states,
+ willWatchProperty: function(prop){
+ },
+
init: function() {
this._super();
var childViews = get(this, 'childViews');
@@ -42757,10 +42798,11 @@
"use strict";
var bind = __dependency1__.bind;
var merge = __dependency1__.merge;
var serialize = __dependency1__.serialize;
var promiseLabel = __dependency1__.promiseLabel;
+ var applyHook = __dependency1__.applyHook;
var Promise = __dependency2__["default"];
function HandlerInfo(_props) {
var props = _props || {};
merge(this, props);
@@ -42843,18 +42885,17 @@
if (this.queryParams) {
args.push(this.queryParams);
}
args.push(payload);
- var handler = this.handler;
- var result = handler[hookName] && handler[hookName].apply(handler, args);
+ var result = applyHook(this.handler, hookName, args);
if (result && result.isTransition) {
result = null;
}
- return Promise.resolve(result, null, this.promiseLabel("Resolve value returned from one of the model hooks"));
+ return Promise.resolve(result, this.promiseLabel("Resolve value returned from one of the model hooks"));
},
// overridden by subclasses
getModel: null,
@@ -43047,10 +43088,11 @@
define("router/handler-info/unresolved-handler-info-by-param",
["../handler-info","router/utils","exports"],
function(__dependency1__, __dependency2__, __exports__) {
"use strict";
var HandlerInfo = __dependency1__["default"];
+ var resolveHook = __dependency2__.resolveHook;
var merge = __dependency2__.merge;
var subclass = __dependency2__.subclass;
var promiseLabel = __dependency2__.promiseLabel;
// Generated by URL transitions and non-dynamic route segments in named Transitions.
@@ -43065,12 +43107,13 @@
fullParams = {};
merge(fullParams, this.params);
fullParams.queryParams = payload.queryParams;
}
- var hookName = typeof this.handler.deserialize === 'function' ?
- 'deserialize' : 'model';
+ var handler = this.handler;
+ var hookName = resolveHook(handler, 'deserialize') ||
+ resolveHook(handler, 'model');
return this.runSharedModelHook(payload, hookName, [fullParams]);
}
});
@@ -43089,10 +43132,11 @@
var merge = __dependency3__.merge;
var serialize = __dependency3__.serialize;
var extractQueryParams = __dependency3__.extractQueryParams;
var getChangelist = __dependency3__.getChangelist;
var promiseLabel = __dependency3__.promiseLabel;
+ var callHook = __dependency3__.callHook;
var TransitionState = __dependency4__["default"];
var logAbort = __dependency5__.logAbort;
var Transition = __dependency5__.Transition;
var TransitionAborted = __dependency5__.TransitionAborted;
var NamedTransitionIntent = __dependency6__["default"];
@@ -43232,15 +43276,13 @@
on each of them starting at the leaf and traversing up through
its ancestors.
*/
reset: function() {
if (this.state) {
- forEach(this.state.handlerInfos, function(handlerInfo) {
+ forEach(this.state.handlerInfos.slice().reverse(), function(handlerInfo) {
var handler = handlerInfo.handler;
- if (handler.exit) {
- handler.exit();
- }
+ callHook(handler, 'exit');
});
}
this.state = new TransitionState();
this.currentHandlerInfos = null;
@@ -43300,11 +43342,11 @@
transitionTo: function(name) {
return doTransition(this, arguments);
},
intermediateTransitionTo: function(name) {
- doTransition(this, arguments, true);
+ return doTransition(this, arguments, true);
},
refresh: function(pivotHandler) {
var state = this.activeTransition ? this.activeTransition.state : this.state;
var handlerInfos = state.handlerInfos;
@@ -43520,22 +43562,23 @@
var partition = partitionHandlers(router.state, newState);
forEach(partition.exited, function(handlerInfo) {
var handler = handlerInfo.handler;
delete handler.context;
- if (handler.reset) { handler.reset(true, transition); }
- if (handler.exit) { handler.exit(transition); }
+
+ callHook(handler, 'reset', true, transition);
+ callHook(handler, 'exit', transition);
});
var oldState = router.oldState = router.state;
router.state = newState;
var currentHandlerInfos = router.currentHandlerInfos = partition.unchanged.slice();
try {
forEach(partition.reset, function(handlerInfo) {
var handler = handlerInfo.handler;
- if (handler.reset) { handler.reset(false, transition); }
+ callHook(handler, 'reset', false, transition);
});
forEach(partition.updatedContext, function(handlerInfo) {
return handlerEnteredOrUpdated(currentHandlerInfos, handlerInfo, false, transition);
});
@@ -43562,19 +43605,19 @@
function handlerEnteredOrUpdated(currentHandlerInfos, handlerInfo, enter, transition) {
var handler = handlerInfo.handler,
context = handlerInfo.context;
- if (enter && handler.enter) { handler.enter(transition); }
+ callHook(handler, 'enter', transition);
if (transition && transition.isAborted) {
throw new TransitionAborted();
}
handler.context = context;
- if (handler.contextDidChange) { handler.contextDidChange(); }
+ callHook(handler, 'contextDidChange');
- if (handler.setup) { handler.setup(context, transition); }
+ callHook(handler, 'setup', context, transition);
if (transition && transition.isAborted) {
throw new TransitionAborted();
}
currentHandlerInfos.push(handlerInfo);
@@ -43633,11 +43676,11 @@
exited: [],
entered: [],
unchanged: []
};
- var handlerChanged, contextChanged, i, l;
+ var handlerChanged, contextChanged = false, i, l;
for (i=0, l=newHandlers.length; i<l; i++) {
var oldHandler = oldHandlers[i], newHandler = newHandlers[i];
if (!oldHandler || oldHandler.handler !== newHandler.handler) {
@@ -43851,13 +43894,14 @@
function notifyExistingHandlers(router, newState, newTransition) {
var oldHandlers = router.state.handlerInfos,
changing = [],
leavingIndex = null,
- leaving, leavingChecker, i, oldHandler, newHandler;
+ leaving, leavingChecker, i, oldHandlerLen, oldHandler, newHandler;
- for (i = 0; i < oldHandlers.length; i++) {
+ oldHandlerLen = oldHandlers.length;
+ for (i = 0; i < oldHandlerLen; i++) {
oldHandler = oldHandlers[i];
newHandler = newState.handlerInfos[i];
if (!newHandler || oldHandler.name !== newHandler.name) {
leavingIndex = i;
@@ -43868,13 +43912,13 @@
changing.push(oldHandler);
}
}
if (leavingIndex !== null) {
- leaving = oldHandlers.slice(leavingIndex, oldHandlers.length);
+ leaving = oldHandlers.slice(leavingIndex, oldHandlerLen);
leavingChecker = function(name) {
- for (var h = 0; h < leaving.length; h++) {
+ for (var h = 0, len = leaving.length; h < len; h++) {
if (leaving[h].name === name) {
return true;
}
}
return false;
@@ -43949,19 +43993,19 @@
return this.applyToHandlers(oldState, handlers, getHandler, targetRouteName, isIntermediate);
},
applyToHandlers: function(oldState, handlers, getHandler, targetRouteName, isIntermediate, checkingIfActive) {
- var i;
+ var i, len;
var newState = new TransitionState();
var objects = this.contexts.slice(0);
var invalidateIndex = handlers.length;
// Pivot handlers are provided for refresh transitions
if (this.pivotHandler) {
- for (i = 0; i < handlers.length; ++i) {
+ for (i = 0, len = handlers.length; i < len; ++i) {
if (getHandler(handlers[i].handler) === this.pivotHandler) {
invalidateIndex = i;
break;
}
}
@@ -44188,10 +44232,11 @@
function(__dependency1__, __dependency2__, __dependency3__, __exports__) {
"use strict";
var ResolvedHandlerInfo = __dependency1__.ResolvedHandlerInfo;
var forEach = __dependency2__.forEach;
var promiseLabel = __dependency2__.promiseLabel;
+ var callHook = __dependency2__.callHook;
var Promise = __dependency3__["default"];
function TransitionState(other) {
this.handlerInfos = [];
this.queryParams = {};
@@ -44232,17 +44277,17 @@
// The prelude RSVP.resolve() asyncs us into the promise land.
return Promise.resolve(null, this.promiseLabel("Start transition"))
.then(resolveOneHandlerInfo, null, this.promiseLabel('Resolve handler'))['catch'](handleError, this.promiseLabel('Handle error'));
function innerShouldContinue() {
- return Promise.resolve(shouldContinue(), promiseLabel("Check if should continue"))['catch'](function(reason) {
+ return Promise.resolve(shouldContinue(), currentState.promiseLabel("Check if should continue"))['catch'](function(reason) {
// We distinguish between errors that occurred
// during resolution (e.g. beforeModel/model/afterModel),
// and aborts due to a rejecting promise from shouldContinue().
wasAborted = true;
return Promise.reject(reason);
- }, promiseLabel("Handle abort"));
+ }, currentState.promiseLabel("Handle abort"));
}
function handleError(error) {
// This is the only possible
// reject value of TransitionState#resolve
@@ -44268,18 +44313,16 @@
// Call the redirect hook. The reason we call it here
// vs. afterModel is so that redirects into child
// routes don't re-run the model hooks for this
// already-resolved route.
var handler = resolvedHandlerInfo.handler;
- if (handler && handler.redirect) {
- handler.redirect(resolvedHandlerInfo.context, payload);
- }
+ callHook(handler, 'redirect', resolvedHandlerInfo.context, payload);
}
// Proceed after ensuring that the redirect hook
// didn't abort this transition by transitioning elsewhere.
- return innerShouldContinue().then(resolveOneHandlerInfo, null, promiseLabel('Resolve handler'));
+ return innerShouldContinue().then(resolveOneHandlerInfo, null, currentState.promiseLabel('Resolve handler'));
}
function resolveOneHandlerInfo() {
if (payload.resolveIndex === currentState.handlerInfos.length) {
// This is is the only possible
@@ -44291,11 +44334,11 @@
}
var handlerInfo = currentState.handlerInfos[payload.resolveIndex];
return handlerInfo.resolve(innerShouldContinue, payload)
- .then(proceed, null, promiseLabel('Proceed'));
+ .then(proceed, null, currentState.promiseLabel('Proceed'));
}
}
};
__exports__["default"] = TransitionState;
@@ -44339,11 +44382,11 @@
this.queryParams = state.queryParams;
this.handlerInfos = state.handlerInfos;
var len = state.handlerInfos.length;
if (len) {
- this.targetName = state.handlerInfos[state.handlerInfos.length-1].name;
+ this.targetName = state.handlerInfos[len-1].name;
}
for (var i = 0; i < len; ++i) {
var handlerInfo = state.handlerInfos[i];
@@ -44433,20 +44476,57 @@
Forwards to the internal `promise` property which you can
use in situations where you want to pass around a thennable,
but not the Transition itself.
- @param {Function} success
- @param {Function} failure
+ @param {Function} onFulfilled
+ @param {Function} onRejected
+ @param {String} label optional string for labeling the promise.
+ Useful for tooling.
+ @return {Promise}
*/
- then: function(success, failure) {
- return this.promise.then(success, failure);
+ then: function(onFulfilled, onRejected, label) {
+ return this.promise.then(onFulfilled, onRejected, label);
},
/**
@public
+ Forwards to the internal `promise` property which you can
+ use in situations where you want to pass around a thennable,
+ but not the Transition itself.
+
+ @method catch
+ @param {Function} onRejection
+ @param {String} label optional string for labeling the promise.
+ Useful for tooling.
+ @return {Promise}
+ */
+ "catch": function(onRejection, label) {
+ return this.promise["catch"](onRejection, label);
+ },
+
+ /**
+ @public
+
+ Forwards to the internal `promise` property which you can
+ use in situations where you want to pass around a thennable,
+ but not the Transition itself.
+
+ @method finally
+ @param {Function} callback
+ @param {String} label optional string for labeling the promise.
+ Useful for tooling.
+ @return {Promise}
+ */
+ "finally": function(callback, label) {
+ return this.promise["finally"](callback, label);
+ },
+
+ /**
+ @public
+
Aborts the Transition. Note you can also implicitly abort a transition
by initiating another transition while a previous one is underway.
*/
abort: function() {
if (this.isAborted) { return this; }
@@ -44764,22 +44844,45 @@
C.prototype = oCreate(parentConstructor.prototype);
merge(C.prototype, proto);
return C;
}
- __exports__.subclass = subclass;__exports__.merge = merge;
+ __exports__.subclass = subclass;function resolveHook(obj, hookName) {
+ if (!obj) { return; }
+ var underscored = "_" + hookName;
+ return obj[underscored] && underscored ||
+ obj[hookName] && hookName;
+ }
+
+ function callHook(obj, hookName) {
+ var args = slice.call(arguments, 2);
+ return applyHook(obj, hookName, args);
+ }
+
+ function applyHook(obj, _hookName, args) {
+ var hookName = resolveHook(obj, _hookName);
+ if (hookName) {
+ return obj[hookName].apply(obj, args);
+ }
+ }
+
+ __exports__.merge = merge;
__exports__.slice = slice;
__exports__.isParam = isParam;
__exports__.coerceQueryParamsToString = coerceQueryParamsToString;
+ __exports__.callHook = callHook;
+ __exports__.resolveHook = resolveHook;
+ __exports__.applyHook = applyHook;
});
define("router",
["./router/router","exports"],
function(__dependency1__, __exports__) {
"use strict";
var Router = __dependency1__["default"];
__exports__["default"] = Router;
});
+
/**
@class RSVP
@module RSVP
*/
define('rsvp/-internal', [
\ No newline at end of file