Index: runtime/vm/dart_api_impl.cc |
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc |
index 8d48d15f04c0572a080f3a83ce534b65dc27eda1..9d252f51abc6e38dd2df608e322c9d2772419a34 100644 |
--- a/runtime/vm/dart_api_impl.cc |
+++ b/runtime/vm/dart_api_impl.cc |
@@ -759,14 +759,17 @@ DART_EXPORT bool Dart_CloseNativePort(Dart_Port native_port_id) { |
DART_EXPORT Dart_Handle Dart_NewSendPort(Dart_Port port_id) { |
Isolate* isolate = Isolate::Current(); |
DARTSCOPE(isolate); |
- const String& class_name = String::Handle(String::NewSymbol("SendPortImpl")); |
+ Library& isolate_lib = Library::Handle(Library::IsolateLibrary()); |
+ ASSERT(!isolate_lib.IsNull()); |
+ const String& class_name = |
+ String::Handle(isolate_lib.PrivateName("_SendPortImpl")); |
const String& function_name = String::Handle(String::NewSymbol("_create")); |
const int kNumArguments = 1; |
const Array& kNoArgumentNames = Array::Handle(); |
// TODO(turnidge): Consider adding a helper function to make |
// function resolution by class name and function name more concise. |
const Function& function = Function::Handle( |
- Resolver::ResolveStatic(Library::Handle(Library::CoreLibrary()), |
+ Resolver::ResolveStatic(isolate_lib, |
class_name, |
function_name, |
kNumArguments, |
@@ -783,14 +786,16 @@ DART_EXPORT Dart_Handle Dart_NewSendPort(Dart_Port port_id) { |
DART_EXPORT Dart_Handle Dart_GetReceivePort(Dart_Port port_id) { |
Isolate* isolate = Isolate::Current(); |
DARTSCOPE(isolate); |
+ Library& isolate_lib = Library::Handle(Library::IsolateLibrary()); |
+ ASSERT(!isolate_lib.IsNull()); |
const String& class_name = |
- String::Handle(String::NewSymbol("ReceivePortImpl")); |
+ String::Handle(isolate_lib.PrivateName("_ReceivePortImpl")); |
const String& function_name = |
String::Handle(String::NewSymbol("_get_or_create")); |
const int kNumArguments = 1; |
const Array& kNoArgumentNames = Array::Handle(); |
const Function& function = Function::Handle( |
- Resolver::ResolveStatic(Library::Handle(Library::CoreLibrary()), |
+ Resolver::ResolveStatic(isolate_lib, |
class_name, |
function_name, |
kNumArguments, |