/*
    This file is part of the WebKit open source project.
    This file has been generated by generate-bindings.pl. DO NOT MODIFY!

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.

    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.
*/

#include "config.h"
#include "JSWorkerGlobalScope.h"

#include "Database.h"
#include "DatabaseSync.h"
#include "Event.h"
#include "EventListener.h"
#include "ExceptionCode.h"
#include "JSBlob.h"
#include "JSDOMBinding.h"
#include "JSDOMURL.h"
#include "JSDatabaseCallback.h"
#include "JSErrorHandler.h"
#include "JSEvent.h"
#include "JSEventListener.h"
#include "JSEventSource.h"
#include "JSMessageEvent.h"
#include "JSWorkerGlobalScope.h"
#include "JSWorkerLocation.h"
#include "JSWorkerNavigator.h"
#include "JSXMLHttpRequest.h"
#include "RuntimeEnabledFeatures.h"
#include "WorkerGlobalScope.h"
#include "WorkerGlobalScopeIndexedDatabase.h"
#include "WorkerGlobalScopeWebDatabase.h"
#include "WorkerLocation.h"
#include "WorkerNavigator.h"
#include <runtime/Error.h>
#include <wtf/GetPtr.h>

#if ENABLE(BLOB)
#include "JSFileReader.h"
#include "JSFileReaderSync.h"
#endif

#if ENABLE(CHANNEL_MESSAGING)
#include "JSMessageChannel.h"
#endif

#if ENABLE(INDEXED_DATABASE)
#include "IDBFactory.h"
#include "JSIDBCursor.h"
#include "JSIDBCursorWithValue.h"
#include "JSIDBDatabase.h"
#include "JSIDBFactory.h"
#include "JSIDBIndex.h"
#include "JSIDBKeyRange.h"
#include "JSIDBObjectStore.h"
#include "JSIDBOpenDBRequest.h"
#include "JSIDBRequest.h"
#include "JSIDBTransaction.h"
#include "JSIDBVersionChangeEvent.h"
#endif

#if ENABLE(SQL_DATABASE)
#include "JSDatabase.h"
#include "JSDatabaseSync.h"
#endif

#if ENABLE(WEB_SOCKETS)
#include "JSWebSocket.h"
#endif

using namespace JSC;

namespace WebCore {

/* Hash table */

static const HashTableValue JSWorkerGlobalScopeTableValues[] =
{
    { "self", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeSelf), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeSelf) },
    { "location", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeLocation), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeLocation) },
    { "onerror", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeOnerror), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeOnerror) },
    { "onoffline", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeOnoffline), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeOnoffline) },
    { "ononline", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeOnonline), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeOnonline) },
    { "navigator", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeNavigator), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeNavigator) },
#if ENABLE(BLOB)
    { "webkitURL", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeWebkitURLConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeWebkitURLConstructor) },
#endif
#if ENABLE(WEB_SOCKETS)
    { "WebSocket", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeWebSocketConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeWebSocketConstructor) },
#endif
#if ENABLE(CHANNEL_MESSAGING)
    { "MessageChannel", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeMessageChannelConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeMessageChannelConstructor) },
#endif
    { "MessageEvent", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeMessageEventConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeMessageEventConstructor) },
    { "Blob", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeBlobConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeBlobConstructor) },
#if ENABLE(BLOB)
    { "FileReader", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeFileReaderConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeFileReaderConstructor) },
#endif
#if ENABLE(BLOB)
    { "FileReaderSync", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeFileReaderSyncConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeFileReaderSyncConstructor) },
#endif
    { "URL", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeURLConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeURLConstructor) },
    { "EventSource", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeEventSourceConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeEventSourceConstructor) },
    { "WorkerGlobalScope", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeWorkerGlobalScopeConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeWorkerGlobalScopeConstructor) },
    { "WorkerLocation", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeWorkerLocationConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeWorkerLocationConstructor) },
    { "XMLHttpRequest", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeXMLHttpRequestConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeXMLHttpRequestConstructor) },
#if ENABLE(INDEXED_DATABASE)
    { "webkitIndexedDB", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeWebkitIndexedDB), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
#endif
#if ENABLE(INDEXED_DATABASE)
    { "webkitIDBCursor", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeWebkitIDBCursorConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeWebkitIDBCursorConstructor) },
#endif
#if ENABLE(INDEXED_DATABASE)
    { "webkitIDBDatabase", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeWebkitIDBDatabaseConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeWebkitIDBDatabaseConstructor) },
#endif
#if ENABLE(INDEXED_DATABASE)
    { "webkitIDBFactory", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeWebkitIDBFactoryConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeWebkitIDBFactoryConstructor) },
#endif
#if ENABLE(INDEXED_DATABASE)
    { "webkitIDBIndex", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeWebkitIDBIndexConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeWebkitIDBIndexConstructor) },
#endif
#if ENABLE(INDEXED_DATABASE)
    { "webkitIDBKeyRange", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeWebkitIDBKeyRangeConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeWebkitIDBKeyRangeConstructor) },
