Bug 1398601 - Don't allow NSVO in js::CreateObjectsForEnvironmentChain r=jorendorff
☠☠ backed out by a45742d015d3 ☠ ☠
authorTed Campbell <tcampbell@mozilla.com>
Sat, 09 Sep 2017 20:37:18 -0400
changeset 429932 b728872f4d9ad911854b90ca9893cdb7604fa9bf
parent 429931 05957a92b1a56cbf8f7c71afa4fef2b3f46b2ae3
child 429933 82f171552905ea7bdbc60688db5b4aad3a3f4b95
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs1398601
milestone57.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 1398601 - Don't allow NSVO in js::CreateObjectsForEnvironmentChain r=jorendorff Seeing an NSVO in CreateObjectsForEnvironmentChain indicates the shared global namespace is about to be polluted, so fix those bugs and turn this to a diagnostic. MozReview-Commit-ID: 7OUef76geJL
js/src/vm/EnvironmentObject.cpp
--- a/js/src/vm/EnvironmentObject.cpp
+++ b/js/src/vm/EnvironmentObject.cpp
@@ -3182,17 +3182,18 @@ js::GetDebugEnvironmentForGlobalLexicalE
 
 bool
 js::CreateObjectsForEnvironmentChain(JSContext* cx, AutoObjectVector& chain,
                                      HandleObject terminatingEnv, MutableHandleObject envObj)
 {
 #ifdef DEBUG
     for (size_t i = 0; i < chain.length(); ++i) {
         assertSameCompartment(cx, chain[i]);
-        MOZ_ASSERT(!chain[i]->is<GlobalObject>());
+        MOZ_ASSERT(!chain[i]->is<GlobalObject>() &&
+                   !chain[i]->is<NonSyntacticVariablesObject>());
     }
 #endif
 
     // Construct With object wrappers for the things on this environment chain
     // and use the result as the thing to scope the function to.
     Rooted<WithEnvironmentObject*> withEnv(cx);
     RootedObject enclosingEnv(cx, terminatingEnv);
     for (size_t i = chain.length(); i > 0; ) {