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

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.
@@ -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.14.0-beta.2
9
+ * @version 2.14.0-beta.3
10
10
  */
11
11
 
12
12
  var enifed, requireModule, Ember;
@@ -188,10 +188,13 @@ enifed('ember-babel', ['exports'], function (exports) {
188
188
  enifed('ember-debug/deprecate', ['exports', 'ember-debug/error', 'ember-console', 'ember-environment', 'ember-debug/handlers'], function (exports, _error, _emberConsole, _emberEnvironment, _handlers) {
189
189
  'use strict';
190
190
 
191
- exports.missingOptionsUntilDeprecation = exports.missingOptionsIdDeprecation = exports.missingOptionsDeprecation = undefined;
192
- exports.registerHandler = registerHandler;
193
- exports.default = deprecate;
191
+ exports.missingOptionsUntilDeprecation = exports.missingOptionsIdDeprecation = exports.missingOptionsDeprecation = exports.registerHandler = undefined;
192
+
194
193
 
194
+ /**
195
+ @module ember
196
+ @submodule ember-debug
197
+ */
195
198
 
196
199
  /**
197
200
  Allows for runtime registration of handler functions that override the default deprecation behavior.
@@ -228,144 +231,150 @@ enifed('ember-debug/deprecate', ['exports', 'ember-debug/error', 'ember-console'
228
231
  @param handler {Function} A function to handle deprecation calls.
229
232
  @since 2.1.0
230
233
  */
231
- /*global __fail__*/
234
+ var registerHandler = function () {}; /*global __fail__*/
232
235
 
233
- function registerHandler(handler) {
234
- (0, _handlers.registerHandler)('deprecate', handler);
235
- }
236
+ var missingOptionsDeprecation = void 0,
237
+ missingOptionsIdDeprecation = void 0,
238
+ missingOptionsUntilDeprecation = void 0,
239
+ deprecate = void 0;
236
240
 
237
- function formatMessage(_message, options) {
238
- var message = _message;
241
+ if (true) {
242
+ exports.registerHandler = registerHandler = function registerHandler(handler) {
243
+ (0, _handlers.registerHandler)('deprecate', handler);
244
+ };
239
245
 
240
- if (options && options.id) {
241
- message = message + (' [deprecation id: ' + options.id + ']');
242
- }
246
+ var formatMessage = function formatMessage(_message, options) {
247
+ var message = _message;
243
248
 
244
- if (options && options.url) {
245
- message += ' See ' + options.url + ' for more details.';
246
- }
249
+ if (options && options.id) {
250
+ message = message + (' [deprecation id: ' + options.id + ']');
251
+ }
247
252
 
248
- return message;
249
- }
253
+ if (options && options.url) {
254
+ message += ' See ' + options.url + ' for more details.';
255
+ }
250
256
 
251
- registerHandler(function logDeprecationToConsole(message, options) {
252
- var updatedMessage = formatMessage(message, options);
257
+ return message;
258
+ };
253
259
 
254
- _emberConsole.default.warn('DEPRECATION: ' + updatedMessage);
255
- });
260
+ registerHandler(function logDeprecationToConsole(message, options) {
261
+ var updatedMessage = formatMessage(message, options);
256
262
 
257
- var captureErrorForStack = void 0;
263
+ _emberConsole.default.warn('DEPRECATION: ' + updatedMessage);
264
+ });
258
265
 
259
- if (new Error().stack) {
260
- captureErrorForStack = function () {
261
- return new Error();
262
- };
263
- } else {
264
- captureErrorForStack = function () {
265
- try {
266
- __fail__.fail();
267
- } catch (e) {
268
- return e;
269
- }
270
- };
271
- }
266
+ var captureErrorForStack = void 0;
272
267
 
273
- registerHandler(function logDeprecationStackTrace(message, options, next) {
274
- if (_emberEnvironment.ENV.LOG_STACKTRACE_ON_DEPRECATION) {
275
- var stackStr = '';
276
- var error = captureErrorForStack();
277
- var stack = void 0;
278
-
279
- if (error.stack) {
280
- if (error['arguments']) {
281
- // Chrome
282
- stack = error.stack.replace(/^\s+at\s+/gm, '').replace(/^([^\(]+?)([\n$])/gm, '{anonymous}($1)$2').replace(/^Object.<anonymous>\s*\(([^\)]+)\)/gm, '{anonymous}($1)').split('\n');
283
- stack.shift();
284
- } else {
285
- // Firefox
286
- stack = error.stack.replace(/(?:\n@:0)?\s+$/m, '').replace(/^\(/gm, '{anonymous}(').split('\n');
268
+ if (new Error().stack) {
269
+ captureErrorForStack = function () {
270
+ return new Error();
271
+ };
272
+ } else {
273
+ captureErrorForStack = function () {
274
+ try {
275
+ __fail__.fail();
276
+ } catch (e) {
277
+ return e;
287
278
  }
279
+ };
280
+ }
288
281
 
289
- stackStr = '\n ' + stack.slice(2).join('\n ');
290
- }
282
+ registerHandler(function logDeprecationStackTrace(message, options, next) {
283
+ if (_emberEnvironment.ENV.LOG_STACKTRACE_ON_DEPRECATION) {
284
+ var stackStr = '';
285
+ var error = captureErrorForStack();
286
+ var stack = void 0;
291
287
 
292
- var updatedMessage = formatMessage(message, options);
288
+ if (error.stack) {
289
+ if (error['arguments']) {
290
+ // Chrome
291
+ stack = error.stack.replace(/^\s+at\s+/gm, '').replace(/^([^\(]+?)([\n$])/gm, '{anonymous}($1)$2').replace(/^Object.<anonymous>\s*\(([^\)]+)\)/gm, '{anonymous}($1)').split('\n');
292
+ stack.shift();
293
+ } else {
294
+ // Firefox
295
+ stack = error.stack.replace(/(?:\n@:0)?\s+$/m, '').replace(/^\(/gm, '{anonymous}(').split('\n');
296
+ }
293
297
 
294
- _emberConsole.default.warn('DEPRECATION: ' + updatedMessage + stackStr);
295
- } else {
296
- next.apply(undefined, arguments);
297
- }
298
- });
298
+ stackStr = '\n ' + stack.slice(2).join('\n ');
299
+ }
299
300
 
300
- registerHandler(function raiseOnDeprecation(message, options, next) {
301
- if (_emberEnvironment.ENV.RAISE_ON_DEPRECATION) {
302
- var updatedMessage = formatMessage(message);
301
+ var updatedMessage = formatMessage(message, options);
303
302
 
304
- throw new _error.default(updatedMessage);
305
- } else {
306
- next.apply(undefined, arguments);
307
- }
308
- });
303
+ _emberConsole.default.warn('DEPRECATION: ' + updatedMessage + stackStr);
304
+ } else {
305
+ next.apply(undefined, arguments);
306
+ }
307
+ });
309
308
 
310
- var missingOptionsDeprecation = exports.missingOptionsDeprecation = 'When calling `Ember.deprecate` you ' + 'must provide an `options` hash as the third parameter. ' + '`options` should include `id` and `until` properties.';
311
- var missingOptionsIdDeprecation = exports.missingOptionsIdDeprecation = 'When calling `Ember.deprecate` you must provide `id` in options.';
312
- var missingOptionsUntilDeprecation = exports.missingOptionsUntilDeprecation = 'When calling `Ember.deprecate` you must provide `until` in options.';
309
+ registerHandler(function raiseOnDeprecation(message, options, next) {
310
+ if (_emberEnvironment.ENV.RAISE_ON_DEPRECATION) {
311
+ var updatedMessage = formatMessage(message);
313
312
 
314
- /**
315
- @module ember
316
- @submodule ember-debug
317
- */
313
+ throw new _error.default(updatedMessage);
314
+ } else {
315
+ next.apply(undefined, arguments);
316
+ }
317
+ });
318
318
 
319
- /**
320
- Display a deprecation warning with the provided message and a stack trace
321
- (Chrome and Firefox only).
322
-
323
- * In a production build, this method is defined as an empty function (NOP).
324
- Uses of this method in Ember itself are stripped from the ember.prod.js build.
325
-
326
- @method deprecate
327
- @param {String} message A description of the deprecation.
328
- @param {Boolean} test A boolean. If falsy, the deprecation will be displayed.
329
- @param {Object} options
330
- @param {String} options.id A unique id for this deprecation. The id can be
331
- used by Ember debugging tools to change the behavior (raise, log or silence)
332
- for that specific deprecation. The id should be namespaced by dots, e.g.
333
- "view.helper.select".
334
- @param {string} options.until The version of Ember when this deprecation
335
- warning will be removed.
336
- @param {String} [options.url] An optional url to the transition guide on the
337
- emberjs.com website.
338
- @for Ember
339
- @public
340
- @since 1.0.0
341
- */
342
- function deprecate(message, test, options) {
343
- if (!options || !options.id && !options.until) {
344
- deprecate(missingOptionsDeprecation, false, {
345
- id: 'ember-debug.deprecate-options-missing',
346
- until: '3.0.0',
347
- url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options'
348
- });
349
- }
319
+ exports.missingOptionsDeprecation = missingOptionsDeprecation = 'When calling `Ember.deprecate` you ' + 'must provide an `options` hash as the third parameter. ' + '`options` should include `id` and `until` properties.';
320
+ exports.missingOptionsIdDeprecation = missingOptionsIdDeprecation = 'When calling `Ember.deprecate` you must provide `id` in options.';
321
+ exports.missingOptionsUntilDeprecation = missingOptionsUntilDeprecation = 'When calling `Ember.deprecate` you must provide `until` in options.';
350
322
 
351
- if (options && !options.id) {
352
- deprecate(missingOptionsIdDeprecation, false, {
353
- id: 'ember-debug.deprecate-id-missing',
354
- until: '3.0.0',
355
- url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options'
356
- });
357
- }
323
+ /**
324
+ Display a deprecation warning with the provided message and a stack trace
325
+ (Chrome and Firefox only).
326
+ * In a production build, this method is defined as an empty function (NOP).
327
+ Uses of this method in Ember itself are stripped from the ember.prod.js build.
328
+ @method deprecate
329
+ @param {String} message A description of the deprecation.
330
+ @param {Boolean} test A boolean. If falsy, the deprecation will be displayed.
331
+ @param {Object} options
332
+ @param {String} options.id A unique id for this deprecation. The id can be
333
+ used by Ember debugging tools to change the behavior (raise, log or silence)
334
+ for that specific deprecation. The id should be namespaced by dots, e.g.
335
+ "view.helper.select".
336
+ @param {string} options.until The version of Ember when this deprecation
337
+ warning will be removed.
338
+ @param {String} [options.url] An optional url to the transition guide on the
339
+ emberjs.com website.
340
+ @for Ember
341
+ @public
342
+ @since 1.0.0
343
+ */
344
+ deprecate = function deprecate(message, test, options) {
345
+ if (!options || !options.id && !options.until) {
346
+ deprecate(missingOptionsDeprecation, false, {
347
+ id: 'ember-debug.deprecate-options-missing',
348
+ until: '3.0.0',
349
+ url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options'
350
+ });
351
+ }
358
352
 
359
- if (options && !options.until) {
360
- deprecate(missingOptionsUntilDeprecation, options && options.until, {
361
- id: 'ember-debug.deprecate-until-missing',
362
- until: '3.0.0',
363
- url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options'
364
- });
365
- }
353
+ if (options && !options.id) {
354
+ deprecate(missingOptionsIdDeprecation, false, {
355
+ id: 'ember-debug.deprecate-id-missing',
356
+ until: '3.0.0',
357
+ url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options'
358
+ });
359
+ }
366
360
 
367
- _handlers.invoke.apply(undefined, ['deprecate'].concat(Array.prototype.slice.call(arguments)));
361
+ if (options && !options.until) {
362
+ deprecate(missingOptionsUntilDeprecation, options && options.until, {
363
+ id: 'ember-debug.deprecate-until-missing',
364
+ until: '3.0.0',
365
+ url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options'
366
+ });
367
+ }
368
+
369
+ _handlers.invoke.apply(undefined, ['deprecate'].concat(Array.prototype.slice.call(arguments)));
370
+ };
368
371
  }
372
+
373
+ exports.default = deprecate;
374
+ exports.registerHandler = registerHandler;
375
+ exports.missingOptionsDeprecation = missingOptionsDeprecation;
376
+ exports.missingOptionsIdDeprecation = missingOptionsIdDeprecation;
377
+ exports.missingOptionsUntilDeprecation = missingOptionsUntilDeprecation;
369
378
  });
370
379
  enifed("ember-debug/error", ["exports", "ember-babel"], function (exports, _emberBabel) {
371
380
  "use strict";
@@ -478,37 +487,43 @@ enifed('ember-debug/features', ['exports', 'ember-environment', 'ember/features'
478
487
  }
479
488
  }
480
489
  });
481
- enifed("ember-debug/handlers", ["exports"], function (exports) {
482
- "use strict";
490
+ enifed('ember-debug/handlers', ['exports'], function (exports) {
491
+ 'use strict';
483
492
 
484
- exports.registerHandler = registerHandler;
485
- exports.invoke = invoke;
486
493
  var HANDLERS = exports.HANDLERS = {};
487
494
 
488
- function registerHandler(type, callback) {
489
- var nextHandler = HANDLERS[type] || function () {};
495
+ var registerHandler = function () {};
496
+ var invoke = function () {};
497
+
498
+ if (true) {
499
+ exports.registerHandler = registerHandler = function registerHandler(type, callback) {
500
+ var nextHandler = HANDLERS[type] || function () {};
490
501
 
491
- HANDLERS[type] = function (message, options) {
492
- callback(message, options, nextHandler);
502
+ HANDLERS[type] = function (message, options) {
503
+ callback(message, options, nextHandler);
504
+ };
493
505
  };
494
- }
495
506
 
496
- function invoke(type, message, test, options) {
497
- if (test) {
498
- return;
499
- }
507
+ exports.invoke = invoke = function invoke(type, message, test, options) {
508
+ if (test) {
509
+ return;
510
+ }
500
511
 
501
- var handlerForType = HANDLERS[type];
512
+ var handlerForType = HANDLERS[type];
502
513
 
503
- if (handlerForType) {
504
- handlerForType(message, options);
505
- }
514
+ if (handlerForType) {
515
+ handlerForType(message, options);
516
+ }
517
+ };
506
518
  }
519
+
520
+ exports.registerHandler = registerHandler;
521
+ exports.invoke = invoke;
507
522
  });
508
523
  enifed('ember-debug/index', ['exports', 'ember-debug/warn', 'ember-debug/deprecate', 'ember-debug/features', 'ember-debug/error', 'ember-debug/testing', 'ember-environment', 'ember-console', 'ember/features'], function (exports, _warn2, _deprecate2, _features, _error, _testing, _emberEnvironment, _emberConsole, _features2) {
509
524
  'use strict';
510
525
 
511
- exports.runningNonEmberDebugJS = exports.debugFunctions = exports.setTesting = exports.isTesting = exports.Error = exports.isFeatureEnabled = exports.registerDeprecationHandler = exports.registerWarnHandler = undefined;
526
+ exports._warnIfUsingStrippedFeatureFlags = exports.getDebugFunction = exports.setDebugFunction = exports.deprecateFunc = exports.runInDebug = exports.debugFreeze = exports.debugSeal = exports.deprecate = exports.debug = exports.warn = exports.info = exports.assert = exports.setTesting = exports.isTesting = exports.Error = exports.isFeatureEnabled = exports.registerDeprecationHandler = exports.registerWarnHandler = undefined;
512
527
  Object.defineProperty(exports, 'registerWarnHandler', {
513
528
  enumerable: true,
514
529
  get: function () {
@@ -545,35 +560,75 @@ enifed('ember-debug/index', ['exports', 'ember-debug/warn', 'ember-debug/depreca
545
560
  return _testing.setTesting;
546
561
  }
547
562
  });
548
- exports._warnIfUsingStrippedFeatureFlags = _warnIfUsingStrippedFeatureFlags;
549
- exports.getDebugFunction = getDebugFunction;
550
- exports.setDebugFunction = setDebugFunction;
551
- exports.assert = assert;
552
- exports.info = info;
553
- exports.warn = warn;
554
- exports.debug = debug;
555
- exports.deprecate = deprecate;
556
- exports.deprecateFunc = deprecateFunc;
557
- exports.runInDebug = runInDebug;
558
- exports.debugSeal = debugSeal;
559
- exports.debugFreeze = debugFreeze;
560
563
  var DEFAULT_FEATURES = _features2.DEFAULT_FEATURES,
561
564
  FEATURES = _features2.FEATURES;
562
- var debugFunctions = exports.debugFunctions = {
563
- assert: function () {},
564
- info: function () {},
565
- warn: function () {},
566
- debug: function () {},
567
- deprecate: function () {},
568
- deprecateFunc: function () {
569
- var _ref;
570
-
571
- return _ref = arguments.length - 1, arguments.length <= _ref ? undefined : arguments[_ref];
572
- },
573
- debugSeal: function () {},
574
- debugFreeze: function () {}
565
+
566
+
567
+ // These are the default production build versions:
568
+ var assert = function () {};
569
+ var info = function () {};
570
+ var warn = function () {};
571
+ var debug = function () {};
572
+ var deprecate = function () {};
573
+ var debugSeal = function () {};
574
+ var debugFreeze = function () {};
575
+ var runInDebug = function () {};
576
+
577
+ var deprecateFunc = function () {
578
+ return arguments[arguments.length - 1];
575
579
  };
576
580
 
581
+ var setDebugFunction = function () {};
582
+ var getDebugFunction = function () {};
583
+
584
+ if (true) {
585
+ exports.setDebugFunction = setDebugFunction = function (type, callback) {
586
+ switch (type) {
587
+ case 'assert':
588
+ return exports.assert = assert = callback;
589
+ case 'info':
590
+ return exports.info = info = callback;
591
+ case 'warn':
592
+ return exports.warn = warn = callback;
593
+ case 'debug':
594
+ return exports.debug = debug = callback;
595
+ case 'deprecate':
596
+ return exports.deprecate = deprecate = callback;
597
+ case 'debugSeal':
598
+ return exports.debugSeal = debugSeal = callback;
599
+ case 'debugFreeze':
600
+ return exports.debugFreeze = debugFreeze = callback;
601
+ case 'runInDebug':
602
+ return exports.runInDebug = runInDebug = callback;
603
+ case 'deprecateFunc':
604
+ return exports.deprecateFunc = deprecateFunc = callback;
605
+ }
606
+ };
607
+
608
+ exports.getDebugFunction = getDebugFunction = function (type) {
609
+ switch (type) {
610
+ case 'assert':
611
+ return assert;
612
+ case 'info':
613
+ return info;
614
+ case 'warn':
615
+ return warn;
616
+ case 'debug':
617
+ return debug;
618
+ case 'deprecate':
619
+ return deprecate;
620
+ case 'debugSeal':
621
+ return debugSeal;
622
+ case 'debugFreeze':
623
+ return debugFreeze;
624
+ case 'runInDebug':
625
+ return runInDebug;
626
+ case 'deprecateFunc':
627
+ return deprecateFunc;
628
+ }
629
+ };
630
+ }
631
+
577
632
  /**
578
633
  @module ember
579
634
  @submodule ember-debug
@@ -584,173 +639,159 @@ enifed('ember-debug/index', ['exports', 'ember-debug/warn', 'ember-debug/depreca
584
639
  @public
585
640
  */
586
641
 
587
- /**
588
- Define an assertion that will throw an exception if the condition is not met.
589
-
590
- * In a production build, this method is defined as an empty function (NOP).
591
- Uses of this method in Ember itself are stripped from the ember.prod.js build.
592
-
593
- ```javascript
594
- // Test for truthiness
595
- Ember.assert('Must pass a valid object', obj);
596
-
597
- // Fail unconditionally
598
- Ember.assert('This code path should never be run');
599
- ```
600
-
601
- @method assert
602
- @param {String} desc A description of the assertion. This will become
603
- the text of the Error thrown if the assertion fails.
604
- @param {Boolean} test Must be truthy for the assertion to pass. If
605
- falsy, an exception will be thrown.
606
- @public
607
- @since 1.0.0
608
- */
609
- setDebugFunction('assert', function assert(desc, test) {
610
- if (!test) {
611
- throw new _error.default('Assertion Failed: ' + desc);
612
- }
613
- });
642
+ if (true) {
643
+ /**
644
+ Define an assertion that will throw an exception if the condition is not met.
645
+ * In a production build, this method is defined as an empty function (NOP).
646
+ Uses of this method in Ember itself are stripped from the ember.prod.js build.
647
+ ```javascript
648
+ // Test for truthiness
649
+ Ember.assert('Must pass a valid object', obj);
650
+ // Fail unconditionally
651
+ Ember.assert('This code path should never be run');
652
+ ```
653
+ @method assert
654
+ @param {String} desc A description of the assertion. This will become
655
+ the text of the Error thrown if the assertion fails.
656
+ @param {Boolean} test Must be truthy for the assertion to pass. If
657
+ falsy, an exception will be thrown.
658
+ @public
659
+ @since 1.0.0
660
+ */
661
+ setDebugFunction('assert', function assert(desc, test) {
662
+ if (!test) {
663
+ throw new _error.default('Assertion Failed: ' + desc);
664
+ }
665
+ });
614
666
 
615
- /**
616
- Display a debug notice.
617
-
618
- * In a production build, this method is defined as an empty function (NOP).
619
- Uses of this method in Ember itself are stripped from the ember.prod.js build.
620
-
621
- ```javascript
622
- Ember.debug('I\'m a debug notice!');
623
- ```
624
-
625
- @method debug
626
- @param {String} message A debug message to display.
627
- @public
628
- */
629
- setDebugFunction('debug', function debug(message) {
630
- _emberConsole.default.debug('DEBUG: ' + message);
631
- });
667
+ /**
668
+ Display a debug notice.
669
+ * In a production build, this method is defined as an empty function (NOP).
670
+ Uses of this method in Ember itself are stripped from the ember.prod.js build.
671
+ ```javascript
672
+ Ember.debug('I\'m a debug notice!');
673
+ ```
674
+ @method debug
675
+ @param {String} message A debug message to display.
676
+ @public
677
+ */
678
+ setDebugFunction('debug', function debug(message) {
679
+ _emberConsole.default.debug('DEBUG: ' + message);
680
+ });
632
681
 
633
- /**
634
- Display an info notice.
635
-
636
- * In a production build, this method is defined as an empty function (NOP).
637
- Uses of this method in Ember itself are stripped from the ember.prod.js build.
638
-
639
- @method info
640
- @private
641
- */
642
- setDebugFunction('info', function info() {
643
- _emberConsole.default.info.apply(undefined, arguments);
644
- });
682
+ /**
683
+ Display an info notice.
684
+ * In a production build, this method is defined as an empty function (NOP).
685
+ Uses of this method in Ember itself are stripped from the ember.prod.js build.
686
+ @method info
687
+ @private
688
+ */
689
+ setDebugFunction('info', function info() {
690
+ _emberConsole.default.info.apply(undefined, arguments);
691
+ });
645
692
 
646
- /**
647
- Alias an old, deprecated method with its new counterpart.
648
-
649
- Display a deprecation warning with the provided message and a stack trace
650
- (Chrome and Firefox only) when the assigned method is called.
651
-
652
- * In a production build, this method is defined as an empty function (NOP).
653
-
654
- ```javascript
655
- Ember.oldMethod = Ember.deprecateFunc('Please use the new, updated method', Ember.newMethod);
656
- ```
657
-
658
- @method deprecateFunc
659
- @param {String} message A description of the deprecation.
660
- @param {Object} [options] The options object for Ember.deprecate.
661
- @param {Function} func The new function called to replace its deprecated counterpart.
662
- @return {Function} A new function that wraps the original function with a deprecation warning
663
- @private
664
- */
665
- setDebugFunction('deprecateFunc', function deprecateFunc() {
666
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
667
- args[_key] = arguments[_key];
668
- }
693
+ /**
694
+ Alias an old, deprecated method with its new counterpart.
695
+ Display a deprecation warning with the provided message and a stack trace
696
+ (Chrome and Firefox only) when the assigned method is called.
697
+ * In a production build, this method is defined as an empty function (NOP).
698
+ ```javascript
699
+ Ember.oldMethod = Ember.deprecateFunc('Please use the new, updated method', Ember.newMethod);
700
+ ```
701
+ @method deprecateFunc
702
+ @param {String} message A description of the deprecation.
703
+ @param {Object} [options] The options object for Ember.deprecate.
704
+ @param {Function} func The new function called to replace its deprecated counterpart.
705
+ @return {Function} A new function that wraps the original function with a deprecation warning
706
+ @private
707
+ */
708
+ setDebugFunction('deprecateFunc', function deprecateFunc() {
709
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
710
+ args[_key] = arguments[_key];
711
+ }
669
712
 
670
- if (args.length === 3) {
671
- var message = args[0],
672
- options = args[1],
673
- func = args[2];
713
+ if (args.length === 3) {
714
+ var message = args[0],
715
+ options = args[1],
716
+ func = args[2];
674
717
 
675
- return function () {
676
- deprecate(message, false, options);
677
- return func.apply(this, arguments);
678
- };
679
- } else {
680
- var _message = args[0],
681
- _func = args[1];
718
+ return function () {
719
+ deprecate(message, false, options);
720
+ return func.apply(this, arguments);
721
+ };
722
+ } else {
723
+ var _message = args[0],
724
+ _func = args[1];
682
725
 
683
- return function () {
684
- deprecate(_message);
685
- return _func.apply(this, arguments);
686
- };
687
- }
688
- });
726
+ return function () {
727
+ deprecate(_message);
728
+ return _func.apply(this, arguments);
729
+ };
730
+ }
731
+ });
689
732
 
690
- /**
691
- Run a function meant for debugging.
692
-
693
- * In a production build, this method is defined as an empty function (NOP).
694
- Uses of this method in Ember itself are stripped from the ember.prod.js build.
695
-
696
- ```javascript
697
- Ember.runInDebug(() => {
698
- Ember.Component.reopen({
699
- didInsertElement() {
700
- console.log("I'm happy");
701
- }
733
+ /**
734
+ Run a function meant for debugging.
735
+ * In a production build, this method is defined as an empty function (NOP).
736
+ Uses of this method in Ember itself are stripped from the ember.prod.js build.
737
+ ```javascript
738
+ Ember.runInDebug(() => {
739
+ Ember.Component.reopen({
740
+ didInsertElement() {
741
+ console.log("I'm happy");
742
+ }
743
+ });
702
744
  });
745
+ ```
746
+ @method runInDebug
747
+ @param {Function} func The function to be executed.
748
+ @since 1.5.0
749
+ @public
750
+ */
751
+ setDebugFunction('runInDebug', function runInDebug(func) {
752
+ func();
703
753
  });
704
- ```
705
-
706
- @method runInDebug
707
- @param {Function} func The function to be executed.
708
- @since 1.5.0
709
- @public
710
- */
711
- setDebugFunction('runInDebug', function runInDebug(func) {
712
- func();
713
- });
714
754
 
715
- setDebugFunction('debugSeal', function debugSeal(obj) {
716
- Object.seal(obj);
717
- });
755
+ setDebugFunction('debugSeal', function debugSeal(obj) {
756
+ Object.seal(obj);
757
+ });
718
758
 
719
- setDebugFunction('debugFreeze', function debugFreeze(obj) {
720
- Object.freeze(obj);
721
- });
759
+ setDebugFunction('debugFreeze', function debugFreeze(obj) {
760
+ Object.freeze(obj);
761
+ });
762
+
763
+ setDebugFunction('deprecate', _deprecate2.default);
722
764
 
723
- setDebugFunction('deprecate', _deprecate2.default);
765
+ setDebugFunction('warn', _warn2.default);
766
+ }
724
767
 
725
- setDebugFunction('warn', _warn2.default);
768
+ var _warnIfUsingStrippedFeatureFlags = void 0;
726
769
 
727
- /**
728
- Will call `Ember.warn()` if ENABLE_OPTIONAL_FEATURES or
729
- any specific FEATURES flag is truthy.
730
-
731
- This method is called automatically in debug canary builds.
732
-
733
- @private
734
- @method _warnIfUsingStrippedFeatureFlags
735
- @return {void}
736
- */
737
- function _warnIfUsingStrippedFeatureFlags(FEATURES, knownFeatures, featuresWereStripped) {
738
- if (featuresWereStripped) {
739
- warn('Ember.ENV.ENABLE_OPTIONAL_FEATURES is only available in canary builds.', !_emberEnvironment.ENV.ENABLE_OPTIONAL_FEATURES, { id: 'ember-debug.feature-flag-with-features-stripped' });
740
-
741
- var keys = Object.keys(FEATURES || {});
742
- for (var i = 0; i < keys.length; i++) {
743
- var key = keys[i];
744
- if (key === 'isEnabled' || !(key in knownFeatures)) {
745
- continue;
746
- }
770
+ if (true && !(0, _testing.isTesting)()) {
771
+ /**
772
+ Will call `Ember.warn()` if ENABLE_OPTIONAL_FEATURES or
773
+ any specific FEATURES flag is truthy.
774
+ This method is called automatically in debug canary builds.
775
+ @private
776
+ @method _warnIfUsingStrippedFeatureFlags
777
+ @return {void}
778
+ */
779
+ exports._warnIfUsingStrippedFeatureFlags = _warnIfUsingStrippedFeatureFlags = function _warnIfUsingStrippedFeatureFlags(FEATURES, knownFeatures, featuresWereStripped) {
780
+ if (featuresWereStripped) {
781
+ warn('Ember.ENV.ENABLE_OPTIONAL_FEATURES is only available in canary builds.', !_emberEnvironment.ENV.ENABLE_OPTIONAL_FEATURES, { id: 'ember-debug.feature-flag-with-features-stripped' });
782
+
783
+ var keys = Object.keys(FEATURES || {});
784
+ for (var i = 0; i < keys.length; i++) {
785
+ var key = keys[i];
786
+ if (key === 'isEnabled' || !(key in knownFeatures)) {
787
+ continue;
788
+ }
747
789
 
748
- warn('FEATURE["' + key + '"] is set as enabled, but FEATURE flags are only available in canary builds.', !FEATURES[key], { id: 'ember-debug.feature-flag-with-features-stripped' });
790
+ warn('FEATURE["' + key + '"] is set as enabled, but FEATURE flags are only available in canary builds.', !FEATURES[key], { id: 'ember-debug.feature-flag-with-features-stripped' });
791
+ }
749
792
  }
750
- }
751
- }
793
+ };
752
794
 
753
- if (!(0, _testing.isTesting)()) {
754
795
  // Complain if they're using FEATURE flags in builds other than canary
755
796
  FEATURES['features-stripped-test'] = true;
756
797
  var featuresWereStripped = true;
@@ -783,65 +824,18 @@ enifed('ember-debug/index', ['exports', 'ember-debug/warn', 'ember-debug/depreca
783
824
  }
784
825
  }
785
826
 
786
- /*
787
- We are transitioning away from `ember.js` to `ember.debug.js` to make
788
- it much clearer that it is only for local development purposes.
789
-
790
- This flag value is changed by the tooling (by a simple string replacement)
791
- so that if `ember.js` (which must be output for backwards compat reasons) is
792
- used a nice helpful warning message will be printed out.
793
- */
794
- var runningNonEmberDebugJS = exports.runningNonEmberDebugJS = false;
795
- if (runningNonEmberDebugJS) {
796
- warn('Please use `ember.debug.js` instead of `ember.js` for development and debugging.');
797
- }
798
-
799
- function getDebugFunction(name) {
800
- return debugFunctions[name];
801
- }
802
-
803
- function setDebugFunction(name, fn) {
804
- debugFunctions[name] = fn;
805
- }
806
-
807
- function assert() {
808
- return debugFunctions.assert.apply(undefined, arguments);
809
- }
810
-
811
- function info() {
812
- return debugFunctions.info.apply(undefined, arguments);
813
- }
814
-
815
- function warn() {
816
- return debugFunctions.warn.apply(undefined, arguments);
817
- }
818
-
819
- function debug() {
820
- return debugFunctions.debug.apply(undefined, arguments);
821
- }
822
-
823
- function deprecate() {
824
- return debugFunctions.deprecate.apply(undefined, arguments);
825
- }
826
-
827
- function deprecateFunc() {
828
- return debugFunctions.deprecateFunc.apply(undefined, arguments);
829
- }
830
-
831
- function runInDebug() {
832
- return debugFunctions.runInDebug.apply(undefined, arguments);
833
- }
834
-
835
- function debugSeal() {
836
- return debugFunctions.debugSeal.apply(undefined, arguments);
837
- }
838
-
839
- function debugFreeze() {
840
- return debugFunctions.debugFreeze.apply(undefined, arguments);
841
- }
842
- });
843
- enifed("ember-debug/run-in-debug", [], function () {
844
- "use strict";
827
+ exports.assert = assert;
828
+ exports.info = info;
829
+ exports.warn = warn;
830
+ exports.debug = debug;
831
+ exports.deprecate = deprecate;
832
+ exports.debugSeal = debugSeal;
833
+ exports.debugFreeze = debugFreeze;
834
+ exports.runInDebug = runInDebug;
835
+ exports.deprecateFunc = deprecateFunc;
836
+ exports.setDebugFunction = setDebugFunction;
837
+ exports.getDebugFunction = getDebugFunction;
838
+ exports._warnIfUsingStrippedFeatureFlags = _warnIfUsingStrippedFeatureFlags;
845
839
  });
846
840
  enifed("ember-debug/testing", ["exports"], function (exports) {
847
841
  "use strict";
@@ -861,99 +855,103 @@ enifed("ember-debug/testing", ["exports"], function (exports) {
861
855
  enifed('ember-debug/warn', ['exports', 'ember-console', 'ember-debug/deprecate', 'ember-debug/handlers'], function (exports, _emberConsole, _deprecate, _handlers) {
862
856
  'use strict';
863
857
 
864
- exports.missingOptionsIdDeprecation = exports.missingOptionsDeprecation = undefined;
865
- exports.registerHandler = registerHandler;
866
- exports.default = warn;
858
+ exports.missingOptionsDeprecation = exports.missingOptionsIdDeprecation = exports.registerHandler = undefined;
867
859
 
868
860
 
869
- /**
870
- Allows for runtime registration of handler functions that override the default warning behavior.
871
- Warnings are invoked by calls made to [Ember.warn](http://emberjs.com/api/classes/Ember.html#method_warn).
872
- The following example demonstrates its usage by registering a handler that does nothing overriding Ember's
873
- default warning behavior.
874
-
875
- ```javascript
876
- // next is not called, so no warnings get the default behavior
877
- Ember.Debug.registerWarnHandler(() => {});
878
- ```
879
-
880
- The handler function takes the following arguments:
881
-
882
- <ul>
883
- <li> <code>message</code> - The message received from the warn call. </li>
884
- <li> <code>options</code> - An object passed in with the warn call containing additional information including:</li>
885
- <ul>
886
- <li> <code>id</code> - An id of the warning in the form of <code>package-name.specific-warning</code>.</li>
887
- </ul>
888
- <li> <code>next</code> - A function that calls into the previously registered handler.</li>
889
- </ul>
890
-
891
- @public
892
- @static
893
- @method registerWarnHandler
894
- @param handler {Function} A function to handle warnings.
895
- @since 2.1.0
896
- */
897
- function registerHandler(handler) {
898
- (0, _handlers.registerHandler)('warn', handler);
899
- }
900
-
901
- registerHandler(function logWarning(message, options) {
902
- _emberConsole.default.warn('WARNING: ' + message);
903
- if ('trace' in _emberConsole.default) {
904
- _emberConsole.default.trace();
905
- }
906
- });
907
-
908
- var missingOptionsDeprecation = exports.missingOptionsDeprecation = 'When calling `Ember.warn` you ' + 'must provide an `options` hash as the third parameter. ' + '`options` should include an `id` property.';
909
- var missingOptionsIdDeprecation = exports.missingOptionsIdDeprecation = 'When calling `Ember.warn` you must provide `id` in options.';
861
+ var registerHandler = function () {};
862
+ var warn = function () {};
863
+ var missingOptionsDeprecation = void 0,
864
+ missingOptionsIdDeprecation = void 0;
910
865
 
911
866
  /**
912
867
  @module ember
913
868
  @submodule ember-debug
914
869
  */
915
870
 
916
- /**
917
- Display a warning with the provided message.
918
-
919
- * In a production build, this method is defined as an empty function (NOP).
920
- Uses of this method in Ember itself are stripped from the ember.prod.js build.
921
-
922
- @method warn
923
- @param {String} message A warning to display.
924
- @param {Boolean} test An optional boolean. If falsy, the warning
925
- will be displayed.
926
- @param {Object} options An object that can be used to pass a unique
927
- `id` for this warning. The `id` can be used by Ember debugging tools
928
- to change the behavior (raise, log, or silence) for that specific warning.
929
- The `id` should be namespaced by dots, e.g. "ember-debug.feature-flag-with-features-stripped"
930
- @for Ember
931
- @public
932
- @since 1.0.0
933
- */
934
- function warn(message, test, options) {
935
- if (arguments.length === 2 && typeof test === 'object') {
936
- options = test;
937
- test = false;
938
- }
939
- if (!options) {
940
- (0, _deprecate.default)(missingOptionsDeprecation, false, {
941
- id: 'ember-debug.warn-options-missing',
942
- until: '3.0.0',
943
- url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options'
944
- });
945
- }
871
+ if (true) {
872
+ /**
873
+ Allows for runtime registration of handler functions that override the default warning behavior.
874
+ Warnings are invoked by calls made to [Ember.warn](http://emberjs.com/api/classes/Ember.html#method_warn).
875
+ The following example demonstrates its usage by registering a handler that does nothing overriding Ember's
876
+ default warning behavior.
877
+ ```javascript
878
+ // next is not called, so no warnings get the default behavior
879
+ Ember.Debug.registerWarnHandler(() => {});
880
+ ```
881
+ The handler function takes the following arguments:
882
+ <ul>
883
+ <li> <code>message</code> - The message received from the warn call. </li>
884
+ <li> <code>options</code> - An object passed in with the warn call containing additional information including:</li>
885
+ <ul>
886
+ <li> <code>id</code> - An id of the warning in the form of <code>package-name.specific-warning</code>.</li>
887
+ </ul>
888
+ <li> <code>next</code> - A function that calls into the previously registered handler.</li>
889
+ </ul>
890
+ @public
891
+ @static
892
+ @method registerWarnHandler
893
+ @param handler {Function} A function to handle warnings.
894
+ @since 2.1.0
895
+ */
896
+ exports.registerHandler = registerHandler = function registerHandler(handler) {
897
+ (0, _handlers.registerHandler)('warn', handler);
898
+ };
946
899
 
947
- if (options && !options.id) {
948
- (0, _deprecate.default)(missingOptionsIdDeprecation, false, {
949
- id: 'ember-debug.warn-id-missing',
950
- until: '3.0.0',
951
- url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options'
952
- });
953
- }
900
+ registerHandler(function logWarning(message, options) {
901
+ _emberConsole.default.warn('WARNING: ' + message);
902
+ if ('trace' in _emberConsole.default) {
903
+ _emberConsole.default.trace();
904
+ }
905
+ });
906
+
907
+ exports.missingOptionsDeprecation = missingOptionsDeprecation = 'When calling `Ember.warn` you ' + 'must provide an `options` hash as the third parameter. ' + '`options` should include an `id` property.';
908
+ exports.missingOptionsIdDeprecation = missingOptionsIdDeprecation = 'When calling `Ember.warn` you must provide `id` in options.';
954
909
 
955
- (0, _handlers.invoke)('warn', message, test, options);
910
+ /**
911
+ Display a warning with the provided message.
912
+ * In a production build, this method is defined as an empty function (NOP).
913
+ Uses of this method in Ember itself are stripped from the ember.prod.js build.
914
+ @method warn
915
+ @param {String} message A warning to display.
916
+ @param {Boolean} test An optional boolean. If falsy, the warning
917
+ will be displayed.
918
+ @param {Object} options An object that can be used to pass a unique
919
+ `id` for this warning. The `id` can be used by Ember debugging tools
920
+ to change the behavior (raise, log, or silence) for that specific warning.
921
+ The `id` should be namespaced by dots, e.g. "ember-debug.feature-flag-with-features-stripped"
922
+ @for Ember
923
+ @public
924
+ @since 1.0.0
925
+ */
926
+ warn = function warn(message, test, options) {
927
+ if (arguments.length === 2 && typeof test === 'object') {
928
+ options = test;
929
+ test = false;
930
+ }
931
+ if (!options) {
932
+ (0, _deprecate.default)(missingOptionsDeprecation, false, {
933
+ id: 'ember-debug.warn-options-missing',
934
+ until: '3.0.0',
935
+ url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options'
936
+ });
937
+ }
938
+
939
+ if (options && !options.id) {
940
+ (0, _deprecate.default)(missingOptionsIdDeprecation, false, {
941
+ id: 'ember-debug.warn-id-missing',
942
+ until: '3.0.0',
943
+ url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options'
944
+ });
945
+ }
946
+
947
+ (0, _handlers.invoke)('warn', message, test, options);
948
+ };
956
949
  }
950
+
951
+ exports.default = warn;
952
+ exports.registerHandler = registerHandler;
953
+ exports.missingOptionsIdDeprecation = missingOptionsIdDeprecation;
954
+ exports.missingOptionsDeprecation = missingOptionsDeprecation;
957
955
  });
958
956
  enifed('ember-testing/adapters/adapter', ['exports', 'ember-runtime'], function (exports, _emberRuntime) {
959
957
  'use strict';
@@ -1645,7 +1643,7 @@ enifed('ember-testing/helpers/pause_test', ['exports', 'ember-runtime', 'ember-c
1645
1643
  @submodule ember-testing
1646
1644
  */
1647
1645
  function resumeTest() {
1648
- (true && (0, _emberDebug.assert)('Testing has not been paused. There is nothing to resume.', resume));
1646
+ (true && !(resume) && (0, _emberDebug.assert)('Testing has not been paused. There is nothing to resume.', resume));
1649
1647
 
1650
1648
  resume();
1651
1649
  resume = undefined;