Skip to content

Commit 5fbb553

Browse files
committed
fix: apply review suggestions
1 parent 4475644 commit 5fbb553

2 files changed

Lines changed: 3 additions & 9 deletions

File tree

builtins/web/event/event-target.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ template <typename T> struct GCPolicy<RefPtr<T>> {
123123
}
124124
return true;
125125
}
126+
// RefPtr<T> is allocated on the C++ heap using MakeRefPtr, never in the GC nursery.
126127
static constexpr bool mightBeInNursery() { return false; }
127128
static bool isTenured(const RefPtr<T> & /*unused*/) { return true; }
128129
};

runtime/script_loader.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -340,18 +340,11 @@ bool module_load_hook(JSContext *cx, JS::HandleScript referrer, JS::HandleObject
340340
ref_priv = JS::GetScriptPrivate(referrer);
341341
}
342342

343-
if (ref_priv.isUndefined() || !ref_priv.isObject()) {
344-
JS_ReportErrorASCII(cx, "Module referrer has no private value");
345-
return false;
346-
}
343+
MOZ_ASSERT(ref_priv.isObject(), "Module referrer must have an object private value");
347344

348345
RootedObject info(cx, &ref_priv.toObject());
349346
RootedValue parent_path_val(cx);
350-
if (!JS_GetProperty(cx, info, "id", &parent_path_val)) {
351-
return false;
352-
}
353-
if (!parent_path_val.isString()) {
354-
JS_ReportErrorASCII(cx, "Module referrer has no id property");
347+
if (!JS_GetProperty(cx, info, "id", &parent_path_val) || !parent_path_val.isString()) {
355348
return false;
356349
}
357350

0 commit comments

Comments
 (0)