source: webkit/trunk/JavaScriptCore/kjs/function.h@ 11375

Last change on this file since 11375 was 11375, checked in by mjs, 19 years ago

JavaScriptCore:

Rubber stamped by Eric.

  • renamed SharedPtr to RefPtr via script
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • kjs/function.cpp: (KJS::GlobalFuncImp::callAsFunction):
  • kjs/function.h:
  • kjs/function_object.cpp: (FunctionObjectImp::construct):
  • kjs/internal.cpp: (KJS::Parser::parse): (KJS::InterpreterImp::checkSyntax): (KJS::InterpreterImp::evaluate):
  • kjs/internal.h:
  • kjs/nodes.h:
  • kjs/nodes2string.cpp: (KJS::SourceStream::operator<<):
  • kjs/protect.h:
  • kxmlcore/RefPtr.h: Added. (KXMLCore::RefPtr::RefPtr): (KXMLCore::RefPtr::~RefPtr): (KXMLCore::RefPtr::isNull): (KXMLCore::RefPtr::notNull): (KXMLCore::RefPtr::reset): (KXMLCore::RefPtr::get): (KXMLCore::RefPtr::operator*): (KXMLCore::RefPtr::operator->): (KXMLCore::RefPtr::operator!): (KXMLCore::RefPtr::operator UnspecifiedBoolType): (KXMLCore::::operator): (KXMLCore::operator==): (KXMLCore::operator!=): (KXMLCore::static_pointer_cast): (KXMLCore::const_pointer_cast):
  • kxmlcore/SharedPtr.h: Removed.

WebCore:

