summaryrefslogtreecommitdiff
path: root/fxjs/cfxjse_arguments.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fxjs/cfxjse_arguments.cpp')
-rw-r--r--fxjs/cfxjse_arguments.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/fxjs/cfxjse_arguments.cpp b/fxjs/cfxjse_arguments.cpp
index b8670ad981..0b0dc39953 100644
--- a/fxjs/cfxjse_arguments.cpp
+++ b/fxjs/cfxjse_arguments.cpp
@@ -28,20 +28,29 @@ std::unique_ptr<CFXJSE_Value> CFXJSE_Arguments::GetValue(int32_t index) const {
}
bool CFXJSE_Arguments::GetBoolean(int32_t index) const {
- return (*m_pInfo)[index]->BooleanValue();
+ return (*m_pInfo)[index]
+ ->BooleanValue(m_pInfo->GetIsolate()->GetCurrentContext())
+ .FromMaybe(false);
}
int32_t CFXJSE_Arguments::GetInt32(int32_t index) const {
- return static_cast<int32_t>((*m_pInfo)[index]->NumberValue());
+ return static_cast<int32_t>(
+ (*m_pInfo)[index]
+ ->NumberValue(m_pInfo->GetIsolate()->GetCurrentContext())
+ .FromMaybe(0.0));
}
float CFXJSE_Arguments::GetFloat(int32_t index) const {
- return static_cast<float>((*m_pInfo)[index]->NumberValue());
+ return static_cast<float>(
+ (*m_pInfo)[index]
+ ->NumberValue(m_pInfo->GetIsolate()->GetCurrentContext())
+ .FromMaybe(0.0));
}
ByteString CFXJSE_Arguments::GetUTF8String(int32_t index) const {
- v8::Local<v8::String> hString = (*m_pInfo)[index]->ToString();
- v8::String::Utf8Value szStringVal(m_pInfo->GetIsolate(), hString);
+ v8::Isolate* isolate = m_pInfo->GetIsolate();
+ v8::Local<v8::String> hString = (*m_pInfo)[index]->ToString(isolate);
+ v8::String::Utf8Value szStringVal(isolate, hString);
return ByteString(*szStringVal);
}