Skip to content

Commit

Permalink
Merge pull request #29 from cksource/t/28
Browse files Browse the repository at this point in the history
Added CKEDITOR.isDebug property.
  • Loading branch information
Reinmar committed Oct 2, 2015
2 parents 68c5b27 + 8fc1d97 commit f2c4744
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
17 changes: 17 additions & 0 deletions ckeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,23 @@
*/
basePath: getBasePath(),

/**
* Whether the app should work in the "debug mode" (aka "verbose mode").
*
* You can use the `CKEDITOR.isDebug` condition in order to wrap code that should be removed in the build version:
*
* if ( CKEDITOR.isDebug ) {
* if ( doSomeSuperUnnecessaryDebugChecks() ) {
* throw new CKEditorError( 'sth-broke: Kaboom!' );
* }
* }
*
* See also {@link #isDev}.
*
* @property
*/
isDebug: true,

/**
* Defines an AMD module.
*
Expand Down
4 changes: 3 additions & 1 deletion src/ckeditor-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ define( 'ckeditor-dev', function() {
*
* This property is not defined in production (compiled, build code).
*
* @memberof CKEditor
* See also {@link #isDebug}.
*
* @member CKEDITOR
*/
isDev: true,

Expand Down
8 changes: 8 additions & 0 deletions tests/ckeditor/ckeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,11 @@ describe( 'getPluginPath()', function() {
expect( path ).to.equal( basePath + 'plugins/test/' );
} );
} );

describe( 'isDebug', function() {
it( 'is a boolean', function() {
var CKEDITOR = modules.ckeditor;

expect( CKEDITOR.isDebug ).to.be.a( 'boolean' );
} );
} );

0 comments on commit f2c4744

Please sign in to comment.