ember-source 1.10.0.beta.3 → 1.10.0.beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of ember-source might be problematic. Click here for more details.

@@ -5,7 +5,7 @@
5
5
  * Portions Copyright 2008-2011 Apple Inc. All rights reserved.
6
6
  * @license Licensed under MIT license
7
7
  * See https://raw.github.com/emberjs/ember.js/master/LICENSE
8
- * @version 1.10.0-beta.3
8
+ * @version 1.10.0-beta.4
9
9
  */
10
10
 
11
11
  (function() {
@@ -4034,7 +4034,7 @@ enifed("ember-htmlbars.jshint",
4034
4034
  "use strict";
4035
4035
  module('JSHint - .');
4036
4036
  test('ember-htmlbars.js should pass jshint', function() {
4037
- ok(true, 'ember-htmlbars.js should pass jshint.');
4037
+ ok(false, 'ember-htmlbars.js should pass jshint.\nember-htmlbars.js: line 26, col 3, \'helper\' is defined but never used.\n\n1 error');
4038
4038
  });
4039
4039
  });
4040
4040
  enifed("ember-htmlbars/compat.jshint",
@@ -4732,17 +4732,19 @@ enifed("ember-htmlbars/tests/compat/handlebars_get_test.jshint",
4732
4732
  });
4733
4733
  });
4734
4734
  enifed("ember-htmlbars/tests/compat/helper_test",
4735
- ["ember-htmlbars/compat/helper","ember-views/views/view","ember-htmlbars/helpers","ember-template-compiler/system/compile","ember-runtime/tests/utils"],
4736
- function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__) {
4735
+ ["ember-htmlbars/compat/helper","ember-views/views/view","ember-views/views/component","ember-htmlbars/system/make-view-helper","ember-htmlbars/helpers","ember-template-compiler/system/compile","ember-runtime/tests/utils"],
4736
+ function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__) {
4737
4737
  "use strict";
4738
4738
  var registerHandlebarsCompatibleHelper = __dependency1__.registerHandlebarsCompatibleHelper;
4739
4739
 
4740
4740
  var EmberView = __dependency2__["default"];
4741
+ var Component = __dependency3__["default"];
4741
4742
 
4742
- var helpers = __dependency3__["default"];
4743
- var compile = __dependency4__["default"];
4744
- var runAppend = __dependency5__.runAppend;
4745
- var runDestroy = __dependency5__.runDestroy;
4743
+ var makeViewHelper = __dependency4__["default"];
4744
+ var helpers = __dependency5__["default"];
4745
+ var compile = __dependency6__["default"];
4746
+ var runAppend = __dependency7__.runAppend;
4747
+ var runDestroy = __dependency7__.runDestroy;
4746
4748
 
4747
4749
  var view;
4748
4750
 
@@ -4753,6 +4755,7 @@ enifed("ember-htmlbars/tests/compat/helper_test",
4753
4755
  runDestroy(view);
4754
4756
 
4755
4757
  delete helpers.test;
4758
+ delete helpers['view-helper'];
4756
4759
  }
4757
4760
  });
4758
4761
 
@@ -4854,6 +4857,25 @@ enifed("ember-htmlbars/tests/compat/helper_test",
4854
4857
  runAppend(view);
4855
4858
  });
4856
4859
 
4860
+ test('registering a helper created from `Ember.Handlebars.makeViewHelper` does not double wrap the helper', function() {
4861
+ expect(1);
4862
+
4863
+ var ViewHelperComponent = Component.extend({
4864
+ layout: compile('woot!')
4865
+ });
4866
+
4867
+ var helper = makeViewHelper(ViewHelperComponent);
4868
+ registerHandlebarsCompatibleHelper('view-helper', helper);
4869
+
4870
+ view = EmberView.extend({
4871
+ template: compile('{{view-helper}}')
4872
+ }).create();
4873
+
4874
+ runAppend(view);
4875
+
4876
+ equal(view.$().text(), 'woot!');
4877
+ });
4878
+
4857
4879
 
4858
4880
  });
4859
4881
  enifed("ember-htmlbars/tests/compat/helper_test.jshint",
@@ -4977,8 +4999,8 @@ enifed("ember-htmlbars/tests/compat/make_bound_helper_test",
4977
4999
  });
4978
5000
 
4979
5001
  test("primitives should work correctly [DEPRECATED]", function() {
4980
- expectDeprecation('Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each foo in bar}}`) instead. See http://emberjs.com/guides/deprecations/#toc_more-consistent-handlebars-scope for more details.');
4981
- expectDeprecation('Using the context switching form of `{{with}}` is deprecated. Please use the keyword form (`{{with foo as bar}}`) instead. See http://emberjs.com/guides/deprecations/#toc_more-consistent-handlebars-scope for more details.');
5002
+ expectDeprecation('Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each foo in bar}}`) instead.');
5003
+ expectDeprecation('Using the context switching form of `{{with}}` is deprecated. Please use the keyword form (`{{with foo as bar}}`) instead.');
4982
5004
 
4983
5005
  view = EmberView.create({
4984
5006
  prims: Ember.A(["string", 12]),
@@ -5376,7 +5398,7 @@ enifed("ember-htmlbars/tests/compat/make_bound_helper_test",
5376
5398
 
5377
5399
  expectDeprecation(function() {
5378
5400
  runAppend(view);
5379
- }, 'Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each foo in bar}}`) instead. See http://emberjs.com/guides/deprecations/#toc_more-consistent-handlebars-scope for more details.');
5401
+ }, 'Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each foo in bar}}`) instead.');
5380
5402
 
5381
5403
  equal(view.$().text(), '|NOPE 0|NOPE |NOPE false|NOPE OMG|GMO |NOPE 0|NOPE |NOPE false|NOPE OMG|GMO ', "helper output is correct");
5382
5404
 
@@ -5404,7 +5426,7 @@ enifed("ember-htmlbars/tests/compat/make_bound_helper_test",
5404
5426
 
5405
5427
  expectDeprecation(function() {
5406
5428
  runAppend(view);
5407
- }, 'Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each foo in bar}}`) instead. See http://emberjs.com/guides/deprecations/#toc_more-consistent-handlebars-scope for more details.');
5429
+ }, 'Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each foo in bar}}`) instead.');
5408
5430
 
5409
5431
  equal(view.$().text(), '|NOPE 5|5 |NOPE 5|5 ', "helper output is correct");
5410
5432
 
@@ -5562,116 +5584,6 @@ enifed("ember-htmlbars/tests/compat/precompile_test.jshint",
5562
5584
  ok(true, 'ember-htmlbars/tests/compat/precompile_test.js should pass jshint.');
5563
5585
  });
5564
5586
  });