#endif
#if ENABLE(INDEXED_DATABASE)
    { "webkitIDBObjectStore", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeWebkitIDBObjectStoreConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeWebkitIDBObjectStoreConstructor) },
#endif
#if ENABLE(INDEXED_DATABASE)
    { "webkitIDBRequest", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeWebkitIDBRequestConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeWebkitIDBRequestConstructor) },
#endif
#if ENABLE(INDEXED_DATABASE)
    { "webkitIDBTransaction", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeWebkitIDBTransactionConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeWebkitIDBTransactionConstructor) },
#endif
#if ENABLE(INDEXED_DATABASE)
    { "indexedDB", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeIndexedDB), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
#endif
#if ENABLE(INDEXED_DATABASE)
    { "IDBCursor", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeIDBCursorConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeIDBCursorConstructor) },
#endif
#if ENABLE(INDEXED_DATABASE)
    { "IDBCursorWithValue", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeIDBCursorWithValueConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeIDBCursorWithValueConstructor) },
#endif
#if ENABLE(INDEXED_DATABASE)
    { "IDBDatabase", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeIDBDatabaseConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeIDBDatabaseConstructor) },
#endif
#if ENABLE(INDEXED_DATABASE)
    { "IDBFactory", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeIDBFactoryConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeIDBFactoryConstructor) },
#endif
#if ENABLE(INDEXED_DATABASE)
    { "IDBIndex", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeIDBIndexConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeIDBIndexConstructor) },
#endif
#if ENABLE(INDEXED_DATABASE)
    { "IDBKeyRange", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeIDBKeyRangeConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeIDBKeyRangeConstructor) },
#endif
#if ENABLE(INDEXED_DATABASE)
    { "IDBObjectStore", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeIDBObjectStoreConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeIDBObjectStoreConstructor) },
#endif
#if ENABLE(INDEXED_DATABASE)
    { "IDBOpenDBRequest", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeIDBOpenDBRequestConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeIDBOpenDBRequestConstructor) },
#endif
#if ENABLE(INDEXED_DATABASE)
    { "IDBRequest", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeIDBRequestConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeIDBRequestConstructor) },
#endif
#if ENABLE(INDEXED_DATABASE)
    { "IDBTransaction", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeIDBTransactionConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeIDBTransactionConstructor) },
#endif
#if ENABLE(INDEXED_DATABASE)
    { "IDBVersionChangeEvent", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeIDBVersionChangeEventConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeIDBVersionChangeEventConstructor) },
#endif
    { "constructor", DontEnum | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
    { 0, 0, NoIntrinsic, 0, 0 }
};

static const HashTable JSWorkerGlobalScopeTable = { 134, 127, true, JSWorkerGlobalScopeTableValues, 0 };
/* Hash table for constructor */

static const HashTableValue JSWorkerGlobalScopeConstructorTableValues[] =
{
    { 0, 0, NoIntrinsic, 0, 0 }
};

static const HashTable JSWorkerGlobalScopeConstructorTable = { 1, 0, false, JSWorkerGlobalScopeConstructorTableValues, 0 };
static const HashTable& getJSWorkerGlobalScopeConstructorTable(VM& vm)
{
    return getHashTableForGlobalData(vm, JSWorkerGlobalScopeConstructorTable);
}

const ClassInfo JSWorkerGlobalScopeConstructor::s_info = { "WorkerGlobalScopeConstructor", &Base::s_info, 0, getJSWorkerGlobalScopeConstructorTable, CREATE_METHOD_TABLE(JSWorkerGlobalScopeConstructor) };

JSWorkerGlobalScopeConstructor::JSWorkerGlobalScopeConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
    : DOMConstructorObject(structure, globalObject)
{
}

void JSWorkerGlobalScopeConstructor::finishCreation(VM& vm, JSDOMGlobalObject* globalObject)
{
    Base::finishCreation(vm);
    ASSERT(inherits(info()));
    putDirect(vm, vm.propertyNames->prototype, globalObject->prototype(), DontDelete | ReadOnly);
    putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontDelete | DontEnum);
}

bool JSWorkerGlobalScopeConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
{
    return getStaticValueSlot<JSWorkerGlobalScopeConstructor, JSDOMWrapper>(exec, getJSWorkerGlobalScopeConstructorTable(exec->vm()), jsCast<JSWorkerGlobalScopeConstructor*>(object), propertyName, slot);
}

/* Hash table for prototype */

static const HashTableValue JSWorkerGlobalScopePrototypeTableValues[] =
{
    { "close", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsWorkerGlobalScopePrototypeFunctionClose), (intptr_t) (0) },
    { "importScripts", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsWorkerGlobalScopePrototypeFunctionImportScripts), (intptr_t) (0) },
    { "addEventListener", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsWorkerGlobalScopePrototypeFunctionAddEventListener), (intptr_t) (2) },
    { "removeEventListener", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsWorkerGlobalScopePrototypeFunctionRemoveEventListener), (intptr_t) (2) },
    { "dispatchEvent", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsWorkerGlobalScopePrototypeFunctionDispatchEvent), (intptr_t) (1) },
