diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-12-06 21:22:40 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-07 05:22:40 +0800 |
commit | 2cbbf5c375a0fae88345c3ed3bc2829b4b1ac250 (patch) | |
tree | f1dd106d04820e8002d2f99cba76206d690d7c96 /test/sandbox.js | |
parent | 3c384cf9a8ed4230cf87f14ab017b613b38df628 (diff) | |
download | tracifyjs-2cbbf5c375a0fae88345c3ed3bc2829b4b1ac250.tar.gz tracifyjs-2cbbf5c375a0fae88345c3ed3bc2829b4b1ac250.zip |
support async function (#4333)
Diffstat (limited to 'test/sandbox.js')
-rw-r--r-- | test/sandbox.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/sandbox.js b/test/sandbox.js index c1575783..46b1a410 100644 --- a/test/sandbox.js +++ b/test/sandbox.js @@ -32,11 +32,12 @@ function createContext() { function safe_log(arg, level) { if (arg) switch (typeof arg) { - case "function": + case "function": return arg.toString(); - case "object": + case "object": if (arg === global) return "[object global]"; if (/Error$/.test(arg.name)) return arg.toString(); + if (typeof arg.then == "function") return "[object Promise]"; arg.constructor.toString(); if (level--) for (var key in arg) { var desc = Object.getOwnPropertyDescriptor(arg, key); |