5565
- enifed("ember-htmlbars/tests/helper_test",
5566
- ["ember-views/views/view","ember-metal/run_loop","ember-runtime/system/object","ember-metal/property_set","ember-runtime/tests/utils","ember-htmlbars/helpers","ember-template-compiler/system/compile"],
5567
- function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__) {
5568
- "use strict";
5569
- var EmberView = __dependency1__["default"];
5570
- var run = __dependency2__["default"];
5571
- var EmberObject = __dependency3__["default"];
5572
- var set = __dependency4__.set;
5573
- var runAppend = __dependency5__.runAppend;
5574
- var runDestroy = __dependency5__.runDestroy;
5575
-
5576
- var helpers = __dependency6__["default"];
5577
- var helper = __dependency6__.helper;
5578
- var compile = __dependency7__["default"];
5579
-
5580
- var view;
5581
-
5582
- QUnit.module("ember-htmlbars: Ember.HTMLBars.helper", {
5583
- teardown: function() {
5584
- runDestroy(view);
5585
-
5586
- delete helpers.oceanView;
5587
- delete helpers.something;
5588
- }
5589
- });
5590
-
5591
- test("should render an instance of the specified view", function() {
5592
- var OceanView = EmberView.extend({
5593
- template: compile('zomg, nice view')
5594
- });
5595
-
5596
- helper('oceanView', OceanView);
5597
-
5598
- view = EmberView.create({
5599
- controller: EmberObject.create(),
5600
- template: compile('{{oceanView tagName="strong"}}')
5601
- });
5602
-
5603
- runAppend(view);
5604
-
5605
- var oceanViews = view.$().find("strong:contains('zomg, nice view')");
5606
-
5607
- equal(oceanViews.length, 1, "helper rendered an instance of the view");
5608
- });
5609
-
5610
- test("Should bind to this keyword", function() {
5611
- var OceanView = EmberView.extend({
5612
- model: null,
5613
- template: compile('{{view.model}}')
5614
- });
5615
-
5616
- helper('oceanView', OceanView);
5617
-
5618
- view = EmberView.create({
5619
- context: 'foo',
5620
- controller: EmberObject.create(),
5621
- template: compile('{{oceanView tagName="strong" viewName="ocean" model=this}}')
5622
- });
5623
-
5624
- runAppend(view);
5625
-
5626
- var oceanViews = view.$().find("strong:contains('foo')");
5627
-
5628
- equal(oceanViews.length, 1, "helper rendered an instance of the view");
5629
-
5630
- run(function() {
5631
- set(view, 'ocean.model', 'bar');
5632
- });
5633
-
5634
- oceanViews = view.$().find("strong:contains('bar')");
5635
-
5636
- equal(oceanViews.length, 1, "helper rendered an instance of the view");
5637
- });
5638
-
5639
- test('should create a bound helper when provided a function', function() {
5640
- var boundFunc;
5641
-
5642
- boundFunc = function(params, hash) {
5643
- return params[0];
5644
- };
5645
-
5646
- helper('something', boundFunc);
5647
-
5648
- view = EmberView.create({
5649
- controller: {
5650
- value: 'foo'
5651
- },
5652
- template: compile('{{something value}}')
5653
- });
5654
-
5655
- runAppend(view);
5656
-
5657
- equal(view.$().text(), 'foo', 'renders the bound value initially');
5658
-
5659
- run(function() {
5660
- set(view, 'controller.value', 'bar');
5661
- });
5662
-
5663
- equal(view.$().text(), 'bar', 're-renders the bound value');
5664
- });
5665
- });
5666
- enifed("ember-htmlbars/tests/helper_test.jshint",
5667
- [],
5668
- function() {
5669
- "use strict";
5670
- module('JSHint - ember-htmlbars/tests');
5671
- test('ember-htmlbars/tests/helper_test.js should pass jshint', function() {
5672
- ok(true, 'ember-htmlbars/tests/helper_test.js should pass jshint.');
5673
- });
5674
- });
5675
5587
  enifed("ember-htmlbars/tests/helpers/bind_attr_test",
5676
5588
  ["ember-metal/core","ember-metal/run_loop","ember-runtime/system/namespace","ember-views/views/view","ember-views/views/metamorph_view","ember-runtime/system/object","ember-runtime/system/native_array","ember-metal/computed","ember-metal/observer","ember-runtime/system/container","ember-metal/property_set","ember-runtime/tests/utils","htmlbars-test-helpers","ember-htmlbars/helpers","ember-template-compiler/system/compile"],
5677
5589
  function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__) {
@@ -5884,13 +5796,16 @@ enifed("ember-htmlbars/tests/helpers/bind_attr_test",
5884
5796
  var originalBindAttr = helpers['bind-attr'];
5885
5797
 
5886
5798
  try {
5887
- helpers['bind-attr'] = function() {
5888
- equal(arguments[0], 'foo', 'First arg match');
5889
- equal(arguments[1], 'bar', 'Second arg match');
5890
-
5891
- return 'result';
5892
- };
5799
+
5800
+ helpers['bind-attr'] = {
5801
+ helperFunction: function() {
5802
+ equal(arguments[0], 'foo', 'First arg match');
5803
+ equal(arguments[1], 'bar', 'Second arg match');
5893
5804
 
5805
+ return 'result';
5806
+ }
5807
+ };
5808
+
5894
5809
  expectDeprecation(function() {
5895
5810
  var result;
5896
5811
 
@@ -5903,6 +5818,27 @@ enifed("ember-htmlbars/tests/helpers/bind_attr_test",
5903
5818
  }
5904
5819
  });
5905
5820
 
5821
+ test("{{bindAttr}} can be used to bind attributes [DEPRECATED]", function() {
5822
+ expect(3);
5823
+
5824
+ view = EmberView.create({
5825
+ value: 'Test',
5826
+ template: compile('<img src="test.jpg" {{bindAttr alt=view.value}}>')
5827
+ });
5828
+
5829
+ expectDeprecation(function() {
5830
+ runAppend(view);
5831
+ }, /The 'bindAttr' view helper is deprecated in favor of 'bind-attr'/);
5832
+
5833
+ equal(view.$('img').attr('alt'), "Test", "renders initial value");
5834
+
5835
+ run(function() {
5836
+ view.set('value', 'Updated');
5837
+ });
5838
+
5839
+ equal(view.$('img').attr('alt'), "Updated", "updates value");
5840
+ });
5841
+
5906
5842
  test("should be able to bind element attributes using {{bind-attr}} inside a block", function() {
5907
5843
  var template = compile('{{#with view.content as image}}<img {{bind-attr src=image.url alt=image.title}}>{{/with}}');
5908
5844
 
@@ -6091,7 +6027,7 @@ enifed("ember-htmlbars/tests/helpers/bind_attr_test",
6091
6027
  });
6092
6028
 
6093
6029
  test("should be able to bind-attr to 'this' in an {{#each}} block [DEPRECATED]", function() {
6094
- expectDeprecation('Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each foo in bar}}`) instead. See http://emberjs.com/guides/deprecations/#toc_more-consistent-handlebars-scope for more details.');
6030
+ expectDeprecation('Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each foo in bar}}`) instead.');
6095
6031
 
6096
6032
  view = EmberView.create({
6097
6033
  template: compile('{{#each view.images}}<img {{bind-attr src=this}}>{{/each}}'),
@@ -6107,7 +6043,7 @@ enifed("ember-htmlbars/tests/helpers/bind_attr_test",
6107
6043
  });
6108
6044
 
6109
6045
  test("should be able to bind classes to 'this' in an {{#each}} block with {{bind-attr class}} [DEPRECATED]", function() {
6110
- expectDeprecation('Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each foo in bar}}`) instead. See http://emberjs.com/guides/deprecations/#toc_more-consistent-handlebars-scope for more details.');
6046
+ expectDeprecation('Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each foo in bar}}`) instead.');
6111
6047
 
6112
6048
  view = EmberView.create({
6113
6049
  template: compile('{{#each view.items}}<li {{bind-attr class="this"}}>Item</li>{{/each}}'),
@@ -6205,6 +6141,32 @@ enifed("ember-htmlbars/tests/helpers/bind_attr_test",
6205
6141
  runAppend(view);
6206
6142
  equal(matchingElement.length, 1, 'element is in the DOM when didInsertElement');
6207
6143
  });
6144
+
6145
+ test("asserts for <div class='foo' {{bind-attr class='bar'}}></div>", function() {
6146
+ var template = compile('<div class="foo" {{bind-attr class=view.foo}}></div>');
6147
+
6148
+ view = EmberView.create({
6149
+ template: template,
6150
+ foo: 'bar'
6151
+ });
6152
+
6153
+ expectAssertion(function() {
6154
+ runAppend(view);
6155
+ }, /You cannot set `class` manually and via `{{bind-attr}}` helper on the same element/);
6156
+ });
6157
+
6158
+ test("asserts for <div data-bar='foo' {{bind-attr data-bar='blah'}}></div>", function() {
6159
+ var template = compile('<div data-bar="foo" {{bind-attr data-bar=view.blah}}></div>');
6160
+
6161
+ view = EmberView.create({
6162
+ template: template,
6163
+ blah: 'bar'
6164
+ });
6165
+
6166
+ expectAssertion(function() {
6167
+ runAppend(view);
6168
+ }, /You cannot set `data-bar` manually and via `{{bind-attr}}` helper on the same element/);
6169
+ });
6208
6170
  });
6209
6171
  enifed("ember-htmlbars/tests/helpers/bind_attr_test.jshint",
6210
6172
  [],
@@ -6994,7 +6956,7 @@ enifed("ember-htmlbars/tests/helpers/collection_test",
6994
6956
 
6995
6957
  expectDeprecation(function() {
6996
6958
  runAppend(view);
6997
- }, 'Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each foo in bar}}`) instead. See http://emberjs.com/guides/deprecations/#toc_more-consistent-handlebars-scope for more details.');
6959
+ }, 'Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each foo in bar}}`) instead.');
6998
6960
 
6999
6961
  equal(view.$().text(), "Mac OS X 10.7: Lion Mac OS X 10.6: Snow Leopard Mac OS X 10.5: Leopard ", "prints each item in sequence");
7000
6962
  });
@@ -7327,7 +7289,7 @@ enifed("ember-htmlbars/tests/helpers/each_test",
7327
7289
  var compile = __dependency15__["default"];
7328
7290
 
7329
7291
  var people, view, container;
7330
- var template, templateMyView, MyView;
7292
+ var template, templateMyView, MyView, MyEmptyView, templateMyEmptyView;
7331
7293
 
7332
7294
  // This function lets us write {{#EACH|people|p}} {{p}} {{/each}}
7333
7295
  // and generate:
@@ -7406,9 +7368,14 @@ enifed("ember-htmlbars/tests/helpers/each_test",
7406
7368
  template: templateMyView
7407
7369
  });
7408
7370
 
7371
+ templateMyEmptyView = templateFor("I'm empty");
7372
+ lookup.MyEmptyView = MyEmptyView = EmberView.extend({
7373
+ template: templateMyEmptyView
7374
+ });
7375
+
7409
7376
  expectDeprecation(function() {
7410
7377
  runAppend(view);
7411
- },'Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each foo in bar}}`) instead. See http://emberjs.com/guides/deprecations/#toc_more-consistent-handlebars-scope for more details.');
7378
+ },'Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each foo in bar}}`) instead.');
7412
7379
  },
7413
7380
 
7414
7381
  teardown: function() {
@@ -7803,9 +7770,7 @@ enifed("ember-htmlbars/tests/helpers/each_test",
7803
7770
  view = EmberView.create({
7804
7771
  template: templateFor('{{each view.people itemView="anItemView"}}'),
7805
7772
  people: people,
7806
- controller: {
7807
- container: container
7808
- }
7773
+ container: container
7809
7774
  });
7810
7775
 
7811
7776
  container.register('view:anItemView', itemView);
@@ -7825,9 +7790,7 @@ enifed("ember-htmlbars/tests/helpers/each_test",
7825
7790
  view = EmberView.create({
7826
7791
  template: templateFor('{{each view.people itemView="an-item-view"}}'),
7827
7792
  people: people,
7828
- controller: {
7829
- container: container
7830
- }
7793
+ container: container
7831
7794
  });
7832
7795
 
7833
7796
  container.register('view:an-item-view', itemView);
@@ -7914,6 +7877,123 @@ enifed("ember-htmlbars/tests/helpers/each_test",
7914
7877
 
7915
7878
  });
7916
7879
 
7880
+ test("it supports {{emptyView=}}", function() {
7881
+ var emptyView = EmberView.extend({
7882
+ template: templateFor('emptyView:sad panda')
7883
+ });
7884
+
7885
+ runDestroy(view);
7886
+
7887
+ view = EmberView.create({
7888
+ template: templateFor('{{each view.people emptyView="anEmptyView"}}'),
7889
+ people: A(),
7890
+ container: container
7891
+ });
7892
+
7893
+ container.register('view:anEmptyView', emptyView);
7894
+
7895
+ runAppend(view);
7896
+
7897
+ assertText(view, "emptyView:sad panda");
7898
+ });
7899
+
7900
+ test("it defers all normalization of emptyView names to the resolver", function() {
7901
+ var emptyView = EmberView.extend({
7902
+ template: templateFor('emptyView:sad panda')
7903
+ });
7904
+
7905
+ runDestroy(view);
7906
+
7907
+ view = EmberView.create({
7908
+ template: templateFor('{{each view.people emptyView="an-empty-view"}}'),
7909
+ people: A(),
7910
+ container: container
7911
+ });
7912
+
7913
+ container.register('view:an-empty-view', emptyView);
7914
+
7915
+ container.resolve = function(fullname) {
7916
+ equal(fullname, "view:an-empty-view", "leaves fullname untouched");
7917
+ return Container.prototype.resolve.call(this, fullname);
7918
+ };
7919
+
7920
+ runAppend(view);
7921
+ });
7922
+
7923
+ test("it supports {{emptyViewClass=}} with global (DEPRECATED)", function() {
7924
+ runDestroy(view);
7925
+
7926
+ view = EmberView.create({
7927
+ template: templateFor('{{each view.people emptyViewClass=MyEmptyView}}'),
7928
+ people: A()
7929
+ });
7930
+
7931
+ var deprecation = /Resolved the view "MyEmptyView" on the global context/;
7932
+
7933
+
7934
+ deprecation = /Global lookup of MyEmptyView from a Handlebars template is deprecated/;
7935
+
7936
+
7937
+ expectDeprecation(function() {
7938
+ runAppend(view);
7939
+ }, deprecation);
7940
+
7941
+ assertText(view, "I'm empty");
7942
+ });
7943
+
7944
+ test("it supports {{emptyViewClass=}} via container", function() {
7945
+ runDestroy(view);
7946
+
7947
+ view = EmberView.create({
7948
+ container: {
7949
+ lookupFactory: function(name) {
7950
+ equal(name, 'view:my-empty-view');
7951
+ return MyEmptyView;
7952
+ }
7953
+ },
7954
+ template: templateFor('{{each view.people emptyViewClass="my-empty-view"}}'),
7955
+ people: A()
7956
+ });
7957
+
7958
+ runAppend(view);
7959
+
7960
+ assertText(view, "I'm empty");
7961
+ });
7962
+
7963
+ test("it supports {{emptyViewClass=}} with tagName (DEPRECATED)", function() {
7964
+ runDestroy(view);
7965
+
7966
+ view = EmberView.create({
7967
+ template: templateFor('{{each view.people emptyViewClass=MyEmptyView tagName="b"}}'),
7968
+ people: A()
7969
+ });
7970
+
7971
+ expectDeprecation(/Supplying a tagName to Metamorph views is unreliable and is deprecated./);
7972
+
7973
+ runAppend(view);
7974
+
7975
+ equal(view.$('b').length, 1, 'rendered b tag');
7976
+ equal(view.$('b').text(), "I'm empty");
7977
+ });
7978
+
7979
+ test("it supports {{emptyViewClass=}} with in format", function() {
7980
+ runDestroy(view);
7981
+
7982
+ view = EmberView.create({
7983
+ container: {
7984
+ lookupFactory: function(name) {
7985
+ return MyEmptyView;
7986
+ }
7987
+ },
7988
+ template: templateFor('{{each person in view.people emptyViewClass="myEmptyView"}}'),
7989
+ people: A()
7990
+ });
7991
+
7992
+ runAppend(view);
7993
+
7994
+ assertText(view, "I'm empty");
7995
+ });
7996
+
7917
7997
  test("it supports {{else}}", function() {
7918
7998
  runDestroy(view);
7919
7999
  view = EmberView.create({
@@ -7965,7 +8045,7 @@ enifed("ember-htmlbars/tests/helpers/each_test",
7965
8045
 
7966
8046
  expectDeprecation(function() {
7967
8047
  runAppend(view);
7968
- },'Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each foo in bar}}`) instead. See http://emberjs.com/guides/deprecations/#toc_more-consistent-handlebars-scope for more details.');
8048
+ },'Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each foo in bar}}`) instead.');
7969
8049
 
7970
8050
  equal(view.$().text(), "AdamSteve");
7971
8051
  });
@@ -7980,7 +8060,7 @@ enifed("ember-htmlbars/tests/helpers/each_test",
7980
8060
 
7981
8061
  expectDeprecation(function() {
7982
8062
  runAppend(view);
7983
- },'Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each foo in bar}}`) instead. See http://emberjs.com/guides/deprecations/#toc_more-consistent-handlebars-scope for more details.');
8063
+ },'Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each foo in bar}}`) instead.');
7984
8064
 
7985
8065
  equal(view.$().text(), "AdamSteve");
7986
8066
  });
@@ -7995,7 +8075,7 @@ enifed("ember-htmlbars/tests/helpers/each_test",
7995
8075
 
7996
8076
  expectDeprecation(function() {
7997
8077
  runAppend(view);
7998
- },'Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each foo in bar}}`) instead. See http://emberjs.com/guides/deprecations/#toc_more-consistent-handlebars-scope for more details.');
8078
+ },'Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each foo in bar}}`) instead.');
7999
8079
 
8000
8080
  equal(view.$().text(), "AdamSteve");
8001
8081
  });
