You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Macro values Infinity, NaN and -0 are inlined as null, null and 0 #183
Number values returned by a macro are serialized with JSON.stringify, so non-finite numbers (Infinity, -Infinity, NaN) become null and -0 becomes 0. The build succeeds and the bundle silently uses the wrong value.
stringifyValue in src/core/index.ts falls through to return JSON.stringify(value) for numbers (including inside arrays and plain objects returned by a macro, so [Infinity] becomes [null]). Emitting Infinity, -Infinity, NaN and -0 for those cases (as stringifyValue already does for bigint, RegExp and Date) would preserve the returned number.
Activity