File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -1193,14 +1193,24 @@ final class _SerializeVisitor
1193
1193
// Dart always converts integers to strings in the obvious way, so all we
1194
1194
// have to do is clamp doubles that are close to being integers.
1195
1195
if (fuzzyAsInt (number) case var integer? ) {
1196
- // JS still uses exponential notation for integers, so we have to handle
1197
- // it here.
1198
- buffer.write (_removeExponent (integer.toString ()));
1199
- return ;
1196
+ // Write the number as fuzzy integer only if not in inspect mode or if the
1197
+ // number precisely equals to the fuzzy interger
1198
+ if (! _inspect || number == integer) {
1199
+ // JS still uses exponential notation for integers, so we have to handle
1200
+ // it here.
1201
+ buffer.write (_removeExponent (integer.toString ()));
1202
+ return ;
1203
+ }
1200
1204
}
1201
1205
1202
1206
var text = _removeExponent (number.toString ());
1203
1207
1208
+ // Write the number at full precision in inspect mode.
1209
+ if (_inspect) {
1210
+ buffer.write (text);
1211
+ return ;
1212
+ }
1213
+
1204
1214
// Any double that's less than `SassNumber.precision + 2` digits long is
1205
1215
// guaranteed to be safe to emit directly, since it'll contain at most `0.`
1206
1216
// followed by [SassNumber.precision] digits.
You can’t perform that action at this time.
0 commit comments