@@ -8083,7 +8163,7 @@ enifed("ember-htmlbars/tests/helpers/each_test",
8083
8163
 
8084
8164
  expectDeprecation(function() {
8085
8165
  runAppend(view);
8086
- },'Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each foo in bar}}`) instead. See http://emberjs.com/guides/deprecations/#toc_more-consistent-handlebars-scope for more details.');
8166
+ },'Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each foo in bar}}`) instead.');
8087
8167
 
8088
8168
  equal(view.$().text(), "AdamSteve");
8089
8169
  });
@@ -8204,7 +8284,7 @@ enifed("ember-htmlbars/tests/helpers/each_test",
8204
8284
 
8205
8285
  expectDeprecation(function() {
8206
8286
  runAppend(view);
8207
- },'Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each foo in bar}}`) instead. See http://emberjs.com/guides/deprecations/#toc_more-consistent-handlebars-scope for more details.');
8287
+ },'Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each foo in bar}}`) instead.');
8208
8288
 
8209
8289
  equal(view.$().text(), "AdamSteve");
8210
8290
  });
@@ -8219,7 +8299,7 @@ enifed("ember-htmlbars/tests/helpers/each_test",
8219
8299
 
8220
8300
  expectDeprecation(function() {
8221
8301
  runAppend(view);
8222
- },'Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each foo in bar}}`) instead. See http://emberjs.com/guides/deprecations/#toc_more-consistent-handlebars-scope for more details.');
8302
+ },'Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each foo in bar}}`) instead.');
8223
8303
 
