Bug 1308057 - retvals should start null, and missing return. - r=ethlin
MozReview-Commit-ID: FEOoKQBy7Hk
--- a/dom/canvas/WebGLExtensionDisjointTimerQuery.cpp
+++ b/dom/canvas/WebGLExtensionDisjointTimerQuery.cpp
@@ -144,16 +144,17 @@ WebGLExtensionDisjointTimerQuery::QueryC
query->QueueAvailablity();
}
void
WebGLExtensionDisjointTimerQuery::GetQueryEXT(JSContext* cx, GLenum target,
GLenum pname,
JS::MutableHandle<JS::Value> retval)
{
+ retval.setNull();
if (mIsLost)
return;
mContext->MakeContextCurrent();
switch (pname) {
case LOCAL_GL_CURRENT_QUERY_EXT:
if (target != LOCAL_GL_TIME_ELAPSED_EXT) {
mContext->ErrorInvalidEnumInfo("getQueryEXT: Invalid query target.",
@@ -195,25 +196,27 @@ WebGLExtensionDisjointTimerQuery::GetQue
}
void
WebGLExtensionDisjointTimerQuery::GetQueryObjectEXT(JSContext* cx,
WebGLTimerQuery* query,
GLenum pname,
JS::MutableHandle<JS::Value> retval)
{
+ retval.setNull();
if (mIsLost)
return;
if (!mContext->ValidateObject("getQueryObjectEXT", query))
return;
if (query == mActiveQuery.get()) {
mContext->ErrorInvalidOperation("getQueryObjectEXT: Query must not be"
" active.");
+ return;
}
mContext->MakeContextCurrent();
// XXX: Note that the query result *may change* within the same task!
// This does not follow the specification, which states that all calls
// checking query results must return the same value until the event loop
// is empty.
switch (pname) {