| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a7419d0 commit 34f4934
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -909,14 +909,20 @@ static void ReadDir(const FunctionCallbackInfo<Value>& args) { | |||
| 909 | 909 | name_v[name_idx++] = filename.ToLocalChecked(); | |
| 910 | 910 | ||
| 911 | 911 | if (name_idx >= arraysize(name_v)) { | |
| 912 | - fn->Call(env->context(), names, name_idx, name_v) | ||
| 913 | - .ToLocalChecked(); | ||
| 912 | + MaybeLocal<Value> ret = fn->Call(env->context(), names, name_idx, | ||
| 913 | + name_v); | ||
| 914 | + if (ret.IsEmpty()) { | ||
| 915 | + return; | ||
| 916 | + } | ||
| 914 | 917 | name_idx = 0; | |
| 915 | 918 | } | |
| 916 | 919 | } | |
| 917 | 920 | ||
| 918 | 921 | if (name_idx > 0) { | |
| 919 | - fn->Call(env->context(), names, name_idx, name_v).ToLocalChecked(); | ||
| 922 | + MaybeLocal<Value> ret = fn->Call(env->context(), names, name_idx, name_v); | ||
| 923 | + if (ret.IsEmpty()) { | ||
| 924 | + return; | ||
| 925 | + } | ||
| 920 | 926 | } | |
| 921 | 927 | ||
| 922 | 928 | args.GetReturnValue().Set(names); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,18 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + | ||
| 3 | + const common = require('../common'); | ||
| 4 | + | ||
| 5 | + const fs = require('fs'); | ||
| 6 | + | ||
| 7 | + function recurse() { | ||
| 8 | + fs.readdirSync('.'); | ||
| 9 | + recurse(); | ||
| 10 | + } | ||
| 11 | + | ||
| 12 | + common.expectsError( | ||
| 13 | + () => recurse(), | ||
| 14 | + { | ||
| 15 | + type: RangeError, | ||
| 16 | + message: 'Maximum call stack size exceeded' | ||
| 17 | + } | ||
| 18 | + ); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments