diff options
author | Guy Bedford <guybedford@gmail.com> | 2019-11-05 03:40:11 +0300 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2019-11-17 10:59:11 +0300 |
commit | caedcd9ef945a6b0e31cbd7489bb22c0f7b3a10b (patch) | |
tree | 5554d7e534e3307d4717e2d7687861af93a0c2c8 /src/node_file.cc | |
parent | ae5aa3ee830feeaee329ba14e34ab1c8b23bef3d (diff) |
module: fix for empty object in InternalModuleReadJSON
Fixes: https://github.com/nodejs/node/issues/30245
PR-URL: https://github.com/nodejs/node/pull/30256
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Diffstat (limited to 'src/node_file.cc')
-rw-r--r-- | src/node_file.cc | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/node_file.cc b/src/node_file.cc index 8b6a90989f8..48b382986c0 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -18,7 +18,6 @@ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "node_file.h" #include "aliased_buffer.h" #include "memory_tracker-inl.h" @@ -787,7 +786,7 @@ static void InternalModuleReadJSON(const FunctionCallbackInfo<Value>& args) { size == SearchString(&chars[start], size, "\"main\"") && size == SearchString(&chars[start], size, "\"exports\"") && size == SearchString(&chars[start], size, "\"type\""))) { - return; + args.GetReturnValue().Set(env->empty_object_string()); } else { Local<String> chars_string = String::NewFromUtf8(isolate, |