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

Sign up to get free protection for your applications and to get access to all the features.

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.2
8
+ * @version 1.10.0-beta.3
9
9
  */
10
10
 
11
11
  (function() {
@@ -4037,78 +4037,6 @@ enifed("ember-htmlbars.jshint",
4037
4037
  ok(true, 'ember-htmlbars.js should pass jshint.');
4038
4038
  });
4039
4039
  });
4040
- enifed("ember-htmlbars/attr_nodes.jshint",
4041
- [],
4042
- function() {
4043
- "use strict";
4044
- module('JSHint - ember-htmlbars');
4045
- test('ember-htmlbars/attr_nodes.js should pass jshint', function() {
4046
- ok(true, 'ember-htmlbars/attr_nodes.js should pass jshint.');
4047
- });
4048
- });
4049
- enifed("ember-htmlbars/attr_nodes/legacy_bind.jshint",
4050
- [],
4051
- function() {
4052
- "use strict";
4053
- module('JSHint - ember-htmlbars/attr_nodes');
4054
- test('ember-htmlbars/attr_nodes/legacy_bind.js should pass jshint', function() {
4055
- ok(true, 'ember-htmlbars/attr_nodes/legacy_bind.js should pass jshint.');
4056
- });
4057
- });
4058
- enifed("ember-htmlbars/attr_nodes/quoted.jshint",
4059
- [],
4060
- function() {
4061
- "use strict";
4062
- module('JSHint - ember-htmlbars/attr_nodes');
4063
- test('ember-htmlbars/attr_nodes/quoted.js should pass jshint', function() {
4064
- ok(true, 'ember-htmlbars/attr_nodes/quoted.js should pass jshint.');
4065
- });
4066
- });
4067
- enifed("ember-htmlbars/attr_nodes/sanitized.jshint",
4068
- [],
4069
- function() {
4070
- "use strict";
4071
- module('JSHint - ember-htmlbars/attr_nodes');
4072
- test('ember-htmlbars/attr_nodes/sanitized.js should pass jshint', function() {
4073
- ok(true, 'ember-htmlbars/attr_nodes/sanitized.js should pass jshint.');
4074
- });
4075
- });
4076
- enifed("ember-htmlbars/attr_nodes/simple.jshint",
4077
- [],
4078
- function() {
4079
- "use strict";
4080
- module('JSHint - ember-htmlbars/attr_nodes');
4081
- test('ember-htmlbars/attr_nodes/simple.js should pass jshint', function() {
4082
- ok(true, 'ember-htmlbars/attr_nodes/simple.js should pass jshint.');
4083
- });
4084
- });
4085
- enifed("ember-htmlbars/attr_nodes/unquoted.jshint",
4086
- [],
4087
- function() {
4088
- "use strict";
4089
- module('JSHint - ember-htmlbars/attr_nodes');
4090
- test('ember-htmlbars/attr_nodes/unquoted.js should pass jshint', function() {
4091
- ok(true, 'ember-htmlbars/attr_nodes/unquoted.js should pass jshint.');
4092
- });
4093
- });
4094
- enifed("ember-htmlbars/attr_nodes/unquoted_nonproperty.jshint",
4095
- [],
4096
- function() {
4097
- "use strict";
4098
- module('JSHint - ember-htmlbars/attr_nodes');
4099
- test('ember-htmlbars/attr_nodes/unquoted_nonproperty.js should pass jshint', function() {
4100
- ok(true, 'ember-htmlbars/attr_nodes/unquoted_nonproperty.js should pass jshint.');
4101
- });
4102
- });
4103
- enifed("ember-htmlbars/attr_nodes/utils.jshint",
4104
- [],
4105
- function() {
4106
- "use strict";
4107
- module('JSHint - ember-htmlbars/attr_nodes');
4108
- test('ember-htmlbars/attr_nodes/utils.js should pass jshint', function() {
4109
- ok(true, 'ember-htmlbars/attr_nodes/utils.js should pass jshint.');
4110
- });
4111
- });
4112
4040
  enifed("ember-htmlbars/compat.jshint",
4113
4041
  [],
4114
4042
  function() {
@@ -4325,6 +4253,15 @@ enifed("ember-htmlbars/hooks/attribute.jshint",
4325
4253
  ok(true, 'ember-htmlbars/hooks/attribute.js should pass jshint.');
4326
4254
  });
4327
4255
  });
