From c32ad86171e174bb1904b76966920d3224f212d4 Mon Sep 17 00:00:00 2001 From: Cameron Kaiser Date: Tue, 8 Aug 2017 17:36:29 -0700 Subject: [PATCH] M1329323 --- dom/base/nsGlobalWindow.cpp | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index dd349274f..e80ba6ab9 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -810,9 +810,6 @@ nsOuterWindowProxy::getOwnPropertyDescriptor(JSContext* cx, } // else fall through to js::Wrapper - // When we change this to always claim the property is configurable (bug - // 1178639), update the comments in nsOuterWindowProxy::defineProperty - // accordingly. return js::Wrapper::getOwnPropertyDescriptor(cx, proxy, id, desc); } @@ -831,29 +828,6 @@ nsOuterWindowProxy::defineProperty(JSContext* cx, return result.failCantDefineWindowElement(); } -#ifndef RELEASE_BUILD // To be turned on in bug 1178638. - // For now, allow chrome code to define non-configurable properties - // on windows, until we sort out what exactly the addon SDK is - // doing. In the meantime, this still allows us to test web compat - // behavior. - if (desc.hasConfigurable() && !desc.configurable() && - !nsContentUtils::IsCallerChrome()) { - return ThrowErrorMessage(cx, MSG_DEFINE_NON_CONFIGURABLE_PROP_ON_WINDOW); - } - - // Note that if hasConfigurable() is false we do NOT want to - // setConfigurable(true). That would make this code: - // - // var x; - // window.x = 5; - // - // fail, because the JS engine ends up converting the assignment into a define - // with !hasConfigurable(), but the var actually declared a non-configurable - // property on our underlying Window object, so the set would fail if we - // forced setConfigurable(true) here. What we want to do instead is change - // getOwnPropertyDescriptor to always claim configurable. See bug 1178639. -#endif - return js::Wrapper::defineProperty(cx, proxy, id, desc, result); }