mirror of
https://github.com/oven-sh/bun
synced 2026-02-16 13:51:47 +00:00
cpp: audit redundant and problematic uses of JSValue constructor (#20623)
This commit is contained in:
@@ -1029,7 +1029,7 @@ static JSValue fetchESMSourceCode(
|
||||
else if (res->result.value.tag == SyntheticModuleType::ExportsObject) {
|
||||
JSC::JSValue value = JSC::JSValue::decode(res->result.value.jsvalue_for_export);
|
||||
if (!value) {
|
||||
return reject(JSC::JSValue(JSC::createSyntaxError(globalObject, "Failed to parse Object"_s)));
|
||||
return reject(JSC::createSyntaxError(globalObject, "Failed to parse Object"_s));
|
||||
}
|
||||
|
||||
// JSON can become strings, null, numbers, booleans so we must handle "export default 123"
|
||||
@@ -1044,7 +1044,7 @@ static JSValue fetchESMSourceCode(
|
||||
} else if (res->result.value.tag == SyntheticModuleType::ExportDefaultObject) {
|
||||
JSC::JSValue value = JSC::JSValue::decode(res->result.value.jsvalue_for_export);
|
||||
if (!value) {
|
||||
return reject(JSC::JSValue(JSC::createSyntaxError(globalObject, "Failed to parse Object"_s)));
|
||||
return reject(JSC::createSyntaxError(globalObject, "Failed to parse Object"_s));
|
||||
}
|
||||
|
||||
// JSON can become strings, null, numbers, booleans so we must handle "export default 123"
|
||||
|
||||
Reference in New Issue
Block a user