#if ENABLE(SQL_DATABASE)
    { "openDatabase", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsWorkerGlobalScopePrototypeFunctionOpenDatabase), (intptr_t) (4) },
#endif
#if ENABLE(SQL_DATABASE)
    { "openDatabaseSync", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsWorkerGlobalScopePrototypeFunctionOpenDatabaseSync), (intptr_t) (4) },
#endif
    { "setTimeout", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsWorkerGlobalScopePrototypeFunctionSetTimeout), (intptr_t) (1) },
    { "clearTimeout", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsWorkerGlobalScopePrototypeFunctionClearTimeout), (intptr_t) (0) },
    { "setInterval", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsWorkerGlobalScopePrototypeFunctionSetInterval), (intptr_t) (1) },
    { "clearInterval", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsWorkerGlobalScopePrototypeFunctionClearInterval), (intptr_t) (0) },
    { 0, 0, NoIntrinsic, 0, 0 }
};

static const HashTable JSWorkerGlobalScopePrototypeTable = { 35, 31, false, JSWorkerGlobalScopePrototypeTableValues, 0 };
static const HashTable& getJSWorkerGlobalScopePrototypeTable(VM& vm)
{
    return getHashTableForGlobalData(vm, JSWorkerGlobalScopePrototypeTable);
}

const ClassInfo JSWorkerGlobalScopePrototype::s_info = { "WorkerGlobalScopePrototype", &Base::s_info, 0, getJSWorkerGlobalScopePrototypeTable, CREATE_METHOD_TABLE(JSWorkerGlobalScopePrototype) };

bool JSWorkerGlobalScopePrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
{
    JSWorkerGlobalScopePrototype* thisObject = jsCast<JSWorkerGlobalScopePrototype*>(object);
    return getStaticFunctionSlot<JSObject>(exec, getJSWorkerGlobalScopePrototypeTable(exec->vm()), thisObject, propertyName, slot);
}

static const HashTable& getJSWorkerGlobalScopeTable(VM& vm)
{
    return getHashTableForGlobalData(vm, JSWorkerGlobalScopeTable);
}

const ClassInfo JSWorkerGlobalScope::s_info = { "WorkerGlobalScope", &Base::s_info, 0, getJSWorkerGlobalScopeTable , CREATE_METHOD_TABLE(JSWorkerGlobalScope) };

JSWorkerGlobalScope::JSWorkerGlobalScope(VM& vm, Structure* structure, PassRefPtr<WorkerGlobalScope> impl)
    : JSWorkerGlobalScopeBase(vm, structure, impl)
{
}

bool JSWorkerGlobalScope::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
{
    JSWorkerGlobalScope* thisObject = jsCast<JSWorkerGlobalScope*>(object);
    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
    if (thisObject->getOwnPropertySlotDelegate(exec, propertyName, slot))
        return true;
    return getStaticValueSlot<JSWorkerGlobalScope, Base>(exec, getJSWorkerGlobalScopeTable(exec->vm()), thisObject, propertyName, slot);
}

bool JSWorkerGlobalScope::getOwnPropertySlotByIndex(JSObject* object, ExecState* exec, unsigned index, PropertySlot& slot)
{
    JSWorkerGlobalScope* thisObject = jsCast<JSWorkerGlobalScope*>(object);
    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
    PropertyName propertyName = Identifier::from(exec, index);
    if (thisObject->getOwnPropertySlotDelegate(exec, propertyName, slot))
        return true;
    return Base::getOwnPropertySlotByIndex(thisObject, exec, index, slot);
}

EncodedJSValue jsWorkerGlobalScopeSelf(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    WorkerGlobalScope& impl = castedThis->impl();
    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.self()));
    return JSValue::encode(result);
}


EncodedJSValue jsWorkerGlobalScopeLocation(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    WorkerGlobalScope& impl = castedThis->impl();
    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.location()));
    return JSValue::encode(result);
}


EncodedJSValue jsWorkerGlobalScopeOnerror(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    WorkerGlobalScope& impl = castedThis->impl();
    if (EventListener* listener = impl.onerror()) {
        if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
            if (JSObject* jsFunction = jsListener->jsFunction(&impl))
                return JSValue::encode(jsFunction);
        }
    }
    return JSValue::encode(jsNull());
}


EncodedJSValue jsWorkerGlobalScopeOnoffline(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    WorkerGlobalScope& impl = castedThis->impl();
    if (EventListener* listener = impl.onoffline()) {
        if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
            if (JSObject* jsFunction = jsListener->jsFunction(&impl))
                return JSValue::encode(jsFunction);
        }
    }
    return JSValue::encode(jsNull());
}


EncodedJSValue jsWorkerGlobalScopeOnonline(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    WorkerGlobalScope& impl = castedThis->impl();
    if (EventListener* listener = impl.ononline()) {
        if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
            if (JSObject* jsFunction = jsListener->jsFunction(&impl))
                return JSValue::encode(jsFunction);
        }
    }
    return JSValue::encode(jsNull());
}


EncodedJSValue jsWorkerGlobalScopeNavigator(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    WorkerGlobalScope& impl = castedThis->impl();
    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.navigator()));
    return JSValue::encode(result);
}


