summaryrefslogtreecommitdiff
path: root/xfa/src/fxjse/src/util_inline.h
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/src/fxjse/src/util_inline.h')
-rw-r--r--xfa/src/fxjse/src/util_inline.h61
1 files changed, 32 insertions, 29 deletions
diff --git a/xfa/src/fxjse/src/util_inline.h b/xfa/src/fxjse/src/util_inline.h
index 3425465844..80034aa9c2 100644
--- a/xfa/src/fxjse/src/util_inline.h
+++ b/xfa/src/fxjse/src/util_inline.h
@@ -6,39 +6,42 @@
#ifndef FXJSE_UTIL_INLINE_H_
#define FXJSE_UTIL_INLINE_H_
-static V8_INLINE v8::Local<v8::Object> FXJSE_GetGlobalObjectFromContext(const v8::Local<v8::Context>& hContext)
-{
- return hContext->Global()->GetPrototype().As<v8::Object>();
+static V8_INLINE v8::Local<v8::Object> FXJSE_GetGlobalObjectFromContext(
+ const v8::Local<v8::Context>& hContext) {
+ return hContext->Global()->GetPrototype().As<v8::Object>();
}
-static V8_INLINE void FXJSE_UpdateObjectBinding(v8::Local<v8::Object>& hObject, void* lpNewBinding)
-{
- ASSERT(!hObject.IsEmpty());
- ASSERT(hObject->InternalFieldCount() > 0);
- hObject->SetAlignedPointerInInternalField(0, lpNewBinding);
+static V8_INLINE void FXJSE_UpdateObjectBinding(v8::Local<v8::Object>& hObject,
+ void* lpNewBinding) {
+ ASSERT(!hObject.IsEmpty());
+ ASSERT(hObject->InternalFieldCount() > 0);
+ hObject->SetAlignedPointerInInternalField(0, lpNewBinding);
}
-static V8_INLINE void* FXJSE_RetrieveObjectBinding(const v8::Local<v8::Object>& hJSObject, CFXJSE_Class* lpClass = NULL)
-{
- ASSERT(!hJSObject.IsEmpty());
- if(!hJSObject->IsObject()) {
- return NULL;
+static V8_INLINE void* FXJSE_RetrieveObjectBinding(
+ const v8::Local<v8::Object>& hJSObject,
+ CFXJSE_Class* lpClass = NULL) {
+ ASSERT(!hJSObject.IsEmpty());
+ if (!hJSObject->IsObject()) {
+ return NULL;
+ }
+ v8::Local<v8::Object> hObject = hJSObject;
+ if (hObject->InternalFieldCount() == 0) {
+ v8::Local<v8::Value> hProtoObject = hObject->GetPrototype();
+ if (hProtoObject.IsEmpty() || !hProtoObject->IsObject()) {
+ return NULL;
}
- v8::Local<v8::Object> hObject = hJSObject;
- if(hObject->InternalFieldCount() == 0) {
- v8::Local<v8::Value> hProtoObject = hObject->GetPrototype();
- if(hProtoObject.IsEmpty() || !hProtoObject->IsObject()) {
- return NULL;
- }
- hObject = hProtoObject.As<v8::Object>();
- if(hObject->InternalFieldCount() == 0) {
- return NULL;
- }
+ hObject = hProtoObject.As<v8::Object>();
+ if (hObject->InternalFieldCount() == 0) {
+ return NULL;
}
- if(lpClass) {
- v8::Local<v8::FunctionTemplate> hClass = v8::Local<v8::FunctionTemplate>::New(lpClass->GetContext()->GetRuntime(), lpClass->GetTemplate());
- if(!hClass->HasInstance(hObject)) {
- return NULL;
- }
+ }
+ if (lpClass) {
+ v8::Local<v8::FunctionTemplate> hClass =
+ v8::Local<v8::FunctionTemplate>::New(
+ lpClass->GetContext()->GetRuntime(), lpClass->GetTemplate());
+ if (!hClass->HasInstance(hObject)) {
+ return NULL;
}
- return hObject->GetAlignedPointerFromInternalField(0);
+ }
+ return hObject->GetAlignedPointerFromInternalField(0);
}
#endif