File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -77,3 +77,9 @@ describe('Issue #1247', () => {
77
77
expect ( r . wasAltered ( ) ) . toBe ( false ) ;
78
78
} ) ;
79
79
} ) ;
80
+
81
+ describe ( 'Issue #1252' , ( ) => {
82
+ const prototypelessObj = Object . create ( null ) ;
83
+ const list = List ( [ prototypelessObj ] ) ;
84
+ expect ( list . toString ( ) ) . toBe ( 'List [ {} ]' ) ;
85
+ } ) ;
Original file line number Diff line number Diff line change 9
9
* Converts a value to a string, adding quotes if a string was provided.
10
10
*/
11
11
export default function quoteString ( value ) {
12
- return typeof value === 'string' ? JSON . stringify ( value ) : String ( value ) ;
12
+ try {
13
+ return typeof value === 'string' ? JSON . stringify ( value ) : String ( value ) ;
14
+ } catch ( _ignoreError ) {
15
+ return JSON . stringify ( value ) ;
16
+ }
13
17
}
You can’t perform that action at this time.
0 commit comments