File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -443,15 +443,15 @@ if (typeof NumberDecimal !== 'undefined') {
443443 if ( ! NumberDecimal . prototype ) {
444444 NumberDecimal . prototype = { } ;
445445 }
446- NumberDecimal . prototype . nativeToString = NumberDecimal . prototype . toString
447-
448- NumberDecimal . prototype . tojson = function ( ) {
449- return this . nativeToString ( ) ;
450- } ;
451446
447+ NumberDecimal . prototype . nativeToString = NumberDecimal . prototype . toString
452448 NumberDecimal . prototype . toString = function ( ) {
453449 return `NumberDecimal("${ this . nativeToString ( ) } ")` ;
454450 } ;
451+
452+ NumberDecimal . prototype . tojson = function ( ) {
453+ return this . toString ( ) ;
454+ } ;
455455}
456456
457457// ObjectId
Original file line number Diff line number Diff line change @@ -24,4 +24,4 @@ const nl2 = NumberLong("200");
2424assert . strictEqual ( maxLong . compare ( nl2 ) , 1 ) ;
2525const decimal = NumberDecimal ( "1.1" ) ;
2626assert . strictEqual ( decimal . toString ( ) , 'NumberDecimal("1.1")' ) ;
27- assert . strictEqual ( decimal . tojson ( ) , '1.1' ) ;
27+ assert . strictEqual ( decimal . tojson ( ) , 'NumberDecimal(" 1.1") ' ) ;
You can’t perform that action at this time.
0 commit comments