| Index: src/d8.cc
|
| diff --git a/src/d8.cc b/src/d8.cc
|
| index 2117825ef4b77b5f89d66934bd3471086e42fd12..7db6f3ed9e442081528e05140bd25b8911e26cb6 100644
|
| --- a/src/d8.cc
|
| +++ b/src/d8.cc
|
| @@ -717,17 +717,14 @@
|
| Isolate* isolate = args.GetIsolate();
|
| HandleScope handle_scope(isolate);
|
| Local<Context> context = isolate->GetCurrentContext();
|
| - Local<Value> this_value;
|
|
|
| if (args.Length() < 1) {
|
| Throw(isolate, "Invalid argument");
|
| return;
|
| }
|
|
|
| - if (args.This()->InternalFieldCount() > 0) {
|
| - this_value = args.This()->GetInternalField(0);
|
| - }
|
| - if (this_value.IsEmpty()) {
|
| + Local<Value> this_value = args.This()->GetInternalField(0);
|
| + if (!this_value->IsExternal()) {
|
| Throw(isolate, "this is not a Worker");
|
| return;
|
| }
|
| @@ -773,11 +770,9 @@
|
| void Shell::WorkerGetMessage(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
| Isolate* isolate = args.GetIsolate();
|
| HandleScope handle_scope(isolate);
|
| - Local<Value> this_value;
|
| - if (args.This()->InternalFieldCount() > 0) {
|
| - this_value = args.This()->GetInternalField(0);
|
| - }
|
| - if (this_value.IsEmpty()) {
|
| +
|
| + Local<Value> this_value = args.This()->GetInternalField(0);
|
| + if (!this_value->IsExternal()) {
|
| Throw(isolate, "this is not a Worker");
|
| return;
|
| }
|
| @@ -800,11 +795,8 @@
|
| void Shell::WorkerTerminate(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
| Isolate* isolate = args.GetIsolate();
|
| HandleScope handle_scope(isolate);
|
| - Local<Value> this_value;
|
| - if (args.This()->InternalFieldCount() > 0) {
|
| - this_value = args.This()->GetInternalField(0);
|
| - }
|
| - if (this_value.IsEmpty()) {
|
| + Local<Value> this_value = args.This()->GetInternalField(0);
|
| + if (!this_value->IsExternal()) {
|
| Throw(isolate, "this is not a Worker");
|
| return;
|
| }
|
|
|