#if ENABLE(BLOB)
EncodedJSValue jsWorkerGlobalScopeWebkitURLConstructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    return JSValue::encode(JSDOMURL::getConstructor(exec->vm(), castedThis->globalObject()));
}

#endif

#if ENABLE(WEB_SOCKETS)
EncodedJSValue jsWorkerGlobalScopeWebSocketConstructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    if (!RuntimeEnabledFeatures::sharedFeatures().webSocketEnabled())
        return JSValue::encode(jsUndefined());
    return JSValue::encode(JSWebSocket::getConstructor(exec->vm(), castedThis->globalObject()));
}

#endif

#if ENABLE(CHANNEL_MESSAGING)
EncodedJSValue jsWorkerGlobalScopeMessageChannelConstructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    return JSValue::encode(JSMessageChannel::getConstructor(exec->vm(), castedThis->globalObject()));
}

#endif

EncodedJSValue jsWorkerGlobalScopeMessageEventConstructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    return JSValue::encode(JSMessageEvent::getConstructor(exec->vm(), castedThis->globalObject()));
}


EncodedJSValue jsWorkerGlobalScopeBlobConstructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    return JSValue::encode(JSBlob::getConstructor(exec->vm(), castedThis->globalObject()));
}


#if ENABLE(BLOB)
EncodedJSValue jsWorkerGlobalScopeFileReaderConstructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    return JSValue::encode(JSFileReader::getConstructor(exec->vm(), castedThis->globalObject()));
}

#endif

#if ENABLE(BLOB)
EncodedJSValue jsWorkerGlobalScopeFileReaderSyncConstructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    return JSValue::encode(JSFileReaderSync::getConstructor(exec->vm(), castedThis->globalObject()));
}

#endif

EncodedJSValue jsWorkerGlobalScopeURLConstructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    return JSValue::encode(JSDOMURL::getConstructor(exec->vm(), castedThis->globalObject()));
}


EncodedJSValue jsWorkerGlobalScopeEventSourceConstructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    return JSValue::encode(JSEventSource::getConstructor(exec->vm(), castedThis->globalObject()));
}


EncodedJSValue jsWorkerGlobalScopeWorkerGlobalScopeConstructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    return JSValue::encode(JSWorkerGlobalScope::getConstructor(exec->vm(), castedThis->globalObject()));
}


EncodedJSValue jsWorkerGlobalScopeWorkerLocationConstructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    return JSValue::encode(JSWorkerLocation::getConstructor(exec->vm(), castedThis->globalObject()));
}


EncodedJSValue jsWorkerGlobalScopeXMLHttpRequestConstructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    return JSValue::encode(JSXMLHttpRequest::getConstructor(exec->vm(), castedThis->globalObject()));
}


#if ENABLE(INDEXED_DATABASE)
EncodedJSValue jsWorkerGlobalScopeWebkitIndexedDB(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    WorkerGlobalScope& impl = castedThis->impl();
    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(WorkerGlobalScopeIndexedDatabase::indexedDB(&impl)));
    return JSValue::encode(result);
}

#endif

#if ENABLE(INDEXED_DATABASE)
EncodedJSValue jsWorkerGlobalScopeWebkitIDBCursorConstructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    return JSValue::encode(JSIDBCursor::getConstructor(exec->vm(), castedThis->globalObject()));
}

#endif

#if ENABLE(INDEXED_DATABASE)
EncodedJSValue jsWorkerGlobalScopeWebkitIDBDatabaseConstructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    return JSValue::encode(JSIDBDatabase::getConstructor(exec->vm(), castedThis->globalObject()));
}

#endif

#if ENABLE(INDEXED_DATABASE)
EncodedJSValue jsWorkerGlobalScopeWebkitIDBFactoryConstructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    return JSValue::encode(JSIDBFactory::getConstructor(exec->vm(), castedThis->globalObject()));
}

#endif

#if ENABLE(INDEXED_DATABASE)
EncodedJSValue jsWorkerGlobalScopeWebkitIDBIndexConstructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    return JSValue::encode(JSIDBIndex::getConstructor(exec->vm(), castedThis->globalObject()));
}

#endif

#if ENABLE(INDEXED_DATABASE)
EncodedJSValue jsWorkerGlobalScopeWebkitIDBKeyRangeConstructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    return JSValue::encode(JSIDBKeyRange::getConstructor(exec->vm(), castedThis->globalObject()));
}

#endif

#if ENABLE(INDEXED_DATABASE)
EncodedJSValue jsWorkerGlobalScopeWebkitIDBObjectStoreConstructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    return JSValue::encode(JSIDBObjectStore::getConstructor(exec->vm(), castedThis->globalObject()));
}

#endif

#if ENABLE(INDEXED_DATABASE)
EncodedJSValue jsWorkerGlobalScopeWebkitIDBRequestConstructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    return JSValue::encode(JSIDBRequest::getConstructor(exec->vm(), castedThis->globalObject()));
}

#endif

#if ENABLE(INDEXED_DATABASE)
EncodedJSValue jsWorkerGlobalScopeWebkitIDBTransactionConstructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    return JSValue::encode(JSIDBTransaction::getConstructor(exec->vm(), castedThis->globalObject()));
}

