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

Unified Diff: runtime/vm/isolate.cc

Issue 73893004: Revert "Fix VM not accepting static methods for Isolate.spawn." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/isolate.h ('k') | tests/isolate/static_function_lib.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/isolate.cc
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index a2a8ede4ebfa5b45a1a1525b9685d61b1dda3a8f..b89db64127603e35e642051b503d8e6f1a61d801 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -996,21 +996,17 @@ IsolateSpawnState::IsolateSpawnState(const Function& func)
: isolate_(NULL),
script_url_(NULL),
library_url_(NULL),
- class_name_(NULL),
function_name_(NULL),
exception_callback_name_(NULL) {
script_url_ = NULL;
const Class& cls = Class::Handle(func.Owner());
+ ASSERT(cls.IsTopLevel());
const Library& lib = Library::Handle(cls.library());
const String& lib_url = String::Handle(lib.url());
library_url_ = strdup(lib_url.ToCString());
const String& func_name = String::Handle(func.name());
function_name_ = strdup(func_name.ToCString());
- if (!cls.IsTopLevel()) {
- const String& class_name = String::Handle(cls.Name());
- class_name_ = strdup(class_name.ToCString());
- }
exception_callback_name_ = strdup("_unhandledExceptionCallback");
}
@@ -1018,7 +1014,6 @@ IsolateSpawnState::IsolateSpawnState(const Function& func)
IsolateSpawnState::IsolateSpawnState(const char* script_url)
: isolate_(NULL),
library_url_(NULL),
- class_name_(NULL),
function_name_(NULL),
exception_callback_name_(NULL) {
script_url_ = strdup(script_url);
@@ -1032,7 +1027,6 @@ IsolateSpawnState::~IsolateSpawnState() {
free(script_url_);
free(library_url_);
free(function_name_);
- free(class_name_);
free(exception_callback_name_);
}
@@ -1054,36 +1048,13 @@ RawObject* IsolateSpawnState::ResolveFunction() {
ASSERT(!lib.IsNull());
// Resolve the function.
- const String& func_name = String::Handle(String::New(function_name()));
-
- if (class_name() == NULL) {
- const Function& func = Function::Handle(lib.LookupLocalFunction(func_name));
- if (func.IsNull()) {
- const String& msg = String::Handle(String::NewFormatted(
- "Unable to resolve function '%s' in library '%s'.",
- function_name(),
- (library_url() != NULL ? library_url() : script_url())));
- return LanguageError::New(msg);
- }
- return func.raw();
- }
-
- const String& cls_name = String::Handle(String::New(class_name()));
- const Class& cls = Class::Handle(lib.LookupLocalClass(cls_name));
- if (cls.IsNull()) {
- const String& msg = String::Handle(String::NewFormatted(
- "Unable to resolve class '%s' in library '%s'.",
- class_name(),
- (library_url() != NULL ? library_url() : script_url())));
- return LanguageError::New(msg);
- }
- const Function& func =
- Function::Handle(cls.LookupStaticFunctionAllowPrivate(func_name));
+ const String& func_name =
+ String::Handle(String::New(function_name()));
+ const Function& func = Function::Handle(lib.LookupLocalFunction(func_name));
if (func.IsNull()) {
const String& msg = String::Handle(String::NewFormatted(
- "Unable to resolve static method '%s.%s' in library '%s'.",
- class_name(), function_name(),
- (library_url() != NULL ? library_url() : script_url())));
+ "Unable to resolve function '%s' in library '%s'.",
+ function_name(), (library_url() ? library_url() : script_url())));
return LanguageError::New(msg);
}
return func.raw();
« no previous file with comments | « runtime/vm/isolate.h ('k') | tests/isolate/static_function_lib.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698