Index: src/d8.cc |
diff --git a/src/d8.cc b/src/d8.cc |
index ddef1def632d33b6454a4467a00bda3e8aefa7a4..d55faabe8bcc414624f485a9af2c432516185dd6 100644 |
--- a/src/d8.cc |
+++ b/src/d8.cc |
@@ -699,6 +699,11 @@ void Shell::WorkerNew(const v8::FunctionCallbackInfo<v8::Value>& args) { |
return; |
} |
+ if (!args.IsConstructCall()) { |
+ Throw(args.GetIsolate(), "Worker must be constructed with new"); |
+ return; |
+ } |
+ |
{ |
base::LockGuard<base::Mutex> lock_guard(workers_mutex_.Pointer()); |
// Initialize the internal field to NULL; if we return early without |