/** @file JSMOMGuideSearchConstructor.cpp
 *
 * Copyright (C) Espial Limited 2015 - Company confidential - All rights reserved.
 *
 */

#include "config.h"

#if ENABLE(RMAI)

#include "JSMOMGuideSearchConstructor.h"

#include "MOMGuideSearch.h"
#include "JSMOMGuideSearch.h"

#include "ScriptExecutionContext.h"
#include <runtime/Error.h>

using namespace JSC;

namespace WebCore {

template<> EncodedJSValue JSC_HOST_CALL JSMOMGuideSearchConstructor::construct(ExecState* exec)
{
	JSMOMGuideSearchConstructor* jsConstructor = jsCast<JSMOMGuideSearchConstructor*>(exec->callee());
    ScriptExecutionContext* context = jsConstructor->scriptExecutionContext();

    if (!context)
        return JSValue::encode(createReferenceError(exec, "MOMGuideSearch constructor associated document is unavailable"));

    return JSValue::encode(toJS(exec, jsConstructor->globalObject(), MOMGuideSearch::create(context)));
}

} // namespace WebCore

#endif // ENABLE(VIDEO)
