Skip to content

Commit

Permalink
Use the development version of Ember.js.
Browse files Browse the repository at this point in the history
In addition to being easier to debug because it's
unminified, the development version of Ember.js
also includes many helpful assertions that are
stripped from the production version.

You should use this version during development
because it will provide you with more helpful
error messages.
  • Loading branch information
tomdale committed Jul 2, 2012
1 parent 85bfe71 commit b16cbe0
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 32 deletions.
2 changes: 1 addition & 1 deletion app/config.js
Expand Up @@ -8,7 +8,7 @@ requirejs.config({
// Libraries
jquery : '../lib/jquery',
handlebars : '../lib/handlebars',
Ember : '../lib/ember.min',
Ember : '../lib/ember',
templates : './templates',
hbs : '../lib/hbs',
Handlebars : '../lib/Handlebars',
Expand Down
83 changes: 52 additions & 31 deletions lib/ember.js
@@ -1,5 +1,5 @@
// Version: v0.9.8.1-458-ge3106a5
// Last commit: e3106a5 (2012-06-28 08:43:09 -0700)
// Version: v0.9.8.1-462-g541d085
// Last commit: 541d085 (2012-06-29 20:54:45 -0700)


(function() {
Expand Down Expand Up @@ -136,8 +136,8 @@ window.ember_deprecateFunc = Ember.deprecateFunc("ember_deprecateFunc is deprec

})();

// Version: v0.9.8.1-458-ge3106a5
// Last commit: e3106a5 (2012-06-28 08:43:09 -0700)
// Version: v0.9.8.1-462-g541d085
// Last commit: 541d085 (2012-06-29 20:54:45 -0700)


(function() {
Expand Down Expand Up @@ -10632,9 +10632,17 @@ var get = Ember.get, set = Ember.set;
Ember.HistoryLocation = Ember.Object.extend({
init: function() {
set(this, 'location', get(this, 'location') || window.location);
set(this, '_initialURL', get(this, 'location').pathname);
set(this, 'callbacks', Ember.A());
},

/**
@private

Used to give history a starting reference
*/
_initialURL: null,

/**
@private

Expand All @@ -10650,12 +10658,13 @@ Ember.HistoryLocation = Ember.Object.extend({
Uses `history.pushState` to update the url without a page reload.
*/
setURL: function(path) {
var state = window.history.state;
var state = window.history.state,
initialURL = get(this, '_initialURL');

if (path === "") { path = '/'; }
// We only want pushState to be executed if we are passing
// in a new path, otherwise a new state will be inserted
// for the same path.
if ((!state && path !== '/') || (state && state.path !== path)) {

if ((initialURL && initialURL !== path) || (state && state.path !== path)) {
set(this, '_initialURL', null);
window.history.pushState({ path: path }, null, path);
}
},
Expand Down Expand Up @@ -11575,6 +11584,17 @@ var childViewsProperty = Ember.computed(function() {
return ret;
}).property().cacheable();

var controllerProperty = Ember.computed(function(key, value) {
var parentView;

if (arguments.length === 2) {
return value;
} else {
parentView = get(this, 'parentView');
return parentView ? get(parentView, 'controller') : null;
}
}).property().cacheable();

var VIEW_PRESERVES_CONTEXT = Ember.VIEW_PRESERVES_CONTEXT;
Ember.warn("The way that the {{view}} helper affects templates is about to change. Previously, templates inside child views would use the new view as the context. Soon, views will preserve their parent context when rendering their template. You can opt-in early to the new behavior by setting `ENV.VIEW_PRESERVES_CONTEXT = true`. For more information, see https://gist.github.com/2494968. You should update your templates as soon as possible; this default will change soon, and the option will be eliminated entirely before the 1.0 release.", VIEW_PRESERVES_CONTEXT);

Expand Down Expand Up @@ -12043,17 +12063,7 @@ Ember.View = Ember.Object.extend(Ember.Evented,

@type Object
*/
controller: Ember.computed(function(key, value) {
var parentView;

if (arguments.length === 2) {
return value;
} else {
parentView = get(this, 'parentView');
return parentView ? get(parentView, 'controller') : null;
}
}).property().cacheable(),

controller: controllerProperty,
/**
A view may contain a layout. A layout is a regular template but
supersedes the `template` property during rendering. It is the
Expand Down Expand Up @@ -12118,20 +12128,22 @@ Ember.View = Ember.Object.extend(Ember.Evented,
to be re-rendered.
*/
_context: Ember.computed(function(key, value) {
var parentView, controller;
var parentView, context;

if (arguments.length === 2) {
return value;
}

if (VIEW_PRESERVES_CONTEXT) {
if (controller = get(this, 'controller')) {
return controller;
if (Ember.meta(this).descs.controller !== controllerProperty) {
if (context = get(this, 'controller')) {
return context;
}
}

parentView = get(this, '_parentView');
if (parentView) {
return get(parentView, '_context');
if (parentView && (context = get(parentView, '_context'))) {
return context;
}
}

Expand Down Expand Up @@ -14801,6 +14813,12 @@ Ember.State = Ember.Object.extend(Ember.Evented,
return !get(this, 'childStates').length;
}).cacheable(),

/**
A boolean value indicating whether the state takes a context.
By default we assume all states take contexts.
*/
hasContext: true,

/**
This is the default transition event.

Expand Down Expand Up @@ -15321,7 +15339,6 @@ Ember.StateManager = Ember.State.extend(

send: function(event, context) {
Ember.assert('Cannot send event "' + event + '" while currentState is ' + get(this, 'currentState'), get(this, 'currentState'));
if (arguments.length === 1) { context = {}; }
return this.sendRecursively(event, get(this, 'currentState'), context);
},

Expand Down Expand Up @@ -15488,7 +15505,7 @@ Ember.StateManager = Ember.State.extend(
exitStates.unshift(state);
}

useContext = context && (!get(state, 'isRoutable') || get(state, 'isDynamic'));
useContext = context && get(state, 'hasContext');
matchedContexts.unshift(useContext ? contexts.pop() : null);
}

Expand All @@ -15500,6 +15517,7 @@ Ember.StateManager = Ember.State.extend(
state = getPath(state, 'states.'+initialState);
if (!state) { break; }
enterStates.push(state);
matchedContexts.push(undefined);
}

while (enterStates.length > 0) {
Expand Down Expand Up @@ -15730,9 +15748,10 @@ Ember.Routable = Ember.Mixin.create({
/**
@private

Check whether the route has dynamic segments
Check whether the route has dynamic segments and therefore takes
a context.
*/
isDynamic: Ember.computed(function() {
hasContext: Ember.computed(function() {
var routeMatcher = get(this, 'routeMatcher');
if (routeMatcher) {
return routeMatcher.identifiers.length > 0;
Expand Down Expand Up @@ -18842,6 +18861,8 @@ Ember.Handlebars.EachView = Ember.CollectionView.extend(Ember._Metamorph, {
// In this case, we do not bind, because the `content` of
// a #each item cannot change.
data.keywords[keyword] = content;
} else {
set(view, 'controller', get(view, 'content'));
}

return view;
Expand Down Expand Up @@ -20112,8 +20133,8 @@ Ember.$(document).ready(

})();

// Version: v0.9.8.1-458-ge3106a5
// Last commit: e3106a5 (2012-06-28 08:43:09 -0700)
// Version: v0.9.8.1-462-g541d085
// Last commit: 541d085 (2012-06-29 20:54:45 -0700)


(function() {
Expand Down

0 comments on commit b16cbe0

Please sign in to comment.