#endif

#if ENABLE(INDEXED_DATABASE)
EncodedJSValue jsWorkerGlobalScopeIndexedDB(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    WorkerGlobalScope& impl = castedThis->impl();
    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(WorkerGlobalScopeIndexedDatabase::indexedDB(&impl)));
    return JSValue::encode(result);
}

#endif

#if ENABLE(INDEXED_DATABASE)
EncodedJSValue jsWorkerGlobalScopeIDBCursorConstructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    return JSValue::encode(JSIDBCursor::getConstructor(exec->vm(), castedThis->globalObject()));
}

#endif

#if ENABLE(INDEXED_DATABASE)
EncodedJSValue jsWorkerGlobalScopeIDBCursorWithValueConstructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    return JSValue::encode(JSIDBCursorWithValue::getConstructor(exec->vm(), castedThis->globalObject()));
}

#endif

#if ENABLE(INDEXED_DATABASE)
EncodedJSValue jsWorkerGlobalScopeIDBDatabaseConstructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    return JSValue::encode(JSIDBDatabase::getConstructor(exec->vm(), castedThis->globalObject()));
}

#endif

#if ENABLE(INDEXED_DATABASE)
EncodedJSValue jsWorkerGlobalScopeIDBFactoryConstructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    return JSValue::encode(JSIDBFactory::getConstructor(exec->vm(), castedThis->globalObject()));
}

#endif

#if ENABLE(INDEXED_DATABASE)
EncodedJSValue jsWorkerGlobalScopeIDBIndexConstructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    return JSValue::encode(JSIDBIndex::getConstructor(exec->vm(), castedThis->globalObject()));
}

#endif

#if ENABLE(INDEXED_DATABASE)
EncodedJSValue jsWorkerGlobalScopeIDBKeyRangeConstructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    return JSValue::encode(JSIDBKeyRange::getConstructor(exec->vm(), castedThis->globalObject()));
}

#endif

#if ENABLE(INDEXED_DATABASE)
EncodedJSValue jsWorkerGlobalScopeIDBObjectStoreConstructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    return JSValue::encode(JSIDBObjectStore::getConstructor(exec->vm(), castedThis->globalObject()));
}

#endif

#if ENABLE(INDEXED_DATABASE)
EncodedJSValue jsWorkerGlobalScopeIDBOpenDBRequestConstructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    return JSValue::encode(JSIDBOpenDBRequest::getConstructor(exec->vm(), castedThis->globalObject()));
}

#endif

#if ENABLE(INDEXED_DATABASE)
EncodedJSValue jsWorkerGlobalScopeIDBRequestConstructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    return JSValue::encode(JSIDBRequest::getConstructor(exec->vm(), castedThis->globalObject()));
}

#endif

#if ENABLE(INDEXED_DATABASE)
EncodedJSValue jsWorkerGlobalScopeIDBTransactionConstructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    return JSValue::encode(JSIDBTransaction::getConstructor(exec->vm(), castedThis->globalObject()));
}

#endif

#if ENABLE(INDEXED_DATABASE)
EncodedJSValue jsWorkerGlobalScopeIDBVersionChangeEventConstructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    return JSValue::encode(JSIDBVersionChangeEvent::getConstructor(exec->vm(), castedThis->globalObject()));
}

#endif

EncodedJSValue jsWorkerGlobalScopeConstructor(ExecState* exec, EncodedJSValue thisValue, EncodedJSValue, PropertyName)
{
    JSWorkerGlobalScope* domObject = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!domObject)
        return throwVMTypeError(exec);
    if (!domObject)
        return throwVMTypeError(exec);
    return JSValue::encode(JSWorkerGlobalScope::getConstructor(exec->vm(), domObject->globalObject()));
}

void setJSWorkerGlobalScopeSelf(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    // Shadowing a built-in object
    castedThis->putDirect(exec->vm(), Identifier(exec, "self"), value);
}


void setJSWorkerGlobalScopeLocation(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    // Shadowing a built-in object
    castedThis->putDirect(exec->vm(), Identifier(exec, "location"), value);
}


void setJSWorkerGlobalScopeOnerror(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    UNUSED_PARAM(exec);
    WorkerGlobalScope& impl = castedThis->impl();
    impl.setOnerror(createJSErrorHandler(exec, value, castedThis));
}


void setJSWorkerGlobalScopeOnoffline(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    UNUSED_PARAM(exec);
    WorkerGlobalScope& impl = castedThis->impl();
    impl.setOnoffline(createJSAttributeEventListener(exec, value, castedThis));
}


void setJSWorkerGlobalScopeOnonline(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    UNUSED_PARAM(exec);
    WorkerGlobalScope& impl = castedThis->impl();
    impl.setOnonline(createJSAttributeEventListener(exec, value, castedThis));
}


void setJSWorkerGlobalScopeNavigator(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    // Shadowing a built-in object
    castedThis->putDirect(exec->vm(), Identifier(exec, "navigator"), value);
}