8224
8304
  equal(view.$().text(), "AdamSteve");
8225
8305
  });
@@ -8294,7 +8374,7 @@ enifed("ember-htmlbars/tests/helpers/if_unless_test",
8294
8374
 
8295
8375
  expectDeprecation(function() {
8296
8376
  runAppend(view);
8297
- }, 'Using the context switching form of `{{with}}` is deprecated. Please use the keyword form (`{{with foo as bar}}`) instead. See http://emberjs.com/guides/deprecations/#toc_more-consistent-handlebars-scope for more details.');
8377
+ }, 'Using the context switching form of `{{with}}` is deprecated. Please use the keyword form (`{{with foo as bar}}`) instead.');
8298
8378
 
8299
8379
  equal(view.$().text(), 'foo: 42');
8300
8380
  });
@@ -8447,6 +8527,15 @@ enifed("ember-htmlbars/tests/helpers/if_unless_test",
8447
8527
  equal(view.$().text(), 'Nope');
8448
8528
  });
8449
8529
 
8530
+ test("The `unboundIf` helper should work when its inverse is not present", function() {
8531
+ view = EmberView.create({
8532
+ conditional: false,
8533
+ template: compile('{{#unboundIf view.conditional}}Yep{{/unboundIf}}')
8534
+ });
8535
+ runAppend(view);
8536
+ equal(view.$().text(), '');
8537
+ });
8538
+
8450
8539
  test("The `if` helper ignores a controller option", function() {
8451
8540
  var lookupCalled = false;
8452
8541
 
@@ -11695,7 +11784,7 @@ enifed("ember-htmlbars/tests/helpers/with_test",
11695
11784
 
11696
11785
  expectDeprecation(function(){
11697
11786
  runAppend(view);
11698
- }, 'Using the context switching form of `{{with}}` is deprecated. Please use the keyword form (`{{with foo as bar}}`) instead. See http://emberjs.com/guides/deprecations/#toc_more-consistent-handlebars-scope for more details.');
11787
+ }, 'Using the context switching form of `{{with}}` is deprecated. Please use the keyword form (`{{with foo as bar}}`) instead.');
11699
11788
 
11700
11789
  equal(view.$().text(), "controller:Steve Holt and Bob Loblaw");
11701
11790
 
@@ -11836,7 +11925,7 @@ enifed("ember-htmlbars/tests/helpers/with_test",
11836
11925
 
11837
11926
  expectDeprecation(function(){
11838
11927
  runAppend(view);
11839
- }, 'Using the context switching form of `{{with}}` is deprecated. Please use the keyword form (`{{with foo as bar}}`) instead. See http://emberjs.com/guides/deprecations/#toc_more-consistent-handlebars-scope for more details.');
11928
+ }, 'Using the context switching form of `{{with}}` is deprecated. Please use the keyword form (`{{with foo as bar}}`) instead.');
11840
11929
 
