| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -214,6 +214,7 @@ constexpr size_t kFsStatsBufferLength = | |||
| 214 | 214 | V(done_string, "done") \ | |
| 215 | 215 | V(duration_string, "duration") \ | |
| 216 | 216 | V(emit_warning_string, "emitWarning") \ | |
| 217 | + V(empty_object_string, "{}") \ | ||
| 217 | 218 | V(encoding_string, "encoding") \ | |
| 218 | 219 | V(entries_string, "entries") \ | |
| 219 | 220 | V(entry_type_string, "entryType") \ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,7 +18,6 @@ | |||
| 18 | 18 | // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR | |
| 19 | 19 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE | |
| 20 | 20 | // USE OR OTHER DEALINGS IN THE SOFTWARE. | |
| 21 | - | ||
| 22 | 21 | #include "node_file.h" | |
| 23 | 22 | #include "aliased_buffer.h" | |
| 24 | 23 | #include "memory_tracker-inl.h" | |
@@ -787,7 +786,7 @@ static void InternalModuleReadJSON(const FunctionCallbackInfo<Value>& args) { | |||
| 787 | 786 | size == SearchString(&chars[start], size, "\"main\"") && | |
| 788 | 787 | size == SearchString(&chars[start], size, "\"exports\"") && | |
| 789 | 788 | size == SearchString(&chars[start], size, "\"type\""))) { | |
| 790 | - return; | ||
| 789 | + args.GetReturnValue().Set(env->empty_object_string()); | ||
| 791 | 790 | } else { | |
| 792 | 791 | Local<String> chars_string = | |
| 793 | 792 | String::NewFromUtf8(isolate, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,8 @@ | |||
| 1 | + // Flags: --experimental-modules | ||
| 2 | + import '../common/index.mjs'; | ||
| 3 | + import { strictEqual } from 'assert'; | ||
| 4 | + | ||
| 5 | + import asdf from | ||
| 6 | + '../fixtures/es-modules/package-type-module/nested-default-type/module.js'; | ||
| 7 | + | ||
| 8 | + strictEqual(asdf, 'asdf'); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1 @@ | |||
| 1 | + module.exports = 'asdf'; | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1 @@ | |||
| 1 | + {} | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,9 +8,8 @@ const { readFileSync } = require('fs'); | |||
| 8 | 8 | const { strictEqual } = require('assert'); | |
| 9 | 9 | ||
| 10 | 10 | strictEqual(internalModuleReadJSON('nosuchfile'), undefined); | |
| 11 | - strictEqual(internalModuleReadJSON(fixtures.path('empty.txt')), undefined); | ||
| 12 | - strictEqual(internalModuleReadJSON(fixtures.path('empty-with-bom.txt')), | ||
| 13 | - undefined); | ||
| 11 | + strictEqual(internalModuleReadJSON(fixtures.path('empty.txt')), '{}'); | ||
| 12 | + strictEqual(internalModuleReadJSON(fixtures.path('empty-with-bom.txt')), '{}'); | ||
| 14 | 13 | { | |
| 15 | 14 | const filename = fixtures.path('require-bin/package.json'); | |
| 16 | 15 | strictEqual(internalModuleReadJSON(filename), readFileSync(filename, 'utf8')); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments