Index: src/d8.cc |
diff --git a/src/d8.cc b/src/d8.cc |
index e165aa47e020e377c713872c552d255ca7acf2f4..3b5accb40f4c0870caf408b124850a2fd5e62d15 100644 |
--- a/src/d8.cc |
+++ b/src/d8.cc |
@@ -704,6 +704,10 @@ void Shell::WorkerNew(const v8::FunctionCallbackInfo<v8::Value>& args) { |
workers_.Add(worker); |
String::Utf8Value function_string(args[0]->ToString()); |
+ if (!*function_string) { |
+ Throw(args.GetIsolate(), "Function.prototype.toString failed"); |
+ return; |
+ } |
worker->StartExecuteInThread(isolate, *function_string); |
} |
} |