The V8 documentation explicitly states that SnapshotCreator::CreateBlob()
should not be called from within a HandleScope.
Additionally, this patch removes some non-functional error handling code
from the deno_core::Isolate::snapshot() method.
Rewrite "normalize_path()" to remove all intermediate components from the path, ie. "./" and "../". It's very similar in functionality to fs::canonicalize(), however "normalize_path() doesn't resolve symlinks.
Previously, bundles always utilised top level await, even if the bundled
modules didn't require top level await. Now, analysis of the bundle is
done and if none of the bundled modules are asynchronously executed,
then the bundle as a whole will be synchronously executed.
Fixes #4055
Fixes #4123
- Added `ServerRequest.finalize()`: consuming all unread body stream and trailers.
- This is cleanup method for reading next request from same keep-alive connection.
- Needed when handler didn't consume all body and trailers even after responding.
- refactor: `ServerRequest._bodyStream()`, `ServerRequestBody` are removed.
- Now using `bodyReader()` and `chunkedBodyReader()` instead.
- fix: Trailers should only be read `transfer-encoding` is `chunked` and `trailer` header is set and its value is valid.
- fix: use `Headers.append()` on reading trailers.
- fix: delete `trailer` field from headers after reading trailers.
- reorg: Several functions related to IO are moved into `http/io.ts`
This PR introduces the mutex guard for the test cases which depends on the
permission prompt mocking utility. permission_request test cases depend on
the mocked (dummy) value of the permission_prompt result. The value is stored
at static STUB_PROMPT_VALUE: AtomicBool and these test cases share this
value. So we should lock at the start of these test cases.
Before this change cargo test permission failed 6 times out of 20. After this
change, 0 times out of 20 (on my mac).