File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
packages/repl/src/lib/Output Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 92
92
<span class ="token comment" >{String (value )}</span >
93
93
{:else }
94
94
<span class ="token {typeof value }" >
95
- {JSON .stringify (value )}
95
+ {typeof value === ' bigint ' ? ` ${ value }n ` : JSON .stringify (value )}
96
96
</span >
97
97
{/if }
98
98
</span >
170
170
color : var (--shiki-token-string );
171
171
}
172
172
173
- .token.number {
173
+ .token.number ,
174
+ .token.bigint {
174
175
color : var (--shiki-token-constant );
175
176
}
176
177
Original file line number Diff line number Diff line change 155
155
return { type : 'Set' , value } ;
156
156
}
157
157
158
+ // if we don't handle bigints separately, they will cause JSON.stringify to blow up
159
+ if ( typeof value === 'bigint' ) {
160
+ return { type : 'BigInt' , value : value + '' } ;
161
+ }
162
+
158
163
return value ;
159
164
} ) ;
160
165
} catch ( error ) {
You can’t perform that action at this time.
0 commit comments