#if ENABLE(BLOB)
void setJSWorkerGlobalScopeWebkitURLConstructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    // Shadowing a built-in constructor
    castedThis->putDirect(exec->vm(), Identifier(exec, "webkitURL"), value);
}

#endif

#if ENABLE(WEB_SOCKETS)
void setJSWorkerGlobalScopeWebSocketConstructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    // Shadowing a built-in constructor
    castedThis->putDirect(exec->vm(), Identifier(exec, "WebSocket"), value);
}

#endif

#if ENABLE(CHANNEL_MESSAGING)
void setJSWorkerGlobalScopeMessageChannelConstructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    // Shadowing a built-in constructor
    castedThis->putDirect(exec->vm(), Identifier(exec, "MessageChannel"), value);
}

#endif

void setJSWorkerGlobalScopeMessageEventConstructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    // Shadowing a built-in constructor
    castedThis->putDirect(exec->vm(), Identifier(exec, "MessageEvent"), value);
}


void setJSWorkerGlobalScopeBlobConstructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    // Shadowing a built-in constructor
    castedThis->putDirect(exec->vm(), Identifier(exec, "Blob"), value);
}


#if ENABLE(BLOB)
void setJSWorkerGlobalScopeFileReaderConstructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    // Shadowing a built-in constructor
    castedThis->putDirect(exec->vm(), Identifier(exec, "FileReader"), value);
}

#endif

#if ENABLE(BLOB)
void setJSWorkerGlobalScopeFileReaderSyncConstructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    // Shadowing a built-in constructor
    castedThis->putDirect(exec->vm(), Identifier(exec, "FileReaderSync"), value);
}

#endif

void setJSWorkerGlobalScopeURLConstructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    // Shadowing a built-in constructor
    castedThis->putDirect(exec->vm(), Identifier(exec, "URL"), value);
}


void setJSWorkerGlobalScopeEventSourceConstructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    // Shadowing a built-in constructor
    castedThis->putDirect(exec->vm(), Identifier(exec, "EventSource"), value);
}


void setJSWorkerGlobalScopeWorkerGlobalScopeConstructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    // Shadowing a built-in constructor
    castedThis->putDirect(exec->vm(), Identifier(exec, "WorkerGlobalScope"), value);
}


void setJSWorkerGlobalScopeWorkerLocationConstructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    // Shadowing a built-in constructor
    castedThis->putDirect(exec->vm(), Identifier(exec, "WorkerLocation"), value);
}


void setJSWorkerGlobalScopeXMLHttpRequestConstructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    // Shadowing a built-in constructor
    castedThis->putDirect(exec->vm(), Identifier(exec, "XMLHttpRequest"), value);
}


#if ENABLE(INDEXED_DATABASE)
void setJSWorkerGlobalScopeWebkitIDBCursorConstructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    // Shadowing a built-in constructor
    castedThis->putDirect(exec->vm(), Identifier(exec, "webkitIDBCursor"), value);
}

#endif

#if ENABLE(INDEXED_DATABASE)
void setJSWorkerGlobalScopeWebkitIDBDatabaseConstructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    // Shadowing a built-in constructor
    castedThis->putDirect(exec->vm(), Identifier(exec, "webkitIDBDatabase"), value);
}

#endif

#if ENABLE(INDEXED_DATABASE)
void setJSWorkerGlobalScopeWebkitIDBFactoryConstructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    // Shadowing a built-in constructor
    castedThis->putDirect(exec->vm(), Identifier(exec, "webkitIDBFactory"), value);
}

#endif

#if ENABLE(INDEXED_DATABASE)
void setJSWorkerGlobalScopeWebkitIDBIndexConstructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    // Shadowing a built-in constructor
    castedThis->putDirect(exec->vm(), Identifier(exec, "webkitIDBIndex"), value);
}

#endif

#if ENABLE(INDEXED_DATABASE)
void setJSWorkerGlobalScopeWebkitIDBKeyRangeConstructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    // Shadowing a built-in constructor
    castedThis->putDirect(exec->vm(), Identifier(exec, "webkitIDBKeyRange"), value);
}

#endif

#if ENABLE(INDEXED_DATABASE)
void setJSWorkerGlobalScopeWebkitIDBObjectStoreConstructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    // Shadowing a built-in constructor
    castedThis->putDirect(exec->vm(), Identifier(exec, "webkitIDBObjectStore"), value);
}

#endif

#if ENABLE(INDEXED_DATABASE)
void setJSWorkerGlobalScopeWebkitIDBRequestConstructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    // Shadowing a built-in constructor
    castedThis->putDirect(exec->vm(), Identifier(exec, "webkitIDBRequest"), value);
}

#endif

#if ENABLE(INDEXED_DATABASE)
void setJSWorkerGlobalScopeWebkitIDBTransactionConstructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    // Shadowing a built-in constructor
    castedThis->putDirect(exec->vm(), Identifier(exec, "webkitIDBTransaction"), value);
}

#endif

#if ENABLE(INDEXED_DATABASE)
void setJSWorkerGlobalScopeIDBCursorConstructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    // Shadowing a built-in constructor
    castedThis->putDirect(exec->vm(), Identifier(exec, "IDBCursor"), value);
}

