source: webkit/trunk/JavaScriptCore/kjs/reference.h@ 15310

Last change on this file since 15310 was 15225, checked in by ggaren, 19 years ago

Reviewed by Maciej.


  • Standardized which functions take a JSContext as an argument. The rule is: if you might execute JavaScript, you take a JSContext, otherwise you don't.


The FIXME in JSObjectRef.h requires refactoring some parts of Interpreter,
but not API changes, so I'm putting it off until later.

  • API/JSCallbackObject.cpp: (KJS::JSCallbackObject::JSCallbackObject): (KJS::JSCallbackObject::init):
  • API/JSCallbackObject.h:
  • API/JSContextRef.cpp: (JSContextCreate):
  • API/JSContextRef.h:
  • API/JSObjectRef.cpp: (JSObjectMake): (JSPropertyEnumeratorGetNext):
  • API/JSObjectRef.h:
  • API/testapi.c: (MyObject_initialize): (main):
  • JavaScriptCore.exp:
  • kjs/array_object.cpp: (ArrayInstance::setLength): (ArrayInstance::pushUndefinedObjectsToEnd):
  • kjs/nodes.cpp: (ForInNode::execute):
  • kjs/reference.cpp: (KJS::Reference::getPropertyName): (KJS::Reference::getValue):
  • kjs/reference.h:
  • kjs/scope_chain.cpp: (KJS::ScopeChain::print):
  • Property svn:eol-style set to native
File size: 1.8 KB
Line 
1// -*- c-basic-offset: 2 -*-
2/*
3 * This file is part of the KDE libraries
4 * Copyright (C) 2003 Apple Computer, Inc
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
15 *
16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20 *
21 */
22
23#ifndef KJS_REFERENCE_H_
24#define KJS_REFERENCE_H_
25
26#include "object.h"
27
28namespace KJS {
29
30 class JSObject;
31
32 class Reference {
33 friend class ReferenceList;
34 friend class ReferenceListIterator;
35 public:
36 Reference(JSObject *b, const Identifier& p);
37 Reference(JSObject *b, unsigned p);
38
39 /**
40 * Performs the GetPropertyName type conversion operation on this value
41 * (ECMA 8.7)
42 */
43 Identifier getPropertyName() const;
44
45 /**
46 * Performs the GetValue type conversion operation on this value
47 * (ECMA 8.7.1)
48 */
49 JSValue *getValue(ExecState *exec) const;
50
51 /**
52 * Performs the PutValue type conversion operation on this value
53 * (ECMA 8.7.1)
54 */
55 bool deleteValue(ExecState *exec);
56
57 protected:
58 JSValue *base;
59
60 private:
61 Reference() { }
62
63 unsigned propertyNameAsNumber;
64 bool propertyNameIsNumber;
65 mutable Identifier prop;
66 };
67
68}
69
70#endif
Note: See TracBrowser for help on using the repository browser.