| Index: runtime/vm/object.cc
|
| diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
|
| index af8695abcf43b802c1adeeeed8abc8553a5c65a3..c6674c0637633b451a3f4dfce9074c8711835b65 100644
|
| --- a/runtime/vm/object.cc
|
| +++ b/runtime/vm/object.cc
|
| @@ -444,6 +444,8 @@ RawClass* Object::CreateAndRegisterInterface(const char* cname,
|
| void Object::RegisterClass(const Class& cls,
|
| const String& name,
|
| const Library& lib) {
|
| + ASSERT(name.Length() > 0);
|
| + ASSERT(name.CharAt(0) != '_');
|
| cls.set_name(name);
|
| lib.AddClass(cls);
|
| }
|
| @@ -452,6 +454,8 @@ void Object::RegisterClass(const Class& cls,
|
| void Object::RegisterPrivateClass(const Class& cls,
|
| const String& public_class_name,
|
| const Library& lib) {
|
| + ASSERT(public_class_name.Length() > 0);
|
| + ASSERT(public_class_name.CharAt(0) == '_');
|
| String& str = String::Handle();
|
| str = lib.PrivateName(public_class_name);
|
| cls.set_name(str);
|
| @@ -624,12 +628,6 @@ RawError* Object::Init(Isolate* isolate) {
|
| RegisterClass(cls, name, core_impl_lib);
|
| pending_classes.Add(cls, Heap::kOld);
|
|
|
| - cls = Class::New<WeakProperty>();
|
| - object_store->set_weak_property_class(cls);
|
| - name = Symbols::WeakProperty();
|
| - RegisterClass(cls, name, core_impl_lib);
|
| - pending_classes.Add(cls, Heap::kOld);
|
| -
|
| // Initialize the base interfaces used by the core VM classes.
|
| const Script& script = Script::Handle(Bootstrap::LoadCoreScript(false));
|
|
|
| @@ -747,6 +745,11 @@ RawError* Object::Init(Isolate* isolate) {
|
| name = Symbols::_ExternalFloat64Array();
|
| RegisterPrivateClass(cls, name, core_lib);
|
|
|
| + cls = Class::New<WeakProperty>();
|
| + object_store->set_weak_property_class(cls);
|
| + name = Symbols::_WeakProperty();
|
| + RegisterPrivateClass(cls, name, core_lib);
|
| +
|
| // Set the super type of class Stacktrace to Object type so that the
|
| // 'toString' method is implemented.
|
| cls = object_store->stacktrace_class();
|
| @@ -11144,7 +11147,7 @@ RawWeakProperty* WeakProperty::New(Heap::Space space) {
|
|
|
|
|
| const char* WeakProperty::ToCString() const {
|
| - return "WeakProperty";
|
| + return "_WeakProperty";
|
| }
|
|
|
| } // namespace dart
|
|
|