Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 7743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7754 if (name.CharAt(i) == '.') { | 7754 if (name.CharAt(i) == '.') { |
| 7755 if (name.CharAt(i + 1) == '_') { | 7755 if (name.CharAt(i + 1) == '_') { |
| 7756 return true; | 7756 return true; |
| 7757 } | 7757 } |
| 7758 } | 7758 } |
| 7759 } | 7759 } |
| 7760 return false; | 7760 return false; |
| 7761 } | 7761 } |
| 7762 | 7762 |
| 7763 | 7763 |
| 7764 const String& Library::PrivateCoreLibName(const String& member) { | |
| 7765 const Library& core_lib = Library::Handle(Library::CoreLibrary()); | |
| 7766 const String& private_name = String::ZoneHandle(core_lib.PrivateName(member)); | |
| 7767 return private_name; | |
| 7768 } | |
| 7769 | |
| 7770 | |
| 7771 RawClass* Library::LookupCoreClass(const String& class_name) { | |
| 7772 const Library& core_lib = Library::Handle(Library::CoreLibrary()); | |
| 7773 String& name = String::Handle(class_name.raw()); | |
| 7774 if (class_name.CharAt(0) == Scanner::kPrivateIdentifierStart) { | |
| 7775 // Private identifiers are mangled on a per script basis. | |
|
hausner
2013/10/14 23:11:14
per library, not per script
srdjan
2013/10/14 23:19:42
Done, also fixed identical comment in scanner.cc
| |
| 7776 name = String::Concat(name, String::Handle(core_lib.private_key())); | |
| 7777 name = Symbols::New(name); | |
| 7778 } | |
| 7779 return core_lib.LookupClass(name); | |
| 7780 } | |
| 7781 | |
| 7782 | |
| 7764 // Cannot handle qualified names properly as it only appends private key to | 7783 // Cannot handle qualified names properly as it only appends private key to |
| 7765 // the end (e.g. _Alfa.foo -> _Alfa.foo@...). | 7784 // the end (e.g. _Alfa.foo -> _Alfa.foo@...). |
| 7766 RawString* Library::PrivateName(const String& name) const { | 7785 RawString* Library::PrivateName(const String& name) const { |
| 7767 ASSERT(IsPrivate(name)); | 7786 ASSERT(IsPrivate(name)); |
| 7768 // ASSERT(strchr(name, '@') == NULL); | 7787 // ASSERT(strchr(name, '@') == NULL); |
| 7769 String& str = String::Handle(); | 7788 String& str = String::Handle(); |
| 7770 str = name.raw(); | 7789 str = name.raw(); |
| 7771 str = String::Concat(str, String::Handle(this->private_key())); | 7790 str = String::Concat(str, String::Handle(this->private_key())); |
| 7772 str = Symbols::New(str); | 7791 str = Symbols::New(str); |
| 7773 return str.raw(); | 7792 return str.raw(); |
| (...skipping 7709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 15483 return "_MirrorReference"; | 15502 return "_MirrorReference"; |
| 15484 } | 15503 } |
| 15485 | 15504 |
| 15486 | 15505 |
| 15487 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { | 15506 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { |
| 15488 JSONObject jsobj(stream); | 15507 JSONObject jsobj(stream); |
| 15489 } | 15508 } |
| 15490 | 15509 |
| 15491 | 15510 |
| 15492 } // namespace dart | 15511 } // namespace dart |
| OLD | NEW |