Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: src/objects.cc

Issue 2919063002: [modules] Teach JSObject::ReferencesObject about module contexts. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/objects.h" 5 #include "src/objects.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <iomanip> 8 #include <iomanip>
9 #include <memory> 9 #include <memory>
10 #include <sstream> 10 #include <sstream>
(...skipping 7369 matching lines...) Expand 10 before | Expand all | Expand 10 after
7380 if (ctxobj->ReferencesObject(obj)) { 7380 if (ctxobj->ReferencesObject(obj)) {
7381 return true; 7381 return true;
7382 } 7382 }
7383 } else if (ctxobj == obj) { 7383 } else if (ctxobj == obj) {
7384 return true; 7384 return true;
7385 } 7385 }
7386 } 7386 }
7387 } 7387 }
7388 7388
7389 // Check the context extension (if any) if it can have references. 7389 // Check the context extension (if any) if it can have references.
7390 if (context->has_extension() && !context->IsCatchContext()) { 7390 if (context->has_extension() && !context->IsCatchContext() &&
7391 !context->IsModuleContext()) {
7391 // With harmony scoping, a JSFunction may have a script context. 7392 // With harmony scoping, a JSFunction may have a script context.
7392 // TODO(mvstanton): walk into the ScopeInfo. 7393 // TODO(mvstanton): walk into the ScopeInfo.
7393 if (context->IsScriptContext()) { 7394 if (context->IsScriptContext()) {
7394 return false; 7395 return false;
7395 } 7396 }
7396 7397
7397 return context->extension_object()->ReferencesObject(obj); 7398 return context->extension_object()->ReferencesObject(obj);
7398 } 7399 }
7399 } 7400 }
7400 7401
(...skipping 13146 matching lines...) Expand 10 before | Expand all | Expand 10 after
20547 // not 20548 // not
20548 // depend on this. 20549 // depend on this.
20549 return DICTIONARY_ELEMENTS; 20550 return DICTIONARY_ELEMENTS;
20550 } 20551 }
20551 DCHECK_LE(kind, LAST_ELEMENTS_KIND); 20552 DCHECK_LE(kind, LAST_ELEMENTS_KIND);
20552 return kind; 20553 return kind;
20553 } 20554 }
20554 } 20555 }
20555 } // namespace internal 20556 } // namespace internal
20556 } // namespace v8 20557 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698