| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 963c14c commit c6193fe
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1646,6 +1646,13 @@ function format(...args) { | |||
| 1646 | 1646 | } | |
| 1647 | 1647 | ||
| 1648 | 1648 | function hasBuiltInToString(value) { | |
| 1649 | + // Prevent triggering proxy traps. | ||
| 1650 | + const getFullProxy = false; | ||
| 1651 | + const proxyTarget = getProxyDetails(value, getFullProxy); | ||
| 1652 | + if (proxyTarget !== undefined) { | ||
| 1653 | + value = proxyTarget; | ||
| 1654 | + } | ||
| 1655 | + | ||
| 1649 | 1656 | // Count objects that have no `toString` function as built-in. | |
| 1650 | 1657 | if (typeof value.toString !== 'function') { | |
| 1651 | 1658 | return true; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -41,6 +41,9 @@ proxyObj = new Proxy(target, handler); | |||
| 41 | 41 | // Inspecting the proxy should not actually walk it's properties | |
| 42 | 42 | util.inspect(proxyObj, opts); | |
| 43 | 43 | ||
| 44 | + // Make sure inspecting object does not trigger any proxy traps. | ||
| 45 | + util.format('%s', proxyObj); | ||
| 46 | + | ||
| 44 | 47 | // getProxyDetails is an internal method, not intended for public use. | |
| 45 | 48 | // This is here to test that the internals are working correctly. | |
| 46 | 49 | let details = processUtil.getProxyDetails(proxyObj, true); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments