webengine/osswebengine/DerivedSources/WebCore/JSComment.cpp
changeset 0 dd21522fd290
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2     This file is part of the WebKit open source project.
       
     3     This file has been generated by generate-bindings.pl. DO NOT MODIFY!
       
     4 
       
     5     This library is free software; you can redistribute it and/or
       
     6     modify it under the terms of the GNU Library General Public
       
     7     License as published by the Free Software Foundation; either
       
     8     version 2 of the License, or (at your option) any later version.
       
     9 
       
    10     This library is distributed in the hope that it will be useful,
       
    11     but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
       
    13     Library General Public License for more details.
       
    14 
       
    15     You should have received a copy of the GNU Library General Public License
       
    16     along with this library; see the file COPYING.LIB.  If not, write to
       
    17     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
       
    18     Boston, MA 02110-1301, USA.
       
    19 */
       
    20 
       
    21 #include "config.h"
       
    22 
       
    23 #include "JSComment.h"
       
    24 
       
    25 #include <wtf/GetPtr.h>
       
    26 
       
    27 #include "Comment.h"
       
    28 
       
    29 using namespace KJS;
       
    30 
       
    31 namespace WebCore {
       
    32 
       
    33 /* Hash table */
       
    34 
       
    35 static const HashEntry JSCommentTableEntries[] =
       
    36 {
       
    37     { "constructor", JSComment::ConstructorAttrNum, DontDelete|DontEnum|ReadOnly, 0, 0 }
       
    38 };
       
    39 
       
    40 static const HashTable JSCommentTable = 
       
    41 {
       
    42     2, 1, JSCommentTableEntries, 1
       
    43 };
       
    44 
       
    45 /* Hash table for constructor */
       
    46 
       
    47 static const HashEntry JSCommentConstructorTableEntries[] =
       
    48 {
       
    49     { 0, 0, 0, 0, 0 }
       
    50 };
       
    51 
       
    52 static const HashTable JSCommentConstructorTable = 
       
    53 {
       
    54     2, 1, JSCommentConstructorTableEntries, 1
       
    55 };
       
    56 
       
    57 class JSCommentConstructor : public DOMObject {
       
    58 public:
       
    59     JSCommentConstructor(ExecState* exec)
       
    60     {
       
    61         setPrototype(exec->lexicalInterpreter()->builtinObjectPrototype());
       
    62         putDirect(exec->propertyNames().prototype, JSCommentPrototype::self(exec), None);
       
    63     }
       
    64     virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
       
    65     JSValue* getValueProperty(ExecState*, int token) const;
       
    66     virtual const ClassInfo* classInfo() const { return &info; }
       
    67     static const ClassInfo info;
       
    68 
       
    69     virtual bool implementsHasInstance() const { return true; }
       
    70 };
       
    71 
       
    72 const ClassInfo JSCommentConstructor::info = { "CommentConstructor", 0, &JSCommentConstructorTable, 0 };
       
    73 
       
    74 bool JSCommentConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
    75 {
       
    76     return getStaticValueSlot<JSCommentConstructor, DOMObject>(exec, &JSCommentConstructorTable, this, propertyName, slot);
       
    77 }
       
    78 
       
    79 JSValue* JSCommentConstructor::getValueProperty(ExecState*, int token) const
       
    80 {
       
    81     // The token is the numeric value of its associated constant
       
    82     return jsNumber(token);
       
    83 }
       
    84 
       
    85 /* Hash table for prototype */
       
    86 
       
    87 static const HashEntry JSCommentPrototypeTableEntries[] =
       
    88 {
       
    89     { 0, 0, 0, 0, 0 }
       
    90 };
       
    91 
       
    92 static const HashTable JSCommentPrototypeTable = 
       
    93 {
       
    94     2, 1, JSCommentPrototypeTableEntries, 1
       
    95 };
       
    96 
       
    97 const ClassInfo JSCommentPrototype::info = { "CommentPrototype", 0, &JSCommentPrototypeTable, 0 };
       
    98 
       
    99 JSObject* JSCommentPrototype::self(ExecState* exec)
       
   100 {
       
   101     return KJS::cacheGlobalObject<JSCommentPrototype>(exec, "[[JSComment.prototype]]");
       
   102 }
       
   103 
       
   104 const ClassInfo JSComment::info = { "Comment", &JSCharacterData::info, &JSCommentTable, 0 };
       
   105 
       
   106 JSComment::JSComment(ExecState* exec, Comment* impl)
       
   107     : JSCharacterData(exec, impl)
       
   108 {
       
   109     setPrototype(JSCommentPrototype::self(exec));
       
   110 }
       
   111 
       
   112 bool JSComment::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   113 {
       
   114     return getStaticValueSlot<JSComment, JSCharacterData>(exec, &JSCommentTable, this, propertyName, slot);
       
   115 }
       
   116 
       
   117 JSValue* JSComment::getValueProperty(ExecState* exec, int token) const
       
   118 {
       
   119     switch (token) {
       
   120     case ConstructorAttrNum:
       
   121         return getConstructor(exec);
       
   122     }
       
   123     return 0;
       
   124 }
       
   125 
       
   126 JSValue* JSComment::getConstructor(ExecState* exec)
       
   127 {
       
   128     return KJS::cacheGlobalObject<JSCommentConstructor>(exec, "[[Comment.constructor]]");
       
   129 }
       
   130 
       
   131 }