ember-source 2.12.1 → 2.12.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,7 @@
6
6
  * Portions Copyright 2008-2011 Apple Inc. All rights reserved.
7
7
  * @license Licensed under MIT license
8
8
  * See https://raw.github.com/emberjs/ember.js/master/LICENSE
9
- * @version 2.12.1
9
+ * @version 2.12.2
10
10
  */
11
11
 
12
12
  var enifed, requireModule, Ember;
@@ -755,8 +755,9 @@ enifed('container/tests/container_test', ['exports', 'ember-utils', 'ember-envir
755
755
  });
756
756
 
757
757
  QUnit.test('A deprecated `container` property is appended to every object instantiated from an extendable factory', function () {
758
+ var owner = {};
758
759
  var registry = new _containerIndex.Registry();
759
- var container = registry.container();
760
+ var container = owner.__container__ = registry.container({ owner: owner });
760
761
  var PostController = _internalTestHelpers.factory();
761
762
  registry.register('controller:post', PostController);
762
763
  var postController = container.lookup('controller:post');
@@ -6774,12 +6775,12 @@ enifed('ember-debug/warn.lint-test', ['exports'], function (exports) {
6774
6775
  });
6775
6776
  });
6776
6777
  enifed('ember-dev/test-helper/assertion', ['exports', 'ember-dev/test-helper/utils'], function (exports, _emberDevTestHelperUtils) {
6777
- /* globals QUnit */
6778
-
6779
6778
  'use strict';
6780
6779
 
6781
6780
  exports.default = AssertionAssert;
6782
6781
 
6782
+ /* globals QUnit */
6783
+
6783
6784
  var BREAK = {};
6784
6785
 
6785
6786
  /**
@@ -6799,19 +6800,18 @@ enifed('ember-dev/test-helper/assertion', ['exports', 'ember-dev/test-helper/uti
6799
6800
  In particular, this prevents `Ember.assert` from throw errors that would
6800
6801
  disrupt the control flow.
6801
6802
  */
6802
-
6803
6803
  function AssertionAssert(env) {
6804
6804
  this.env = env;
6805
6805
  }
6806
6806
 
6807
6807
  AssertionAssert.prototype = {
6808
- reset: function () {},
6809
- assert: function () {},
6808
+ reset: function reset() {},
6809
+ assert: function assert() {},
6810
6810
 
6811
- inject: function () {
6811
+ inject: function inject() {
6812
6812
  var _this = this;
6813
6813
 
6814
- var expectAssertion = function (func, expectedMessage) {
6814
+ var expectAssertion = function expectAssertion(func, expectedMessage) {
6815
6815
  if (_this.env.runningProdBuild) {
6816
6816
  QUnit.ok(true, 'Assertions disabled in production builds.');
6817
6817
  return;
@@ -6840,7 +6840,7 @@ enifed('ember-dev/test-helper/assertion', ['exports', 'ember-dev/test-helper/uti
6840
6840
  assert(sawCall, actualMessage, expectedMessage);
6841
6841
  };
6842
6842
 
6843
- var ignoreAssertion = function (func) {
6843
+ var ignoreAssertion = function ignoreAssertion(func) {
6844
6844
  _emberDevTestHelperUtils.callWithStub(_this.env, 'assert', func);
6845
6845
  };
6846
6846
 
@@ -6848,7 +6848,7 @@ enifed('ember-dev/test-helper/assertion', ['exports', 'ember-dev/test-helper/uti
6848
6848
  window.ignoreAssertion = ignoreAssertion;
6849
6849
  },
6850
6850
 
6851
- restore: function () {
6851
+ restore: function restore() {
6852
6852
  window.expectAssertion = null;
6853
6853
  window.ignoreAssertion = null;
6854
6854
  }
@@ -6877,61 +6877,86 @@ enifed('ember-dev/test-helper/assertion', ['exports', 'ember-dev/test-helper/uti
6877
6877
  enifed('ember-dev/test-helper/debug', ['exports', 'ember-dev/test-helper/method-call-tracker'], function (exports, _emberDevTestHelperMethodCallTracker) {
6878
6878
  'use strict';
6879
6879
 
6880
+ var _createClass = (function () {
6881
+ function defineProperties(target, props) {
6882
+ for (var i = 0; i < props.length; i++) {
6883
+ var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ('value' in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
6884
+ }
6885
+ }return function (Constructor, protoProps, staticProps) {
6886
+ if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
6887
+ };
6888
+ })();
6889
+
6890
+ function _classCallCheck(instance, Constructor) {
6891
+ if (!(instance instanceof Constructor)) {
6892
+ throw new TypeError('Cannot call a class as a function');
6893
+ }
6894
+ }
6895
+
6880
6896
  var DebugAssert = (function () {
6881
6897
  function DebugAssert(methodName, env) {
6898
+ _classCallCheck(this, DebugAssert);
6899
+
6882
6900
  this.methodName = methodName;
6883
6901
  this.env = env;
6884
6902
  }
6885
6903
 
6886
- DebugAssert.prototype.inject = function inject() {};
6887
-
6888
- DebugAssert.prototype.restore = function restore() {
6889
- this.reset();
6890
- };
6891
-
6892
- DebugAssert.prototype.reset = function reset() {
6893
- if (this.tracker) {
6894
- this.tracker.restoreMethod();
6904
+ _createClass(DebugAssert, [{
6905
+ key: 'inject',
6906
+ value: function inject() {}
6907
+ }, {
6908
+ key: 'restore',
6909
+ value: function restore() {
6910
+ this.reset();
6895
6911
  }
6912
+ }, {
6913
+ key: 'reset',
6914
+ value: function reset() {
6915
+ if (this.tracker) {
6916
+ this.tracker.restoreMethod();
6917
+ }
6896
6918
 
6897
- this.tracker = null;
6898
- };
6899
-
6900
- DebugAssert.prototype.assert = function assert() {
6901
- if (this.tracker) {
6902
- this.tracker.assert();
6919
+ this.tracker = null;
6920
+ }
6921
+ }, {
6922
+ key: 'assert',
6923
+ value: function assert() {
6924
+ if (this.tracker) {
6925
+ this.tracker.assert();
6926
+ }
6903
6927
  }
6904
- };
6905
-
6906
- // Run an expectation callback within the context of a new tracker, optionally
6907
- // accepting a function to run, which asserts immediately
6908
6928
 
6909
- DebugAssert.prototype.runExpectation = function runExpectation(func, callback) {
6910
- var originalTracker = undefined;
6929
+ // Run an expectation callback within the context of a new tracker, optionally
6930
+ // accepting a function to run, which asserts immediately
6931
+ }, {
6932
+ key: 'runExpectation',
6933
+ value: function runExpectation(func, callback) {
6934
+ var originalTracker = undefined;
6911
6935
 
6912
- // When helpers are passed a callback, they get a new tracker context
6913
- if (func) {
6914
- originalTracker = this.tracker;
6915
- this.tracker = null;
6916
- }
6936
+ // When helpers are passed a callback, they get a new tracker context
6937
+ if (func) {
6938
+ originalTracker = this.tracker;
6939
+ this.tracker = null;
6940
+ }
6917
6941
 
6918
- if (!this.tracker) {
6919
- this.tracker = new _emberDevTestHelperMethodCallTracker.default(this.env, this.methodName);
6920
- }
6942
+ if (!this.tracker) {
6943
+ this.tracker = new _emberDevTestHelperMethodCallTracker.default(this.env, this.methodName);
6944
+ }
6921
6945
 
6922
- // Yield to caller with tracker instance
6923
- callback(this.tracker);
6946
+ // Yield to caller with tracker instance
6947
+ callback(this.tracker);
6924
6948
 
6925
- // Once the given callback is invoked, the pending assertions should be
6926
- // flushed immediately
6927
- if (func) {
6928
- func();
6929
- this.assert();
6930
- this.reset();
6949
+ // Once the given callback is invoked, the pending assertions should be
6950
+ // flushed immediately
6951
+ if (func) {
6952
+ func();
6953
+ this.assert();
6954
+ this.reset();
6931
6955
 
6932
- this.tracker = originalTracker;
6956
+ this.tracker = originalTracker;
6957
+ }
6933
6958
  }
6934
- };
6959
+ }]);
6935
6960
 
6936
6961
  return DebugAssert;
6937
6962
  })();
@@ -6941,82 +6966,130 @@ enifed('ember-dev/test-helper/debug', ['exports', 'ember-dev/test-helper/method-
6941
6966
  enifed('ember-dev/test-helper/deprecation', ['exports', 'ember-dev/test-helper/debug', 'ember-dev/test-helper/utils'], function (exports, _emberDevTestHelperDebug, _emberDevTestHelperUtils) {
6942
6967
  'use strict';
6943
6968
 
6969
+ var _createClass = (function () {
6970
+ function defineProperties(target, props) {
6971
+ for (var i = 0; i < props.length; i++) {
6972
+ var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ('value' in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
6973
+ }
6974
+ }return function (Constructor, protoProps, staticProps) {
6975
+ if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
6976
+ };
6977
+ })();
6978
+
6979
+ var _get = function get(_x, _x2, _x3) {
6980
+ var _again = true;_function: while (_again) {
6981
+ var object = _x,
6982
+ property = _x2,
6983
+ receiver = _x3;_again = false;if (object === null) object = Function.prototype;var desc = Object.getOwnPropertyDescriptor(object, property);if (desc === undefined) {
6984
+ var parent = Object.getPrototypeOf(object);if (parent === null) {
6985
+ return undefined;
6986
+ } else {
6987
+ _x = parent;_x2 = property;_x3 = receiver;_again = true;desc = parent = undefined;continue _function;
6988
+ }
6989
+ } else if ('value' in desc) {
6990
+ return desc.value;
6991
+ } else {
6992
+ var getter = desc.get;if (getter === undefined) {
6993
+ return undefined;
6994
+ }return getter.call(receiver);
6995
+ }
6996
+ }
6997
+ };
6998
+
6999
+ function _classCallCheck(instance, Constructor) {
7000
+ if (!(instance instanceof Constructor)) {
7001
+ throw new TypeError('Cannot call a class as a function');
7002
+ }
7003
+ }
7004
+
7005
+ function _inherits(subClass, superClass) {
7006
+ if (typeof superClass !== 'function' && superClass !== null) {
7007
+ throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass);
7008
+ }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : babelHelpers.defaults(subClass, superClass);
7009
+ }
7010
+
6944
7011
  var DeprecationAssert = (function (_DebugAssert) {
6945
- babelHelpers.inherits(DeprecationAssert, _DebugAssert);
7012
+ _inherits(DeprecationAssert, _DebugAssert);
6946
7013
 
6947
7014
  function DeprecationAssert(env) {
6948
- _DebugAssert.call(this, 'deprecate', env);
6949
- }
7015
+ _classCallCheck(this, DeprecationAssert);
6950
7016
 
6951
- DeprecationAssert.prototype.inject = function inject() {
6952
- var _this = this;
7017
+ _get(Object.getPrototypeOf(DeprecationAssert.prototype), 'constructor', this).call(this, 'deprecate', env);
7018
+ }
6953
7019
 
6954
- // Expects no deprecation to happen within a function, or if no function is
6955
- // passed, from the time of calling until the end of the test.
6956
- //
6957
- // expectNoDeprecation(function() {
6958
- // fancyNewThing();
6959
- // });
6960
- //
6961
- // expectNoDeprecation();
6962
- // Ember.deprecate("Old And Busted");
6963
- //
6964
- var expectNoDeprecation = function (func) {
6965
- if (typeof func !== 'function') {
6966
- func = null;
6967
- }
7020
+ _createClass(DeprecationAssert, [{
7021
+ key: 'inject',
7022
+ value: function inject() {
7023
+ var _this = this;
6968
7024
 
6969
- _this.runExpectation(func, function (tracker) {
6970
- if (tracker.isExpectingCalls()) {
6971
- throw new Error("expectNoDeprecation was called after expectDeprecation was called!");
7025
+ // Expects no deprecation to happen within a function, or if no function is
7026
+ // passed, from the time of calling until the end of the test.
7027
+ //
7028
+ // expectNoDeprecation(function() {
7029
+ // fancyNewThing();
7030
+ // });
7031
+ //
7032
+ // expectNoDeprecation();
7033
+ // Ember.deprecate("Old And Busted");
7034
+ //
7035
+ var expectNoDeprecation = function expectNoDeprecation(func) {
7036
+ if (typeof func !== 'function') {
7037
+ func = null;
6972
7038
  }
6973
7039
 
6974
- tracker.expectNoCalls();
6975
- });
6976
- };
7040
+ _this.runExpectation(func, function (tracker) {
7041
+ if (tracker.isExpectingCalls()) {
7042
+ throw new Error("expectNoDeprecation was called after expectDeprecation was called!");
7043
+ }
6977
7044
 
6978
- // Expect a deprecation to happen within a function, or if no function
6979
- // is pass, from the time of calling until the end of the test. Can be called
6980
- // multiple times to assert deprecations with different specific messages
6981
- // were fired.
6982
- //
6983
- // expectDeprecation(function() {
6984
- // Ember.deprecate("Old And Busted");
6985
- // }, /* optionalStringOrRegex */);
6986
- //
6987
- // expectDeprecation(/* optionalStringOrRegex */);
6988
- // Ember.deprecate("Old And Busted");
6989
- //
6990
- var expectDeprecation = function (func, message) {
6991
- if (typeof func !== 'function') {
6992
- message = func;
6993
- func = null;
6994
- }
7045
+ tracker.expectNoCalls();
7046
+ });
7047
+ };
6995
7048
 
6996
- _this.runExpectation(func, function (tracker) {
6997
- if (tracker.isExpectingNoCalls()) {
6998
- throw new Error("expectDeprecation was called after expectNoDeprecation was called!");
7049
+ // Expect a deprecation to happen within a function, or if no function
7050
+ // is pass, from the time of calling until the end of the test. Can be called
7051
+ // multiple times to assert deprecations with different specific messages
7052
+ // were fired.
7053
+ //
7054
+ // expectDeprecation(function() {
7055
+ // Ember.deprecate("Old And Busted");
7056
+ // }, /* optionalStringOrRegex */);
7057
+ //
7058
+ // expectDeprecation(/* optionalStringOrRegex */);
7059
+ // Ember.deprecate("Old And Busted");
7060
+ //
7061
+ var expectDeprecation = function expectDeprecation(func, message) {
7062
+ if (typeof func !== 'function') {
7063
+ message = func;
7064
+ func = null;
6999
7065
  }
7000
7066
 
7001
- tracker.expectCall(message);
7002
- });
7003
- };
7067
+ _this.runExpectation(func, function (tracker) {
7068
+ if (tracker.isExpectingNoCalls()) {
7069
+ throw new Error("expectDeprecation was called after expectNoDeprecation was called!");
7070
+ }
7004
7071
 
7005
- var ignoreDeprecation = function (func) {
7006
- _emberDevTestHelperUtils.callWithStub(_this.env, 'deprecate', func);
7007
- };
7072
+ tracker.expectCall(message);
7073
+ });
7074
+ };
7008
7075
 
7009
- window.expectNoDeprecation = expectNoDeprecation;
7010
- window.expectDeprecation = expectDeprecation;
7011
- window.ignoreDeprecation = ignoreDeprecation;
7012
- };
7076
+ var ignoreDeprecation = function ignoreDeprecation(func) {
7077
+ _emberDevTestHelperUtils.callWithStub(_this.env, 'deprecate', func);
7078
+ };
7013
7079
 
7014
- DeprecationAssert.prototype.restore = function restore() {
7015
- _DebugAssert.prototype.restore.call(this);
7016
- window.expectDeprecation = null;
7017
- window.expectNoDeprecation = null;
7018
- window.ignoreDeprecation = null;
7019
- };
7080
+ window.expectNoDeprecation = expectNoDeprecation;
7081
+ window.expectDeprecation = expectDeprecation;
7082
+ window.ignoreDeprecation = ignoreDeprecation;
7083
+ }
7084
+ }, {
7085
+ key: 'restore',
7086
+ value: function restore() {
7087
+ _get(Object.getPrototypeOf(DeprecationAssert.prototype), 'restore', this).call(this);
7088
+ window.expectDeprecation = null;
7089
+ window.expectNoDeprecation = null;
7090
+ window.ignoreDeprecation = null;
7091
+ }
7092
+ }]);
7020
7093
 
7021
7094
  return DeprecationAssert;
7022
7095
  })(_emberDevTestHelperDebug.default);
@@ -7035,7 +7108,7 @@ enifed('ember-dev/test-helper/method-call-tracker', ['exports', 'ember-dev/test-
7035
7108
 
7036
7109
  'use strict';
7037
7110
 
7038
- var MethodCallTracker = function (env, methodName) {
7111
+ var MethodCallTracker = function MethodCallTracker(env, methodName) {
7039
7112
  this._env = env;
7040
7113
  this._methodName = methodName;
7041
7114
  this._isExpectingNoCalls = false;
@@ -7044,7 +7117,7 @@ enifed('ember-dev/test-helper/method-call-tracker', ['exports', 'ember-dev/test-
7044
7117
  };
7045
7118
 
7046
7119
  MethodCallTracker.prototype = {
7047
- stubMethod: function () {
7120
+ stubMethod: function stubMethod() {
7048
7121
  var _this = this;
7049
7122
 
7050
7123
  if (this._originalMethod) {
@@ -7064,31 +7137,31 @@ enifed('ember-dev/test-helper/method-call-tracker', ['exports', 'ember-dev/test-
7064
7137
  });
7065
7138
  },
7066
7139
 
7067
- restoreMethod: function () {
7140
+ restoreMethod: function restoreMethod() {
7068
7141
  if (this._originalMethod) {
7069
7142
  this._env.setDebugFunction(this._methodName, this._originalMethod);
7070
7143
  }
7071
7144
  },
7072
7145
 
7073
- expectCall: function (message) {
7146
+ expectCall: function expectCall(message) {
7074
7147
  this.stubMethod();
7075
7148
  this._expecteds.push(message || /.*/);
7076
7149
  },
7077
7150
 
7078
- expectNoCalls: function () {
7151
+ expectNoCalls: function expectNoCalls() {
7079
7152
  this.stubMethod();
7080
7153
  this._isExpectingNoCalls = true;
7081
7154
  },
7082
7155
 
7083
- isExpectingNoCalls: function () {
7156
+ isExpectingNoCalls: function isExpectingNoCalls() {
7084
7157
  return this._isExpectingNoCalls;
7085
7158
  },
7086
7159
 
7087
- isExpectingCalls: function () {
7160
+ isExpectingCalls: function isExpectingCalls() {
7088
7161
  return !this._isExpectingNoCalls && this._expecteds.length;
7089
7162
  },
7090
7163
 
7091
- assert: function () {
7164
+ assert: function assert() {
7092
7165
  var env = this._env;
7093
7166
  var methodName = this._methodName;
7094
7167
  var isExpectingNoCalls = this._isExpectingNoCalls;
@@ -7162,14 +7235,14 @@ enifed("ember-dev/test-helper/remaining-template", ["exports"], function (export
7162
7235
 
7163
7236
  "use strict";
7164
7237
 
7165
- var RemainingTemplateAssert = function (env) {
7238
+ var RemainingTemplateAssert = function RemainingTemplateAssert(env) {
7166
7239
  this.env = env;
7167
7240
  };
7168
7241
 
7169
7242
  RemainingTemplateAssert.prototype = {
7170
- reset: function () {},
7171
- inject: function () {},
7172
- assert: function () {
7243
+ reset: function reset() {},
7244
+ inject: function inject() {},
7245
+ assert: function assert() {
7173
7246
  if (this.env.Ember && this.env.Ember.TEMPLATES) {
7174
7247
  var templateNames = [],
7175
7248
  name;
@@ -7185,7 +7258,7 @@ enifed("ember-dev/test-helper/remaining-template", ["exports"], function (export
7185
7258
  }
7186
7259
  }
7187
7260
  },
7188
- restore: function () {}
7261
+ restore: function restore() {}
7189
7262
  };
7190
7263
 
7191
7264
  exports.default = RemainingTemplateAssert;
@@ -7195,14 +7268,14 @@ enifed("ember-dev/test-helper/remaining-view", ["exports"], function (exports) {
7195
7268
 
7196
7269
  "use strict";
7197
7270
 
7198
- var RemainingViewAssert = function (env) {
7271
+ var RemainingViewAssert = function RemainingViewAssert(env) {
7199
7272
  this.env = env;
7200
7273
  };
7201
7274
 
7202
7275
  RemainingViewAssert.prototype = {
7203
- reset: function () {},
7204
- inject: function () {},
7205
- assert: function () {
7276
+ reset: function reset() {},
7277
+ inject: function inject() {},
7278
+ assert: function assert() {
7206
7279
  if (this.env.Ember && this.env.Ember.View) {
7207
7280
  var viewIds = [],
7208
7281
  id;
@@ -7218,7 +7291,7 @@ enifed("ember-dev/test-helper/remaining-view", ["exports"], function (exports) {
7218
7291
  }
7219
7292
  }
7220
7293
  },
7221
- restore: function () {}
7294
+ restore: function restore() {}
7222
7295
  };
7223
7296
 
7224
7297
  exports.default = RemainingViewAssert;
@@ -7233,9 +7306,9 @@ enifed("ember-dev/test-helper/run-loop", ["exports"], function (exports) {
7233
7306
  }
7234
7307
 
7235
7308
  RunLoopAssertion.prototype = {
7236
- reset: function () {},
7237
- inject: function () {},
7238
- assert: function () {
7309
+ reset: function reset() {},
7310
+ inject: function inject() {},
7311
+ assert: function assert() {
7239
7312
  var run = this.env.Ember.run;
7240
7313
 
7241
7314
  if (run.currentRunLoop) {
@@ -7250,18 +7323,17 @@ enifed("ember-dev/test-helper/run-loop", ["exports"], function (exports) {
7250
7323
  run.cancelTimers();
7251
7324
  }
7252
7325
  },
7253
- restore: function () {}
7326
+ restore: function restore() {}
7254
7327
  };
7255
7328
 
7256
7329
  exports.default = RunLoopAssertion;
7257
7330
  });
7258
7331
  enifed("ember-dev/test-helper/setup-qunit", ["exports"], function (exports) {
7259
- /* globals QUnit */
7260
-
7261
7332
  "use strict";
7262
7333
 
7263
7334
  exports.default = setupQUnit;
7264
7335
 
7336
+ /* globals QUnit */
7265
7337
  function setupQUnit(assertion, _qunitGlobal) {
7266
7338
  var qunitGlobal = QUnit;
7267
7339
 
@@ -7300,6 +7372,7 @@ enifed('ember-dev/test-helper/utils', ['exports'], function (exports) {
7300
7372
  exports.buildCompositeAssert = buildCompositeAssert;
7301
7373
  exports.callWithStub = callWithStub;
7302
7374
  exports.checkTest = checkTest;
7375
+
7303
7376
  function callForEach(prop, func) {
7304
7377
  return function () {
7305
7378
  for (var i = 0, l = this[prop].length; i < l; i++) {
@@ -7346,82 +7419,130 @@ enifed('ember-dev/test-helper/utils', ['exports'], function (exports) {
7346
7419
  enifed('ember-dev/test-helper/warning', ['exports', 'ember-dev/test-helper/debug', 'ember-dev/test-helper/utils'], function (exports, _emberDevTestHelperDebug, _emberDevTestHelperUtils) {
7347
7420
  'use strict';
7348
7421
 
7422
+ var _createClass = (function () {
7423
+ function defineProperties(target, props) {
7424
+ for (var i = 0; i < props.length; i++) {
7425
+ var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ('value' in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
7426
+ }
7427
+ }return function (Constructor, protoProps, staticProps) {
7428
+ if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
7429
+ };
7430
+ })();
7431
+
7432
+ var _get = function get(_x, _x2, _x3) {
7433
+ var _again = true;_function: while (_again) {
7434
+ var object = _x,
7435
+ property = _x2,
7436
+ receiver = _x3;_again = false;if (object === null) object = Function.prototype;var desc = Object.getOwnPropertyDescriptor(object, property);if (desc === undefined) {
7437
+ var parent = Object.getPrototypeOf(object);if (parent === null) {
7438
+ return undefined;
7439
+ } else {
7440
+ _x = parent;_x2 = property;_x3 = receiver;_again = true;desc = parent = undefined;continue _function;
7441
+ }
7442
+ } else if ('value' in desc) {
7443
+ return desc.value;
7444
+ } else {
7445
+ var getter = desc.get;if (getter === undefined) {
7446
+ return undefined;
7447
+ }return getter.call(receiver);
7448
+ }
7449
+ }
7450
+ };
7451
+
7452
+ function _classCallCheck(instance, Constructor) {
7453
+ if (!(instance instanceof Constructor)) {
7454
+ throw new TypeError('Cannot call a class as a function');
7455
+ }
7456
+ }
7457
+
7458
+ function _inherits(subClass, superClass) {
7459
+ if (typeof superClass !== 'function' && superClass !== null) {
7460
+ throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass);
7461
+ }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : babelHelpers.defaults(subClass, superClass);
7462
+ }
7463
+
7349
7464
  var WarningAssert = (function (_DebugAssert) {
7350
- babelHelpers.inherits(WarningAssert, _DebugAssert);
7465
+ _inherits(WarningAssert, _DebugAssert);
7351
7466
 
7352
7467
  function WarningAssert(env) {
7353
- _DebugAssert.call(this, 'warn', env);
7354
- }
7468
+ _classCallCheck(this, WarningAssert);
7355
7469
 
7356
- WarningAssert.prototype.inject = function inject() {
7357
- var _this = this;
7470
+ _get(Object.getPrototypeOf(WarningAssert.prototype), 'constructor', this).call(this, 'warn', env);
7471
+ }
7358
7472
 
7359
- // Expects no warning to happen within a function, or if no function is
7360
- // passed, from the time of calling until the end of the test.
7361
- //
7362
- // expectNoWarning(function() {
7363
- // fancyNewThing();
7364
- // });
7365
- //
7366
- // expectNoWarning();
7367
- // Ember.warn("Oh snap, didn't expect that");
7368
- //
7369
- var expectNoWarning = function (func) {
7370
- if (typeof func !== 'function') {
7371
- func = null;
7372
- }
7473
+ _createClass(WarningAssert, [{
7474
+ key: 'inject',
7475
+ value: function inject() {
7476
+ var _this = this;
7373
7477
 
7374
- _this.runExpectation(func, function (tracker) {
7375
- if (tracker.isExpectingCalls()) {
7376
- throw new Error("expectNoWarning was called after expectWarning was called!");
7478
+ // Expects no warning to happen within a function, or if no function is
7479
+ // passed, from the time of calling until the end of the test.
7480
+ //
7481
+ // expectNoWarning(function() {
7482
+ // fancyNewThing();
7483
+ // });
7484
+ //
7485
+ // expectNoWarning();
7486
+ // Ember.warn("Oh snap, didn't expect that");
7487
+ //
7488
+ var expectNoWarning = function expectNoWarning(func) {
7489
+ if (typeof func !== 'function') {
7490
+ func = null;
7377
7491
  }
7378
7492
 
7379
- tracker.expectNoCalls();
7380
- });
7381
- };
7493
+ _this.runExpectation(func, function (tracker) {
7494
+ if (tracker.isExpectingCalls()) {
7495
+ throw new Error("expectNoWarning was called after expectWarning was called!");
7496
+ }
7382
7497
 
7383
- // Expect a warning to happen within a function, or if no function is
7384
- // passed, from the time of calling until the end of the test. Can be called
7385
- // multiple times to assert warnings with different specific messages
7386
- // happened.
7387
- //
7388
- // expectWarning(function() {
7389
- // Ember.warn("Times they are a-changin'");
7390
- // }, /* optionalStringOrRegex */);
7391
- //
7392
- // expectWarning(/* optionalStringOrRegex */);
7393
- // Ember.warn("Times definitely be changin'");
7394
- //
7395
- var expectWarning = function (fn, message) {
7396
- if (typeof fn !== 'function') {
7397
- message = fn;
7398
- fn = null;
7399
- }
7498
+ tracker.expectNoCalls();
7499
+ });
7500
+ };
7400
7501
 
7401
- _this.runExpectation(fn, function (tracker) {
7402
- if (tracker.isExpectingNoCalls()) {
7403
- throw new Error("expectWarning was called after expectNoWarning was called!");
7502
+ // Expect a warning to happen within a function, or if no function is
7503
+ // passed, from the time of calling until the end of the test. Can be called
7504
+ // multiple times to assert warnings with different specific messages
7505
+ // happened.
7506
+ //
7507
+ // expectWarning(function() {
7508
+ // Ember.warn("Times they are a-changin'");
7509
+ // }, /* optionalStringOrRegex */);
7510
+ //
7511
+ // expectWarning(/* optionalStringOrRegex */);
7512
+ // Ember.warn("Times definitely be changin'");
7513
+ //
7514
+ var expectWarning = function expectWarning(fn, message) {
7515
+ if (typeof fn !== 'function') {
7516
+ message = fn;
7517
+ fn = null;
7404
7518
  }
7405
7519
 
7406
- tracker.expectCall(message);
7407
- });
7408
- };
7520
+ _this.runExpectation(fn, function (tracker) {
7521
+ if (tracker.isExpectingNoCalls()) {
7522
+ throw new Error("expectWarning was called after expectNoWarning was called!");
7523
+ }
7409
7524
 
7410
- var ignoreWarning = function (func) {
7411
- _emberDevTestHelperUtils.callWithStub(_this.env, 'warn', func);
7412
- };
7525
+ tracker.expectCall(message);
7526
+ });
7527
+ };
7413
7528
 
7414
- window.expectNoWarning = expectNoWarning;
7415
- window.expectWarning = expectWarning;
7416
- window.ignoreWarning = ignoreWarning;
7417
- };
7529
+ var ignoreWarning = function ignoreWarning(func) {
7530
+ _emberDevTestHelperUtils.callWithStub(_this.env, 'warn', func);
7531
+ };
7418
7532
 
7419
- WarningAssert.prototype.restore = function restore() {
7420
- _DebugAssert.prototype.restore.call(this);
7421
- window.expectWarning = null;
7422
- window.expectNoWarning = null;
7423
- window.ignoreWarning = null;
7424
- };
7533
+ window.expectNoWarning = expectNoWarning;
7534
+ window.expectWarning = expectWarning;
7535
+ window.ignoreWarning = ignoreWarning;
7536
+ }
7537
+ }, {
7538
+ key: 'restore',
7539
+ value: function restore() {
7540
+ _get(Object.getPrototypeOf(WarningAssert.prototype), 'restore', this).call(this);
7541
+ window.expectWarning = null;
7542
+ window.expectNoWarning = null;
7543
+ window.ignoreWarning = null;
7544
+ }
7545
+ }]);
7425
7546
 
7426
7547
  return WarningAssert;
7427
7548
  })(_emberDevTestHelperDebug.default);