Bug 1290032 - return null for InvalidEnum. r=jgilbert
authorJerryShih <hshih@mozilla.com>
Thu, 28 Jul 2016 17:37:00 +0200
changeset 347298 85b1e566b5b8c665604bd6a866f916ed2f532948
parent 347297 22b93575a3d939787576df00ac185a8e1ece3e17
child 347299 a9d6defe44163d7375df62109877519dc658f845
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert
bugs1290032
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1290032 - return null for InvalidEnum. r=jgilbert
dom/canvas/WebGL2ContextSamplers.cpp
--- a/dom/canvas/WebGL2ContextSamplers.cpp
+++ b/dom/canvas/WebGL2ContextSamplers.cpp
@@ -198,27 +198,27 @@ WebGL2Context::SamplerParameterfv(WebGLS
 
     sampler->SamplerParameter1f(pname, param[0]);
     WebGLContextUnchecked::SamplerParameterfv(sampler, pname, param.Elements());
 }
 
 void
 WebGL2Context::GetSamplerParameter(JSContext*, WebGLSampler* sampler, GLenum pname, JS::MutableHandleValue retval)
 {
+    retval.setNull();
+
     if (IsContextLost())
         return;
 
     if (!sampler || sampler->IsDeleted())
         return ErrorInvalidOperation("getSamplerParameter: invalid sampler");
 
     if (!ValidateSamplerParameterName(pname, "getSamplerParameter"))
         return;
 
-    retval.set(JS::NullValue());
-
     switch (pname) {
     case LOCAL_GL_TEXTURE_MIN_FILTER:
     case LOCAL_GL_TEXTURE_MAG_FILTER:
     case LOCAL_GL_TEXTURE_WRAP_S:
     case LOCAL_GL_TEXTURE_WRAP_T:
     case LOCAL_GL_TEXTURE_WRAP_R:
     case LOCAL_GL_TEXTURE_COMPARE_MODE:
     case LOCAL_GL_TEXTURE_COMPARE_FUNC: