diff --git a/js/src/jsproxy.cpp b/js/src/jsproxy.cpp index 4fb93b7398f4..1d2796f0b9b0 100644 --- a/js/src/jsproxy.cpp +++ b/js/src/jsproxy.cpp @@ -237,7 +237,6 @@ BaseProxyHandler::keys(JSContext *cx, HandleObject proxy, AutoIdVector &props) c return false; /* Select only the enumerable properties through in-place iteration. */ - Rooted desc(cx); RootedId id(cx); size_t i = 0; for (size_t j = 0, len = props.length(); j < len; j++) { @@ -247,6 +246,7 @@ BaseProxyHandler::keys(JSContext *cx, HandleObject proxy, AutoIdVector &props) c continue; AutoWaivePolicy policy(cx, proxy, id, BaseProxyHandler::GET); + Rooted desc(cx); if (!getOwnPropertyDescriptor(cx, proxy, id, &desc)) return false; if (desc.object() && desc.isEnumerable())