#endif

#if ENABLE(INDEXED_DATABASE)
void setJSWorkerGlobalScopeIDBCursorWithValueConstructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    // Shadowing a built-in constructor
    castedThis->putDirect(exec->vm(), Identifier(exec, "IDBCursorWithValue"), value);
}

#endif

#if ENABLE(INDEXED_DATABASE)
void setJSWorkerGlobalScopeIDBDatabaseConstructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    // Shadowing a built-in constructor
    castedThis->putDirect(exec->vm(), Identifier(exec, "IDBDatabase"), value);
}

#endif

#if ENABLE(INDEXED_DATABASE)
void setJSWorkerGlobalScopeIDBFactoryConstructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    // Shadowing a built-in constructor
    castedThis->putDirect(exec->vm(), Identifier(exec, "IDBFactory"), value);
}

#endif

#if ENABLE(INDEXED_DATABASE)
void setJSWorkerGlobalScopeIDBIndexConstructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    // Shadowing a built-in constructor
    castedThis->putDirect(exec->vm(), Identifier(exec, "IDBIndex"), value);
}

#endif

#if ENABLE(INDEXED_DATABASE)
void setJSWorkerGlobalScopeIDBKeyRangeConstructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    // Shadowing a built-in constructor
    castedThis->putDirect(exec->vm(), Identifier(exec, "IDBKeyRange"), value);
}

#endif

#if ENABLE(INDEXED_DATABASE)
void setJSWorkerGlobalScopeIDBObjectStoreConstructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    // Shadowing a built-in constructor
    castedThis->putDirect(exec->vm(), Identifier(exec, "IDBObjectStore"), value);
}

#endif

#if ENABLE(INDEXED_DATABASE)
void setJSWorkerGlobalScopeIDBOpenDBRequestConstructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    // Shadowing a built-in constructor
    castedThis->putDirect(exec->vm(), Identifier(exec, "IDBOpenDBRequest"), value);
}

#endif

#if ENABLE(INDEXED_DATABASE)
void setJSWorkerGlobalScopeIDBRequestConstructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    // Shadowing a built-in constructor
    castedThis->putDirect(exec->vm(), Identifier(exec, "IDBRequest"), value);
}

#endif

#if ENABLE(INDEXED_DATABASE)
void setJSWorkerGlobalScopeIDBTransactionConstructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    // Shadowing a built-in constructor
    castedThis->putDirect(exec->vm(), Identifier(exec, "IDBTransaction"), value);
}

#endif

#if ENABLE(INDEXED_DATABASE)
void setJSWorkerGlobalScopeIDBVersionChangeEventConstructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    // Shadowing a built-in constructor
    castedThis->putDirect(exec->vm(), Identifier(exec, "IDBVersionChangeEvent"), value);
}

#endif

JSValue JSWorkerGlobalScope::getConstructor(VM& vm, JSGlobalObject* globalObject)
{
    return getDOMConstructor<JSWorkerGlobalScopeConstructor>(vm, jsCast<JSDOMGlobalObject*>(globalObject));
}

EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopePrototypeFunctionClose(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(thisValue);
    if (!castedThis)
        return throwVMTypeError(exec);
    ASSERT_GC_OBJECT_INHERITS(castedThis, JSWorkerGlobalScope::info());
    WorkerGlobalScope& impl = castedThis->impl();
    impl.close();
    return JSValue::encode(jsUndefined());
}

EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopePrototypeFunctionImportScripts(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(thisValue);
    if (!castedThis)
        return throwVMTypeError(exec);
    ASSERT_GC_OBJECT_INHERITS(castedThis, JSWorkerGlobalScope::info());
    return JSValue::encode(castedThis->importScripts(exec));
}

EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopePrototypeFunctionAddEventListener(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(thisValue);
    if (!castedThis)
        return throwVMTypeError(exec);
    ASSERT_GC_OBJECT_INHERITS(castedThis, JSWorkerGlobalScope::info());
    WorkerGlobalScope& impl = castedThis->impl();
    JSValue listener = exec->argument(1);
    if (!listener.isObject())
        return JSValue::encode(jsUndefined());
    impl.addEventListener(exec->argument(0).toString(exec)->value(exec), JSEventListener::create(asObject(listener), castedThis, false, currentWorld(exec)), exec->argument(2).toBoolean(exec));
    return JSValue::encode(jsUndefined());
}

EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopePrototypeFunctionRemoveEventListener(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(thisValue);
    if (!castedThis)
        return throwVMTypeError(exec);
    ASSERT_GC_OBJECT_INHERITS(castedThis, JSWorkerGlobalScope::info());
    WorkerGlobalScope& impl = castedThis->impl();
    JSValue listener = exec->argument(1);
    if (!listener.isObject())
        return JSValue::encode(jsUndefined());
    impl.removeEventListener(exec->argument(0).toString(exec)->value(exec), JSEventListener::create(asObject(listener), castedThis, false, currentWorld(exec)).get(), exec->argument(2).toBoolean(exec));
    return JSValue::encode(jsUndefined());
}

EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopePrototypeFunctionDispatchEvent(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(thisValue);
    if (!castedThis)
        return throwVMTypeError(exec);
    ASSERT_GC_OBJECT_INHERITS(castedThis, JSWorkerGlobalScope::info());
    WorkerGlobalScope& impl = castedThis->impl();
    if (exec->argumentCount() < 1)
        return throwVMError(exec, createNotEnoughArgumentsError(exec));
    ExceptionCode ec = 0;
    Event* evt(toEvent(exec->argument(0)));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());

    JSC::JSValue result = jsBoolean(impl.dispatchEvent(evt, ec));
    setDOMException(exec, ec);
    return JSValue::encode(result);
}

#if ENABLE(SQL_DATABASE)
EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopePrototypeFunctionOpenDatabase(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(thisValue);
    if (!castedThis)
        return throwVMTypeError(exec);
    ASSERT_GC_OBJECT_INHERITS(castedThis, JSWorkerGlobalScope::info());
    WorkerGlobalScope& impl = castedThis->impl();
    if (exec->argumentCount() < 4)
        return throwVMError(exec, createNotEnoughArgumentsError(exec));
    ExceptionCode ec = 0;
    const String& name(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    const String& version(exec->argument(1).isEmpty() ? String() : exec->argument(1).toString(exec)->value(exec));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    const String& displayName(exec->argument(2).isEmpty() ? String() : exec->argument(2).toString(exec)->value(exec));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    unsigned estimatedSize(toUInt32(exec, exec->argument(3), NormalConversion));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    RefPtr<DatabaseCallback> creationCallback;
    if (!exec->argument(4).isUndefinedOrNull()) {
        if (!exec->uncheckedArgument(4).isFunction())
            return throwVMTypeError(exec);
        creationCallback = JSDatabaseCallback::create(asObject(exec->uncheckedArgument(4)), castedThis->globalObject());
    }

    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(WorkerGlobalScopeWebDatabase::openDatabase(&impl, name, version, displayName, estimatedSize, creationCallback, ec)));
    setDOMException(exec, ec);
    return JSValue::encode(result);
}

#endif

#if ENABLE(SQL_DATABASE)
EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopePrototypeFunctionOpenDatabaseSync(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(thisValue);
    if (!castedThis)
        return throwVMTypeError(exec);
    ASSERT_GC_OBJECT_INHERITS(castedThis, JSWorkerGlobalScope::info());
    WorkerGlobalScope& impl = castedThis->impl();
    if (exec->argumentCount() < 4)
        return throwVMError(exec, createNotEnoughArgumentsError(exec));
    ExceptionCode ec = 0;
    const String& name(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    const String& version(exec->argument(1).isEmpty() ? String() : exec->argument(1).toString(exec)->value(exec));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    const String& displayName(exec->argument(2).isEmpty() ? String() : exec->argument(2).toString(exec)->value(exec));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    unsigned estimatedSize(toUInt32(exec, exec->argument(3), NormalConversion));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    RefPtr<DatabaseCallback> creationCallback;
    if (!exec->argument(4).isUndefinedOrNull()) {
        if (!exec->uncheckedArgument(4).isFunction())
            return throwVMTypeError(exec);
        creationCallback = JSDatabaseCallback::create(asObject(exec->uncheckedArgument(4)), castedThis->globalObject());
    }

    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(WorkerGlobalScopeWebDatabase::openDatabaseSync(&impl, name, version, displayName, estimatedSize, creationCallback, ec)));
    setDOMException(exec, ec);
    return JSValue::encode(result);
}

#endif

EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopePrototypeFunctionSetTimeout(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(thisValue);
    if (!castedThis)
        return throwVMTypeError(exec);
    ASSERT_GC_OBJECT_INHERITS(castedThis, JSWorkerGlobalScope::info());
    return JSValue::encode(castedThis->setTimeout(exec));
}

EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopePrototypeFunctionClearTimeout(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(thisValue);
    if (!castedThis)
        return throwVMTypeError(exec);
    ASSERT_GC_OBJECT_INHERITS(castedThis, JSWorkerGlobalScope::info());
    WorkerGlobalScope& impl = castedThis->impl();
    int handle(toInt32(exec, exec->argument(0), NormalConversion));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    impl.clearTimeout(handle);
    return JSValue::encode(jsUndefined());
}

EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopePrototypeFunctionSetInterval(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(thisValue);
    if (!castedThis)
        return throwVMTypeError(exec);
    ASSERT_GC_OBJECT_INHERITS(castedThis, JSWorkerGlobalScope::info());
    return JSValue::encode(castedThis->setInterval(exec));
}

EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopePrototypeFunctionClearInterval(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    JSWorkerGlobalScope* castedThis = jsDynamicCast<JSWorkerGlobalScope*>(thisValue);
    if (!castedThis)
        return throwVMTypeError(exec);
    ASSERT_GC_OBJECT_INHERITS(castedThis, JSWorkerGlobalScope::info());
    WorkerGlobalScope& impl = castedThis->impl();
    int handle(toInt32(exec, exec->argument(0), NormalConversion));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    impl.clearInterval(handle);
    return JSValue::encode(jsUndefined());
}


}
