diff options
author | Guy Bedford <guybedford@gmail.com> | 2019-09-08 18:20:43 +0300 |
---|---|---|
committer | Jan Krems <jan.krems@gmail.com> | 2019-09-20 01:24:50 +0300 |
commit | 4396bebfe1fc024ff6badf2ead40f1b5127d4e67 (patch) | |
tree | e659ad99dc2e6d8f21309b6b0b8e951c5e35aab2 /src/node_file.cc | |
parent | ac4195992290ef6f0b62e2b218ee0dba059f2a76 (diff) |
module: error for CJS .js load within type: module
PR-URL: https://github.com/nodejs/node/pull/29492
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, 2 insertions, 1 deletions
diff --git a/src/node_file.cc b/src/node_file.cc index ae2aa0677f6..195757f43f3 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -875,7 +875,8 @@ static void InternalModuleReadJSON(const FunctionCallbackInfo<Value>& args) { const size_t size = offset - start; if (size == 0 || ( size == SearchString(&chars[start], size, "\"main\"") && - size == SearchString(&chars[start], size, "\"exports\""))) { + size == SearchString(&chars[start], size, "\"exports\"") && + size == SearchString(&chars[start], size, "\"type\""))) { return; } else { Local<String> chars_string = |