| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent d8a0f28 commit 64a8843
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -541,6 +541,14 @@ std::optional<SeaConfig> ParseSingleExecutableConfig( | |||
| 541 | 541 | } | |
| 542 | 542 | } | |
| 543 | 543 | ||
| 544 | + if (!document.at_end()) { | ||
| 545 | + FPrintF(stderr, | ||
| 546 | + "Cannot parse JSON from %s: %s\n", | ||
| 547 | + config_path, | ||
| 548 | + simdjson::error_message(simdjson::TRAILING_CONTENT)); | ||
| 549 | + return std::nullopt; | ||
| 550 | + } | ||
| 551 | + | ||
| 544 | 552 | if (static_cast<bool>(result.flags & SeaFlags::kUseSnapshot) && | |
| 545 | 553 | static_cast<bool>(result.flags & SeaFlags::kUseCodeCache)) { | |
| 546 | 554 | // TODO(joyeecheung): code cache in snapshot should be configured by | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -47,6 +47,24 @@ const { spawnSyncAndAssert } = require('../common/child_process'); | |||
| 47 | 47 | }); | |
| 48 | 48 | } | |
| 49 | 49 | ||
| 50 | + { | ||
| 51 | + tmpdir.refresh(); | ||
| 52 | + const config = tmpdir.resolve('trailing-content.json'); | ||
| 53 | + writeFileSync( | ||
| 54 | + config, | ||
| 55 | + '{"main":"bundle.js","output":"sea.blob"}{}', | ||
| 56 | + 'utf8', | ||
| 57 | + ); | ||
| 58 | + spawnSyncAndAssert( | ||
| 59 | + process.execPath, | ||
| 60 | + ['--experimental-sea-config', config], { | ||
| 61 | + cwd: tmpdir.path, | ||
| 62 | + }, { | ||
| 63 | + status: 1, | ||
| 64 | + stderr: /TRAILING_CONTENT/, | ||
| 65 | + }); | ||
| 66 | + } | ||
| 67 | + | ||
| 50 | 68 | { | |
| 51 | 69 | tmpdir.refresh(); | |
| 52 | 70 | const config = tmpdir.resolve('empty.json'); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments