2009-05-01 Sam Weinig <sam@webkit.org>
[WebKit-https.git] / WebCore / bindings / js / JSWorkerContextBase.cpp
index 668252c..c71f45b 100644 (file)
@@ -31,6 +31,7 @@
 
 #include "JSWorkerContextBase.h"
 
+#include "JSWorkerContext.h"
 #include "WorkerContext.h"
 
 using namespace JSC;
@@ -56,6 +57,16 @@ ScriptExecutionContext* JSWorkerContextBase::scriptExecutionContext() const
     return m_impl.get();
 }
 
+JSValue toJS(ExecState*, WorkerContext* workerContext)
+{
+    if (!workerContext)
+        return jsNull();
+    WorkerScriptController* script = workerContext->script();
+    if (!script)
+        return jsNull();
+    return script->workerContextWrapper();
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(WORKERS)