]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - runtime/Completion.h
JavaScriptCore-1097.3.3.tar.gz
[apple/javascriptcore.git] / runtime / Completion.h
index 63b315e18f639dd84f5ebca8a5dea077f432e320..3d3b86fe44dc5f3573cfc6d86bf64dd147e77004 100644 (file)
 namespace JSC {
 
     class ExecState;
-    class ScopeChain;
+    class ScopeChainNode;
     class SourceCode;
 
-    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*, ScopeChain&, const SourceCode&, JSValue thisValue = JSValue());
+    JS_EXPORT_PRIVATE bool checkSyntax(ExecState*, const SourceCode&, JSValue* exception = 0);
+    JS_EXPORT_PRIVATE JSValue evaluate(ExecState*, ScopeChainNode*, const SourceCode&, JSValue thisValue = JSValue(), JSValue* exception = 0);
 
 } // namespace JSC