| Index: runtime/lib/isolate.cc
|
| diff --git a/runtime/lib/isolate.cc b/runtime/lib/isolate.cc
|
| index 9cfcddf0eee6bbc6327b54ad9428e2dd6daa22ce..29ab5b7f2d2fb6bf965a9a50460f2d5e0b2ead7a 100644
|
| --- a/runtime/lib/isolate.cc
|
| +++ b/runtime/lib/isolate.cc
|
| @@ -215,7 +215,7 @@ static RawObject* Spawn(NativeArguments* arguments, IsolateSpawnState* state) {
|
| }
|
|
|
|
|
| -DEFINE_NATIVE_ENTRY(isolate_spawnFunction, 2) {
|
| +DEFINE_NATIVE_ENTRY(isolate_spawnFunction, 1) {
|
| GET_NON_NULL_NATIVE_ARGUMENT(Instance, closure, arguments->NativeArgAt(0));
|
| bool throw_exception = false;
|
| Function& func = Function::Handle();
|
| @@ -235,36 +235,13 @@ DEFINE_NATIVE_ENTRY(isolate_spawnFunction, 2) {
|
| Exceptions::ThrowArgumentError(msg);
|
| }
|
|
|
| - GET_NATIVE_ARGUMENT(Instance, callback, arguments->NativeArgAt(1));
|
| - Function& callback_func = Function::Handle();
|
| - if (callback.IsClosure()) {
|
| - callback_func = Closure::function(callback);
|
| - const Class& cls = Class::Handle(callback_func.Owner());
|
| - if (!callback_func.IsClosureFunction() || !callback_func.is_static() ||
|
| - !cls.IsTopLevel()) {
|
| - throw_exception = true;
|
| - }
|
| - } else if (!callback.IsNull()) {
|
| - throw_exception = true;
|
| - }
|
| - if (throw_exception) {
|
| - const String& msg = String::Handle(String::New(
|
| - "spawnFunction expects to be passed either a unhandled exception "
|
| - "callback to a top-level static function, or null"));
|
| - Exceptions::ThrowArgumentError(msg);
|
| - }
|
| -
|
| #if defined(DEBUG)
|
| Context& ctx = Context::Handle();
|
| ctx = Closure::context(closure);
|
| ASSERT(ctx.num_variables() == 0);
|
| - if (!callback.IsNull()) {
|
| - ctx = Closure::context(callback);
|
| - ASSERT(ctx.num_variables() == 0);
|
| - }
|
| #endif
|
|
|
| - return Spawn(arguments, new IsolateSpawnState(func, callback_func));
|
| + return Spawn(arguments, new IsolateSpawnState(func));
|
| }
|
|
|
|
|
|
|