File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,6 @@ export function initVuexBackend (hook, bridge) {
21
21
22
22
// devtool -> application
23
23
bridge . on ( 'vuex:travel-to-state' , state => {
24
- hook . emit ( 'vuex:travel-to-state' , parse ( state ) )
24
+ hook . emit ( 'vuex:travel-to-state' , parse ( state , true /* revive */ ) )
25
25
} )
26
26
}
Original file line number Diff line number Diff line change @@ -52,8 +52,20 @@ function replacer (key, val) {
52
52
}
53
53
}
54
54
55
- export function parse ( data , revivier ) {
56
- return CircularJSON . parse ( data , revivier )
55
+ export function parse ( data , revive ) {
56
+ return revive
57
+ ? CircularJSON . parse ( data , reviver )
58
+ : CircularJSON . parse ( data )
59
+ }
60
+
61
+ function reviver ( key , val ) {
62
+ if ( val === UNDEFINED ) {
63
+ return undefined
64
+ } else if ( val === INFINITY ) {
65
+ return Infinity
66
+ } else {
67
+ return val
68
+ }
57
69
}
58
70
59
71
/**
You can’t perform that action at this time.
0 commit comments