mirror of
https://github.com/oven-sh/bun
synced 2026-02-17 14:22:01 +00:00
cpp: audit redundant and problematic uses of JSValue constructor (#20623)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user