Fix Value::isGCThing footgun, stop returning true for NullValue

This commit is contained in:
trav90 2018-04-07 12:24:30 -05:00 committed by Roy Tam
commit 10b24b8110
31 changed files with 87 additions and 103 deletions

View file

@ -1148,8 +1148,8 @@ EventRunnable::PreDispatch(WorkerPrivate* /* unused */)
} else {
bool doClone = true;
JS::Rooted<JS::Value> transferable(cx);
JS::Rooted<JSObject*> obj(cx, response.isObjectOrNull() ?
response.toObjectOrNull() : nullptr);
JS::Rooted<JSObject*> obj(cx, response.isObject() ?
&response.toObject() : nullptr);
if (obj && JS_IsArrayBufferObject(obj)) {
// Use cached response if the arraybuffer has been transfered.
if (mProxy->mArrayBufferResponseWasTransferred) {