blob: 1548710afb8db4b407fd59131c451eecf48db9c7 [file] [log] [blame]
//
// JSRun.h
//
#include "JSRun.h"
JSRun::JSRun(CFStringRef source, JSFlags inFlags)
: JSBase(kJSRunTypeID),
fSource(CFStringToUString(source)),
fGlobalObject(Object(new ObjectImp())),
fInterpreter(fGlobalObject, inFlags),
fFlags(inFlags)
{
}
JSRun::~JSRun()
{
}
JSFlags JSRun::Flags() const
{
return fFlags;
}
UString JSRun::GetSource() const
{
return fSource;
}
Object JSRun::GlobalObject() const
{
return fGlobalObject;
}
JSInterpreter* JSRun::GetInterpreter()
{
return &fInterpreter;
}
Completion JSRun::Evaluate()
{
return fInterpreter.evaluate(fSource);
}
bool JSRun::CheckSyntax()
{
return fInterpreter.checkSyntax(fSource);
}