4256
+ enifed("ember-htmlbars/hooks/block.jshint",
4257
+ [],
4258
+ function() {
4259
+ "use strict";
4260
+ module('JSHint - ember-htmlbars/hooks');
4261
+ test('ember-htmlbars/hooks/block.js should pass jshint', function() {
4262
+ ok(true, 'ember-htmlbars/hooks/block.js should pass jshint.');
4263
+ });
4264
+ });
4328
4265
  enifed("ember-htmlbars/hooks/component.jshint",
4329
4266
  [],
4330
4267
  function() {
@@ -4370,6 +4307,15 @@ enifed("ember-htmlbars/hooks/get.jshint",
4370
4307
  ok(true, 'ember-htmlbars/hooks/get.js should pass jshint.');
4371
4308
  });
4372
4309
  });
4310
+ enifed("ember-htmlbars/hooks/inline.jshint",
4311
+ [],
4312
+ function() {
4313
+ "use strict";
4314
+ module('JSHint - ember-htmlbars/hooks');
4315
+ test('ember-htmlbars/hooks/inline.js should pass jshint', function() {
4316
+ ok(true, 'ember-htmlbars/hooks/inline.js should pass jshint.');
4317
+ });
4318
+ });
4373
4319
  enifed("ember-htmlbars/hooks/set.jshint",
4374
4320
  [],
4375
4321
  function() {
@@ -4551,6 +4497,13 @@ enifed("ember-htmlbars/tests/attr_nodes/nonmatching_reflection_test",
4551
4497
  run(function() { view.appendTo('#qunit-fixture'); });
4552
4498
  }
4553
4499
 
4500
+ function canSetFalsyMaxLength() {
4501
+ var input = document.createElement('input');
4502
+ input.maxLength = 0;
4503
+
4504
+ return input.maxLength === 0;
4505
+ }
4506
+
4554
4507
  });
