Bug 1452583 - Demote bogus assertion in dom_genericSetter to runtime check. r=jandem.
authorJason Orendorff <jorendorff@mozilla.com>
Fri, 13 Apr 2018 14:57:24 -0500
changeset 469014 82e125c825cef4f087473e9637a8d5f11c9680d5
parent 468941 31dd07dd000efefc62ae97317ac336aec085ef79
child 469015 a1e3dce97e85597982416ffb9dc8f81ac9c56bc2
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1452583
milestone61.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 1452583 - Demote bogus assertion in dom_genericSetter to runtime check. r=jandem.
js/src/shell/js.cpp
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -7800,19 +7800,18 @@ dom_genericGetter(JSContext* cx, unsigne
     JSJitGetterOp getter = info->getter;
     return getter(cx, obj, val.toPrivate(), JSJitGetterCallArgs(args));
 }
 
 static bool
 dom_genericSetter(JSContext* cx, unsigned argc, JS::Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    MOZ_ASSERT(args.length() == 1);
-
-    if (!args.thisv().isObject()) {
+
+    if (args.length() < 1 || !args.thisv().isObject()) {
         args.rval().setUndefined();
         return true;
     }
 
     RootedObject obj(cx, &args.thisv().toObject());
     if (JS_GetClass(obj) != &dom_class) {
         args.rval().set(UndefinedValue());
         return true;