summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/runtime/JSAPIValueWrapper.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/runtime/JSAPIValueWrapper.h')
-rw-r--r--Source/JavaScriptCore/runtime/JSAPIValueWrapper.h76
1 files changed, 37 insertions, 39 deletions
diff --git a/Source/JavaScriptCore/runtime/JSAPIValueWrapper.h b/Source/JavaScriptCore/runtime/JSAPIValueWrapper.h
index e1f2cd804..8c7c845d8 100644
--- a/Source/JavaScriptCore/runtime/JSAPIValueWrapper.h
+++ b/Source/JavaScriptCore/runtime/JSAPIValueWrapper.h
@@ -20,8 +20,7 @@
*
*/
-#ifndef JSAPIValueWrapper_h
-#define JSAPIValueWrapper_h
+#pragma once
#include "JSCJSValue.h"
#include "JSCell.h"
@@ -30,50 +29,49 @@
namespace JSC {
- class JSAPIValueWrapper : public JSCell {
- friend JSValue jsAPIValueWrapper(ExecState*, JSValue);
- public:
- typedef JSCell Base;
+class JSAPIValueWrapper : public JSCell {
+ friend JSValue jsAPIValueWrapper(ExecState*, JSValue);
+public:
+ typedef JSCell Base;
+ static const unsigned StructureFlags = Base::StructureFlags | StructureIsImmortal;
- JSValue value() const { return m_value.get(); }
+ JSValue value() const { return m_value.get(); }
- static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
- {
- return Structure::create(vm, globalObject, prototype, TypeInfo(APIValueWrapperType, OverridesVisitChildren | OverridesGetPropertyNames), info());
- }
-
- DECLARE_EXPORT_INFO;
-
- static JSAPIValueWrapper* create(ExecState* exec, JSValue value)
- {
- VM& vm = exec->vm();
- JSAPIValueWrapper* wrapper = new (NotNull, allocateCell<JSAPIValueWrapper>(vm.heap)) JSAPIValueWrapper(exec);
- wrapper->finishCreation(vm, value);
- return wrapper;
- }
+ static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
+ {
+ return Structure::create(vm, globalObject, prototype, TypeInfo(APIValueWrapperType, OverridesGetPropertyNames), info());
+ }
- protected:
- void finishCreation(VM& vm, JSValue value)
- {
- Base::finishCreation(vm);
- m_value.set(vm, this, value);
- ASSERT(!value.isCell());
- }
+ DECLARE_EXPORT_INFO;
- private:
- JSAPIValueWrapper(ExecState* exec)
- : JSCell(exec->vm(), exec->vm().apiWrapperStructure.get())
- {
- }
+ static JSAPIValueWrapper* create(ExecState* exec, JSValue value)
+ {
+ VM& vm = exec->vm();
+ JSAPIValueWrapper* wrapper = new (NotNull, allocateCell<JSAPIValueWrapper>(vm.heap)) JSAPIValueWrapper(exec);
+ wrapper->finishCreation(vm, value);
+ return wrapper;
+ }
- WriteBarrier<Unknown> m_value;
- };
+protected:
+ void finishCreation(VM& vm, JSValue value)
+ {
+ Base::finishCreation(vm);
+ m_value.set(vm, this, value);
+ ASSERT(!value.isCell());
+ }
- inline JSValue jsAPIValueWrapper(ExecState* exec, JSValue value)
+private:
+ JSAPIValueWrapper(ExecState* exec)
+ : JSCell(exec->vm(), exec->vm().apiWrapperStructure.get())
{
- return JSAPIValueWrapper::create(exec, value);
}
-} // namespace JSC
+ WriteBarrier<Unknown> m_value;
+};
-#endif // JSAPIValueWrapper_h
+inline JSValue jsAPIValueWrapper(ExecState* exec, JSValue value)
+{
+ return JSAPIValueWrapper::create(exec, value);
+}
+
+} // namespace JSC