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 "xfa/fxjse/value.h" | 7 #include "xfa/fxjse/value.h" |
8 | 8 |
9 #include <math.h> | 9 #include <math.h> |
10 | 10 |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 : v8::Local<v8::Object>(); | 438 : v8::Local<v8::Object>(); |
439 | 439 |
440 v8::TryCatch trycatch(m_pIsolate); | 440 v8::TryCatch trycatch(m_pIsolate); |
441 if (hFunctionObject.IsEmpty() || !hFunctionObject->IsCallable()) { | 441 if (hFunctionObject.IsEmpty() || !hFunctionObject->IsCallable()) { |
442 if (lpRetValue) | 442 if (lpRetValue) |
443 lpRetValue->ForceSetValue(FXJSE_CreateReturnValue(m_pIsolate, trycatch)); | 443 lpRetValue->ForceSetValue(FXJSE_CreateReturnValue(m_pIsolate, trycatch)); |
444 return FALSE; | 444 return FALSE; |
445 } | 445 } |
446 | 446 |
447 v8::Local<v8::Value> hReturnValue; | 447 v8::Local<v8::Value> hReturnValue; |
448 v8::Local<v8::Value>* lpLocalArgs = NULL; | 448 v8::Local<v8::Value>* lpLocalArgs = nullptr; |
449 if (nArgCount) { | 449 if (nArgCount) { |
450 lpLocalArgs = FX_Alloc(v8::Local<v8::Value>, nArgCount); | 450 lpLocalArgs = FX_Alloc(v8::Local<v8::Value>, nArgCount); |
451 for (uint32_t i = 0; i < nArgCount; i++) { | 451 for (uint32_t i = 0; i < nArgCount; i++) { |
452 new (lpLocalArgs + i) v8::Local<v8::Value>; | 452 new (lpLocalArgs + i) v8::Local<v8::Value>; |
453 CFXJSE_Value* lpArg = lpArgs[i]; | 453 CFXJSE_Value* lpArg = lpArgs[i]; |
454 if (lpArg) { | 454 if (lpArg) { |
455 lpLocalArgs[i] = | 455 lpLocalArgs[i] = |
456 v8::Local<v8::Value>::New(m_pIsolate, lpArg->DirectGetValue()); | 456 v8::Local<v8::Value>::New(m_pIsolate, lpArg->DirectGetValue()); |
457 } | 457 } |
458 if (lpLocalArgs[i].IsEmpty()) { | 458 if (lpLocalArgs[i].IsEmpty()) { |
(...skipping 30 matching lines...) Expand all Loading... |
489 if (lpRetValue) | 489 if (lpRetValue) |
490 lpRetValue->ForceSetValue(hReturnValue); | 490 lpRetValue->ForceSetValue(hReturnValue); |
491 | 491 |
492 if (lpLocalArgs) { | 492 if (lpLocalArgs) { |
493 for (uint32_t i = 0; i < nArgCount; i++) | 493 for (uint32_t i = 0; i < nArgCount; i++) |
494 lpLocalArgs[i].~Local(); | 494 lpLocalArgs[i].~Local(); |
495 FX_Free(lpLocalArgs); | 495 FX_Free(lpLocalArgs); |
496 } | 496 } |
497 return bRetValue; | 497 return bRetValue; |
498 } | 498 } |
OLD | NEW |