4555
4508
  enifed("ember-htmlbars/tests/attr_nodes/nonmatching_reflection_test.jshint",
4556
4509
  [],
@@ -6211,7 +6164,7 @@ enifed("ember-htmlbars/tests/helpers/bind_attr_test",
6211
6164
 
6212
6165
  test("should keep class in the order it appears in", function() {
6213
6166
  view = EmberView.create({
6214
- template: compile('<span {{bind-attr class=":foo :baz"}}></span>'),
6167
+ template: compile('<span {{bind-attr class=":foo :baz"}}></span>')
6215
6168
  });
6216
6169
 
6217
6170
  runAppend(view);
@@ -6287,6 +6240,8 @@ enifed("ember-htmlbars/tests/helpers/bind_test",
6287
6240
  container.optionsForType('template', { instantiate: false });
6288
6241
  container.register('view:default', _MetamorphView);
6289
6242
  container.register('view:toplevel', EmberView.extend());
6243
+
6244
+ expectDeprecation('The `{{bind}}` helper has been deprecated and will be removed.');
6290
6245
  },
6291
6246
  teardown: function() {
6292
6247
  runDestroy(container);
@@ -6354,6 +6309,8 @@ enifed("ember-htmlbars/tests/helpers/bind_test",
6354
6309
  setup: function() {
6355
6310
  container = new Container();
6356
6311
  container.optionsForType('template', { instantiate: false });
6312
+
6313
+ expectDeprecation('The `{{bind}}` helper has been deprecated and will be removed.');
6357
6314
  },
6358
6315
  teardown: function() {
6359
6316
  runDestroy(container);
@@ -8369,12 +8326,12 @@ enifed("ember-htmlbars/tests/helpers/if_unless_test",
8369
8326
  test("The `unless` helper does not error on undefined", function() {
8370
8327
  view = EmberView.create({
8371
8328
  undefinedValue: undefined,
8372
- template: compile('{{#unless view.undefinedValue}}Yep{{/unless}}{{#unbound unless view.undefinedValue}}Yep{{/unbound}}')
8329
+ template: compile('{{#unless view.undefinedValue}}YepBound{{/unless}}{{#unbound unless view.undefinedValue}}YepUnbound{{/unbound}}')
8373
8330
  });
8374
8331
 
8375
8332
  runAppend(view);
8376
8333
 
8377
- equal(view.$().text(), 'YepYep');
8334
+ equal(view.$().text(), 'YepBoundYepUnbound');
8378
8335
  });
8379
8336
 
8380
8337
  test("The `if` helper does not print the contents for an object proxy without content", function() {
@@ -8595,29 +8552,6 @@ enifed("ember-htmlbars/tests/helpers/if_unless_test",
8595
8552
  equal(view.$().text(), '');
8596
8553
  });
8597
8554
 
8598
- test('views within an if statement should be sane on re-render', function() {
8599
- view = EmberView.create({
8600
- template: compile('{{#if view.display}}{{input}}{{/if}}'),
8601
- display: false
8602
- });
8603
-
8604
- runAppend(view);
8605
-
8606
- equal(view.$('input').length, 0);
8607
-
8608
- run(function() {
8609
- // Setting twice will trigger the observer twice, this is intentional
8610
- view.set('display', true);
8611
- view.set('display', 'yes');
8612
- });
8613
-
8614
- var textfield = view.$('input');
8615
- equal(textfield.length, 1);
8616
-
8617
- // Make sure the view is still registered in View.views
8618
- ok(EmberView.views[textfield.attr('id')]);
8619
- });
8620
-
8621
8555
  test('should update the block when object passed to #if helper changes', function() {
8622
8556
  container.register('template:menu', compile('<h1>{{#if view.inception}}{{view.INCEPTION}}{{/if}}</h1>'));
8623
8557
 
@@ -8781,29 +8715,6 @@ enifed("ember-htmlbars/tests/helpers/if_unless_test",
8781
8715
  equal(view.$().text(), '');
8782
8716
  });
8783
8717
 
8784
- test('views within an if statement should be sane on re-render', function() {
8785
- view = EmberView.create({
8786
- template: compile('{{#if view.display}}{{input}}{{/if}}'),
8787
- display: false
8788
- });
8789
-
8790
- runAppend(view);
8791
-
8792
- equal(view.$('input').length, 0);
8793
-
8794
- run(function() {
8795
- // Setting twice will trigger the observer twice, this is intentional
8796
- view.set('display', true);
8797
- view.set('display', 'yes');
8798
- });
8799
-
8800
- var textfield = view.$('input');
8801
- equal(textfield.length, 1);
8802
-
8803
- // Make sure the view is still registered in View.views
8804
- ok(EmberView.views[textfield.attr('id')]);
8805
- });
8806
-
8807
8718
  test('should update the block when object passed to #if helper changes', function() {
8808
8719
  container.register('template:menu', compile('<h1>{{#if view.inception}}{{view.INCEPTION}}{{/if}}</h1>'));
8809
8720
 
@@ -8871,29 +8782,6 @@ enifed("ember-htmlbars/tests/helpers/if_unless_test",
8871
8782
  });
8872
8783
  });
8873
8784
 
8874
- test('views within an if statement should be sane on re-render', function() {
8875
- view = EmberView.create({
8876
- template: compile('{{#if view.display}}{{input}}{{/if}}'),
8877
- display: false
8878
- });
8879
-
8880
- runAppend(view);
8881
-
8882
- equal(view.$('input').length, 0);
8883
-
8884
- run(function() {
8885
- // Setting twice will trigger the observer twice, this is intentional
8886
- view.set('display', true);
8887
- view.set('display', 'yes');
8888
- });
8889
-
8890
- var textfield = view.$('input');
8891
- equal(textfield.length, 1);
8892
-
8893
- // Make sure the view is still registered in View.views
8894
- ok(EmberView.views[textfield.attr('id')]);
8895
- });
8896
-
8897
8785
  test('the {{this}} helper should not fail on removal', function() {
8898
8786
  view = EmberView.create({
8899
8787
  context: 'abc',
@@ -9454,7 +9342,7 @@ enifed("ember-htmlbars/tests/helpers/log_test",
9454
9342
  test('should be able to log `this`', function() {
9455
9343
  view = EmberView.create({
9456
9344
  context: 'one',
9457
- template: compile('{{log this}}'),
9345
+ template: compile('{{log this}}')
9458
9346
  });
9459
9347
 
9460
9348
  runAppend(view);
@@ -13159,7 +13047,7 @@ enifed("ember-htmlbars/tests/integration/escape_integration_test",
13159
13047
  test('should escape HTML in primitive value contexts when using normal mustaches', function() {
13160
13048
  view = EmberView.create({
13161
13049
  context: '<b>Max</b><b>James</b>',
13162
- template: compile('{{this}}'),
13050
+ template: compile('{{this}}')
13163
13051
  });
13164
13052
 
13165
13053
  runAppend(view);
@@ -13178,7 +13066,7 @@ enifed("ember-htmlbars/tests/integration/escape_integration_test",
13178
13066
  test('should not escape HTML in primitive value contexts when using triple mustaches', function() {
13179
13067
  view = EmberView.create({
13180
13068
  context: '<b>Max</b><b>James</b>',
13181
- template: compile('{{{this}}}'),
13069
+ template: compile('{{{this}}}')
13182
13070
  });
13183
13071
 
13184
13072
  runAppend(view);
@@ -15661,6 +15549,12 @@ enifed("ember-metal/tests/accessors/mandatory_setters_test",
15661
15549
 
15662
15550
  QUnit.module('mandatory-setters');
15663
15551
 
15552
+ function hasMandatorySetter(object, property) {
15553
+ var meta = metaFor(object);
15554
+
15555
+ return property in meta.values;
15556
+ }
15557
+
15664
15558
 
15665
15559
  test('does not assert', function() {
15666
15560
  var obj = {
@@ -19334,7 +19228,7 @@ enifed("ember-metal/tests/map_test",
19334
19228
  var expectations = [
19335
19229
  { value: 1, key: "a", context: unboundThis },
19336
19230
  { value: 2, key: "b", context: unboundThis },
19337
- { value: 3, key: "c", context: unboundThis },
19231
+ { value: 3, key: "c", context: unboundThis }
19338
19232
  ];
19339
19233
 
19340
19234
  map.forEach(function(value, key, theMap) {
@@ -19362,7 +19256,7 @@ enifed("ember-metal/tests/map_test",
19362
19256
  var expectations = [
19363
19257
  { value: 1, key: "a", context: context },
19364
19258
  { value: 2, key: "b", context: context },
19365
- { value: 3, key: "c", context: context },
19259
+ { value: 3, key: "c", context: context }
19366
19260
  ];
19367
19261
 
19368
19262
  map.forEach(function(value, key, theMap) {
@@ -19421,7 +19315,7 @@ enifed("ember-metal/tests/map_test",
19421
19315
  { value: 1, key: "a", context: unboundThis },
19422
19316
  { value: 2, key: "b", context: unboundThis },
19423
19317
  { value: 3, key: "c", context: unboundThis },
19424
- { value: 4, key: "d", context: unboundThis },
19318
+ { value: 4, key: "d", context: unboundThis }
19425
19319
  ];
19426
19320
 
19427
19321
  map.forEach(function(value, key, theMap) {
@@ -26379,7 +26273,7 @@ enifed("ember-routing-htmlbars/tests/helpers/outlet_test",
26379
26273
  test("should not throw deprecations if {{outlet}} is used with a quoted name", function() {
26380
26274
  expectNoDeprecation();
26381
26275
  view = EmberView.create({
26382
- template: compile("{{outlet \"foo\"}}"),
26276
+ template: compile("{{outlet \"foo\"}}")
26383
26277
  });
26384
26278
  runAppend(view);
26385
26279
  });
@@ -26387,7 +26281,7 @@ enifed("ember-routing-htmlbars/tests/helpers/outlet_test",
26387
26281
 
26388
26282
  test("should throw an assertion if {{outlet}} used with unquoted name", function() {
26389
26283
  view = EmberView.create({
26390
- template: compile("{{outlet foo}}"),
26284
+ template: compile("{{outlet foo}}")
26391
26285
  });
26392
26286
  expectAssertion(function() {
26393
26287
  runAppend(view);
@@ -28157,7 +28051,8 @@ enifed("ember-routing/tests/system/controller_for_test",
28157
28051
  });
28158
28052
 
28159
28053
  test("generateController should create App.ObjectController if provided", function() {
28160
- var context = {}, controller;
28054
+ var context = {};
28055
+ var controller;
28161
28056
  namespace.ObjectController = ObjectController.extend();
28162
28057
 
28163
28058
  controller = generateController(container, 'home', context);
@@ -28167,7 +28062,8 @@ enifed("ember-routing/tests/system/controller_for_test",
28167
28062
  });
28168
28063
 
28169
28064
  test("generateController should create App.ArrayController if provided", function() {
28170
- var context = Ember.A(), controller;
28065
+ var context = Ember.A();
28066
+ var controller;
28171
28067
  namespace.ArrayController = ArrayController.extend();
28172
28068
 
28173
28069
  controller = generateController(container, 'home', context);
@@ -28499,8 +28395,8 @@ enifed("ember-routing/tests/system/route_test",
28499
28395
 
28500
28396
  container.register('service:auth', Service.extend());
28501
28397
 
28502
- var appRoute = container.lookup('route:application'),
28503
- authService = container.lookup('service:auth');
28398
+ var appRoute = container.lookup('route:application');
28399
+ var authService = container.lookup('service:auth');
28504
28400
 
28505
28401
  equal(authService, appRoute.get('authService'), "service.auth is injected");
28506
28402
  });
@@ -29498,6 +29394,20 @@ enifed("ember-runtime/tests/computed/reduce_computed_macros_test",
29498
29394
  deepEqual(get(obj, 'filtered'), ['b'], "index is passed to callback correctly");
29499
29395
  });
29500
29396
 
29397
+ test("it passes the array to the callback", function() {
29398
+ var array = Ember.A(['a', 'b', 'c']);
29399
+
29400
+ run(function() {
29401
+ obj = EmberObject.createWithMixins({
29402
+ array: array,
29403
+ filtered: computedFilter('array', function (item, index, array) { return index === array.get('length') - 2; })
29404
+ });
29405
+ get(obj, 'filtered');
29406
+ });
29407
+
29408
+ deepEqual(get(obj, 'filtered'), ['b'], "array is passed to callback correctly");
29409
+ });
29410
+
29501
29411
  test("it caches properly", function() {
29502
29412
  var array = get(obj, 'array');
29503
29413
  get(obj, 'filtered');
@@ -46672,7 +46582,9 @@ enifed("ember-testing/tests/adapters/adapter_test",
46672
46582
  // });
46673
46583
 
46674
46584
  test("exception throws", function() {
46675
- var error = "Hai", thrown;
46585
+ var error = "Hai";
46586
+ var thrown;
46587
+
46676
46588
  try {
46677
46589
  adapter.exception(error);
46678
46590
  } catch (e) {
@@ -47921,6 +47833,24 @@ enifed("ember-views.jshint",
47921
47833
  ok(true, 'ember-views.js should pass jshint.');
47922
47834
  });
47923
47835
  });
47836
+ enifed("ember-views/attr_nodes/attr_node.jshint",
47837
+ [],
47838
+ function() {
47839
+ "use strict";
47840
+ module('JSHint - ember-views/attr_nodes');
47841
+ test('ember-views/attr_nodes/attr_node.js should pass jshint', function() {
47842
+ ok(true, 'ember-views/attr_nodes/attr_node.js should pass jshint.');
47843
+ });
47844
+ });
47845
+ enifed("ember-views/attr_nodes/legacy_bind.jshint",
47846
+ [],
47847
+ function() {
47848
+ "use strict";
47849
+ module('JSHint - ember-views/attr_nodes');
47850
+ test('ember-views/attr_nodes/legacy_bind.js should pass jshint', function() {
47851
+ ok(true, 'ember-views/attr_nodes/legacy_bind.js should pass jshint.');
47852
+ });
47853
+ });
47924
47854
  enifed("ember-views/component_lookup.jshint",
47925
47855
  [],
47926
47856
  function() {
@@ -52331,7 +52261,7 @@ enifed("ember-views/tests/views/simple_bound_view_test",
52331
52261
  var isEscaped = true;
52332
52262
  var view = new SimpleBoundView(lazyValue, isEscaped);
52333
52263
  view._morph = {
52334
- update: function(newValue) {
52264
+ setContent: function(newValue) {
52335
52265
  value = newValue;
52336
52266
  }
52337
52267
  };
@@ -52340,19 +52270,19 @@ enifed("ember-views/tests/views/simple_bound_view_test",
52340
52270
 
52341
52271
  view.update();
52342
52272
 
52343
- equal(value, 'bar', 'expected call to morph.update with "bar"');
52273
+ equal(value, 'bar', 'expected call to morph.setContent with "bar"');
52344
52274
  value = null;
52345
52275
 
52346
52276
  view.update();
52347
52277
 
52348
- equal(value, null, 'expected no call to morph.update');
52278
+ equal(value, null, 'expected no call to morph.setContent');
52349
52279
 
52350
52280
  obj.foo = 'baz'; // change property
52351
52281
  lazyValue.notify();
52352
52282
 
52353
52283
  view.update();
52354
52284
 
52355
- equal(value, 'baz', 'expected call to morph.update with "baz"');
52285
+ equal(value, 'baz', 'expected call to morph.setContent with "baz"');
52356
52286
  });
52357
52287
  });
52358
52288
  enifed("ember-views/tests/views/simple_bound_view_test.jshint",
@@ -61689,7 +61619,8 @@ enifed("ember/tests/routing/basic_test",
61689
61619
  this.route("home");
61690
61620
  });
61691
61621
 
61692
- var chooseFollowed = 0, destination;
61622
+ var chooseFollowed = 0;
61623
+ var destination;
61693
61624
 
61694
61625
  App.ChooseRoute = Ember.Route.extend({
61695
61626
  redirect: function() {
@@ -63382,7 +63313,8 @@ enifed("ember/tests/routing/query_params_test",
63382
63313
  });
63383
63314
  }
63384
63315
 
63385
- var startingURL = '', expectedReplaceURL, expectedPushURL;
63316
+ var startingURL = '';
63317
+ var expectedReplaceURL, expectedPushURL;
63386
63318
 
63387
63319
  function setAndFlush(obj, prop, value) {
63388
63320
  Ember.run(obj, 'set', prop, value);