File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 37
37
</template >
38
38
39
39
<script >
40
- import { UNDEFINED , isPlainObject } from ' ../../util'
40
+ import { UNDEFINED , INFINITY , isPlainObject } from ' ../../util'
41
41
42
42
const rawTypeRE = / ^ \[ object (\w + )\] $ /
43
43
@@ -59,13 +59,13 @@ export default {
59
59
const type = typeof value
60
60
if (value == null || value === UNDEFINED ) {
61
61
return ' null'
62
+ } else if (type === ' boolean' || type === ' number' || value === INFINITY ) {
63
+ return ' literal'
62
64
} else if (
63
65
value instanceof RegExp ||
64
66
(type === ' string' && ! rawTypeRE .test (value))
65
67
) {
66
68
return ' string'
67
- } else if (type === ' boolean' || type === ' number' ) {
68
- return ' literal'
69
69
}
70
70
},
71
71
isExpandableType () {
@@ -78,6 +78,8 @@ export default {
78
78
return ' null'
79
79
} else if (value === UNDEFINED ) {
80
80
return ' undefined'
81
+ } else if (value === INFINITY ) {
82
+ return ' Infinity'
81
83
} else if (Array .isArray (value)) {
82
84
return ' Array[' + value .length + ' ]'
83
85
} else if (isPlainObject (value)) {
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ export function inDoc (node) {
36
36
*/
37
37
38
38
export const UNDEFINED = '__vue_devtool_undefined__'
39
+ export const INFINITY = '__vue_devtool_infinity__'
39
40
40
41
export function stringify ( data ) {
41
42
return CircularJSON . stringify ( data , replacer )
@@ -44,13 +45,15 @@ export function stringify (data) {
44
45
function replacer ( key , val ) {
45
46
if ( val === undefined ) {
46
47
return UNDEFINED
48
+ } else if ( val === Infinity ) {
49
+ return INFINITY
47
50
} else {
48
51
return sanitize ( val )
49
52
}
50
53
}
51
54
52
- export function parse ( data ) {
53
- return CircularJSON . parse ( data )
55
+ export function parse ( data , revivier ) {
56
+ return CircularJSON . parse ( data , revivier )
54
57
}
55
58
56
59
/**
You can’t perform that action at this time.
0 commit comments