]>
git.saurik.com Git - apple/javascriptcore.git/blob - runtime/SymbolObject.h
2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
4 * Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser 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.
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 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 #ifndef SymbolObject_h
23 #define SymbolObject_h
25 #include "JSWrapperObject.h"
30 class SymbolObject
: public JSWrapperObject
{
32 typedef JSWrapperObject Base
;
34 static SymbolObject
* create(VM
& vm
, Structure
* structure
)
36 Symbol
* symbol
= Symbol::create(vm
);
37 SymbolObject
* object
= new (NotNull
, allocateCell
<SymbolObject
>(vm
.heap
)) SymbolObject(vm
, structure
);
38 object
->finishCreation(vm
, symbol
);
41 static SymbolObject
* create(VM
& vm
, Structure
* structure
, Symbol
* symbol
)
43 SymbolObject
* object
= new (NotNull
, allocateCell
<SymbolObject
>(vm
.heap
)) SymbolObject(vm
, structure
);
44 object
->finishCreation(vm
, symbol
);
47 static SymbolObject
* create(VM
&, JSGlobalObject
*, Symbol
*);
51 Symbol
* internalValue() const { return asSymbol(JSWrapperObject::internalValue());}
53 static Structure
* createStructure(VM
& vm
, JSGlobalObject
* globalObject
, JSValue prototype
)
55 return Structure::create(vm
, globalObject
, prototype
, TypeInfo(ObjectType
, StructureFlags
), info());
58 static JSValue
defaultValue(const JSObject
*, ExecState
*, PreferredPrimitiveType
);
61 JS_EXPORT_PRIVATE
void finishCreation(VM
&, Symbol
*);
62 JS_EXPORT_PRIVATE
SymbolObject(VM
&, Structure
*);
67 #endif // SymbolObject_h