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

Side by Side Diff: runtime/vm/object.cc

Issue 23613006: Do not export library prefix names used in a library (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/language/prefix24_lib1.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 7675 matching lines...) Expand 10 before | Expand all | Expand 10 after
7686 return false; 7686 return false;
7687 } 7687 }
7688 7688
7689 7689
7690 RawObject* Namespace::Lookup(const String& name) const { 7690 RawObject* Namespace::Lookup(const String& name) const {
7691 Isolate* isolate = Isolate::Current(); 7691 Isolate* isolate = Isolate::Current();
7692 const Library& lib = Library::Handle(isolate, library()); 7692 const Library& lib = Library::Handle(isolate, library());
7693 intptr_t ignore = 0; 7693 intptr_t ignore = 0;
7694 // Lookup the name in the library's symbols. 7694 // Lookup the name in the library's symbols.
7695 Object& obj = Object::Handle(isolate, lib.LookupEntry(name, &ignore)); 7695 Object& obj = Object::Handle(isolate, lib.LookupEntry(name, &ignore));
7696 if (obj.IsNull()) { 7696 // Library prefixes are not exported.
7697 if (obj.IsNull() || obj.IsLibraryPrefix()) {
7697 // Lookup in the re-exported symbols. 7698 // Lookup in the re-exported symbols.
7698 obj = lib.LookupExport(name); 7699 obj = lib.LookupExport(name);
Ivan Posva 2013/09/03 21:56:06 Wouldn't it be a conflict if the library is re-exp
hausner 2013/09/03 22:19:10 That is part of what Gilad has to clarify for us.
7699 } 7700 }
7700 if (obj.IsNull() || HidesName(name)) { 7701 if (obj.IsNull() || HidesName(name) || obj.IsLibraryPrefix()) {
7701 return Object::null(); 7702 return Object::null();
7702 } 7703 }
7703 return obj.raw(); 7704 return obj.raw();
7704 } 7705 }
7705 7706
7706 7707
7707 RawNamespace* Namespace::New() { 7708 RawNamespace* Namespace::New() {
7708 ASSERT(Object::namespace_class() != Class::null()); 7709 ASSERT(Object::namespace_class() != Class::null());
7709 RawObject* raw = Object::Allocate(Namespace::kClassId, 7710 RawObject* raw = Object::Allocate(Namespace::kClassId,
7710 Namespace::InstanceSize(), 7711 Namespace::InstanceSize(),
(...skipping 7189 matching lines...) Expand 10 before | Expand all | Expand 10 after
14900 } 14901 }
14901 14902
14902 14903
14903 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { 14904 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const {
14904 stream->OpenObject(); 14905 stream->OpenObject();
14905 stream->CloseObject(); 14906 stream->CloseObject();
14906 } 14907 }
14907 14908
14908 14909
14909 } // namespace dart 14910 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/language/prefix24_lib1.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698