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 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
736 return 0; | 736 return 0; |
737 return 1; | 737 return 1; |
738 } | 738 } |
739 | 739 |
740 v8::Local<v8::Value> JS_GetArrayElement(IJS_Runtime* pJSRuntime, | 740 v8::Local<v8::Value> JS_GetArrayElement(IJS_Runtime* pJSRuntime, |
741 v8::Local<v8::Array> pArray, | 741 v8::Local<v8::Array> pArray, |
742 unsigned index) { | 742 unsigned index) { |
743 if (pArray.IsEmpty()) | 743 if (pArray.IsEmpty()) |
744 return v8::Local<v8::Value>(); | 744 return v8::Local<v8::Value>(); |
745 v8::Local<v8::Value> val; | 745 v8::Local<v8::Value> val; |
746 if (pArray->Get(pJSRuntime->GetCurrentContext(), index).ToLocal(&val)) | 746 if (!pArray->Get(pJSRuntime->GetCurrentContext(), index).ToLocal(&val)) |
747 return v8::Local<v8::Value>(); | 747 return v8::Local<v8::Value>(); |
748 return val; | 748 return val; |
749 } | 749 } |
750 | 750 |
751 unsigned JS_GetArrayLength(v8::Local<v8::Array> pArray) { | 751 unsigned JS_GetArrayLength(v8::Local<v8::Array> pArray) { |
752 if (pArray.IsEmpty()) | 752 if (pArray.IsEmpty()) |
753 return 0; | 753 return 0; |
754 return pArray->Length(); | 754 return pArray->Length(); |
755 } | 755 } |
756 | 756 |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1149 | 1149 |
1150 bool JS_PortIsNan(double d) { | 1150 bool JS_PortIsNan(double d) { |
1151 return d != d; | 1151 return d != d; |
1152 } | 1152 } |
1153 | 1153 |
1154 double JS_LocalTime(double d) { | 1154 double JS_LocalTime(double d) { |
1155 return JS_GetDateTime() + _getDaylightSavingTA(d); | 1155 return JS_GetDateTime() + _getDaylightSavingTA(d); |
1156 } | 1156 } |
1157 | 1157 |
1158 // JavaScript time implement End. | 1158 // JavaScript time implement End. |
OLD | NEW |