From 35ffb915bf68087cb290835e166e58a493929262 Mon Sep 17 00:00:00 2001 From: Mark David Avery Date: Wed, 6 Apr 2016 12:29:20 -0700 Subject: [PATCH] [DOC release] updated docs regarding ember debug methods to bring them all in line with #13180 (cherry picked from commit c24c876f4b3d9e8c682d75b30edcf3c83d7326d5) --- packages/ember-debug/lib/deprecate.js | 6 ++++-- packages/ember-debug/lib/index.js | 26 ++++++++++++++++---------- packages/ember-debug/lib/warn.js | 6 ++++-- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/packages/ember-debug/lib/deprecate.js b/packages/ember-debug/lib/deprecate.js index bcb191a9e88..c5698a1b282 100644 --- a/packages/ember-debug/lib/deprecate.js +++ b/packages/ember-debug/lib/deprecate.js @@ -85,8 +85,10 @@ export let missingOptionsUntilDeprecation = 'When calling `Ember.deprecate` you /** 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. diff --git a/packages/ember-debug/lib/index.js b/packages/ember-debug/lib/index.js index 1136f98ff09..9c0e3542a2a 100644 --- a/packages/ember-debug/lib/index.js +++ b/packages/ember-debug/lib/index.js @@ -30,10 +30,10 @@ import { generateTestAsFunctionDeprecation } from 'ember-debug/handlers'; /** - 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 @@ -71,8 +71,10 @@ setDebugFunction('assert', function assert(desc, test) { }); /** - 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!'); @@ -89,6 +91,9 @@ setDebugFunction('debug', function debug(message) { /** 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 */ @@ -102,8 +107,7 @@ setDebugFunction('info', function info() { 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); @@ -134,8 +138,10 @@ setDebugFunction('deprecateFunc', function deprecateFunc(...args) { /** - 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(() => { diff --git a/packages/ember-debug/lib/warn.js b/packages/ember-debug/lib/warn.js index 8825f353114..503e72a56d0 100644 --- a/packages/ember-debug/lib/warn.js +++ b/packages/ember-debug/lib/warn.js @@ -24,8 +24,10 @@ export let missingOptionsIdDeprecation = 'When calling `Ember.warn` you must pro */ /** - 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.