source: webkit/trunk/JavaScriptCore/kjs/completion.h@ 35027

Last change on this file since 35027 was 35022, checked in by [email protected], 17 years ago

2008-07-05 Sam Weinig <[email protected]>

Reviewed by Cameron Zwarich.

First step in broad cleanup effort.

[ File list elided ]

  • Property svn:eol-style set to native
File size: 1.8 KB
Line 
1// -*- c-basic-offset: 2 -*-
2/*
3 * Copyright (C) 1999-2001 Harri Porten ([email protected])
4 * Copyright (C) 2001 Peter Kelly ([email protected])
5 * Copyright (C) 2003, 2007 Apple Inc. All rights reserved.
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
16 *
17 * You should have received a copy of the GNU Library General Public License
18 * along with this library; see the file COPYING.LIB. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
21 *
22 */
23
24#ifndef KJS_COMPLETION_H
25#define KJS_COMPLETION_H
26
27namespace KJS {
28
29 class JSValue;
30
31 enum ComplType { Normal, Break, Continue, ReturnValue, Throw, Interrupted };
32
33 /*
34 * Completion objects are used to convey the return status and value
35 * from functions.
36 */
37 class Completion {
38 public:
39 Completion(ComplType type = Normal, JSValue* value = 0)
40 : m_type(type)
41 , m_value(value)
42 {
43 }
44
45 ComplType complType() const { return m_type; }
46 JSValue* value() const { return m_value; }
47 void setValue(JSValue* v) { m_value = v; }
48 bool isValueCompletion() const { return !!m_value; }
49
50 private:
51 ComplType m_type;
52 JSValue* m_value;
53 };
54
55} // namespace KJS
56
57#endif // KJS_COMPLETION_H
Note: See TracBrowser for help on using the repository browser.