11841
11930
  runDestroy(view);
11842
11931
 
@@ -11967,8 +12056,8 @@ enifed("ember-htmlbars/tests/helpers/with_test.jshint",
11967
12056
  });
11968
12057
  });
11969
12058
  enifed("ember-htmlbars/tests/helpers/yield_test",
11970
- ["ember-metal/run_loop","ember-views/views/view","ember-metal/computed","ember-runtime/system/container","ember-metal/property_get","ember-metal/property_set","ember-runtime/system/native_array","ember-views/views/component","ember-metal/error","ember-htmlbars/helpers","ember-template-compiler/system/compile","ember-runtime/tests/utils"],
11971
- function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__) {
12059
+ ["ember-metal/run_loop","ember-views/views/view","ember-metal/computed","ember-runtime/system/container","ember-metal/property_get","ember-metal/property_set","ember-runtime/system/native_array","ember-views/views/component","ember-metal/error","ember-htmlbars/helpers","ember-htmlbars/system/make-view-helper","ember-template-compiler/system/compile","ember-runtime/tests/utils"],
12060
+ function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__) {
11972
12061
  "use strict";
11973
12062
  /*jshint newcap:false*/
11974
12063
  var run = __dependency1__["default"];
@@ -11980,12 +12069,13 @@ enifed("ember-htmlbars/tests/helpers/yield_test",
11980
12069
  var A = __dependency7__.A;
11981
12070
  var Component = __dependency8__["default"];
11982
12071
  var EmberError = __dependency9__["default"];
11983
- var helper = __dependency10__.helper;
12072
+ var registerHelper = __dependency10__.registerHelper;
11984
12073
  var helpers = __dependency10__["default"];
12074
+ var makeViewHelper = __dependency11__["default"];
11985
12075
 
11986
- var compile = __dependency11__["default"];
11987
- var runAppend = __dependency12__.runAppend;
11988
- var runDestroy = __dependency12__.runDestroy;
12076
+ var compile = __dependency12__["default"];
12077
+ var runAppend = __dependency13__.runAppend;
12078
+ var runDestroy = __dependency13__.runDestroy;
11989
12079
 
11990
12080
  var view, container;
11991
12081
 
@@ -12123,7 +12213,7 @@ enifed("ember-htmlbars/tests/helpers/yield_test",
12123
12213
 
12124
12214
  expectDeprecation(function() {
12125
12215
  runAppend(view);
12126
- }, 'Using the context switching form of `{{with}}` is deprecated. Please use the keyword form (`{{with foo as bar}}`) instead. See http://emberjs.com/guides/deprecations/#toc_more-consistent-handlebars-scope for more details.');
12216
+ }, 'Using the context switching form of `{{with}}` is deprecated. Please use the keyword form (`{{with foo as bar}}`) instead.');
12127
12217
 
12128
12218
  equal(view.$('div p:contains(inner) + p:contains(insideWith)').length, 1, "Yield points at the right context");
12129
12219
  });
