Bug 1290032 - return null for InvalidEnum. r=jgilbert
authorJerryShih <hshih@mozilla.com>
Thu, 28 Jul 2016 17:37:00 +0200
changeset 307334 85b1e566b5b8c665604bd6a866f916ed2f532948
parent 307333 22b93575a3d939787576df00ac185a8e1ece3e17
child 307335 a9d6defe44163d7375df62109877519dc658f845
push id30945
push usercbook@mozilla.com
push dateSat, 30 Jul 2016 14:50:21 +0000
treeherderautoland@9e48f74f44c3 [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: