OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "../../../core/include/fxcrt/fx_basic.h" | 7 #include "../../../core/include/fxcrt/fx_basic.h" |
8 #include "../../../core/include/fxcrt/fx_ext.h" | 8 #include "../../../core/include/fxcrt/fx_ext.h" |
9 #include "../../include/jsapi/fxjs_v8.h" | 9 #include "../../include/jsapi/fxjs_v8.h" |
10 #include "../../include/fsdk_define.h" | 10 #include "../../include/fsdk_define.h" |
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 return 0; | 741 return 0; |
742 return 1; | 742 return 1; |
743 } | 743 } |
744 | 744 |
745 v8::Local<v8::Value> JS_GetArrayElement(IJS_Runtime* pJSRuntime, | 745 v8::Local<v8::Value> JS_GetArrayElement(IJS_Runtime* pJSRuntime, |
746 v8::Local<v8::Array> pArray, | 746 v8::Local<v8::Array> pArray, |
747 unsigned index) { | 747 unsigned index) { |
748 if (pArray.IsEmpty()) | 748 if (pArray.IsEmpty()) |
749 return v8::Local<v8::Value>(); | 749 return v8::Local<v8::Value>(); |
750 v8::Local<v8::Value> val; | 750 v8::Local<v8::Value> val; |
751 if (pArray->Get(pJSRuntime->GetCurrentContext(), index).ToLocal(&val)) | 751 if (!pArray->Get(pJSRuntime->GetCurrentContext(), index).ToLocal(&val)) |
752 return v8::Local<v8::Value>(); | 752 return v8::Local<v8::Value>(); |
753 return val; | 753 return val; |
754 } | 754 } |
755 | 755 |
756 unsigned JS_GetArrayLength(v8::Local<v8::Array> pArray) { | 756 unsigned JS_GetArrayLength(v8::Local<v8::Array> pArray) { |
757 if (pArray.IsEmpty()) | 757 if (pArray.IsEmpty()) |
758 return 0; | 758 return 0; |
759 return pArray->Length(); | 759 return pArray->Length(); |
760 } | 760 } |
761 | 761 |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1154 | 1154 |
1155 bool JS_PortIsNan(double d) { | 1155 bool JS_PortIsNan(double d) { |
1156 return d != d; | 1156 return d != d; |
1157 } | 1157 } |
1158 | 1158 |
1159 double JS_LocalTime(double d) { | 1159 double JS_LocalTime(double d) { |
1160 return JS_GetDateTime() + _getDaylightSavingTA(d); | 1160 return JS_GetDateTime() + _getDaylightSavingTA(d); |
1161 } | 1161 } |
1162 | 1162 |
1163 // JavaScript time implement End. | 1163 // JavaScript time implement End. |
OLD | NEW |