File tree Expand file tree Collapse file tree
packages/devtool-extenstion/extension/core Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,6 +13,21 @@ const demo = {
1313 name : "Context Demo" ,
1414} ;
1515
16+ const ws = new WeakSet ( ) ;
17+ const foo = { } ;
18+
19+ ws . add ( foo ) ;
20+
21+ let myMap = new Map ( )
22+ myMap . set ( "s" , 'not a number' )
23+
24+ const valuesToTest = {
25+ f : new Set ( [ 1 , 2 , 3 , 3 ] ) ,
26+ g : ws ,
27+ h : myMap ,
28+ i : ws ,
29+ }
30+
1631const Test = ( ) => {
1732 const [ counter3 , setCounter3 ] = React . useState ( 0 ) ;
1833 const [ counter4 , setCounter4 ] = React . useState ( 0 ) ;
@@ -52,7 +67,7 @@ class Test2 extends React.Component {
5267 // const { id } = this.context;
5368
5469 return (
55- < MyContext2 . Provider value = { { id : counter5 , b : "world" } } >
70+ < MyContext2 . Provider value = { { id : counter5 , b : "world" , ... valuesToTest } } >
5671 < button onClick = { ( ) => this . setState ( { counter5 : counter5 + 1 } ) } >
5772 Click 5 Me { counter5 } { id }
5873 </ button >
Original file line number Diff line number Diff line change @@ -85,6 +85,18 @@ function injectHelpers(target) {
8585 if ( isHTMLElement ( v ) ) {
8686 return `<${ v . tagName } > HTMLElemet` ;
8787 }
88+ if ( v instanceof Set ) {
89+ return `Set [${ Array . from ( v ) . toString ( ) } ]` ;
90+ }
91+ if ( v instanceof Map ) {
92+ return `Map [${ Array . from ( v ) . toString ( ) } ]` ;
93+ }
94+ if ( v instanceof WeakSet ) {
95+ return `WeekSet []` ;
96+ }
97+ if ( v instanceof WeakMap ) {
98+ return `WeakMap {}` ;
99+ }
88100 return v ;
89101 } ) ;
90102 } ;
You can’t perform that action at this time.
0 commit comments