From 1eee0b8bf8bba39b600fb16a9223e545e3bac2bc Mon Sep 17 00:00:00 2001 From: Guy Bedford Date: Mon, 4 Nov 2019 19:40:11 -0500 Subject: 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 Reviewed-By: Jan Krems --- src/node_file.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/node_file.cc') diff --git a/src/node_file.cc b/src/node_file.cc index 8b6a90989f..48b382986c 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& 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 chars_string = String::NewFromUtf8(isolate, -- cgit v1.2.3