Bug 1394490 - Allow NSVO as global lexical |this| draft
authorTed Campbell <tcampbell@mozilla.com>
Thu, 31 Aug 2017 16:35:24 -0400
changeset 657510 11e69aea0a32f34009db302f30e463342f66c2a4
parent 657509 67e2d58a689d477be2c6e969ce451d6cb2d67ddb
child 657665 ea1d70dd626939667e531664a8b9eac4c5a8b303
child 657719 0a86b6b44d421c6dc0c514c09f1196d7bc4da0ca
child 657797 d4f1c913d3091bfbbb2af10fc07a8c75baffca41
push id77543
push userbmo:tcampbell@mozilla.com
push dateFri, 01 Sep 2017 15:47:07 +0000
bugs1394490
milestone57.0a1
Bug 1394490 - Allow NSVO as global lexical |this| Allow an NSVO to be a valid |this| target and don't skip over in js::GetThisValue MozReview-Commit-ID: 3goLslCcc2Q
js/src/jsobj.cpp
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -3266,19 +3266,16 @@ js::GetThisValue(JSObject* obj)
     }
 
     if (obj->is<ModuleEnvironmentObject>())
         return UndefinedValue();
 
     if (obj->is<WithEnvironmentObject>())
         return ObjectValue(*obj->as<WithEnvironmentObject>().withThis());
 
-    if (obj->is<NonSyntacticVariablesObject>())
-        return GetThisValue(obj->enclosingEnvironment());
-
     return ObjectValue(*obj);
 }
 
 class GetObjectSlotNameFunctor : public JS::CallbackTracer::ContextFunctor
 {
     JSObject* obj;
 
   public: