mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
fix: serve handler error with 0 arguments (#23652)
Fixes https://github.com/denoland/deno/issues/23651 Co-authored-by: Satya Rohith <me@satyarohith.com>
This commit is contained in:
parent
20cb0e8863
commit
812f2e4c22
4 changed files with 52 additions and 4 deletions
|
@ -793,9 +793,9 @@ internals.serveHttpOnConnection = serveHttpOnConnection;
|
|||
|
||||
function registerDeclarativeServer(exports) {
|
||||
if (ObjectHasOwn(exports, "fetch")) {
|
||||
if (typeof exports.fetch !== "function" || exports.fetch.length !== 1) {
|
||||
if (typeof exports.fetch !== "function") {
|
||||
throw new TypeError(
|
||||
"Invalid type for fetch: must be a function with a single parameter",
|
||||
"Invalid type for fetch: must be a function with a single or no parameter",
|
||||
);
|
||||
}
|
||||
return ({ servePort, serveHost }) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue