X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/14957cd040308e3eeec43d26bae5d76da13fcd85..217a6308cd6a1dc049a0bb69263bd4c91f91c4d0:/runtime/Completion.h diff --git a/runtime/Completion.h b/runtime/Completion.h index 1dd25fd..78f8ac7 100644 --- a/runtime/Completion.h +++ b/runtime/Completion.h @@ -23,40 +23,19 @@ #ifndef Completion_h #define Completion_h -#include "JSValue.h" +#include "JSCJSValue.h" namespace JSC { - + + struct ParserError; class ExecState; - class ScopeChainNode; + class JSScope; class SourceCode; + class VM; - enum ComplType { Normal, Break, Continue, ReturnValue, Throw, Interrupted, Terminated }; - - /* - * Completion objects are used to convey the return status and value - * from functions. - */ - class Completion { - public: - Completion(ComplType type = Normal, JSValue value = JSValue()) - : m_type(type) - , m_value(value) - { - } - - ComplType complType() const { return m_type; } - JSValue value() const { return m_value; } - void setValue(JSValue v) { m_value = v; } - bool isValueCompletion() const { return m_value; } - - private: - ComplType m_type; - JSValue m_value; - }; - - Completion checkSyntax(ExecState*, const SourceCode&); - Completion evaluate(ExecState*, ScopeChainNode*, const SourceCode&, JSValue thisValue = JSValue()); + JS_EXPORT_PRIVATE bool checkSyntax(VM&, const SourceCode&, ParserError&); + JS_EXPORT_PRIVATE bool checkSyntax(ExecState*, const SourceCode&, JSValue* exception = 0); + JS_EXPORT_PRIVATE JSValue evaluate(ExecState*, const SourceCode&, JSValue thisValue = JSValue(), JSValue* exception = 0); } // namespace JSC