| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 973488b commit 2995506
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -951,14 +951,20 @@ static void ReadDir(const FunctionCallbackInfo<Value>& args) { | |||
| 951 | 951 | name_v[name_idx++] = filename.ToLocalChecked(); | |
| 952 | 952 | ||
| 953 | 953 | if (name_idx >= arraysize(name_v)) { | |
| 954 | - fn->Call(env->context(), names, name_idx, name_v) | ||
| 955 | - .ToLocalChecked(); | ||
| 954 | + MaybeLocal<Value> ret = fn->Call(env->context(), names, name_idx, | ||
| 955 | + name_v); | ||
| 956 | + if (ret.IsEmpty()) { | ||
| 957 | + return; | ||
| 958 | + } | ||
| 956 | 959 | name_idx = 0; | |
| 957 | 960 | } | |
| 958 | 961 | } | |
| 959 | 962 | ||
| 960 | 963 | if (name_idx > 0) { | |
| 961 | - fn->Call(env->context(), names, name_idx, name_v).ToLocalChecked(); | ||
| 964 | + MaybeLocal<Value> ret = fn->Call(env->context(), names, name_idx, name_v); | ||
| 965 | + if (ret.IsEmpty()) { | ||
| 966 | + return; | ||
| 967 | + } | ||
| 962 | 968 | } | |
| 963 | 969 | ||
| 964 | 970 | 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