Rubber stamped by Eric.

  • renamed SharedPtr to RefPtr via script
  • ForwardingHeaders/kxmlcore/RefPtr.h: Added.
  • ForwardingHeaders/kxmlcore/SharedPtr.h: Removed.
  • khtml/css/css_computedstyle.h:
  • khtml/ecma/XSLTProcessor.cpp: (KJS::XSLTProcessorProtoFunc::callAsFunction):
  • khtml/ecma/XSLTProcessor.h:
  • khtml/ecma/domparser.h:
  • khtml/ecma/kjs_css.h:
  • khtml/ecma/kjs_dom.cpp: (KJS::DOMNamedNodesCollection::DOMNamedNodesCollection): (KJS::DOMNamedNodesCollection::getOwnPropertySlot):
  • khtml/ecma/kjs_dom.h:
  • khtml/ecma/kjs_events.h:
  • khtml/ecma/kjs_html.cpp: (KJS::HTMLDocument::namedItemGetter): (KJS::KJS::HTMLCollection::getNamedItems): (KJS::OptionConstructorImp::construct):
  • khtml/ecma/kjs_html.h:
  • khtml/ecma/kjs_range.h:
  • khtml/ecma/kjs_traversal.h:
  • khtml/ecma/kjs_views.h:
  • khtml/ecma/kjs_window.cpp: (KJS::Window::namedItemGetter):
  • khtml/ecma/xmlhttprequest.h:
  • khtml/editing/SelectionController.cpp: (khtml::SelectionController::toRange):
  • khtml/editing/SelectionController.h:
  • khtml/editing/apply_style_command.cpp: (khtml::StyleChange::init): (khtml::StyleChange::currentlyHasStyle): (khtml::ApplyStyleCommand::doApply): (khtml::ApplyStyleCommand::applyRelativeFontStyleChange): (khtml::ApplyStyleCommand::removeCSSStyle): (khtml::hasTextDecorationProperty): (khtml::ApplyStyleCommand::extractTextDecorationStyle): (khtml::ApplyStyleCommand::extractAndNegateTextDecorationStyle): (khtml::ApplyStyleCommand::pushDownTextDecorationStyleAroundNode): (khtml::ApplyStyleCommand::removeInlineStyle): (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): (khtml::ApplyStyleCommand::computedFontSize):
  • khtml/editing/apply_style_command.h:
  • khtml/editing/edit_command.cpp: (khtml::EditCommandPtr::EditCommandPtr): (khtml::EditCommandPtr::operator=):
  • khtml/editing/edit_command.h:
  • khtml/editing/markup.cpp: (khtml::startMarkup):
  • khtml/editing/visible_position.cpp: (khtml::makeRange):
  • khtml/editing/visible_position.h:
  • khtml/editing/visible_range.h:
  • khtml/editing/visible_text.cpp: (khtml::TextIterator::range): (khtml::SimplifiedBackwardsTextIterator::range): (khtml::CharacterIterator::range): (khtml::TextIterator::rangeFromLocationAndLength): (khtml::findPlainText):
  • khtml/editing/visible_text.h: (khtml::WordAwareIterator::range):
  • khtml/editing/visible_units.cpp: (khtml::previousBoundary): (khtml::nextBoundary):
  • khtml/html/html_elementimpl.cpp: (HTMLElementImpl::children):
  • khtml/html/html_elementimpl.h:
  • khtml/html/html_formimpl.cpp: (DOM::HTMLFormElementImpl::elements): (DOM::HTMLSelectElementImpl::add): (DOM::HTMLSelectElementImpl::optionsHTMLCollection):
  • khtml/html/html_formimpl.h:
  • khtml/html/html_imageimpl.cpp: (DOM::HTMLMapElementImpl::areas):
  • khtml/html/html_imageimpl.h:
  • khtml/html/html_miscimpl.cpp: (DOM::HTMLCollectionImpl::namedItems):
  • khtml/html/html_miscimpl.h:
  • khtml/html/html_tableimpl.cpp: (DOM::HTMLTableElementImpl::rows): (DOM::HTMLTableElementImpl::tBodies): (DOM::HTMLTableSectionElementImpl::insertRow): (DOM::HTMLTableSectionElementImpl::deleteRow): (DOM::HTMLTableSectionElementImpl::rows): (DOM::HTMLTableRowElementImpl::insertCell): (DOM::HTMLTableRowElementImpl::deleteCell): (DOM::HTMLTableRowElementImpl::cells):
  • khtml/html/html_tableimpl.h:
  • khtml/html/htmlparser.cpp: (HTMLParser::parseToken): (HTMLParser::insertNode):
  • khtml/khtml_events.h:
  • khtml/khtml_part.cpp: (KHTMLPart::selectionHasStyle): (KHTMLPart::selectionStartHasStyle): (KHTMLPart::selectionComputedStyle): (KHTMLPart::applyEditingStyleToBodyElement): (KHTMLPart::removeEditingStyleFromBodyElement):
  • khtml/khtmlpart_p.h:
  • khtml/khtmlview.cpp: (KHTMLView::viewportMousePressEvent): (KHTMLView::viewportMouseDoubleClickEvent): (KHTMLView::viewportMouseReleaseEvent): (KHTMLView::dispatchMouseEvent):
  • khtml/misc/shared.h:
  • khtml/rendering/bidi.cpp:
  • khtml/rendering/render_block.cpp: (khtml::RenderBlock::updateFirstLetter):
  • khtml/rendering/render_line.h:
  • khtml/rendering/render_text.cpp: (RenderText::setStyle): (RenderText::originalString): (RenderTextFragment::originalString):
  • khtml/rendering/render_text.h:
  • khtml/xml/dom2_eventsimpl.h:
  • khtml/xml/dom2_rangeimpl.cpp: (DOM::rangeOfContents):
  • khtml/xml/dom2_rangeimpl.h:
  • khtml/xml/dom_docimpl.cpp: (DocumentImpl::adoptNode): (DocumentImpl::setFocusNode): (DocumentImpl::addMarker): (DocumentImpl::removeMarkers): (DocumentImpl::applyXSLTransform): (DocumentImpl::images): (DocumentImpl::applets): (DocumentImpl::embeds): (DocumentImpl::objects): (DocumentImpl::links): (DocumentImpl::forms): (DocumentImpl::anchors): (DocumentImpl::all): (DocumentImpl::windowNamedItems): (DocumentImpl::documentNamedItems): (DocumentImpl::getElementsByName):
  • khtml/xml/dom_docimpl.h: (DOM::DocumentImpl::transformSourceDocument):
  • khtml/xml/dom_elementimpl.cpp: (ElementImpl::setAttributeNode): (ElementImpl::removeAttributeNode): (NamedAttrMapImpl::removeNamedItemNS): (NamedAttrMapImpl::setNamedItem): (NamedAttrMapImpl::removeNamedItem):
  • khtml/xml/dom_elementimpl.h: (DOM::ElementImpl::setAttributeNodeNS):
  • khtml/xml/dom_nodeimpl.cpp: (DOM::NodeImpl::childNodes): (DOM::NodeImpl::dispatchWindowEvent): (DOM::NodeImpl::dispatchMouseEvent): (DOM::NodeImpl::getElementsByTagNameNS): (DOM::ContainerNodeImpl::insertBefore): (DOM::ContainerNodeImpl::replaceChild): (DOM::ContainerNodeImpl::appendChild): (DOM::ContainerNodeImpl::addChild):
  • khtml/xml/dom_nodeimpl.h: (DOM::NodeImpl::getElementsByTagName): (DOM::NamedNodeMapImpl::removeNamedItem): (DOM::NamedNodeMapImpl::setNamedItemNS):
  • khtml/xml/dom_xmlimpl.h:
  • khtml/xsl/xslt_processorimpl.cpp: (DOM::XSLTProcessorImpl::createDocumentFromSource): (DOM::createFragmentFromSource): (DOM::xsltStylesheetPointer): (DOM::xmlDocPtrFromNode): (DOM::XSLTProcessorImpl::transformToString): (DOM::XSLTProcessorImpl::transformToDocument): (DOM::XSLTProcessorImpl::transformToFragment): (DOM::XSLTProcessorImpl::getParameter):
  • khtml/xsl/xslt_processorimpl.h:
  • kwq/KWQClipboard.h:
  • kwq/KWQKHTMLPart.h:
  • kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::findString): (KWQKHTMLPart::advanceToNextMisspelling): (KWQKHTMLPart::fontForSelection): (KWQKHTMLPart::markMisspellings): (KWQKHTMLPart::shouldClose):
  • kwq/WebCoreBridge.mm: (-[WebCoreBridge convertToNSRange:DOM::]):
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.6 KB
Line 
1// -*- c-basic-offset: 2 -*-
2/*
3 * This file is part of the KDE libraries
4 * Copyright (C) 1999-2000 Harri Porten ([email protected])
5 * Copyright (C) 2003 Apple Computer, Inc.
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 Steet, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
21 *
22 */
23
24#ifndef _KJS_FUNCTION_H_
25#define _KJS_FUNCTION_H_
26
27#include "internal.h"
28#include "array_instance.h"
29
30namespace KJS {
31
32 class Parameter;
33 class ActivationImp;
34
35 /**
36 * @short Implementation class for internal Functions.
37 */
38 class FunctionImp : public InternalFunctionImp {
39 friend class ActivationImp;
40 public:
41 FunctionImp(ExecState *exec, const Identifier &n = Identifier::null());
42 virtual ~FunctionImp();
43
44 virtual bool getOwnPropertySlot(ExecState *, const Identifier &, PropertySlot&);
45 virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
46 virtual bool deleteProperty(ExecState *exec, const Identifier &propertyName);
47
48 virtual bool implementsCall() const;
49 virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
50
51 void addParameter(const Identifier &n);
52 Identifier getParameterName(int index);
53 // parameters in string representation, e.g. (a, b, c)
54 UString parameterString() const;
55 virtual CodeType codeType() const = 0;
56
57 virtual Completion execute(ExecState *exec) = 0;
58 Identifier name() const { return ident; }
59
60 virtual const ClassInfo *classInfo() const { return &info; }
61 static const ClassInfo info;
62 protected:
63 Parameter *param;
64 Identifier ident;
65
66 private:
67 static ValueImp *argumentsGetter(ExecState *, const Identifier &, const PropertySlot&);
68 static ValueImp *lengthGetter(ExecState *, const Identifier &, const PropertySlot&);
69
70 void processParameters(ExecState *exec, const List &);
71 virtual void processVarDecls(ExecState *exec);
72 };
73
74 class DeclaredFunctionImp : public FunctionImp {
75 public:
76 DeclaredFunctionImp(ExecState *exec, const Identifier &n,
77 FunctionBodyNode *b, const ScopeChain &sc);
78
79 bool implementsConstruct() const;
80 ObjectImp *construct(ExecState *exec, const List &args);
81
82 virtual Completion execute(ExecState *exec);
83 CodeType codeType() const { return FunctionCode; }
84 RefPtr<FunctionBodyNode> body;
85
86 virtual const ClassInfo *classInfo() const { return &info; }
87 static const ClassInfo info;
88 private:
89 virtual void processVarDecls(ExecState *exec);
90 };
91
92 class IndexToNameMap {
93 public:
94 IndexToNameMap(FunctionImp *func, const List &args);
95 ~IndexToNameMap();
96
97 Identifier& operator[](int index);
98 Identifier& operator[](const Identifier &indexIdentifier);
99 bool isMapped(const Identifier &index) const;
100 void IndexToNameMap::unMap(const Identifier &index);
101
102 private:
103 IndexToNameMap(); // prevent construction w/o parameters
104 int size;
105 Identifier * _map;
106 };
107
108 class ArgumentsImp : public ObjectImp {
109 public:
110 ArgumentsImp(ExecState *exec, FunctionImp *func, const List &args, ActivationImp *act);
111 virtual void mark();
112 virtual bool getOwnPropertySlot(ExecState *, const Identifier &, PropertySlot&);
113 virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
114 virtual bool deleteProperty(ExecState *exec, const Identifier &propertyName);
115 virtual const ClassInfo *classInfo() const { return &info; }
116 static const ClassInfo info;
117 private:
118 static ValueImp *mappedIndexGetter(ExecState *exec, const Identifier &, const PropertySlot& slot);
119
120 ActivationImp *_activationObject;
121 mutable IndexToNameMap indexToNameMap;
122 };
123
124 class ActivationImp : public ObjectImp {
125 public:
126 ActivationImp(FunctionImp *function, const List &arguments);
127
128 virtual bool getOwnPropertySlot(ExecState *exec, const Identifier &, PropertySlot&);
129 virtual bool deleteProperty(ExecState *exec, const Identifier &propertyName);
130
131 virtual const ClassInfo *classInfo() const { return &info; }
132 static const ClassInfo info;
133
134 virtual void mark();
135
136 bool isActivation() { return true; }
137 private:
138 static PropertySlot::GetValueFunc getArgumentsGetter();
139 static ValueImp *argumentsGetter(ExecState *exec, const Identifier &, const PropertySlot& slot);
140 void createArgumentsObject(ExecState *exec) const;
141
142 FunctionImp *_function;
143 List _arguments;
144 mutable ArgumentsImp *_argumentsObject;
145 };
146
147 class GlobalFuncImp : public InternalFunctionImp {
148 public:
149 GlobalFuncImp(ExecState *exec, FunctionPrototypeImp *funcProto, int i, int len);
150 virtual bool implementsCall() const;
151 virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
152 virtual CodeType codeType() const;
153 enum { Eval, ParseInt, ParseFloat, IsNaN, IsFinite, Escape, UnEscape,
154 DecodeURI, DecodeURIComponent, EncodeURI, EncodeURIComponent
155#ifndef NDEBUG
156 , KJSPrint
157#endif
158};
159 private:
160 int id;
161 };
162
163
164
165} // namespace
166
167#endif
Note: See TracBrowser for help on using the repository browser.