@@ -52,7 +52,7 @@ cc.clone = function (obj) {
52
52
* @param {object } jsobj subclass
53
53
* @param {object } klass superclass
54
54
*/
55
- cc . associateWithNative = function ( jsobj , superclass ) {
55
+ cc . associateWithNative = function ( jsobj , superclass ) {
56
56
} ;
57
57
58
58
/**
@@ -135,40 +135,65 @@ cc.MessageBox = function (message) {
135
135
console . log ( message ) ;
136
136
} ;
137
137
138
- // cocos2d debug
139
- if ( cc . COCOS2D_DEBUG == 0 ) {
140
- cc . log = function ( ) {
141
- } ;
142
- cc . logINFO = function ( ) {
143
- } ;
144
- cc . logERROR = function ( ) {
145
- } ;
146
- }
147
- else if ( cc . COCOS2D_DEBUG == 1 ) {
148
- cc . logINFO = cc . log ;
149
- cc . logERROR = function ( ) {
150
- } ;
138
+ /**
139
+ * Output Assert message.
140
+ * @function
141
+ * @param {Boolean } cond If cond is false, assert.
142
+ * @param {String } message
143
+ */
144
+ cc . Assert = function ( cond , message ) {
145
+ if ( ( typeof console . assert ) == "function" ) {
146
+ console . assert ( cond , message ) ;
147
+ } else {
148
+ if ( ! cond ) {
149
+ if ( message ) {
150
+ alert ( message ) ;
151
+ }
152
+ }
153
+ }
151
154
}
152
- else if ( cc . COCOS2D_DEBUG > 1 ) {
153
- cc . logINFO = cc . log ;
154
- cc . logERROR = cc . log ;
155
- } // COCOS2D_DEBUG
156
-
157
- if ( cc . COCOS2D_DEBUG ) {
158
- cc . Assert = function ( cond , message ) {
159
- if ( ( typeof console . assert ) == "function" ) {
160
- console . assert ( cond , message ) ;
161
- } else {
162
- if ( ! cond ) {
163
- if ( message ) {
164
- alert ( message ) ;
155
+
156
+ /**
157
+ * Update Debug setting.
158
+ * @function
159
+ */
160
+ cc . initDebugSetting = function ( ) {
161
+ // cocos2d debug
162
+ if ( cc . COCOS2D_DEBUG == 0 ) {
163
+ cc . log = function ( ) {
164
+ } ;
165
+ cc . logINFO = function ( ) {
166
+ } ;
167
+ cc . logERROR = function ( ) {
168
+ } ;
169
+ }
170
+ else if ( cc . COCOS2D_DEBUG == 1 ) {
171
+ cc . logINFO = cc . log ;
172
+ cc . logERROR = function ( ) {
173
+ } ;
174
+ }
175
+ else if ( cc . COCOS2D_DEBUG > 1 ) {
176
+ cc . logINFO = cc . log ;
177
+ cc . logERROR = cc . log ;
178
+ } // COCOS2D_DEBUG
179
+
180
+ if ( cc . COCOS2D_DEBUG ) {
181
+ cc . Assert = function ( cond , message ) {
182
+ if ( ( typeof console . assert ) == "function" ) {
183
+ console . assert ( cond , message ) ;
184
+ } else {
185
+ if ( ! cond ) {
186
+ if ( message ) {
187
+ alert ( message ) ;
188
+ }
165
189
}
166
190
}
167
191
}
192
+ } else {
193
+ cc . Assert = function ( ) {
194
+ } ;
168
195
}
169
- } else {
170
- cc . Assert = function ( ) {
171
- } ;
196
+
172
197
}
173
198
174
199
// Enum the language type supportted now
0 commit comments