@@ -12198,7 +12288,7 @@ enifed("ember-htmlbars/tests/helpers/yield_test",
12198
12288
 
12199
12289
  expectDeprecation(function() {
12200
12290
  runAppend(view);
12201
- }, 'Using the context switching form of `{{with}}` is deprecated. Please use the keyword form (`{{with foo as bar}}`) instead. See http://emberjs.com/guides/deprecations/#toc_more-consistent-handlebars-scope for more details.');
12291
+ }, 'Using the context switching form of `{{with}}` is deprecated. Please use the keyword form (`{{with foo as bar}}`) instead.');
12202
12292
 
12203
12293
  equal('outerinner', view.$('p').text(), "Yield points at the right context");
12204
12294
  });
@@ -12294,13 +12384,13 @@ enifed("ember-htmlbars/tests/helpers/yield_test",
12294
12384
  }
12295
12385
  });
12296
12386
 
12297
- helper('inner-component', InnerComponent);
12387
+ registerHelper('inner-component', makeViewHelper(InnerComponent));
12298
12388
 
12299
12389
  var OuterComponent = Component.extend({
12300
12390
  layout: compile("{{#inner-component}}<span>{{yield}}</span>{{/inner-component}}")
12301
12391
  });
12302
12392
 
12303
- helper('outer-component', OuterComponent);
12393
+ registerHelper('outer-component', makeViewHelper(OuterComponent));
12304
12394
 
12305
12395
  view = EmberView.create({
12306
12396
  template: compile(
@@ -13520,7 +13610,7 @@ enifed("ember-htmlbars/tests/integration/with_view_test",
13520
13610
 
13521
13611
  expectDeprecation(function() {
13522
13612
  runAppend(view);
13523
- }, 'Using the context switching form of `{{with}}` is deprecated. Please use the keyword form (`{{with foo as bar}}`) instead. See http://emberjs.com/guides/deprecations/#toc_more-consistent-handlebars-scope for more details.');
13613
+ }, 'Using the context switching form of `{{with}}` is deprecated. Please use the keyword form (`{{with foo as bar}}`) instead.');
13524
13614
 
13525
13615
  equal(view.$('#first').text(), 'bam', 'precond - view renders Handlebars template');
13526
13616
 
@@ -13551,7 +13641,7 @@ enifed("ember-htmlbars/tests/integration/with_view_test",
13551
13641
 
13552
13642
  expectDeprecation(function() {
13553
13643
  runAppend(view);
13554
- }, 'Using the context switching form of `{{with}}` is deprecated. Please use the keyword form (`{{with foo as bar}}`) instead. See http://emberjs.com/guides/deprecations/#toc_more-consistent-handlebars-scope for more details.');
13644
+ }, 'Using the context switching form of `{{with}}` is deprecated. Please use the keyword form (`{{with foo as bar}}`) instead.');
13555
13645
 
13556
13646
  equal(view.$().text(), 'barbang', 'renders values from view and child view');
13557
13647
  });
