Skip to content

Commit a7d6a6f

Browse files
committed
Added minor inline comments for future reference.
1 parent 1e0cd0a commit a7d6a6f

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

test/NodeJS/NodeJSServiceImplementations/OutOfProcess/Http/HttpNodeJSPoolServiceIntegrationTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,13 @@ public async void FileWatching_RespectsGracefulShutdownOptionWhenItsTrue()
9494
const int dummyNumProcesses = 5;
9595
Uri tempWatchDirectoryUri = CreateWatchDirectoryUri();
9696
// Create initial module
97-
string dummylongRunningTriggerPath = new Uri(tempWatchDirectoryUri, "dummyTriggerFile").LocalPath;
97+
string dummylongRunningTriggerPath = new Uri(tempWatchDirectoryUri, "dummyTriggerFile").LocalPath; // Use LocalPath instead of AbsolutePath, the latter performs URL encoding, which results in paths that are invalid for local use
9898
#if NET461
9999
File.WriteAllText(dummylongRunningTriggerPath, string.Empty); // fs.watch returns immediately if path to watch doesn't exist
100100
#else
101101
await File.WriteAllTextAsync(dummylongRunningTriggerPath, string.Empty).ConfigureAwait(false); // fs.watch returns immediately if path to watch doesn't exist
102102
#endif
103+
// JavascriptEncode.Default.Encode encodes a string so that it can be used as a string literal in Javascript
103104
string dummyInitialModule = $@"module.exports = {{
104105
getPid: (callback) => callback(null, process.pid),
105106
longRunning: (callback) => {{

test/NodeJS/NodeJSServiceImplementations/OutOfProcess/Http/HttpNodeJSServiceIntegrationTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1107,12 +1107,13 @@ public async void FileWatching_RespectsGracefulShutdownOptionWhenItsTrue()
11071107
// Arrange
11081108
Uri tempWatchDirectoryUri = CreateWatchDirectoryUri();
11091109
// Create initial module
1110-
string dummylongRunningTriggerPath = new Uri(tempWatchDirectoryUri, "dummyTriggerFile").LocalPath; // fs.watch can't deal with backslashes in paths
1110+
string dummylongRunningTriggerPath = new Uri(tempWatchDirectoryUri, "dummyTriggerFile").LocalPath; // Use LocalPath instead of AbsolutePath, the latter performs URL encoding, which results in paths that are invalid for local use
11111111
#if NET461
11121112
File.WriteAllText(dummylongRunningTriggerPath, string.Empty); // fs.watch returns immediately if path to watch doesn't exist
11131113
#else
11141114
await File.WriteAllTextAsync(dummylongRunningTriggerPath, string.Empty).ConfigureAwait(false); // fs.watch returns immediately if path to watch doesn't exist
11151115
#endif
1116+
// JavascriptEncode.Default.Encode encodes a string so that it can be used as a string literal in Javascript
11161117
string dummyInitialModule = $@"module.exports = {{
11171118
getPid: (callback) => callback(null, process.pid),
11181119
longRunning: (callback) => {{

0 commit comments

Comments
 (0)