Skip to content

Commit

Permalink
[DOC release] updated docs regarding ember debug methods to bring the…
Browse files Browse the repository at this point in the history
…m all in line with #13180

(cherry picked from commit c24c876)
  • Loading branch information
webark authored and rwjblue committed Apr 11, 2016
1 parent 7c62e1e commit ef802ad
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
6 changes: 4 additions & 2 deletions packages/ember-debug/lib/deprecate.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
26 changes: 16 additions & 10 deletions packages/ember-debug/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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!');
Expand All @@ -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
*/
Expand All @@ -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);
Expand Down Expand Up @@ -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(() => {
Expand Down
6 changes: 4 additions & 2 deletions packages/ember-debug/lib/warn.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit ef802ad

Please sign in to comment.