cpp: audit redundant and problematic uses of JSValue constructor (#20623)

This commit is contained in:
Meghan Denny
2025-06-24 19:58:44 -08:00
committed by GitHub
parent 61024b2b4a
commit 2072fa1d59
49 changed files with 266 additions and 304 deletions

View File

@@ -252,13 +252,13 @@ JSC_DEFINE_HOST_FUNCTION(jsFunctionNodeModuleCreateRequire,
ERR::INVALID_ARG_VALUE(scope, globalObject,
"filename"_s, argument,
"must be a file URL object, file URL string, or absolute path string"_s);
RELEASE_AND_RETURN(scope, JSValue::encode({}));
RELEASE_AND_RETURN(scope, {});
}
if (!url.protocolIsFile()) {
ERR::INVALID_ARG_VALUE(scope, globalObject,
"filename"_s, argument,
"must be a file URL object, file URL string, or absolute path string"_s);
RELEASE_AND_RETURN(scope, JSValue::encode({}));
RELEASE_AND_RETURN(scope, {});
}
val = url.fileSystemPath();
}