1
0
mirror of synced 2025-12-10 08:28:08 +08:00

Fix: Symbol stringify error

This commit is contained in:
surunzi
2016-05-21 14:26:06 +08:00
parent c9bc01c593
commit 7ed72ae248
2 changed files with 4 additions and 1 deletions

View File

@@ -339,6 +339,7 @@ function stringify(obj, simple, visited)
isArr = (type == '[object Array]'),
isObj = (type == '[object Object]'),
isNum = (type == '[object Number]'),
isSymbol = (type == '[object Symbol]'),
isBool = (type == '[object Boolean]');
for (let i = 0, len = visited.length; i < len; i++)
@@ -391,6 +392,9 @@ function stringify(obj, simple, visited)
} else if (obj === null)
{
json = 'null';
} else if (isSymbol)
{
json = '"Symbol"';
} else if (obj === undefined)
{
json = '"undefined"';

View File

@@ -6,7 +6,6 @@
<title>Eruda</title>
<link rel="stylesheet" href="style.css">
<script>
alert(typeof window.EventTarget);
window.onerror = function (msg) {
alert(msg);
}