@@ -13574,7 +13664,7 @@ enifed("ember-htmlbars/tests/integration/with_view_test",
13574
13664
 
13575
13665
  expectDeprecation(function() {
13576
13666
  runAppend(view);
13577
- }, 'Using the context switching form of `{{with}}` is deprecated. Please use the keyword form (`{{with foo as bar}}`) instead. See http://emberjs.com/guides/deprecations/#toc_more-consistent-handlebars-scope for more details.');
13667
+ }, 'Using the context switching form of `{{with}}` is deprecated. Please use the keyword form (`{{with foo as bar}}`) instead.');
13578
13668
 
13579
13669
  equal(trim(view.$().text()), 'Name: SFMoMA Price: $20', 'should print baz twice');
13580
13670
  });
@@ -20134,6 +20224,28 @@ enifed("ember-metal/tests/mixin/mergedProperties_test",
20134
20224
  deepEqual(get(obj, 'bar'), { a: true, l: true, e: true, x: true }, "get bar");
20135
20225
  });
20136
20226
 
20227
+ test("mergedProperties should exist even if not explicitly set on create", function() {
20228
+
20229
+ var AnObj = Ember.Object.extend({
20230
+ mergedProperties: ['options'],
20231
+ options: {
20232
+ a: 'a',
20233
+ b: {
20234
+ c: 'ccc'
20235
+ }
20236
+ }
20237
+ });
20238
+
20239
+ var obj = AnObj.create({
20240
+ options: {
20241
+ a: 'A'
20242
+ }
20243
+ });
20244
+
20245
+ equal(get(obj, "options").a, 'A');
20246
+ equal(get(obj, "options").b.c, 'ccc');
20247
+ });
20248
+
20137
20249
  test("mergedProperties' overwriting methods can call _super", function() {
20138
20250
 
20139
20251
  expect(4);
@@ -24872,7 +24984,7 @@ enifed("ember-routing-htmlbars/tests/helpers/action_test",
24872
24984
 
24873
24985
  expectDeprecation(function() {
24874
24986
  runAppend(view);
24875
- }, 'Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each foo in bar}}`) instead. See http://emberjs.com/guides/deprecations/#toc_more-consistent-handlebars-scope for more details.');
24987
+ }, 'Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each foo in bar}}`) instead.');
24876
24988
 
24877
24989
  equal(registeredTarget, itemController, "the item controller is the target of action");
24878
24990
  });
@@ -24902,14 +25014,14 @@ enifed("ember-routing-htmlbars/tests/helpers/action_test",
24902
25014
 
24903
25015
  expectDeprecation(function() {
24904
25016
  runAppend(view);
24905
- }, 'Using the context switching form of `{{with}}` is deprecated. Please use the keyword form (`{{with foo as bar}}`) instead. See http://emberjs.com/guides/deprecations/#toc_more-consistent-handlebars-scope for more details.');
25017
+ }, 'Using the context switching form of `{{with}}` is deprecated. Please use the keyword form (`{{with foo as bar}}`) instead.');
24906
25018
 
24907
25019
  ok(registeredTarget instanceof PersonController, "the with-controller is the target of action");
24908
25020
  });
24909
25021
 
24910
25022
  test("should target the with-controller inside an {{each}} in a {{#with controller='person'}} [DEPRECATED]", function() {
24911
- expectDeprecation('Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each foo in bar}}`) instead. See http://emberjs.com/guides/deprecations/#toc_more-consistent-handlebars-scope for more details.');
24912
- expectDeprecation('Using the context switching form of `{{with}}` is deprecated. Please use the keyword form (`{{with foo as bar}}`) instead. See http://emberjs.com/guides/deprecations/#toc_more-consistent-handlebars-scope for more details.');
25023
+ expectDeprecation('Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each foo in bar}}`) instead.');
25024
+ expectDeprecation('Using the context switching form of `{{with}}` is deprecated. Please use the keyword form (`{{with foo as bar}}`) instead.');
24913
25025
 
24914
25026
  var eventsCalled = [];
24915
25027
 
@@ -25209,7 +25321,7 @@ enifed("ember-routing-htmlbars/tests/helpers/action_test",
25209
25321
 
25210
25322
  expectDeprecation(function() {
25211
25323
  runAppend(view);
25212
- }, 'Using the context switching form of `{{with}}` is deprecated. Please use the keyword form (`{{with foo as bar}}`) instead. See http://emberjs.com/guides/deprecations/#toc_more-consistent-handlebars-scope for more details.');
25324
+ }, 'Using the context switching form of `{{with}}` is deprecated. Please use the keyword form (`{{with foo as bar}}`) instead.');
25213
25325
 
25214
25326
  view.$('a').trigger('click');
25215
25327
 
@@ -25640,7 +25752,7 @@ enifed("ember-routing-htmlbars/tests/helpers/action_test",
25640
25752
  view.set('controller', controller);
25641
25753
  view.appendTo('#qunit-fixture');
25642
25754
  });
25643
- }, 'Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each foo in bar}}`) instead. See http://emberjs.com/guides/deprecations/#toc_more-consistent-handlebars-scope for more details.');
25755
+ }, 'Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each foo in bar}}`) instead.');
25644
25756
 
