dist/ember-testing.js in ember-source-2.5.0.beta.4 vs dist/ember-testing.js in ember-source-2.5.0
- old
+ new
@@ -4,11 +4,11 @@
* @copyright Copyright 2011-2016 Tilde Inc. and contributors
* Portions Copyright 2006-2011 Strobe Inc.
* Portions Copyright 2008-2011 Apple Inc. All rights reserved.
* @license Licensed under MIT license
* See https://raw.github.com/emberjs/ember.js/master/LICENSE
- * @version 2.5.0-beta.4
+ * @version 2.5.0
*/
var enifed, requireModule, require, requirejs, Ember;
var mainContext = this;
@@ -202,13 +202,15 @@
@submodule ember-debug
*/
/**
Display a deprecation warning with the provided message and a stack trace
- (Chrome and Firefox only). Ember build tools will remove any calls to
- `Ember.deprecate()` when doing a production build.
+ (Chrome and Firefox only).
+ * In a production build, this method is defined as an empty function (NOP).
+ Uses of this method in Ember itself are stripped from the ember.prod.js build.
+
@method deprecate
@param {String} message A description of the deprecation.
@param {Boolean} test A boolean. If falsy, the deprecation
will be displayed.
@param {Object} options An object that can be used to pass
@@ -310,15 +312,15 @@
@class Ember
@public
*/
/**
- Define an assertion that will throw an exception if the condition is not
- met. Ember build tools will remove any calls to `Ember.assert()` when
- doing an Ember.js framework production build and will make the assertion a
- no-op for an application production build. Example:
+ Define an assertion that will throw an exception if the condition is not met.
+ * In a production build, this method is defined as an empty function (NOP).
+ Uses of this method in Ember itself are stripped from the ember.prod.js build.
+
```javascript
// Test for truthiness
Ember.assert('Must pass a valid object', obj);
// Fail unconditionally
@@ -347,13 +349,15 @@
throw new _emberMetalError.default('Assertion Failed: ' + desc);
}
});
/**
- Display a debug notice. Ember build tools will remove any calls to
- `Ember.debug()` when doing a production build.
+ Display a debug notice.
+ * In a production build, this method is defined as an empty function (NOP).
+ Uses of this method in Ember itself are stripped from the ember.prod.js build.
+
```javascript
Ember.debug('I\'m a debug notice!');
```
@method debug
@@ -365,10 +369,13 @@
});
/**
Display an info notice.
+ * In a production build, this method is defined as an empty function (NOP).
+ Uses of this method in Ember itself are stripped from the ember.prod.js build.
+
@method info
@private
*/
_emberMetalDebug.setDebugFunction('info', function info() {
_emberMetalLogger.default.info.apply(undefined, arguments);
@@ -378,12 +385,11 @@
Alias an old, deprecated method with its new counterpart.
Display a deprecation warning with the provided message and a stack trace
(Chrome and Firefox only) when the assigned method is called.
- Ember build tools will not remove calls to `Ember.deprecateFunc()`, though
- no warnings will be shown in production.
+ * In a production build, this method is defined as an empty function (NOP).
```javascript
Ember.oldMethod = Ember.deprecateFunc('Please use the new, updated method', Ember.newMethod);
```
@@ -430,13 +436,15 @@
if (typeof _ret2 === 'object') return _ret2.v;
}
});
/**
- Run a function meant for debugging. Ember build tools will remove any calls to
- `Ember.runInDebug()` when doing a production build.
+ Run a function meant for debugging.
+ * In a production build, this method is defined as an empty function (NOP).
+ Uses of this method in Ember itself are stripped from the ember.prod.js build.
+
```javascript
Ember.runInDebug(() => {
Ember.Component.reopen({
didInsertElement() {
console.log("I'm happy");
@@ -471,29 +479,33 @@
@private
@method _warnIfUsingStrippedFeatureFlags
@return {void}
*/
- function _warnIfUsingStrippedFeatureFlags(FEATURES, featuresWereStripped) {
+ function _warnIfUsingStrippedFeatureFlags(FEATURES, knownFeatures, featuresWereStripped) {
if (featuresWereStripped) {
_emberMetalDebug.warn('Ember.ENV.ENABLE_OPTIONAL_FEATURES is only available in canary builds.', !_emberMetalCore.default.ENV.ENABLE_OPTIONAL_FEATURES, { id: 'ember-debug.feature-flag-with-features-stripped' });
- for (var key in FEATURES) {
- if (FEATURES.hasOwnProperty(key) && key !== 'isEnabled') {
- _emberMetalDebug.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' });
+ var keys = Object.keys(FEATURES || {});
+ for (var i = 0; i < keys.length; i++) {
+ var key = keys[i];
+ if (key === 'isEnabled' || !(key in knownFeatures)) {
+ continue;
}
+
+ _emberMetalDebug.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' });
}
}
}
if (!_emberMetalCore.default.testing) {
// Complain if they're using FEATURE flags in builds other than canary
_emberMetalFeatures.FEATURES['features-stripped-test'] = true;
var featuresWereStripped = true;
delete _emberMetalFeatures.FEATURES['features-stripped-test'];
- _warnIfUsingStrippedFeatureFlags(_emberMetalCore.default.ENV.FEATURES, featuresWereStripped);
+ _warnIfUsingStrippedFeatureFlags(_emberMetalCore.default.ENV.FEATURES, _emberMetalFeatures.KNOWN_FEATURES, featuresWereStripped);
// Inform the developer about the Ember Inspector if not installed.
var isFirefox = _emberMetalEnvironment.default.isFirefox;
var isChrome = _emberMetalEnvironment.default.isChrome;
@@ -627,11 +639,13 @@
@module ember
@submodule ember-debug
*/
/**
- Display a warning with the provided message. Ember build tools will
- remove any calls to `Ember.warn()` when doing a production build.
+ Display a warning with the provided message.
+
+ * In a production build, this method is defined as an empty function (NOP).
+ Uses of this method in Ember itself are stripped from the ember.prod.js build.
@method warn
@param {String} message A warning to display.
@param {Boolean} test An optional boolean. If falsy, the warning
will be displayed.