diff options
Diffstat (limited to 'webkit/port/bindings/v8/V8WorkerCustom.cpp')
-rw-r--r-- | webkit/port/bindings/v8/V8WorkerCustom.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/webkit/port/bindings/v8/V8WorkerCustom.cpp b/webkit/port/bindings/v8/V8WorkerCustom.cpp index 7426383..47be71c 100644 --- a/webkit/port/bindings/v8/V8WorkerCustom.cpp +++ b/webkit/port/bindings/v8/V8WorkerCustom.cpp @@ -34,6 +34,7 @@ #include "v8_binding.h" #include "v8_custom.h" #include "v8_proxy.h" +#include "WorkerContextExecutionProxy.h" #include "ExceptionCode.h" #include "Frame.h" @@ -48,6 +49,11 @@ namespace WebCore { CALLBACK_FUNC_DECL(WorkerConstructor) { INC_STATS(L"DOM.Worker.Constructor"); + if (!WorkerContextExecutionProxy::IsWebWorkersEnabled()) { + V8Proxy::ThrowError(V8Proxy::SYNTAX_ERROR, "Worker is not enabled."); + return v8::Undefined(); + } + if (!args.IsConstructCall()) { V8Proxy::ThrowError(V8Proxy::TYPE_ERROR, "DOM object constructor cannot be called as a function."); |