25645
25757
  var testBoundAction = function(propertyValue){
25646
25758
  run(function(){
@@ -26228,7 +26340,7 @@ enifed("ember-routing-htmlbars/tests/helpers/outlet_test",
26228
26340
 
26229
26341
  expectDeprecation(function() {
26230
26342
  runAppend(view);
26231
- }, 'Using the context switching form of `{{with}}` is deprecated. Please use the keyword form (`{{with foo as bar}}`) instead. See http://emberjs.com/guides/deprecations/#toc_more-consistent-handlebars-scope for more details.');
26343
+ }, 'Using the context switching form of `{{with}}` is deprecated. Please use the keyword form (`{{with foo as bar}}`) instead.');
26232
26344
 
26233
26345
  run(function() {
26234
26346
  view.connectOutlet('main', bottomView);
@@ -28345,7 +28457,13 @@ enifed("ember-routing/tests/system/route_test",
28345
28457
  deepEqual(route.serialize(model, ['post_id']), {post_id: 2}, "serialized correctly");
28346
28458
  });
28347
28459
 
28348
- test("returns undefined if model is not set", function(){
28460
+ test("returns checks for existence of model.post_id before trying model.id", function() {
28461
+ var model = { post_id: 3 };
28462
+
28463
+ deepEqual(route.serialize(model, ['post_id']), { post_id: 3 }, "serialized correctly");
28464
+ });
28465
+
28466
+ test("returns undefined if model is not set", function() {
28349
28467
  equal(route.serialize(undefined, ['post_id']), undefined, "serialized correctly");
28350
28468
  });
28351
28469
 
@@ -46041,6 +46159,56 @@ enifed("ember-template-compiler/tests/main_test.jshint",
46041
46159
  ok(true, 'ember-template-compiler/tests/main_test.js should pass jshint.');
46042
46160
  });
46043
46161
  });
46162
+ enifed("ember-template-compiler/tests/plugins/transform-each-in-to-hash-test",
46163
+ ["ember-template-compiler"],
46164
+ function(__dependency1__) {
46165
+ "use strict";
46166
+ var compile = __dependency1__.compile;
46167
+
46168
+ QUnit.module('ember-template-compiler: transform-each-in-to-hash');
46169
+
46170
+ test('cannot use block params and keyword syntax together', function() {
46171
+ expect(1);
46172
+
46173
+ throws(function() {
46174
+ compile('{{#each thing in controller as |other-thing|}}{{thing}}-{{other-thing}}{{/each}}', true);
46175
+ },/You cannot use keyword \(`{{each foo in bar}}`\) and block params \(`{{each bar as \|foo\|}}`\) at the same time\./);
46176
+ });
46177
+ });
46178
+ enifed("ember-template-compiler/tests/plugins/transform-each-in-to-hash-test.jshint",
46179
+ [],
46180
+ function() {
46181
+ "use strict";
46182
+ module('JSHint - ember-template-compiler/tests/plugins');
46183
+ test('ember-template-compiler/tests/plugins/transform-each-in-to-hash-test.js should pass jshint', function() {
46184
+ ok(true, 'ember-template-compiler/tests/plugins/transform-each-in-to-hash-test.js should pass jshint.');
46185
+ });
46186
+ });
46187
+ enifed("ember-template-compiler/tests/plugins/transform-with-as-to-hash-test",
46188
+ ["ember-template-compiler"],
46189
+ function(__dependency1__) {
46190
+ "use strict";
46191
+ var compile = __dependency1__.compile;
46192
+
46193
+ QUnit.module('ember-template-compiler: transform-with-as-to-hash');
46194
+
46195
+ test('cannot use block params and keyword syntax together', function() {
46196
+ expect(1);
46197
+
46198
+ throws(function() {
46199
+ compile('{{#with foo as thing as |other-thing|}}{{thing}}-{{other-thing}}{{/with}}');
46200
+ }, /You cannot use keyword/);
46201
+ });
46202
+ });
46203
+ enifed("ember-template-compiler/tests/plugins/transform-with-as-to-hash-test.jshint",
46204
+ [],
46205
+ function() {
46206
+ "use strict";
46207
+ module('JSHint - ember-template-compiler/tests/plugins');
46208
+ test('ember-template-compiler/tests/plugins/transform-with-as-to-hash-test.js should pass jshint', function() {
46209
+ ok(true, 'ember-template-compiler/tests/plugins/transform-with-as-to-hash-test.js should pass jshint.');
46210
+ });
46211
+ });
46044
46212
  enifed("ember-template-compiler/tests/plugins_test",
46045
46213
  ["ember-template-compiler/plugins","ember-template-compiler/system/compile"],
46046
46214
  function(__dependency1__, __dependency2__) {
@@ -54955,7 +55123,7 @@ enifed("ember-views/tests/views/view/init_test",
54955
55123
 
54956
55124
  QUnit.module("EmberView.createWithMixins");
54957
55125
 
54958
- test("should warn if a non-array is used for classNames", function() {
55126
+ test("should warn if a computed property is used for classNames", function() {
54959
55127
  expectAssertion(function() {
54960
55128
  EmberView.createWithMixins({
54961
55129
  elementId: 'test',
@@ -54963,10 +55131,10 @@ enifed("ember-views/tests/views/view/init_test",
54963
55131
  return ['className'];
54964
55132
  })["volatile"]()
54965
55133
  });
54966
- }, /Only arrays are allowed/i);
55134
+ }, /Only arrays of static class strings.*For dynamic classes/i);
54967
55135
  });
54968
55136
 
54969
- test("should warn if a non-array is used for classNamesBindings", function() {
55137
+ test("should warn if a non-array is used for classNameBindings", function() {
54970
55138
  expectAssertion(function() {
54971
55139
  EmberView.createWithMixins({
54972
55140
  elementId: 'test',
@@ -58896,7 +59064,7 @@ enifed("ember/tests/helpers/link_to_test",
58896
59064
 
58897
59065
  expectDeprecation(function() {
58898
59066
  bootApplication();
58899
- }, 'Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each foo in bar}}`) instead. See http://emberjs.com/guides/deprecations/#toc_more-consistent-handlebars-scope for more details.');
59067
+ }, 'Using the context switching form of {{each}} is deprecated. Please use the keyword form (`{{#each foo in bar}}`) instead.');
58900
59068
 
58901
59069
  function linksEqual($links, expected) {
58902
59070
  equal($links.length, expected.length, "Has correct number of links");