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

Unified Diff: runtime/lib/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 | « no previous file | runtime/vm/isolate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/isolate.cc
diff --git a/runtime/lib/isolate.cc b/runtime/lib/isolate.cc
index ffdc224b0d9f93c86371bb110c4f12f50d8fc0d0..f9000831c29f1d16b636aeb06edaa2f8ae3a23c7 100644
--- a/runtime/lib/isolate.cc
+++ b/runtime/lib/isolate.cc
@@ -220,7 +220,8 @@ DEFINE_NATIVE_ENTRY(Isolate_spawnFunction, 1) {
Function& func = Function::Handle();
if (closure.IsClosure()) {
func = Closure::function(closure);
- if (!(func.IsImplicitClosureFunction() && func.is_static())) {
+ const Class& cls = Class::Handle(func.Owner());
+ if (!func.IsClosureFunction() || !func.is_static() || !cls.IsTopLevel()) {
throw_exception = true;
}
} else {
@@ -228,7 +229,7 @@ DEFINE_NATIVE_ENTRY(Isolate_spawnFunction, 1) {
}
if (throw_exception) {
const String& msg = String::Handle(String::New(
- "Isolate.spawn expects to be passed a static or top-level function"));
+ "Isolate.spawn expects to be passed a top-level function"));
Exceptions::ThrowArgumentError(msg);
}
« no previous file with comments | « no previous file | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698