-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Solved RangeError: Maximum call stack size exceeded (native stack depth), js engine: hermes
- Loading branch information
1 parent
b3d2138
commit bb0d2a2
Showing
1 changed file
with
8 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,12 +3,17 @@ var uncurryThis = require('../internals/function-uncurry-this'); | |
var isCallable = require('../internals/is-callable'); | ||
var store = require('../internals/shared-store'); | ||
|
||
var functionToString = uncurryThis(Function.toString); | ||
var functionToString = uncurryThis(Function.prototype.toString); | ||
|
||
// this helper broken in `[email protected]`, so we can't use `shared` helper | ||
// Avoid recursion in `store.inspectSource` | ||
if (!isCallable(store.inspectSource)) { | ||
store.inspectSource = function (it) { | ||
return functionToString(it); | ||
try { | ||
return isCallable(it) ? functionToString(it) : ''; | ||
} catch (error) { | ||
// Fallback to an empty string if `functionToString` fails | ||
return ''; | ||
} | ||
}; | ||
} | ||
|
||
|