@@ -29,15 +29,14 @@ void AsyncWork(uv_work_t *req) {
2929// this function will be run inside the main event loop
3030// so it is safe to use V8 again
3131void AsyncAfter (uv_work_t *req) {
32- Isolate* isolate = Isolate::GetCurrent ();
33- HandleScope scope (isolate);
32+ HandleScope scope;
3433
3534 // fetch our data structure
3635 AsyncData *asyncData = (AsyncData *)req->data ;
3736 // create an arguments array for the callback
3837 Handle<Value> argv[] = {
3938 Null (),
40- Number::New (isolate, asyncData->estimate )
39+ Number::New (asyncData->estimate )
4140 };
4241
4342 // surround in a try/catch for safety
@@ -49,16 +48,15 @@ void AsyncAfter(uv_work_t *req) {
4948
5049 // dispose the Persistent handle so the callback
5150 // function can be garbage-collected
52- asyncData->callback .Dispose (isolate );
51+ asyncData->callback .Dispose ();
5352 // clean up any memory we allocated
5453 delete asyncData;
5554 delete req;
5655}
5756
5857// Asynchronous access to the `Estimate()` function
5958Handle<Value> CalculateAsync (const Arguments& args) {
60- Isolate* isolate = Isolate::GetCurrent ();
61- HandleScope scope (isolate);
59+ HandleScope scope;
6260
6361 // create an async work token
6462 uv_work_t *req = new uv_work_t ;
@@ -71,7 +69,7 @@ Handle<Value> CalculateAsync(const Arguments& args) {
7169 // expect a function as the second argument
7270 // we create a Persistent reference to it so
7371 // it won't be garbage-collected
74- asyncData->callback = Persistent<Function>::New (isolate,
72+ asyncData->callback = Persistent<Function>::New (
7573 Local<Function>::Cast (args[1 ]));
7674
7775 // pass the work token to libuv to be run when a
0 commit comments