@@ -19,19 +19,19 @@ DUK_LOCAL duk_double_t duk__push_this_number_plain(duk_hthread *thr) {
1919 goto done ;
2020 }
2121 h = duk_get_hobject (thr , -1 );
22- if (!h ||
23- (DUK_HOBJECT_GET_CLASS_NUMBER (h ) != DUK_HOBJECT_CLASS_NUMBER )) {
22+ if (!h || (DUK_HOBJECT_GET_CLASS_NUMBER (h ) != DUK_HOBJECT_CLASS_NUMBER )) {
2423 DUK_DDD (DUK_DDDPRINT ("unacceptable this value: %!T" , (duk_tval * ) duk_get_tval (thr , -1 )));
2524 DUK_ERROR_TYPE (thr , "number expected" );
2625 DUK_WO_NORETURN (return 0.0 ;);
2726 }
2827 duk_xget_owndataprop_stridx_short (thr , -1 , DUK_STRIDX_INT_VALUE );
2928 DUK_ASSERT (duk_is_number (thr , -1 ));
3029 DUK_DDD (DUK_DDDPRINT ("number object: %!T, internal value: %!T" ,
31- (duk_tval * ) duk_get_tval (thr , -2 ), (duk_tval * ) duk_get_tval (thr , -1 )));
30+ (duk_tval * ) duk_get_tval (thr , -2 ),
31+ (duk_tval * ) duk_get_tval (thr , -1 )));
3232 duk_remove_m2 (thr );
3333
34- done :
34+ done :
3535 return duk_get_number (thr , -1 );
3636}
3737
@@ -80,9 +80,9 @@ DUK_INTERNAL duk_ret_t duk_bi_number_constructor(duk_hthread *thr) {
8080 DUK_ASSERT (DUK_HOBJECT_GET_CLASS_NUMBER (h_this ) == DUK_HOBJECT_CLASS_NUMBER );
8181 DUK_ASSERT (DUK_HOBJECT_HAS_EXTENSIBLE (h_this ));
8282
83- duk_dup_0 (thr ); /* -> [ val obj val ] */
83+ duk_dup_0 (thr ); /* -> [ val obj val ] */
8484 duk_xdef_prop_stridx_short (thr , -2 , DUK_STRIDX_INT_VALUE , DUK_PROPDESC_FLAGS_NONE );
85- return 0 ; /* no return value -> don't replace created value */
85+ return 0 ; /* no return value -> don't replace created value */
8686}
8787
8888DUK_INTERNAL duk_ret_t duk_bi_number_prototype_value_of (duk_hthread * thr ) {
@@ -104,10 +104,7 @@ DUK_INTERNAL duk_ret_t duk_bi_number_prototype_to_string(duk_hthread *thr) {
104104
105105 n2s_flags = 0 ;
106106
107- duk_numconv_stringify (thr ,
108- radix /*radix*/ ,
109- 0 /*digits*/ ,
110- n2s_flags /*flags*/ );
107+ duk_numconv_stringify (thr , radix /*radix*/ , 0 /*digits*/ , n2s_flags /*flags*/ );
111108 return 1 ;
112109}
113110
@@ -145,16 +142,12 @@ DUK_INTERNAL duk_ret_t duk_bi_number_prototype_to_fixed(duk_hthread *thr) {
145142 goto use_to_string ;
146143 }
147144
148- n2s_flags = DUK_N2S_FLAG_FIXED_FORMAT |
149- DUK_N2S_FLAG_FRACTION_DIGITS ;
145+ n2s_flags = DUK_N2S_FLAG_FIXED_FORMAT | DUK_N2S_FLAG_FRACTION_DIGITS ;
150146
151- duk_numconv_stringify (thr ,
152- 10 /*radix*/ ,
153- frac_digits /*digits*/ ,
154- n2s_flags /*flags*/ );
147+ duk_numconv_stringify (thr , 10 /*radix*/ , frac_digits /*digits*/ , n2s_flags /*flags*/ );
155148 return 1 ;
156149
157- use_to_string :
150+ use_to_string :
158151 DUK_ASSERT_TOP (thr , 2 );
159152 duk_to_string (thr , -1 );
160153 return 1 ;
@@ -170,7 +163,7 @@ DUK_INTERNAL duk_ret_t duk_bi_number_prototype_to_exponential(duk_hthread *thr)
170163 d = duk__push_this_number_plain (thr );
171164
172165 frac_undefined = duk_is_undefined (thr , 0 );
173- duk_to_int (thr , 0 ); /* for side effects */
166+ duk_to_int (thr , 0 ); /* for side effects */
174167
175168 c = (duk_small_int_t ) DUK_FPCLASSIFY (d );
176169 if (c == DUK_FP_NAN || c == DUK_FP_INFINITE ) {
@@ -179,16 +172,12 @@ DUK_INTERNAL duk_ret_t duk_bi_number_prototype_to_exponential(duk_hthread *thr)
179172
180173 frac_digits = (duk_small_int_t ) duk_to_int_check_range (thr , 0 , 0 , 20 );
181174
182- n2s_flags = DUK_N2S_FLAG_FORCE_EXP |
183- (frac_undefined ? 0 : DUK_N2S_FLAG_FIXED_FORMAT );
175+ n2s_flags = DUK_N2S_FLAG_FORCE_EXP | (frac_undefined ? 0 : DUK_N2S_FLAG_FIXED_FORMAT );
184176
185- duk_numconv_stringify (thr ,
186- 10 /*radix*/ ,
187- frac_digits + 1 /*leading digit + fractions*/ ,
188- n2s_flags /*flags*/ );
177+ duk_numconv_stringify (thr , 10 /*radix*/ , frac_digits + 1 /*leading digit + fractions*/ , n2s_flags /*flags*/ );
189178 return 1 ;
190179
191- use_to_string :
180+ use_to_string :
192181 DUK_ASSERT_TOP (thr , 2 );
193182 duk_to_string (thr , -1 );
194183 return 1 ;
@@ -213,7 +202,7 @@ DUK_INTERNAL duk_ret_t duk_bi_number_prototype_to_precision(duk_hthread *thr) {
213202 }
214203 DUK_ASSERT_TOP (thr , 2 );
215204
216- duk_to_int (thr , 0 ); /* for side effects */
205+ duk_to_int (thr , 0 ); /* for side effects */
217206
218207 c = (duk_small_int_t ) DUK_FPCLASSIFY (d );
219208 if (c == DUK_FP_NAN || c == DUK_FP_INFINITE ) {
@@ -222,16 +211,12 @@ DUK_INTERNAL duk_ret_t duk_bi_number_prototype_to_precision(duk_hthread *thr) {
222211
223212 prec = (duk_small_int_t ) duk_to_int_check_range (thr , 0 , 1 , 21 );
224213
225- n2s_flags = DUK_N2S_FLAG_FIXED_FORMAT |
226- DUK_N2S_FLAG_NO_ZERO_PAD ;
214+ n2s_flags = DUK_N2S_FLAG_FIXED_FORMAT | DUK_N2S_FLAG_NO_ZERO_PAD ;
227215
228- duk_numconv_stringify (thr ,
229- 10 /*radix*/ ,
230- prec /*digits*/ ,
231- n2s_flags /*flags*/ );
216+ duk_numconv_stringify (thr , 10 /*radix*/ , prec /*digits*/ , n2s_flags /*flags*/ );
232217 return 1 ;
233218
234- use_to_string :
219+ use_to_string :
235220 /* Used when precision is undefined; also used for NaN (-> "NaN"),
236221 * and +/- infinity (-> "Infinity", "-Infinity").
237222 */
@@ -257,16 +242,16 @@ DUK_INTERNAL duk_ret_t duk_bi_number_check_shared(duk_hthread *thr) {
257242 d = duk_get_number (thr , 0 );
258243
259244 switch (magic ) {
260- case 0 : /* isFinite() */
245+ case 0 : /* isFinite() */
261246 ret = duk_double_is_finite (d );
262247 break ;
263- case 1 : /* isInteger() */
248+ case 1 : /* isInteger() */
264249 ret = duk_double_is_integer (d );
265250 break ;
266- case 2 : /* isNaN() */
251+ case 2 : /* isNaN() */
267252 ret = duk_double_is_nan (d );
268253 break ;
269- default : /* isSafeInteger() */
254+ default : /* isSafeInteger() */
270255 DUK_ASSERT (magic == 3 );
271256 ret = duk_double_is_safe_integer (d );
272257 }
@@ -275,6 +260,6 @@ DUK_INTERNAL duk_ret_t duk_bi_number_check_shared(duk_hthread *thr) {
275260 duk_push_boolean (thr , ret );
276261 return 1 ;
277262}
278- #endif /* DUK_USE_ES6 */
263+ #endif /* DUK_USE_ES6 */
279264
280- #endif /* DUK_USE_NUMBER_BUILTIN */
265+ #endif /* DUK_USE_NUMBER_BUILTIN */
0 commit comments