summaryrefslogtreecommitdiff
path: root/fxjs
diff options
context:
space:
mode:
Diffstat (limited to 'fxjs')
-rw-r--r--fxjs/cfxjse_arguments.cpp2
-rw-r--r--fxjs/cfxjse_arguments.h2
-rw-r--r--fxjs/cfxjse_class.cpp26
-rw-r--r--fxjs/cfxjse_class.h2
-rw-r--r--fxjs/cfxjse_context.cpp61
-rw-r--r--fxjs/cfxjse_context.h6
-rw-r--r--fxjs/cfxjse_runtimedata.cpp4
-rw-r--r--fxjs/cfxjse_value.cpp124
-rw-r--r--fxjs/cfxjse_value.h54
-rw-r--r--fxjs/fxjse.h6
10 files changed, 142 insertions, 145 deletions
diff --git a/fxjs/cfxjse_arguments.cpp b/fxjs/cfxjse_arguments.cpp
index f1dcd2c153..75904cbbea 100644
--- a/fxjs/cfxjse_arguments.cpp
+++ b/fxjs/cfxjse_arguments.cpp
@@ -24,7 +24,7 @@ std::unique_ptr<CFXJSE_Value> CFXJSE_Arguments::GetValue(int32_t index) const {
return lpArgValue;
}
-FX_BOOL CFXJSE_Arguments::GetBoolean(int32_t index) const {
+bool CFXJSE_Arguments::GetBoolean(int32_t index) const {
return (*m_pInfo)[index]->BooleanValue();
}
diff --git a/fxjs/cfxjse_arguments.h b/fxjs/cfxjse_arguments.h
index c38c2925ab..51e1981d03 100644
--- a/fxjs/cfxjse_arguments.h
+++ b/fxjs/cfxjse_arguments.h
@@ -22,7 +22,7 @@ class CFXJSE_Arguments {
v8::Isolate* GetRuntime() const;
int32_t GetLength() const;
std::unique_ptr<CFXJSE_Value> GetValue(int32_t index) const;
- FX_BOOL GetBoolean(int32_t index) const;
+ bool GetBoolean(int32_t index) const;
int32_t GetInt32(int32_t index) const;
FX_FLOAT GetFloat(int32_t index) const;
CFX_ByteString GetUTF8String(int32_t index) const;
diff --git a/fxjs/cfxjse_class.cpp b/fxjs/cfxjse_class.cpp
index c2c8e5fec2..644e81a4f3 100644
--- a/fxjs/cfxjse_class.cpp
+++ b/fxjs/cfxjse_class.cpp
@@ -151,7 +151,7 @@ void DynPropGetterAdapter(const FXJSE_CLASS_DESCRIPTOR* lpClass,
int32_t nPropType =
lpClass->dynPropTypeGetter == nullptr
? FXJSE_ClassPropType_Property
- : lpClass->dynPropTypeGetter(pObject, szPropName, FALSE);
+ : lpClass->dynPropTypeGetter(pObject, szPropName, false);
if (nPropType == FXJSE_ClassPropType_Property) {
if (lpClass->dynPropGetter)
lpClass->dynPropGetter(pObject, szPropName, pValue);
@@ -187,38 +187,38 @@ void DynPropSetterAdapter(const FXJSE_CLASS_DESCRIPTOR* lpClass,
int32_t nPropType =
lpClass->dynPropTypeGetter == nullptr
? FXJSE_ClassPropType_Property
- : lpClass->dynPropTypeGetter(pObject, szPropName, FALSE);
+ : lpClass->dynPropTypeGetter(pObject, szPropName, false);
if (nPropType != FXJSE_ClassPropType_Method) {
if (lpClass->dynPropSetter)
lpClass->dynPropSetter(pObject, szPropName, pValue);
}
}
-FX_BOOL DynPropQueryAdapter(const FXJSE_CLASS_DESCRIPTOR* lpClass,
- CFXJSE_Value* pObject,
- const CFX_ByteStringC& szPropName) {
+bool DynPropQueryAdapter(const FXJSE_CLASS_DESCRIPTOR* lpClass,
+ CFXJSE_Value* pObject,
+ const CFX_ByteStringC& szPropName) {
ASSERT(lpClass);
int32_t nPropType =
lpClass->dynPropTypeGetter == nullptr
? FXJSE_ClassPropType_Property
- : lpClass->dynPropTypeGetter(pObject, szPropName, TRUE);
+ : lpClass->dynPropTypeGetter(pObject, szPropName, true);
return nPropType != FXJSE_ClassPropType_None;
}
-FX_BOOL DynPropDeleterAdapter(const FXJSE_CLASS_DESCRIPTOR* lpClass,
- CFXJSE_Value* pObject,
- const CFX_ByteStringC& szPropName) {
+bool DynPropDeleterAdapter(const FXJSE_CLASS_DESCRIPTOR* lpClass,
+ CFXJSE_Value* pObject,
+ const CFX_ByteStringC& szPropName) {
ASSERT(lpClass);
int32_t nPropType =
lpClass->dynPropTypeGetter == nullptr
? FXJSE_ClassPropType_Property
- : lpClass->dynPropTypeGetter(pObject, szPropName, FALSE);
+ : lpClass->dynPropTypeGetter(pObject, szPropName, false);
if (nPropType != FXJSE_ClassPropType_Method) {
if (lpClass->dynPropDeleter)
return lpClass->dynPropDeleter(pObject, szPropName);
- return nPropType == FXJSE_ClassPropType_Property ? FALSE : TRUE;
+ return nPropType != FXJSE_ClassPropType_Property;
}
- return FALSE;
+ return false;
}
void NamedPropertyQueryCallback(
@@ -315,7 +315,7 @@ void NamedPropertyEnumeratorCallback(
CFXJSE_Class* CFXJSE_Class::Create(
CFXJSE_Context* lpContext,
const FXJSE_CLASS_DESCRIPTOR* lpClassDefinition,
- FX_BOOL bIsJSGlobal) {
+ bool bIsJSGlobal) {
if (!lpContext || !lpClassDefinition)
return nullptr;
diff --git a/fxjs/cfxjse_class.h b/fxjs/cfxjse_class.h
index ac02b0d6e7..1b3528a5c0 100644
--- a/fxjs/cfxjse_class.h
+++ b/fxjs/cfxjse_class.h
@@ -18,7 +18,7 @@ class CFXJSE_Class {
public:
static CFXJSE_Class* Create(CFXJSE_Context* pContext,
const FXJSE_CLASS_DESCRIPTOR* lpClassDefintion,
- FX_BOOL bIsJSGlobal = FALSE);
+ bool bIsJSGlobal = false);
static CFXJSE_Class* GetClassFromContext(CFXJSE_Context* pContext,
const CFX_ByteStringC& szName);
static void SetUpNamedPropHandler(
diff --git a/fxjs/cfxjse_context.cpp b/fxjs/cfxjse_context.cpp
index 93efc4f12c..d82f875e0f 100644
--- a/fxjs/cfxjse_context.cpp
+++ b/fxjs/cfxjse_context.cpp
@@ -156,7 +156,7 @@ CFXJSE_Context* CFXJSE_Context::Create(
CFXJSE_Class* lpGlobalClassObj = nullptr;
v8::Local<v8::ObjectTemplate> hObjectTemplate;
if (lpGlobalClass) {
- lpGlobalClassObj = CFXJSE_Class::Create(pContext, lpGlobalClass, TRUE);
+ lpGlobalClassObj = CFXJSE_Class::Create(pContext, lpGlobalClass, true);
ASSERT(lpGlobalClassObj);
v8::Local<v8::FunctionTemplate> hFunctionTemplate =
v8::Local<v8::FunctionTemplate>::New(pIsolate,
@@ -202,9 +202,9 @@ void CFXJSE_Context::EnableCompatibleMode() {
ExecuteScript(szCompatibleModeScript, nullptr, nullptr);
}
-FX_BOOL CFXJSE_Context::ExecuteScript(const FX_CHAR* szScript,
- CFXJSE_Value* lpRetValue,
- CFXJSE_Value* lpNewThisObject) {
+bool CFXJSE_Context::ExecuteScript(const FX_CHAR* szScript,
+ CFXJSE_Value* lpRetValue,
+ CFXJSE_Value* lpNewThisObject) {
CFXJSE_ScopeUtil_IsolateHandleContext scope(this);
v8::TryCatch trycatch(m_pIsolate);
v8::Local<v8::String> hScriptString =
@@ -214,42 +214,39 @@ FX_BOOL CFXJSE_Context::ExecuteScript(const FX_CHAR* szScript,
if (!trycatch.HasCaught()) {
v8::Local<v8::Value> hValue = hScript->Run();
if (!trycatch.HasCaught()) {
- if (lpRetValue) {
+ if (lpRetValue)
lpRetValue->m_hValue.Reset(m_pIsolate, hValue);
- }
- return TRUE;
+ return true;
}
}
if (lpRetValue) {
lpRetValue->m_hValue.Reset(m_pIsolate,
FXJSE_CreateReturnValue(m_pIsolate, trycatch));
}
- return FALSE;
- } else {
- v8::Local<v8::Value> hNewThis =
- v8::Local<v8::Value>::New(m_pIsolate, lpNewThisObject->m_hValue);
- ASSERT(!hNewThis.IsEmpty());
- v8::Local<v8::Script> hWrapper =
- v8::Script::Compile(v8::String::NewFromUtf8(
- m_pIsolate, "(function () { return eval(arguments[0]); })"));
- v8::Local<v8::Value> hWrapperValue = hWrapper->Run();
- ASSERT(hWrapperValue->IsFunction());
- v8::Local<v8::Function> hWrapperFn = hWrapperValue.As<v8::Function>();
+ return false;
+ }
+
+ v8::Local<v8::Value> hNewThis =
+ v8::Local<v8::Value>::New(m_pIsolate, lpNewThisObject->m_hValue);
+ ASSERT(!hNewThis.IsEmpty());
+ v8::Local<v8::Script> hWrapper = v8::Script::Compile(v8::String::NewFromUtf8(
+ m_pIsolate, "(function () { return eval(arguments[0]); })"));
+ v8::Local<v8::Value> hWrapperValue = hWrapper->Run();
+ ASSERT(hWrapperValue->IsFunction());
+ v8::Local<v8::Function> hWrapperFn = hWrapperValue.As<v8::Function>();
+ if (!trycatch.HasCaught()) {
+ v8::Local<v8::Value> rgArgs[] = {hScriptString};
+ v8::Local<v8::Value> hValue =
+ hWrapperFn->Call(hNewThis.As<v8::Object>(), 1, rgArgs);
if (!trycatch.HasCaught()) {
- v8::Local<v8::Value> rgArgs[] = {hScriptString};
- v8::Local<v8::Value> hValue =
- hWrapperFn->Call(hNewThis.As<v8::Object>(), 1, rgArgs);
- if (!trycatch.HasCaught()) {
- if (lpRetValue) {
- lpRetValue->m_hValue.Reset(m_pIsolate, hValue);
- }
- return TRUE;
- }
+ if (lpRetValue)
+ lpRetValue->m_hValue.Reset(m_pIsolate, hValue);
+ return true;
}
- if (lpRetValue) {
- lpRetValue->m_hValue.Reset(m_pIsolate,
- FXJSE_CreateReturnValue(m_pIsolate, trycatch));
- }
- return FALSE;
}
+ if (lpRetValue) {
+ lpRetValue->m_hValue.Reset(m_pIsolate,
+ FXJSE_CreateReturnValue(m_pIsolate, trycatch));
+ }
+ return false;
}
diff --git a/fxjs/cfxjse_context.h b/fxjs/cfxjse_context.h
index 73f62647cc..a694514770 100644
--- a/fxjs/cfxjse_context.h
+++ b/fxjs/cfxjse_context.h
@@ -30,9 +30,9 @@ class CFXJSE_Context {
v8::Isolate* GetRuntime() { return m_pIsolate; }
std::unique_ptr<CFXJSE_Value> GetGlobalObject();
void EnableCompatibleMode();
- FX_BOOL ExecuteScript(const FX_CHAR* szScript,
- CFXJSE_Value* lpRetValue,
- CFXJSE_Value* lpNewThisObject = nullptr);
+ bool ExecuteScript(const FX_CHAR* szScript,
+ CFXJSE_Value* lpRetValue,
+ CFXJSE_Value* lpNewThisObject = nullptr);
protected:
friend class CFXJSE_Class;
diff --git a/fxjs/cfxjse_runtimedata.cpp b/fxjs/cfxjse_runtimedata.cpp
index 017916a248..4f5cfbcbcb 100644
--- a/fxjs/cfxjse_runtimedata.cpp
+++ b/fxjs/cfxjse_runtimedata.cpp
@@ -36,11 +36,11 @@ void FXJSE_Initialize() {
if (!CFXJSE_IsolateTracker::g_pInstance)
CFXJSE_IsolateTracker::g_pInstance = new CFXJSE_IsolateTracker;
- static FX_BOOL bV8Initialized = FALSE;
+ static bool bV8Initialized = false;
if (bV8Initialized)
return;
- bV8Initialized = TRUE;
+ bV8Initialized = true;
atexit(KillV8);
}
diff --git a/fxjs/cfxjse_value.cpp b/fxjs/cfxjse_value.cpp
index d0a428c9c3..471d85cf76 100644
--- a/fxjs/cfxjse_value.cpp
+++ b/fxjs/cfxjse_value.cpp
@@ -128,87 +128,87 @@ void CFXJSE_Value::SetFloat(FX_FLOAT fFloat) {
m_hValue.Reset(m_pIsolate, pValue);
}
-FX_BOOL CFXJSE_Value::SetObjectProperty(const CFX_ByteStringC& szPropName,
- CFXJSE_Value* lpPropValue) {
+bool CFXJSE_Value::SetObjectProperty(const CFX_ByteStringC& szPropName,
+ CFXJSE_Value* lpPropValue) {
ASSERT(lpPropValue);
CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate);
v8::Local<v8::Value> hObject =
v8::Local<v8::Value>::New(m_pIsolate, m_hValue);
if (!hObject->IsObject())
- return FALSE;
+ return false;
v8::Local<v8::Value> hPropValue =
v8::Local<v8::Value>::New(m_pIsolate, lpPropValue->DirectGetValue());
- return (FX_BOOL)hObject.As<v8::Object>()->Set(
+ return (bool)hObject.As<v8::Object>()->Set(
v8::String::NewFromUtf8(m_pIsolate, szPropName.c_str(),
v8::String::kNormalString,
szPropName.GetLength()),
hPropValue);
}
-FX_BOOL CFXJSE_Value::GetObjectProperty(const CFX_ByteStringC& szPropName,
- CFXJSE_Value* lpPropValue) {
+bool CFXJSE_Value::GetObjectProperty(const CFX_ByteStringC& szPropName,
+ CFXJSE_Value* lpPropValue) {
ASSERT(lpPropValue);
CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate);
v8::Local<v8::Value> hObject =
v8::Local<v8::Value>::New(m_pIsolate, m_hValue);
if (!hObject->IsObject())
- return FALSE;
+ return false;
v8::Local<v8::Value> hPropValue =
hObject.As<v8::Object>()->Get(v8::String::NewFromUtf8(
m_pIsolate, szPropName.c_str(), v8::String::kNormalString,
szPropName.GetLength()));
lpPropValue->ForceSetValue(hPropValue);
- return TRUE;
+ return true;
}
-FX_BOOL CFXJSE_Value::SetObjectProperty(uint32_t uPropIdx,
- CFXJSE_Value* lpPropValue) {
+bool CFXJSE_Value::SetObjectProperty(uint32_t uPropIdx,
+ CFXJSE_Value* lpPropValue) {
CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate);
v8::Local<v8::Value> hObject =
v8::Local<v8::Value>::New(m_pIsolate, m_hValue);
if (!hObject->IsObject())
- return FALSE;
+ return false;
v8::Local<v8::Value> hPropValue =
v8::Local<v8::Value>::New(m_pIsolate, lpPropValue->DirectGetValue());
- return (FX_BOOL)hObject.As<v8::Object>()->Set(uPropIdx, hPropValue);
+ return (bool)hObject.As<v8::Object>()->Set(uPropIdx, hPropValue);
}
-FX_BOOL CFXJSE_Value::GetObjectPropertyByIdx(uint32_t uPropIdx,
- CFXJSE_Value* lpPropValue) {
+bool CFXJSE_Value::GetObjectPropertyByIdx(uint32_t uPropIdx,
+ CFXJSE_Value* lpPropValue) {
CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate);
v8::Local<v8::Value> hObject =
v8::Local<v8::Value>::New(m_pIsolate, m_hValue);
if (!hObject->IsObject())
- return FALSE;
+ return false;
v8::Local<v8::Value> hPropValue = hObject.As<v8::Object>()->Get(uPropIdx);
lpPropValue->ForceSetValue(hPropValue);
- return TRUE;
+ return true;
}
-FX_BOOL CFXJSE_Value::DeleteObjectProperty(const CFX_ByteStringC& szPropName) {
+bool CFXJSE_Value::DeleteObjectProperty(const CFX_ByteStringC& szPropName) {
CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate);
v8::Local<v8::Value> hObject =
v8::Local<v8::Value>::New(m_pIsolate, m_hValue);
if (!hObject->IsObject())
- return FALSE;
+ return false;
hObject.As<v8::Object>()->Delete(v8::String::NewFromUtf8(
m_pIsolate, szPropName.c_str(), v8::String::kNormalString,
szPropName.GetLength()));
- return TRUE;
+ return true;
}
-FX_BOOL CFXJSE_Value::HasObjectOwnProperty(const CFX_ByteStringC& szPropName,
- FX_BOOL bUseTypeGetter) {
+bool CFXJSE_Value::HasObjectOwnProperty(const CFX_ByteStringC& szPropName,
+ bool bUseTypeGetter) {
CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate);
v8::Local<v8::Value> hObject =
v8::Local<v8::Value>::New(m_pIsolate, m_hValue);
if (!hObject->IsObject())
- return FALSE;
+ return false;
v8::Local<v8::String> hKey = v8::String::NewFromUtf8(
m_pIsolate, szPropName.c_str(), v8::String::kNormalString,
@@ -220,14 +220,14 @@ FX_BOOL CFXJSE_Value::HasObjectOwnProperty(const CFX_ByteStringC& szPropName,
.FromMaybe(false));
}
-FX_BOOL CFXJSE_Value::SetObjectOwnProperty(const CFX_ByteStringC& szPropName,
- CFXJSE_Value* lpPropValue) {
+bool CFXJSE_Value::SetObjectOwnProperty(const CFX_ByteStringC& szPropName,
+ CFXJSE_Value* lpPropValue) {
ASSERT(lpPropValue);
CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate);
v8::Local<v8::Value> hObject =
v8::Local<v8::Value>::New(m_pIsolate, m_hValue);
if (!hObject->IsObject())
- return FALSE;
+ return false;
v8::Local<v8::Value> pValue =
v8::Local<v8::Value>::New(m_pIsolate, lpPropValue->m_hValue);
@@ -241,8 +241,8 @@ FX_BOOL CFXJSE_Value::SetObjectOwnProperty(const CFX_ByteStringC& szPropName,
.FromMaybe(false);
}
-FX_BOOL CFXJSE_Value::SetFunctionBind(CFXJSE_Value* lpOldFunction,
- CFXJSE_Value* lpNewThis) {
+bool CFXJSE_Value::SetFunctionBind(CFXJSE_Value* lpOldFunction,
+ CFXJSE_Value* lpNewThis) {
ASSERT(lpOldFunction && lpNewThis);
CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate);
@@ -250,13 +250,13 @@ FX_BOOL CFXJSE_Value::SetFunctionBind(CFXJSE_Value* lpOldFunction,
v8::Local<v8::Value> hOldFunction =
v8::Local<v8::Value>::New(m_pIsolate, lpOldFunction->DirectGetValue());
if (hOldFunction.IsEmpty() || !hOldFunction->IsFunction())
- return FALSE;
+ return false;
rgArgs[0] = hOldFunction;
v8::Local<v8::Value> hNewThis =
v8::Local<v8::Value>::New(m_pIsolate, lpNewThis->DirectGetValue());
if (hNewThis.IsEmpty())
- return FALSE;
+ return false;
rgArgs[1] = hNewThis;
v8::Local<v8::String> hBinderFuncSource =
@@ -268,17 +268,17 @@ FX_BOOL CFXJSE_Value::SetFunctionBind(CFXJSE_Value* lpOldFunction,
v8::Local<v8::Value> hBoundFunction =
hBinderFunc->Call(m_pIsolate->GetCurrentContext()->Global(), 2, rgArgs);
if (hBoundFunction.IsEmpty() || !hBoundFunction->IsFunction())
- return FALSE;
+ return false;
m_hValue.Reset(m_pIsolate, hBoundFunction);
- return TRUE;
+ return true;
}
#define FXJSE_INVALID_PTR ((void*)(intptr_t)-1)
-FX_BOOL CFXJSE_Value::Call(CFXJSE_Value* lpReceiver,
- CFXJSE_Value* lpRetValue,
- uint32_t nArgCount,
- CFXJSE_Value** lpArgs) {
+bool CFXJSE_Value::Call(CFXJSE_Value* lpReceiver,
+ CFXJSE_Value* lpRetValue,
+ uint32_t nArgCount,
+ CFXJSE_Value** lpArgs) {
CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate);
v8::Local<v8::Value> hFunctionValue =
v8::Local<v8::Value>::New(m_pIsolate, DirectGetValue());
@@ -291,7 +291,7 @@ FX_BOOL CFXJSE_Value::Call(CFXJSE_Value* lpReceiver,
if (hFunctionObject.IsEmpty() || !hFunctionObject->IsCallable()) {
if (lpRetValue)
lpRetValue->ForceSetValue(FXJSE_CreateReturnValue(m_pIsolate, trycatch));
- return FALSE;
+ return false;
}
v8::Local<v8::Value> hReturnValue;
@@ -311,7 +311,7 @@ FX_BOOL CFXJSE_Value::Call(CFXJSE_Value* lpReceiver,
}
}
- FX_BOOL bRetValue = TRUE;
+ bool bRetValue = true;
if (lpReceiver == FXJSE_INVALID_PTR) {
v8::MaybeLocal<v8::Value> maybe_retvalue =
hFunctionObject->CallAsConstructor(m_pIsolate->GetCurrentContext(),
@@ -333,7 +333,7 @@ FX_BOOL CFXJSE_Value::Call(CFXJSE_Value* lpReceiver,
if (trycatch.HasCaught()) {
hReturnValue = FXJSE_CreateReturnValue(m_pIsolate, trycatch);
- bRetValue = FALSE;
+ bRetValue = false;
}
if (lpRetValue)
@@ -347,101 +347,101 @@ FX_BOOL CFXJSE_Value::Call(CFXJSE_Value* lpReceiver,
return bRetValue;
}
-FX_BOOL CFXJSE_Value::IsUndefined() const {
+bool CFXJSE_Value::IsUndefined() const {
if (m_hValue.IsEmpty())
- return FALSE;
+ return false;
CFXJSE_ScopeUtil_IsolateHandle scope(m_pIsolate);
v8::Local<v8::Value> hValue = v8::Local<v8::Value>::New(m_pIsolate, m_hValue);
return hValue->IsUndefined();
}
-FX_BOOL CFXJSE_Value::IsNull() const {
+bool CFXJSE_Value::IsNull() const {
if (m_hValue.IsEmpty())
- return FALSE;
+ return false;
CFXJSE_ScopeUtil_IsolateHandle scope(m_pIsolate);
v8::Local<v8::Value> hValue = v8::Local<v8::Value>::New(m_pIsolate, m_hValue);
return hValue->IsNull();
}
-FX_BOOL CFXJSE_Value::IsBoolean() const {
+bool CFXJSE_Value::IsBoolean() const {
if (m_hValue.IsEmpty())
- return FALSE;
+ return false;
CFXJSE_ScopeUtil_IsolateHandle scope(m_pIsolate);
v8::Local<v8::Value> hValue = v8::Local<v8::Value>::New(m_pIsolate, m_hValue);
return hValue->IsBoolean();
}
-FX_BOOL CFXJSE_Value::IsString() const {
+bool CFXJSE_Value::IsString() const {
if (m_hValue.IsEmpty())
- return FALSE;
+ return false;
CFXJSE_ScopeUtil_IsolateHandle scope(m_pIsolate);
v8::Local<v8::Value> hValue = v8::Local<v8::Value>::New(m_pIsolate, m_hValue);
return hValue->IsString();
}
-FX_BOOL CFXJSE_Value::IsNumber() const {
+bool CFXJSE_Value::IsNumber() const {
if (m_hValue.IsEmpty())
- return FALSE;
+ return false;
CFXJSE_ScopeUtil_IsolateHandle scope(m_pIsolate);
v8::Local<v8::Value> hValue = v8::Local<v8::Value>::New(m_pIsolate, m_hValue);
return hValue->IsNumber();
}
-FX_BOOL CFXJSE_Value::IsInteger() const {
+bool CFXJSE_Value::IsInteger() const {
if (m_hValue.IsEmpty())
- return FALSE;
+ return false;
CFXJSE_ScopeUtil_IsolateHandle scope(m_pIsolate);
v8::Local<v8::Value> hValue = v8::Local<v8::Value>::New(m_pIsolate, m_hValue);
return hValue->IsInt32();
}
-FX_BOOL CFXJSE_Value::IsObject() const {
+bool CFXJSE_Value::IsObject() const {
if (m_hValue.IsEmpty())
- return FALSE;
+ return false;
CFXJSE_ScopeUtil_IsolateHandle scope(m_pIsolate);
v8::Local<v8::Value> hValue = v8::Local<v8::Value>::New(m_pIsolate, m_hValue);
return hValue->IsObject();
}
-FX_BOOL CFXJSE_Value::IsArray() const {
+bool CFXJSE_Value::IsArray() const {
if (m_hValue.IsEmpty())
- return FALSE;
+ return false;
CFXJSE_ScopeUtil_IsolateHandle scope(m_pIsolate);
v8::Local<v8::Value> hValue = v8::Local<v8::Value>::New(m_pIsolate, m_hValue);
return hValue->IsArray();
}
-FX_BOOL CFXJSE_Value::IsFunction() const {
+bool CFXJSE_Value::IsFunction() const {
if (m_hValue.IsEmpty())
- return FALSE;
+ return false;
CFXJSE_ScopeUtil_IsolateHandle scope(m_pIsolate);
v8::Local<v8::Value> hValue = v8::Local<v8::Value>::New(m_pIsolate, m_hValue);
return hValue->IsFunction();
}
-FX_BOOL CFXJSE_Value::IsDate() const {
+bool CFXJSE_Value::IsDate() const {
if (m_hValue.IsEmpty())
- return FALSE;
+ return false;
CFXJSE_ScopeUtil_IsolateHandle scope(m_pIsolate);
v8::Local<v8::Value> hValue = v8::Local<v8::Value>::New(m_pIsolate, m_hValue);
return hValue->IsDate();
}
-FX_BOOL CFXJSE_Value::ToBoolean() const {
+bool CFXJSE_Value::ToBoolean() const {
ASSERT(!m_hValue.IsEmpty());
CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate);
v8::Local<v8::Value> hValue = v8::Local<v8::Value>::New(m_pIsolate, m_hValue);
- return static_cast<FX_BOOL>(hValue->BooleanValue());
+ return static_cast<bool>(hValue->BooleanValue());
}
FX_FLOAT CFXJSE_Value::ToFloat() const {
@@ -486,9 +486,9 @@ void CFXJSE_Value::SetNull() {
m_hValue.Reset(m_pIsolate, hValue);
}
-void CFXJSE_Value::SetBoolean(FX_BOOL bBoolean) {
+void CFXJSE_Value::SetBoolean(bool bBoolean) {
CFXJSE_ScopeUtil_IsolateHandle scope(m_pIsolate);
- v8::Local<v8::Value> hValue = v8::Boolean::New(m_pIsolate, bBoolean != FALSE);
+ v8::Local<v8::Value> hValue = v8::Boolean::New(m_pIsolate, bBoolean != false);
m_hValue.Reset(m_pIsolate, hValue);
}
diff --git a/fxjs/cfxjse_value.h b/fxjs/cfxjse_value.h
index 91819d81e4..487cf0c6e8 100644
--- a/fxjs/cfxjse_value.h
+++ b/fxjs/cfxjse_value.h
@@ -21,17 +21,17 @@ class CFXJSE_Value {
explicit CFXJSE_Value(v8::Isolate* pIsolate);
~CFXJSE_Value();
- FX_BOOL IsUndefined() const;
- FX_BOOL IsNull() const;
- FX_BOOL IsBoolean() const;
- FX_BOOL IsString() const;
- FX_BOOL IsNumber() const;
- FX_BOOL IsInteger() const;
- FX_BOOL IsObject() const;
- FX_BOOL IsArray() const;
- FX_BOOL IsFunction() const;
- FX_BOOL IsDate() const;
- FX_BOOL ToBoolean() const;
+ bool IsUndefined() const;
+ bool IsNull() const;
+ bool IsBoolean() const;
+ bool IsString() const;
+ bool IsNumber() const;
+ bool IsInteger() const;
+ bool IsObject() const;
+ bool IsArray() const;
+ bool IsFunction() const;
+ bool IsDate() const;
+ bool ToBoolean() const;
FX_FLOAT ToFloat() const;
double ToDouble() const;
int32_t ToInteger() const;
@@ -43,7 +43,7 @@ class CFXJSE_Value {
void SetUndefined();
void SetNull();
- void SetBoolean(FX_BOOL bBoolean);
+ void SetBoolean(bool bBoolean);
void SetInteger(int32_t nInteger);
void SetDouble(double dDouble);
void SetString(const CFX_ByteStringC& szString);
@@ -55,22 +55,22 @@ class CFXJSE_Value {
void SetArray(uint32_t uValueCount, CFXJSE_Value** rgValues);
void SetDate(double dDouble);
- FX_BOOL GetObjectProperty(const CFX_ByteStringC& szPropName,
+ bool GetObjectProperty(const CFX_ByteStringC& szPropName,
+ CFXJSE_Value* lpPropValue);
+ bool SetObjectProperty(const CFX_ByteStringC& szPropName,
+ CFXJSE_Value* lpPropValue);
+ bool GetObjectPropertyByIdx(uint32_t uPropIdx, CFXJSE_Value* lpPropValue);
+ bool SetObjectProperty(uint32_t uPropIdx, CFXJSE_Value* lpPropValue);
+ bool DeleteObjectProperty(const CFX_ByteStringC& szPropName);
+ bool HasObjectOwnProperty(const CFX_ByteStringC& szPropName,
+ bool bUseTypeGetter);
+ bool SetObjectOwnProperty(const CFX_ByteStringC& szPropName,
CFXJSE_Value* lpPropValue);
- FX_BOOL SetObjectProperty(const CFX_ByteStringC& szPropName,
- CFXJSE_Value* lpPropValue);
- FX_BOOL GetObjectPropertyByIdx(uint32_t uPropIdx, CFXJSE_Value* lpPropValue);
- FX_BOOL SetObjectProperty(uint32_t uPropIdx, CFXJSE_Value* lpPropValue);
- FX_BOOL DeleteObjectProperty(const CFX_ByteStringC& szPropName);
- FX_BOOL HasObjectOwnProperty(const CFX_ByteStringC& szPropName,
- FX_BOOL bUseTypeGetter);
- FX_BOOL SetObjectOwnProperty(const CFX_ByteStringC& szPropName,
- CFXJSE_Value* lpPropValue);
- FX_BOOL SetFunctionBind(CFXJSE_Value* lpOldFunction, CFXJSE_Value* lpNewThis);
- FX_BOOL Call(CFXJSE_Value* lpReceiver,
- CFXJSE_Value* lpRetValue,
- uint32_t nArgCount,
- CFXJSE_Value** lpArgs);
+ bool SetFunctionBind(CFXJSE_Value* lpOldFunction, CFXJSE_Value* lpNewThis);
+ bool Call(CFXJSE_Value* lpReceiver,
+ CFXJSE_Value* lpRetValue,
+ uint32_t nArgCount,
+ CFXJSE_Value** lpArgs);
v8::Isolate* GetIsolate() const { return m_pIsolate; }
const v8::Global<v8::Value>& DirectGetValue() const { return m_hValue; }
diff --git a/fxjs/fxjse.h b/fxjs/fxjse.h
index 0ba285d746..069a3b29a3 100644
--- a/fxjs/fxjse.h
+++ b/fxjs/fxjse.h
@@ -28,9 +28,9 @@ typedef void (*FXJSE_PropAccessor)(CFXJSE_Value* pObject,
CFXJSE_Value* pValue);
typedef int32_t (*FXJSE_PropTypeGetter)(CFXJSE_Value* pObject,
const CFX_ByteStringC& szPropName,
- FX_BOOL bQueryIn);
-typedef FX_BOOL (*FXJSE_PropDeleter)(CFXJSE_Value* pObject,
- const CFX_ByteStringC& szPropName);
+ bool bQueryIn);
+typedef bool (*FXJSE_PropDeleter)(CFXJSE_Value* pObject,
+ const CFX_ByteStringC& szPropName);
enum FXJSE_ClassPropTypes {
FXJSE_ClassPropType_None,