summaryrefslogtreecommitdiff
path: root/fxjs
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-08-05 09:32:50 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-05 09:32:50 -0700
commit135b99861d0d898850754a845f607ec48f0bcccc (patch)
tree3e045fd8e3ed049e2a5a24aa727cdf0a07c05efe /fxjs
parentb20ab6c7acb3be1393461eb650ca8fa4660c937e (diff)
downloadpdfium-135b99861d0d898850754a845f607ec48f0bcccc.tar.xz
Return v8::Date specialization not v8::Value where possiblechromium/2824chromium/2823chromium/2822chromium/2821
Also get rid of FXJS_ValueCopy() while we're at it. BUG=pdfium:556 Review-Url: https://codereview.chromium.org/2215093002
Diffstat (limited to 'fxjs')
-rw-r--r--fxjs/fxjs_v8.cpp10
-rw-r--r--fxjs/include/fxjs_v8.h4
2 files changed, 5 insertions, 9 deletions
diff --git a/fxjs/fxjs_v8.cpp b/fxjs/fxjs_v8.cpp
index 65778859a3..d161af6281 100644
--- a/fxjs/fxjs_v8.cpp
+++ b/fxjs/fxjs_v8.cpp
@@ -758,8 +758,10 @@ v8::Local<v8::Value> FXJS_NewNull(v8::Isolate* pIsolate) {
return v8::Local<v8::Value>();
}
-v8::Local<v8::Value> FXJS_NewDate(v8::Isolate* pIsolate, double d) {
- return v8::Date::New(pIsolate->GetCurrentContext(), d).ToLocalChecked();
+v8::Local<v8::Date> FXJS_NewDate(v8::Isolate* pIsolate, double d) {
+ return v8::Date::New(pIsolate->GetCurrentContext(), d)
+ .ToLocalChecked()
+ .As<v8::Date>();
}
int FXJS_ToInt32(v8::Isolate* pIsolate, v8::Local<v8::Value> pValue) {
@@ -807,7 +809,3 @@ v8::Local<v8::Array> FXJS_ToArray(v8::Isolate* pIsolate,
v8::Local<v8::Context> context = pIsolate->GetCurrentContext();
return v8::Local<v8::Array>::Cast(pValue->ToObject(context).ToLocalChecked());
}
-
-void FXJS_ValueCopy(v8::Local<v8::Value>& pTo, v8::Local<v8::Value> pFrom) {
- pTo = pFrom;
-}
diff --git a/fxjs/include/fxjs_v8.h b/fxjs/include/fxjs_v8.h
index f59f510066..cd4d7c4dab 100644
--- a/fxjs/include/fxjs_v8.h
+++ b/fxjs/include/fxjs_v8.h
@@ -260,7 +260,7 @@ v8::Local<v8::Value> FXJS_NewNumber(v8::Isolate* pIsolate, double number);
v8::Local<v8::Value> FXJS_NewNumber(v8::Isolate* pIsolate, float number);
v8::Local<v8::Value> FXJS_NewBoolean(v8::Isolate* pIsolate, bool b);
v8::Local<v8::Value> FXJS_NewString(v8::Isolate* pIsolate, const wchar_t* str);
-v8::Local<v8::Value> FXJS_NewDate(v8::Isolate* pIsolate, double d);
+v8::Local<v8::Date> FXJS_NewDate(v8::Isolate* pIsolate, double d);
int FXJS_ToInt32(v8::Isolate* pIsolate, v8::Local<v8::Value> pValue);
bool FXJS_ToBoolean(v8::Isolate* pIsolate, v8::Local<v8::Value> pValue);
@@ -271,6 +271,4 @@ CFX_WideString FXJS_ToString(v8::Isolate* pIsolate,
v8::Local<v8::Value> pValue);
v8::Local<v8::Array> FXJS_ToArray(v8::Isolate* pIsolate,
v8::Local<v8::Value> pValue);
-void FXJS_ValueCopy(v8::Local<v8::Value>& pTo, v8::Local<v8::Value> pFrom);
-
#endif // FXJS_INCLUDE_FXJS_V8_H_