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/fxfa/fm2js/xfa_fm2jscontext.h" | 7 #include "xfa/fxfa/fm2js/xfa_fm2jscontext.h" |
8 | 8 |
9 #include <time.h> | 9 #include <time.h> |
10 | 10 |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 } else { | 308 } else { |
309 FX_DOUBLE dValue = HValueToDouble(hThis, argOne); | 309 FX_DOUBLE dValue = HValueToDouble(hThis, argOne); |
310 if (dValue < 0) { | 310 if (dValue < 0) { |
311 dValue = -dValue; | 311 dValue = -dValue; |
312 } | 312 } |
313 FXJSE_Value_SetDouble(args.GetReturnValue(), dValue); | 313 FXJSE_Value_SetDouble(args.GetReturnValue(), dValue); |
314 } | 314 } |
315 FXJSE_Value_Release(argOne); | 315 FXJSE_Value_Release(argOne); |
316 } else { | 316 } else { |
317 CXFA_FM2JSContext* pContext = | 317 CXFA_FM2JSContext* pContext = |
318 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 318 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
319 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 319 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
320 L"Abs"); | 320 L"Abs"); |
321 } | 321 } |
322 } | 322 } |
323 void CXFA_FM2JSContext::Avg(FXJSE_HOBJECT hThis, | 323 void CXFA_FM2JSContext::Avg(FXJSE_HOBJECT hThis, |
324 const CFX_ByteStringC& szFuncName, | 324 const CFX_ByteStringC& szFuncName, |
325 CFXJSE_Arguments& args) { | 325 CFXJSE_Arguments& args) { |
326 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 326 CXFA_FM2JSContext* pContext = |
| 327 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
327 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); | 328 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); |
328 int32_t argc = args.GetLength(); | 329 int32_t argc = args.GetLength(); |
329 uint32_t uCount = 0; | 330 uint32_t uCount = 0; |
330 FX_DOUBLE dSum = 0.0; | 331 FX_DOUBLE dSum = 0.0; |
331 if (argc >= 1) { | 332 if (argc >= 1) { |
332 FXJSE_HVALUE argValue = 0; | 333 FXJSE_HVALUE argValue = 0; |
333 for (int32_t i = 0; i < argc; i++) { | 334 for (int32_t i = 0; i < argc; i++) { |
334 argValue = args.GetValue(i); | 335 argValue = args.GetValue(i); |
335 if (FXJSE_Value_IsNull(argValue)) { | 336 if (FXJSE_Value_IsNull(argValue)) { |
336 FXJSE_Value_Release(argValue); | 337 FXJSE_Value_Release(argValue); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 } | 384 } |
384 if (0 == uCount) { | 385 if (0 == uCount) { |
385 FXJSE_Value_SetNull(args.GetReturnValue()); | 386 FXJSE_Value_SetNull(args.GetReturnValue()); |
386 } else { | 387 } else { |
387 FXJSE_Value_SetDouble(args.GetReturnValue(), dSum / uCount); | 388 FXJSE_Value_SetDouble(args.GetReturnValue(), dSum / uCount); |
388 } | 389 } |
389 } | 390 } |
390 void CXFA_FM2JSContext::Ceil(FXJSE_HOBJECT hThis, | 391 void CXFA_FM2JSContext::Ceil(FXJSE_HOBJECT hThis, |
391 const CFX_ByteStringC& szFuncName, | 392 const CFX_ByteStringC& szFuncName, |
392 CFXJSE_Arguments& args) { | 393 CFXJSE_Arguments& args) { |
393 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 394 CXFA_FM2JSContext* pContext = |
| 395 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
394 if (args.GetLength() == 1) { | 396 if (args.GetLength() == 1) { |
395 FXJSE_HVALUE argValue = GetSimpleHValue(hThis, args, 0); | 397 FXJSE_HVALUE argValue = GetSimpleHValue(hThis, args, 0); |
396 if (HValueIsNull(hThis, argValue)) { | 398 if (HValueIsNull(hThis, argValue)) { |
397 FXJSE_Value_SetNull(args.GetReturnValue()); | 399 FXJSE_Value_SetNull(args.GetReturnValue()); |
398 } else { | 400 } else { |
399 FXJSE_Value_SetFloat(args.GetReturnValue(), | 401 FXJSE_Value_SetFloat(args.GetReturnValue(), |
400 FXSYS_ceil(HValueToFloat(hThis, argValue))); | 402 FXSYS_ceil(HValueToFloat(hThis, argValue))); |
401 } | 403 } |
402 FXJSE_Value_Release(argValue); | 404 FXJSE_Value_Release(argValue); |
403 } else { | 405 } else { |
404 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 406 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
405 L"Ceil"); | 407 L"Ceil"); |
406 } | 408 } |
407 } | 409 } |
408 void CXFA_FM2JSContext::Count(FXJSE_HOBJECT hThis, | 410 void CXFA_FM2JSContext::Count(FXJSE_HOBJECT hThis, |
409 const CFX_ByteStringC& szFuncName, | 411 const CFX_ByteStringC& szFuncName, |
410 CFXJSE_Arguments& args) { | 412 CFXJSE_Arguments& args) { |
411 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 413 CXFA_FM2JSContext* pContext = |
| 414 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
412 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); | 415 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); |
413 int32_t argc = args.GetLength(); | 416 int32_t argc = args.GetLength(); |
414 uint32_t uCount = 0; | 417 uint32_t uCount = 0; |
415 FXJSE_HVALUE argValue = 0; | 418 FXJSE_HVALUE argValue = 0; |
416 for (int32_t i = 0; i < argc; i++) { | 419 for (int32_t i = 0; i < argc; i++) { |
417 argValue = args.GetValue(i); | 420 argValue = args.GetValue(i); |
418 if (FXJSE_Value_IsNull(argValue)) { | 421 if (FXJSE_Value_IsNull(argValue)) { |
419 FXJSE_Value_Release(argValue); | 422 FXJSE_Value_Release(argValue); |
420 continue; | 423 continue; |
421 } else if (FXJSE_Value_IsArray(argValue)) { | 424 } else if (FXJSE_Value_IsArray(argValue)) { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 uCount++; | 467 uCount++; |
465 } | 468 } |
466 FXJSE_Value_Release(argValue); | 469 FXJSE_Value_Release(argValue); |
467 } | 470 } |
468 argValue = 0; | 471 argValue = 0; |
469 FXJSE_Value_SetInteger(args.GetReturnValue(), (int32_t)uCount); | 472 FXJSE_Value_SetInteger(args.GetReturnValue(), (int32_t)uCount); |
470 } | 473 } |
471 void CXFA_FM2JSContext::Floor(FXJSE_HOBJECT hThis, | 474 void CXFA_FM2JSContext::Floor(FXJSE_HOBJECT hThis, |
472 const CFX_ByteStringC& szFuncName, | 475 const CFX_ByteStringC& szFuncName, |
473 CFXJSE_Arguments& args) { | 476 CFXJSE_Arguments& args) { |
474 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 477 CXFA_FM2JSContext* pContext = |
| 478 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
475 if (args.GetLength() == 1) { | 479 if (args.GetLength() == 1) { |
476 FXJSE_HVALUE argValue = GetSimpleHValue(hThis, args, 0); | 480 FXJSE_HVALUE argValue = GetSimpleHValue(hThis, args, 0); |
477 if (HValueIsNull(hThis, argValue)) { | 481 if (HValueIsNull(hThis, argValue)) { |
478 FXJSE_Value_SetNull(args.GetReturnValue()); | 482 FXJSE_Value_SetNull(args.GetReturnValue()); |
479 } else { | 483 } else { |
480 FXJSE_Value_SetFloat(args.GetReturnValue(), | 484 FXJSE_Value_SetFloat(args.GetReturnValue(), |
481 FXSYS_floor(HValueToFloat(hThis, argValue))); | 485 FXSYS_floor(HValueToFloat(hThis, argValue))); |
482 } | 486 } |
483 FXJSE_Value_Release(argValue); | 487 FXJSE_Value_Release(argValue); |
484 } else { | 488 } else { |
485 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 489 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
486 L"Floor"); | 490 L"Floor"); |
487 } | 491 } |
488 } | 492 } |
489 void CXFA_FM2JSContext::Max(FXJSE_HOBJECT hThis, | 493 void CXFA_FM2JSContext::Max(FXJSE_HOBJECT hThis, |
490 const CFX_ByteStringC& szFuncName, | 494 const CFX_ByteStringC& szFuncName, |
491 CFXJSE_Arguments& args) { | 495 CFXJSE_Arguments& args) { |
492 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 496 CXFA_FM2JSContext* pContext = |
| 497 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
493 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); | 498 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); |
494 int32_t argc = args.GetLength(); | 499 int32_t argc = args.GetLength(); |
495 uint32_t uCount = 0; | 500 uint32_t uCount = 0; |
496 FX_DOUBLE dMaxValue = 0.0; | 501 FX_DOUBLE dMaxValue = 0.0; |
497 FXJSE_HVALUE argValue = 0; | 502 FXJSE_HVALUE argValue = 0; |
498 for (int32_t i = 0; i < argc; i++) { | 503 for (int32_t i = 0; i < argc; i++) { |
499 argValue = args.GetValue(i); | 504 argValue = args.GetValue(i); |
500 if (FXJSE_Value_IsNull(argValue)) { | 505 if (FXJSE_Value_IsNull(argValue)) { |
501 FXJSE_Value_Release(argValue); | 506 FXJSE_Value_Release(argValue); |
502 continue; | 507 continue; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 argValue = 0; | 589 argValue = 0; |
585 if (uCount) { | 590 if (uCount) { |
586 FXJSE_Value_SetDouble(args.GetReturnValue(), dMaxValue); | 591 FXJSE_Value_SetDouble(args.GetReturnValue(), dMaxValue); |
587 } else { | 592 } else { |
588 FXJSE_Value_SetNull(args.GetReturnValue()); | 593 FXJSE_Value_SetNull(args.GetReturnValue()); |
589 } | 594 } |
590 } | 595 } |
591 void CXFA_FM2JSContext::Min(FXJSE_HOBJECT hThis, | 596 void CXFA_FM2JSContext::Min(FXJSE_HOBJECT hThis, |
592 const CFX_ByteStringC& szFuncName, | 597 const CFX_ByteStringC& szFuncName, |
593 CFXJSE_Arguments& args) { | 598 CFXJSE_Arguments& args) { |
594 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 599 CXFA_FM2JSContext* pContext = |
| 600 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
595 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); | 601 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); |
596 int32_t argc = args.GetLength(); | 602 int32_t argc = args.GetLength(); |
597 uint32_t uCount = 0; | 603 uint32_t uCount = 0; |
598 FX_DOUBLE dMinValue = 0.0; | 604 FX_DOUBLE dMinValue = 0.0; |
599 FXJSE_HVALUE argValue = 0; | 605 FXJSE_HVALUE argValue = 0; |
600 for (int32_t i = 0; i < argc; i++) { | 606 for (int32_t i = 0; i < argc; i++) { |
601 argValue = args.GetValue(i); | 607 argValue = args.GetValue(i); |
602 if (FXJSE_Value_IsNull(argValue)) { | 608 if (FXJSE_Value_IsNull(argValue)) { |
603 FXJSE_Value_Release(argValue); | 609 FXJSE_Value_Release(argValue); |
604 continue; | 610 continue; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 argValue = 0; | 692 argValue = 0; |
687 if (uCount) { | 693 if (uCount) { |
688 FXJSE_Value_SetDouble(args.GetReturnValue(), dMinValue); | 694 FXJSE_Value_SetDouble(args.GetReturnValue(), dMinValue); |
689 } else { | 695 } else { |
690 FXJSE_Value_SetNull(args.GetReturnValue()); | 696 FXJSE_Value_SetNull(args.GetReturnValue()); |
691 } | 697 } |
692 } | 698 } |
693 void CXFA_FM2JSContext::Mod(FXJSE_HOBJECT hThis, | 699 void CXFA_FM2JSContext::Mod(FXJSE_HOBJECT hThis, |
694 const CFX_ByteStringC& szFuncName, | 700 const CFX_ByteStringC& szFuncName, |
695 CFXJSE_Arguments& args) { | 701 CFXJSE_Arguments& args) { |
696 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 702 CXFA_FM2JSContext* pContext = |
| 703 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
697 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); | 704 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); |
698 if (args.GetLength() == 2) { | 705 if (args.GetLength() == 2) { |
699 FXJSE_HVALUE argOne = args.GetValue(0); | 706 FXJSE_HVALUE argOne = args.GetValue(0); |
700 FXJSE_HVALUE argTwo = args.GetValue(1); | 707 FXJSE_HVALUE argTwo = args.GetValue(1); |
701 if (FXJSE_Value_IsNull(argOne) || FXJSE_Value_IsNull(argTwo)) { | 708 if (FXJSE_Value_IsNull(argOne) || FXJSE_Value_IsNull(argTwo)) { |
702 FXJSE_Value_SetNull(args.GetReturnValue()); | 709 FXJSE_Value_SetNull(args.GetReturnValue()); |
703 } else { | 710 } else { |
704 FX_DOUBLE dDividend = 0.0; | 711 FX_DOUBLE dDividend = 0.0; |
705 FX_DOUBLE dDividor = 0.0; | 712 FX_DOUBLE dDividor = 0.0; |
706 if (FXJSE_Value_IsArray(argOne)) { | 713 if (FXJSE_Value_IsArray(argOne)) { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
772 FXJSE_Value_Release(argOne); | 779 FXJSE_Value_Release(argOne); |
773 FXJSE_Value_Release(argTwo); | 780 FXJSE_Value_Release(argTwo); |
774 } else { | 781 } else { |
775 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 782 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
776 L"Mod"); | 783 L"Mod"); |
777 } | 784 } |
778 } | 785 } |
779 void CXFA_FM2JSContext::Round(FXJSE_HOBJECT hThis, | 786 void CXFA_FM2JSContext::Round(FXJSE_HOBJECT hThis, |
780 const CFX_ByteStringC& szFuncName, | 787 const CFX_ByteStringC& szFuncName, |
781 CFXJSE_Arguments& args) { | 788 CFXJSE_Arguments& args) { |
782 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 789 CXFA_FM2JSContext* pContext = |
| 790 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
783 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); | 791 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); |
784 int32_t argc = args.GetLength(); | 792 int32_t argc = args.GetLength(); |
785 uint8_t uPrecision = 0; | 793 uint8_t uPrecision = 0; |
786 if (argc == 1) { | 794 if (argc == 1) { |
787 FXJSE_HVALUE argOne = args.GetValue(0); | 795 FXJSE_HVALUE argOne = args.GetValue(0); |
788 if (FXJSE_Value_IsNull(argOne)) { | 796 if (FXJSE_Value_IsNull(argOne)) { |
789 FXJSE_Value_SetNull(args.GetReturnValue()); | 797 FXJSE_Value_SetNull(args.GetReturnValue()); |
790 } else { | 798 } else { |
791 FX_DOUBLE dValue = 0.0; | 799 FX_DOUBLE dValue = 0.0; |
792 if (FXJSE_Value_IsArray(argOne)) { | 800 if (FXJSE_Value_IsArray(argOne)) { |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
881 FXJSE_Value_Release(argOne); | 889 FXJSE_Value_Release(argOne); |
882 FXJSE_Value_Release(argTwo); | 890 FXJSE_Value_Release(argTwo); |
883 } else { | 891 } else { |
884 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 892 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
885 L"Round"); | 893 L"Round"); |
886 } | 894 } |
887 } | 895 } |
888 void CXFA_FM2JSContext::Sum(FXJSE_HOBJECT hThis, | 896 void CXFA_FM2JSContext::Sum(FXJSE_HOBJECT hThis, |
889 const CFX_ByteStringC& szFuncName, | 897 const CFX_ByteStringC& szFuncName, |
890 CFXJSE_Arguments& args) { | 898 CFXJSE_Arguments& args) { |
891 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 899 CXFA_FM2JSContext* pContext = |
| 900 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
892 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); | 901 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); |
893 int32_t argc = args.GetLength(); | 902 int32_t argc = args.GetLength(); |
894 uint32_t uCount = 0; | 903 uint32_t uCount = 0; |
895 FX_DOUBLE dSum = 0.0; | 904 FX_DOUBLE dSum = 0.0; |
896 if (argc) { | 905 if (argc) { |
897 FXJSE_HVALUE argValue = 0; | 906 FXJSE_HVALUE argValue = 0; |
898 for (int32_t i = 0; i < argc; i++) { | 907 for (int32_t i = 0; i < argc; i++) { |
899 argValue = args.GetValue(i); | 908 argValue = args.GetValue(i); |
900 if (FXJSE_Value_IsNull(argValue)) { | 909 if (FXJSE_Value_IsNull(argValue)) { |
901 FXJSE_Value_Release(argValue); | 910 FXJSE_Value_Release(argValue); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
972 CFX_ByteString bufferMon; | 981 CFX_ByteString bufferMon; |
973 CFX_ByteString bufferDay; | 982 CFX_ByteString bufferDay; |
974 bufferYear.Format("%d", pTmStruct->tm_year + 1900); | 983 bufferYear.Format("%d", pTmStruct->tm_year + 1900); |
975 bufferMon.Format("%02d", pTmStruct->tm_mon + 1); | 984 bufferMon.Format("%02d", pTmStruct->tm_mon + 1); |
976 bufferDay.Format("%02d", pTmStruct->tm_mday); | 985 bufferDay.Format("%02d", pTmStruct->tm_mday); |
977 CFX_ByteString bufferCurrent = bufferYear + bufferMon + bufferDay; | 986 CFX_ByteString bufferCurrent = bufferYear + bufferMon + bufferDay; |
978 int32_t dDays = DateString2Num(bufferCurrent.AsStringC()); | 987 int32_t dDays = DateString2Num(bufferCurrent.AsStringC()); |
979 FXJSE_Value_SetInteger(args.GetReturnValue(), dDays); | 988 FXJSE_Value_SetInteger(args.GetReturnValue(), dDays); |
980 } else { | 989 } else { |
981 CXFA_FM2JSContext* pContext = | 990 CXFA_FM2JSContext* pContext = |
982 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 991 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
983 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 992 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
984 L"Date"); | 993 L"Date"); |
985 } | 994 } |
986 } | 995 } |
987 void CXFA_FM2JSContext::Date2Num(FXJSE_HOBJECT hThis, | 996 void CXFA_FM2JSContext::Date2Num(FXJSE_HOBJECT hThis, |
988 const CFX_ByteStringC& szFuncName, | 997 const CFX_ByteStringC& szFuncName, |
989 CFXJSE_Arguments& args) { | 998 CFXJSE_Arguments& args) { |
990 int32_t argc = args.GetLength(); | 999 int32_t argc = args.GetLength(); |
991 if ((argc > 0) && (argc < 4)) { | 1000 if ((argc > 0) && (argc < 4)) { |
992 FX_BOOL bFlags = FALSE; | 1001 FX_BOOL bFlags = FALSE; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1033 } | 1042 } |
1034 FXJSE_Value_Release(dateValue); | 1043 FXJSE_Value_Release(dateValue); |
1035 if (argc > 1) { | 1044 if (argc > 1) { |
1036 FXJSE_Value_Release(formatValue); | 1045 FXJSE_Value_Release(formatValue); |
1037 if (argc == 3) { | 1046 if (argc == 3) { |
1038 FXJSE_Value_Release(localValue); | 1047 FXJSE_Value_Release(localValue); |
1039 } | 1048 } |
1040 } | 1049 } |
1041 } else { | 1050 } else { |
1042 CXFA_FM2JSContext* pContext = | 1051 CXFA_FM2JSContext* pContext = |
1043 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 1052 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
1044 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 1053 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
1045 L"Date2Num"); | 1054 L"Date2Num"); |
1046 } | 1055 } |
1047 } | 1056 } |
1048 void CXFA_FM2JSContext::DateFmt(FXJSE_HOBJECT hThis, | 1057 void CXFA_FM2JSContext::DateFmt(FXJSE_HOBJECT hThis, |
1049 const CFX_ByteStringC& szFuncName, | 1058 const CFX_ByteStringC& szFuncName, |
1050 CFXJSE_Arguments& args) { | 1059 CFXJSE_Arguments& args) { |
1051 int32_t argc = args.GetLength(); | 1060 int32_t argc = args.GetLength(); |
1052 if (argc < 3) { | 1061 if (argc < 3) { |
1053 FX_BOOL bFlags = FALSE; | 1062 FX_BOOL bFlags = FALSE; |
(...skipping 30 matching lines...) Expand all Loading... |
1084 FXJSE_Value_SetNull(args.GetReturnValue()); | 1093 FXJSE_Value_SetNull(args.GetReturnValue()); |
1085 } | 1094 } |
1086 if (argc > 0) { | 1095 if (argc > 0) { |
1087 FXJSE_Value_Release(argStyle); | 1096 FXJSE_Value_Release(argStyle); |
1088 if (argc == 2) { | 1097 if (argc == 2) { |
1089 FXJSE_Value_Release(argLocal); | 1098 FXJSE_Value_Release(argLocal); |
1090 } | 1099 } |
1091 } | 1100 } |
1092 } else { | 1101 } else { |
1093 CXFA_FM2JSContext* pContext = | 1102 CXFA_FM2JSContext* pContext = |
1094 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 1103 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
1095 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 1104 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
1096 L"Date2Num"); | 1105 L"Date2Num"); |
1097 } | 1106 } |
1098 } | 1107 } |
1099 void CXFA_FM2JSContext::IsoDate2Num(FXJSE_HOBJECT hThis, | 1108 void CXFA_FM2JSContext::IsoDate2Num(FXJSE_HOBJECT hThis, |
1100 const CFX_ByteStringC& szFuncName, | 1109 const CFX_ByteStringC& szFuncName, |
1101 CFXJSE_Arguments& args) { | 1110 CFXJSE_Arguments& args) { |
1102 if (args.GetLength() == 1) { | 1111 if (args.GetLength() == 1) { |
1103 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); | 1112 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); |
1104 if (FXJSE_Value_IsNull(argOne)) { | 1113 if (FXJSE_Value_IsNull(argOne)) { |
1105 FXJSE_Value_SetNull(args.GetReturnValue()); | 1114 FXJSE_Value_SetNull(args.GetReturnValue()); |
1106 } else { | 1115 } else { |
1107 CFX_ByteString szArgString; | 1116 CFX_ByteString szArgString; |
1108 HValueToUTF8String(argOne, szArgString); | 1117 HValueToUTF8String(argOne, szArgString); |
1109 int32_t dDays = DateString2Num(szArgString.AsStringC()); | 1118 int32_t dDays = DateString2Num(szArgString.AsStringC()); |
1110 FXJSE_Value_SetInteger(args.GetReturnValue(), (int32_t)dDays); | 1119 FXJSE_Value_SetInteger(args.GetReturnValue(), (int32_t)dDays); |
1111 } | 1120 } |
1112 FXJSE_Value_Release(argOne); | 1121 FXJSE_Value_Release(argOne); |
1113 } else { | 1122 } else { |
1114 CXFA_FM2JSContext* pContext = | 1123 CXFA_FM2JSContext* pContext = |
1115 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 1124 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
1116 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 1125 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
1117 L"IsoDate2Num"); | 1126 L"IsoDate2Num"); |
1118 } | 1127 } |
1119 } | 1128 } |
1120 void CXFA_FM2JSContext::IsoTime2Num(FXJSE_HOBJECT hThis, | 1129 void CXFA_FM2JSContext::IsoTime2Num(FXJSE_HOBJECT hThis, |
1121 const CFX_ByteStringC& szFuncName, | 1130 const CFX_ByteStringC& szFuncName, |
1122 CFXJSE_Arguments& args) { | 1131 CFXJSE_Arguments& args) { |
1123 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 1132 CXFA_FM2JSContext* pContext = |
| 1133 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
1124 if (args.GetLength() == 1) { | 1134 if (args.GetLength() == 1) { |
1125 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); | 1135 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); |
1126 if (HValueIsNull(hThis, argOne)) { | 1136 if (HValueIsNull(hThis, argOne)) { |
1127 FXJSE_Value_SetNull(args.GetReturnValue()); | 1137 FXJSE_Value_SetNull(args.GetReturnValue()); |
1128 } else { | 1138 } else { |
1129 CXFA_Document* pDoc = pContext->GetDocument(); | 1139 CXFA_Document* pDoc = pContext->GetDocument(); |
1130 ASSERT(pDoc); | 1140 ASSERT(pDoc); |
1131 IFX_LocaleMgr* pMgr = (IFX_LocaleMgr*)pDoc->GetLocalMgr(); | 1141 IFX_LocaleMgr* pMgr = (IFX_LocaleMgr*)pDoc->GetLocalMgr(); |
1132 CFX_ByteString szArgString; | 1142 CFX_ByteString szArgString; |
1133 HValueToUTF8String(argOne, szArgString); | 1143 HValueToUTF8String(argOne, szArgString); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1212 FXJSE_Value_SetNull(args.GetReturnValue()); | 1222 FXJSE_Value_SetNull(args.GetReturnValue()); |
1213 } | 1223 } |
1214 if (argc > 0) { | 1224 if (argc > 0) { |
1215 FXJSE_Value_Release(argStyle); | 1225 FXJSE_Value_Release(argStyle); |
1216 if (argc == 2) { | 1226 if (argc == 2) { |
1217 FXJSE_Value_Release(argLocal); | 1227 FXJSE_Value_Release(argLocal); |
1218 } | 1228 } |
1219 } | 1229 } |
1220 } else { | 1230 } else { |
1221 CXFA_FM2JSContext* pContext = | 1231 CXFA_FM2JSContext* pContext = |
1222 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 1232 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
1223 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 1233 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
1224 L"LocalDateFmt"); | 1234 L"LocalDateFmt"); |
1225 } | 1235 } |
1226 } | 1236 } |
1227 void CXFA_FM2JSContext::LocalTimeFmt(FXJSE_HOBJECT hThis, | 1237 void CXFA_FM2JSContext::LocalTimeFmt(FXJSE_HOBJECT hThis, |
1228 const CFX_ByteStringC& szFuncName, | 1238 const CFX_ByteStringC& szFuncName, |
1229 CFXJSE_Arguments& args) { | 1239 CFXJSE_Arguments& args) { |
1230 int32_t argc = args.GetLength(); | 1240 int32_t argc = args.GetLength(); |
1231 if (argc < 3) { | 1241 if (argc < 3) { |
1232 FX_BOOL bFlags = FALSE; | 1242 FX_BOOL bFlags = FALSE; |
(...skipping 30 matching lines...) Expand all Loading... |
1263 FXJSE_Value_SetNull(args.GetReturnValue()); | 1273 FXJSE_Value_SetNull(args.GetReturnValue()); |
1264 } | 1274 } |
1265 if (argc > 0) { | 1275 if (argc > 0) { |
1266 FXJSE_Value_Release(argStyle); | 1276 FXJSE_Value_Release(argStyle); |
1267 if (argc == 2) { | 1277 if (argc == 2) { |
1268 FXJSE_Value_Release(argLocal); | 1278 FXJSE_Value_Release(argLocal); |
1269 } | 1279 } |
1270 } | 1280 } |
1271 } else { | 1281 } else { |
1272 CXFA_FM2JSContext* pContext = | 1282 CXFA_FM2JSContext* pContext = |
1273 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 1283 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
1274 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 1284 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
1275 L"LocalTimeFmt"); | 1285 L"LocalTimeFmt"); |
1276 } | 1286 } |
1277 } | 1287 } |
1278 void CXFA_FM2JSContext::Num2Date(FXJSE_HOBJECT hThis, | 1288 void CXFA_FM2JSContext::Num2Date(FXJSE_HOBJECT hThis, |
1279 const CFX_ByteStringC& szFuncName, | 1289 const CFX_ByteStringC& szFuncName, |
1280 CFXJSE_Arguments& args) { | 1290 CFXJSE_Arguments& args) { |
1281 int32_t argc = args.GetLength(); | 1291 int32_t argc = args.GetLength(); |
1282 if ((argc > 0) && (argc < 4)) { | 1292 if ((argc > 0) && (argc < 4)) { |
1283 FX_BOOL bFlags = FALSE; | 1293 FX_BOOL bFlags = FALSE; |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1418 } | 1428 } |
1419 FXJSE_Value_Release(dateValue); | 1429 FXJSE_Value_Release(dateValue); |
1420 if (argc > 1) { | 1430 if (argc > 1) { |
1421 FXJSE_Value_Release(formatValue); | 1431 FXJSE_Value_Release(formatValue); |
1422 if (argc == 3) { | 1432 if (argc == 3) { |
1423 FXJSE_Value_Release(localValue); | 1433 FXJSE_Value_Release(localValue); |
1424 } | 1434 } |
1425 } | 1435 } |
1426 } else { | 1436 } else { |
1427 CXFA_FM2JSContext* pContext = | 1437 CXFA_FM2JSContext* pContext = |
1428 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 1438 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
1429 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 1439 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
1430 L"Num2Date"); | 1440 L"Num2Date"); |
1431 } | 1441 } |
1432 } | 1442 } |
1433 void CXFA_FM2JSContext::Num2GMTime(FXJSE_HOBJECT hThis, | 1443 void CXFA_FM2JSContext::Num2GMTime(FXJSE_HOBJECT hThis, |
1434 const CFX_ByteStringC& szFuncName, | 1444 const CFX_ByteStringC& szFuncName, |
1435 CFXJSE_Arguments& args) { | 1445 CFXJSE_Arguments& args) { |
1436 int32_t argc = args.GetLength(); | 1446 int32_t argc = args.GetLength(); |
1437 if ((argc > 0) && (argc < 4)) { | 1447 if ((argc > 0) && (argc < 4)) { |
1438 FX_BOOL bFlags = FALSE; | 1448 FX_BOOL bFlags = FALSE; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1480 } | 1490 } |
1481 FXJSE_Value_Release(timeValue); | 1491 FXJSE_Value_Release(timeValue); |
1482 if (argc > 1) { | 1492 if (argc > 1) { |
1483 FXJSE_Value_Release(formatValue); | 1493 FXJSE_Value_Release(formatValue); |
1484 if (argc == 3) { | 1494 if (argc == 3) { |
1485 FXJSE_Value_Release(localValue); | 1495 FXJSE_Value_Release(localValue); |
1486 } | 1496 } |
1487 } | 1497 } |
1488 } else { | 1498 } else { |
1489 CXFA_FM2JSContext* pContext = | 1499 CXFA_FM2JSContext* pContext = |
1490 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 1500 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
1491 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 1501 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
1492 L"Num2GMTime"); | 1502 L"Num2GMTime"); |
1493 } | 1503 } |
1494 } | 1504 } |
1495 void CXFA_FM2JSContext::Num2Time(FXJSE_HOBJECT hThis, | 1505 void CXFA_FM2JSContext::Num2Time(FXJSE_HOBJECT hThis, |
1496 const CFX_ByteStringC& szFuncName, | 1506 const CFX_ByteStringC& szFuncName, |
1497 CFXJSE_Arguments& args) { | 1507 CFXJSE_Arguments& args) { |
1498 int32_t argc = args.GetLength(); | 1508 int32_t argc = args.GetLength(); |
1499 if ((argc > 0) && (argc < 4)) { | 1509 if ((argc > 0) && (argc < 4)) { |
1500 FX_BOOL bFlags = FALSE; | 1510 FX_BOOL bFlags = FALSE; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1542 } | 1552 } |
1543 FXJSE_Value_Release(timeValue); | 1553 FXJSE_Value_Release(timeValue); |
1544 if (argc > 1) { | 1554 if (argc > 1) { |
1545 FXJSE_Value_Release(formatValue); | 1555 FXJSE_Value_Release(formatValue); |
1546 if (argc == 3) { | 1556 if (argc == 3) { |
1547 FXJSE_Value_Release(localValue); | 1557 FXJSE_Value_Release(localValue); |
1548 } | 1558 } |
1549 } | 1559 } |
1550 } else { | 1560 } else { |
1551 CXFA_FM2JSContext* pContext = | 1561 CXFA_FM2JSContext* pContext = |
1552 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 1562 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
1553 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 1563 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
1554 L"Num2Time"); | 1564 L"Num2Time"); |
1555 } | 1565 } |
1556 } | 1566 } |
1557 void CXFA_FM2JSContext::Time(FXJSE_HOBJECT hThis, | 1567 void CXFA_FM2JSContext::Time(FXJSE_HOBJECT hThis, |
1558 const CFX_ByteStringC& szFuncName, | 1568 const CFX_ByteStringC& szFuncName, |
1559 CFXJSE_Arguments& args) { | 1569 CFXJSE_Arguments& args) { |
1560 if (args.GetLength() == 0) { | 1570 if (args.GetLength() == 0) { |
1561 time_t now; | 1571 time_t now; |
1562 time(&now); | 1572 time(&now); |
1563 struct tm* pGmt = gmtime(&now); | 1573 struct tm* pGmt = gmtime(&now); |
1564 int32_t iGMHour = pGmt->tm_hour; | 1574 int32_t iGMHour = pGmt->tm_hour; |
1565 int32_t iGMMin = pGmt->tm_min; | 1575 int32_t iGMMin = pGmt->tm_min; |
1566 int32_t iGMSec = pGmt->tm_sec; | 1576 int32_t iGMSec = pGmt->tm_sec; |
1567 FXJSE_Value_SetInteger(args.GetReturnValue(), | 1577 FXJSE_Value_SetInteger(args.GetReturnValue(), |
1568 ((iGMHour * 3600 + iGMMin * 60 + iGMSec) * 1000)); | 1578 ((iGMHour * 3600 + iGMMin * 60 + iGMSec) * 1000)); |
1569 } else { | 1579 } else { |
1570 CXFA_FM2JSContext* pContext = | 1580 CXFA_FM2JSContext* pContext = |
1571 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 1581 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
1572 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 1582 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
1573 L"Time"); | 1583 L"Time"); |
1574 } | 1584 } |
1575 } | 1585 } |
1576 void CXFA_FM2JSContext::Time2Num(FXJSE_HOBJECT hThis, | 1586 void CXFA_FM2JSContext::Time2Num(FXJSE_HOBJECT hThis, |
1577 const CFX_ByteStringC& szFuncName, | 1587 const CFX_ByteStringC& szFuncName, |
1578 CFXJSE_Arguments& args) { | 1588 CFXJSE_Arguments& args) { |
1579 int32_t argc = args.GetLength(); | 1589 int32_t argc = args.GetLength(); |
1580 if ((argc > 0) && (argc < 4)) { | 1590 if ((argc > 0) && (argc < 4)) { |
1581 FX_BOOL bFlags = FALSE; | 1591 FX_BOOL bFlags = FALSE; |
(...skipping 19 matching lines...) Expand all Loading... |
1601 if (argc == 3) { | 1611 if (argc == 3) { |
1602 localValue = GetSimpleHValue(hThis, args, 2); | 1612 localValue = GetSimpleHValue(hThis, args, 2); |
1603 if (HValueIsNull(hThis, localValue)) { | 1613 if (HValueIsNull(hThis, localValue)) { |
1604 bFlags = TRUE; | 1614 bFlags = TRUE; |
1605 } else { | 1615 } else { |
1606 HValueToUTF8String(localValue, localString); | 1616 HValueToUTF8String(localValue, localString); |
1607 } | 1617 } |
1608 } | 1618 } |
1609 if (!bFlags) { | 1619 if (!bFlags) { |
1610 CXFA_FM2JSContext* pContext = | 1620 CXFA_FM2JSContext* pContext = |
1611 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 1621 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
1612 CXFA_Document* pDoc = pContext->GetDocument(); | 1622 CXFA_Document* pDoc = pContext->GetDocument(); |
1613 IFX_LocaleMgr* pMgr = (IFX_LocaleMgr*)pDoc->GetLocalMgr(); | 1623 IFX_LocaleMgr* pMgr = (IFX_LocaleMgr*)pDoc->GetLocalMgr(); |
1614 IFX_Locale* pLocale = NULL; | 1624 IFX_Locale* pLocale = NULL; |
1615 if (localString.IsEmpty()) { | 1625 if (localString.IsEmpty()) { |
1616 CXFA_Node* pThisNode = | 1626 CXFA_Node* pThisNode = |
1617 ToNode(pDoc->GetScriptContext()->GetThisObject()); | 1627 ToNode(pDoc->GetScriptContext()->GetThisObject()); |
1618 ASSERT(pThisNode); | 1628 ASSERT(pThisNode); |
1619 CXFA_WidgetData widgetData(pThisNode); | 1629 CXFA_WidgetData widgetData(pThisNode); |
1620 pLocale = widgetData.GetLocal(); | 1630 pLocale = widgetData.GetLocal(); |
1621 } else { | 1631 } else { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1665 } | 1675 } |
1666 FXJSE_Value_Release(timeValue); | 1676 FXJSE_Value_Release(timeValue); |
1667 if (argc > 1) { | 1677 if (argc > 1) { |
1668 FXJSE_Value_Release(formatValue); | 1678 FXJSE_Value_Release(formatValue); |
1669 if (argc == 3) { | 1679 if (argc == 3) { |
1670 FXJSE_Value_Release(localValue); | 1680 FXJSE_Value_Release(localValue); |
1671 } | 1681 } |
1672 } | 1682 } |
1673 } else { | 1683 } else { |
1674 CXFA_FM2JSContext* pContext = | 1684 CXFA_FM2JSContext* pContext = |
1675 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 1685 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
1676 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 1686 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
1677 L"Time2Num"); | 1687 L"Time2Num"); |
1678 } | 1688 } |
1679 } | 1689 } |
1680 void CXFA_FM2JSContext::TimeFmt(FXJSE_HOBJECT hThis, | 1690 void CXFA_FM2JSContext::TimeFmt(FXJSE_HOBJECT hThis, |
1681 const CFX_ByteStringC& szFuncName, | 1691 const CFX_ByteStringC& szFuncName, |
1682 CFXJSE_Arguments& args) { | 1692 CFXJSE_Arguments& args) { |
1683 int32_t argc = args.GetLength(); | 1693 int32_t argc = args.GetLength(); |
1684 if (argc < 3) { | 1694 if (argc < 3) { |
1685 FX_BOOL bFlags = FALSE; | 1695 FX_BOOL bFlags = FALSE; |
(...skipping 30 matching lines...) Expand all Loading... |
1716 FXJSE_Value_SetNull(args.GetReturnValue()); | 1726 FXJSE_Value_SetNull(args.GetReturnValue()); |
1717 } | 1727 } |
1718 if (argc > 0) { | 1728 if (argc > 0) { |
1719 FXJSE_Value_Release(argStyle); | 1729 FXJSE_Value_Release(argStyle); |
1720 if (argc == 2) { | 1730 if (argc == 2) { |
1721 FXJSE_Value_Release(argLocal); | 1731 FXJSE_Value_Release(argLocal); |
1722 } | 1732 } |
1723 } | 1733 } |
1724 } else { | 1734 } else { |
1725 CXFA_FM2JSContext* pContext = | 1735 CXFA_FM2JSContext* pContext = |
1726 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 1736 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
1727 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 1737 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
1728 L"TimeFmt"); | 1738 L"TimeFmt"); |
1729 } | 1739 } |
1730 } | 1740 } |
1731 FX_BOOL CXFA_FM2JSContext::IsIsoDateFormat(const FX_CHAR* pData, | 1741 FX_BOOL CXFA_FM2JSContext::IsIsoDateFormat(const FX_CHAR* pData, |
1732 int32_t iLength, | 1742 int32_t iLength, |
1733 int32_t& iStyle, | 1743 int32_t& iStyle, |
1734 int32_t& iYear, | 1744 int32_t& iYear, |
1735 int32_t& iMonth, | 1745 int32_t& iMonth, |
1736 int32_t& iDay) { | 1746 int32_t& iDay) { |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2045 return iRet; | 2055 return iRet; |
2046 } | 2056 } |
2047 iRet = TRUE; | 2057 iRet = TRUE; |
2048 return iRet; | 2058 return iRet; |
2049 } | 2059 } |
2050 FX_BOOL CXFA_FM2JSContext::Local2IsoDate(FXJSE_HOBJECT hThis, | 2060 FX_BOOL CXFA_FM2JSContext::Local2IsoDate(FXJSE_HOBJECT hThis, |
2051 const CFX_ByteStringC& szDate, | 2061 const CFX_ByteStringC& szDate, |
2052 const CFX_ByteStringC& szFormat, | 2062 const CFX_ByteStringC& szFormat, |
2053 const CFX_ByteStringC& szLocale, | 2063 const CFX_ByteStringC& szLocale, |
2054 CFX_ByteString& strIsoDate) { | 2064 CFX_ByteString& strIsoDate) { |
2055 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 2065 CXFA_FM2JSContext* pContext = |
| 2066 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
2056 CXFA_Document* pDoc = pContext->GetDocument(); | 2067 CXFA_Document* pDoc = pContext->GetDocument(); |
2057 if (!pDoc) { | 2068 if (!pDoc) { |
2058 return FALSE; | 2069 return FALSE; |
2059 } | 2070 } |
2060 IFX_LocaleMgr* pMgr = (IFX_LocaleMgr*)pDoc->GetLocalMgr(); | 2071 IFX_LocaleMgr* pMgr = (IFX_LocaleMgr*)pDoc->GetLocalMgr(); |
2061 IFX_Locale* pLocale = NULL; | 2072 IFX_Locale* pLocale = NULL; |
2062 if (szLocale.IsEmpty()) { | 2073 if (szLocale.IsEmpty()) { |
2063 CXFA_Node* pThisNode = ToNode(pDoc->GetScriptContext()->GetThisObject()); | 2074 CXFA_Node* pThisNode = ToNode(pDoc->GetScriptContext()->GetThisObject()); |
2064 ASSERT(pThisNode); | 2075 ASSERT(pThisNode); |
2065 CXFA_WidgetData widgetData(pThisNode); | 2076 CXFA_WidgetData widgetData(pThisNode); |
(...skipping 14 matching lines...) Expand all Loading... |
2080 wsFormat, pLocale, (CXFA_LocaleMgr*)pMgr); | 2091 wsFormat, pLocale, (CXFA_LocaleMgr*)pMgr); |
2081 CFX_Unitime dt = widgetValue.GetDate(); | 2092 CFX_Unitime dt = widgetValue.GetDate(); |
2082 strIsoDate.Format("%4d-%02d-%02d", dt.GetYear(), dt.GetMonth(), dt.GetDay()); | 2093 strIsoDate.Format("%4d-%02d-%02d", dt.GetYear(), dt.GetMonth(), dt.GetDay()); |
2083 return TRUE; | 2094 return TRUE; |
2084 } | 2095 } |
2085 FX_BOOL CXFA_FM2JSContext::Local2IsoTime(FXJSE_HOBJECT hThis, | 2096 FX_BOOL CXFA_FM2JSContext::Local2IsoTime(FXJSE_HOBJECT hThis, |
2086 const CFX_ByteStringC& szTime, | 2097 const CFX_ByteStringC& szTime, |
2087 const CFX_ByteStringC& szFormat, | 2098 const CFX_ByteStringC& szFormat, |
2088 const CFX_ByteStringC& szLocale, | 2099 const CFX_ByteStringC& szLocale, |
2089 CFX_ByteString& strIsoTime) { | 2100 CFX_ByteString& strIsoTime) { |
2090 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 2101 CXFA_FM2JSContext* pContext = |
| 2102 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
2091 CXFA_Document* pDoc = pContext->GetDocument(); | 2103 CXFA_Document* pDoc = pContext->GetDocument(); |
2092 if (!pDoc) { | 2104 if (!pDoc) { |
2093 return FALSE; | 2105 return FALSE; |
2094 } | 2106 } |
2095 IFX_LocaleMgr* pMgr = (IFX_LocaleMgr*)pDoc->GetLocalMgr(); | 2107 IFX_LocaleMgr* pMgr = (IFX_LocaleMgr*)pDoc->GetLocalMgr(); |
2096 IFX_Locale* pLocale = NULL; | 2108 IFX_Locale* pLocale = NULL; |
2097 if (szLocale.IsEmpty()) { | 2109 if (szLocale.IsEmpty()) { |
2098 CXFA_Node* pThisNode = ToNode(pDoc->GetScriptContext()->GetThisObject()); | 2110 CXFA_Node* pThisNode = ToNode(pDoc->GetScriptContext()->GetThisObject()); |
2099 ASSERT(pThisNode); | 2111 ASSERT(pThisNode); |
2100 CXFA_WidgetData widgetData(pThisNode); | 2112 CXFA_WidgetData widgetData(pThisNode); |
(...skipping 17 matching lines...) Expand all Loading... |
2118 CFX_Unitime utime = widgetValue.GetTime(); | 2130 CFX_Unitime utime = widgetValue.GetTime(); |
2119 strIsoTime.Format("%02d:%02d:%02d.%03d", utime.GetHour(), utime.GetMinute(), | 2131 strIsoTime.Format("%02d:%02d:%02d.%03d", utime.GetHour(), utime.GetMinute(), |
2120 utime.GetSecond(), utime.GetMillisecond()); | 2132 utime.GetSecond(), utime.GetMillisecond()); |
2121 return TRUE; | 2133 return TRUE; |
2122 } | 2134 } |
2123 FX_BOOL CXFA_FM2JSContext::IsoDate2Local(FXJSE_HOBJECT hThis, | 2135 FX_BOOL CXFA_FM2JSContext::IsoDate2Local(FXJSE_HOBJECT hThis, |
2124 const CFX_ByteStringC& szDate, | 2136 const CFX_ByteStringC& szDate, |
2125 const CFX_ByteStringC& szFormat, | 2137 const CFX_ByteStringC& szFormat, |
2126 const CFX_ByteStringC& szLocale, | 2138 const CFX_ByteStringC& szLocale, |
2127 CFX_ByteString& strLocalDate) { | 2139 CFX_ByteString& strLocalDate) { |
2128 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 2140 CXFA_FM2JSContext* pContext = |
| 2141 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
2129 CXFA_Document* pDoc = pContext->GetDocument(); | 2142 CXFA_Document* pDoc = pContext->GetDocument(); |
2130 if (!pDoc) { | 2143 if (!pDoc) { |
2131 return FALSE; | 2144 return FALSE; |
2132 } | 2145 } |
2133 IFX_LocaleMgr* pMgr = (IFX_LocaleMgr*)pDoc->GetLocalMgr(); | 2146 IFX_LocaleMgr* pMgr = (IFX_LocaleMgr*)pDoc->GetLocalMgr(); |
2134 IFX_Locale* pLocale = NULL; | 2147 IFX_Locale* pLocale = NULL; |
2135 if (szLocale.IsEmpty()) { | 2148 if (szLocale.IsEmpty()) { |
2136 CXFA_Node* pThisNode = ToNode(pDoc->GetScriptContext()->GetThisObject()); | 2149 CXFA_Node* pThisNode = ToNode(pDoc->GetScriptContext()->GetThisObject()); |
2137 ASSERT(pThisNode); | 2150 ASSERT(pThisNode); |
2138 CXFA_WidgetData widgetData(pThisNode); | 2151 CXFA_WidgetData widgetData(pThisNode); |
(...skipping 16 matching lines...) Expand all Loading... |
2155 widgetValue.FormatPatterns(wsRet, wsFormat, pLocale, | 2168 widgetValue.FormatPatterns(wsRet, wsFormat, pLocale, |
2156 XFA_VALUEPICTURE_Display); | 2169 XFA_VALUEPICTURE_Display); |
2157 strLocalDate = FX_UTF8Encode(wsRet.c_str(), wsRet.GetLength()); | 2170 strLocalDate = FX_UTF8Encode(wsRet.c_str(), wsRet.GetLength()); |
2158 return TRUE; | 2171 return TRUE; |
2159 } | 2172 } |
2160 FX_BOOL CXFA_FM2JSContext::IsoTime2Local(FXJSE_HOBJECT hThis, | 2173 FX_BOOL CXFA_FM2JSContext::IsoTime2Local(FXJSE_HOBJECT hThis, |
2161 const CFX_ByteStringC& szTime, | 2174 const CFX_ByteStringC& szTime, |
2162 const CFX_ByteStringC& szFormat, | 2175 const CFX_ByteStringC& szFormat, |
2163 const CFX_ByteStringC& szLocale, | 2176 const CFX_ByteStringC& szLocale, |
2164 CFX_ByteString& strLocalTime) { | 2177 CFX_ByteString& strLocalTime) { |
2165 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 2178 CXFA_FM2JSContext* pContext = |
| 2179 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
2166 CXFA_Document* pDoc = pContext->GetDocument(); | 2180 CXFA_Document* pDoc = pContext->GetDocument(); |
2167 if (!pDoc) { | 2181 if (!pDoc) { |
2168 return FALSE; | 2182 return FALSE; |
2169 } | 2183 } |
2170 IFX_LocaleMgr* pMgr = (IFX_LocaleMgr*)pDoc->GetLocalMgr(); | 2184 IFX_LocaleMgr* pMgr = (IFX_LocaleMgr*)pDoc->GetLocalMgr(); |
2171 IFX_Locale* pLocale = NULL; | 2185 IFX_Locale* pLocale = NULL; |
2172 if (szLocale.IsEmpty()) { | 2186 if (szLocale.IsEmpty()) { |
2173 CXFA_Node* pThisNode = ToNode(pDoc->GetScriptContext()->GetThisObject()); | 2187 CXFA_Node* pThisNode = ToNode(pDoc->GetScriptContext()->GetThisObject()); |
2174 ASSERT(pThisNode); | 2188 ASSERT(pThisNode); |
2175 CXFA_WidgetData widgetData(pThisNode); | 2189 CXFA_WidgetData widgetData(pThisNode); |
(...skipping 18 matching lines...) Expand all Loading... |
2194 widgetValue.FormatPatterns(wsRet, wsFormat, pLocale, | 2208 widgetValue.FormatPatterns(wsRet, wsFormat, pLocale, |
2195 XFA_VALUEPICTURE_Display); | 2209 XFA_VALUEPICTURE_Display); |
2196 strLocalTime = FX_UTF8Encode(wsRet.c_str(), wsRet.GetLength()); | 2210 strLocalTime = FX_UTF8Encode(wsRet.c_str(), wsRet.GetLength()); |
2197 return TRUE; | 2211 return TRUE; |
2198 } | 2212 } |
2199 FX_BOOL CXFA_FM2JSContext::GetGMTTime(FXJSE_HOBJECT hThis, | 2213 FX_BOOL CXFA_FM2JSContext::GetGMTTime(FXJSE_HOBJECT hThis, |
2200 const CFX_ByteStringC& szTime, | 2214 const CFX_ByteStringC& szTime, |
2201 const CFX_ByteStringC& szFormat, | 2215 const CFX_ByteStringC& szFormat, |
2202 const CFX_ByteStringC& szLocale, | 2216 const CFX_ByteStringC& szLocale, |
2203 CFX_ByteString& strGMTTime) { | 2217 CFX_ByteString& strGMTTime) { |
2204 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 2218 CXFA_FM2JSContext* pContext = |
| 2219 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
2205 CXFA_Document* pDoc = pContext->GetDocument(); | 2220 CXFA_Document* pDoc = pContext->GetDocument(); |
2206 if (!pDoc) { | 2221 if (!pDoc) { |
2207 return FALSE; | 2222 return FALSE; |
2208 } | 2223 } |
2209 IFX_LocaleMgr* pMgr = (IFX_LocaleMgr*)pDoc->GetLocalMgr(); | 2224 IFX_LocaleMgr* pMgr = (IFX_LocaleMgr*)pDoc->GetLocalMgr(); |
2210 IFX_Locale* pLocale = NULL; | 2225 IFX_Locale* pLocale = NULL; |
2211 if (szLocale.IsEmpty()) { | 2226 if (szLocale.IsEmpty()) { |
2212 CXFA_Node* pThisNode = ToNode(pDoc->GetScriptContext()->GetThisObject()); | 2227 CXFA_Node* pThisNode = ToNode(pDoc->GetScriptContext()->GetThisObject()); |
2213 ASSERT(pThisNode); | 2228 ASSERT(pThisNode); |
2214 CXFA_WidgetData widgetData(pThisNode); | 2229 CXFA_WidgetData widgetData(pThisNode); |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2327 case 3: | 2342 case 3: |
2328 strStyle = FX_LOCALEDATETIMESUBCATEGORY_Long; | 2343 strStyle = FX_LOCALEDATETIMESUBCATEGORY_Long; |
2329 break; | 2344 break; |
2330 case 4: | 2345 case 4: |
2331 strStyle = FX_LOCALEDATETIMESUBCATEGORY_Full; | 2346 strStyle = FX_LOCALEDATETIMESUBCATEGORY_Full; |
2332 break; | 2347 break; |
2333 default: | 2348 default: |
2334 strStyle = FX_LOCALEDATETIMESUBCATEGORY_Medium; | 2349 strStyle = FX_LOCALEDATETIMESUBCATEGORY_Medium; |
2335 break; | 2350 break; |
2336 } | 2351 } |
2337 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 2352 CXFA_FM2JSContext* pContext = |
| 2353 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
2338 CXFA_Document* pDoc = pContext->GetDocument(); | 2354 CXFA_Document* pDoc = pContext->GetDocument(); |
2339 if (!pDoc) { | 2355 if (!pDoc) { |
2340 return; | 2356 return; |
2341 } | 2357 } |
2342 IFX_LocaleMgr* pMgr = (IFX_LocaleMgr*)pDoc->GetLocalMgr(); | 2358 IFX_LocaleMgr* pMgr = (IFX_LocaleMgr*)pDoc->GetLocalMgr(); |
2343 IFX_Locale* pLocale = NULL; | 2359 IFX_Locale* pLocale = NULL; |
2344 if (szLocalStr.IsEmpty()) { | 2360 if (szLocalStr.IsEmpty()) { |
2345 CXFA_Node* pThisNode = ToNode(pDoc->GetScriptContext()->GetThisObject()); | 2361 CXFA_Node* pThisNode = ToNode(pDoc->GetScriptContext()->GetThisObject()); |
2346 ASSERT(pThisNode); | 2362 ASSERT(pThisNode); |
2347 CXFA_WidgetData widgetData(pThisNode); | 2363 CXFA_WidgetData widgetData(pThisNode); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2380 case 3: | 2396 case 3: |
2381 strStyle = FX_LOCALEDATETIMESUBCATEGORY_Long; | 2397 strStyle = FX_LOCALEDATETIMESUBCATEGORY_Long; |
2382 break; | 2398 break; |
2383 case 4: | 2399 case 4: |
2384 strStyle = FX_LOCALEDATETIMESUBCATEGORY_Full; | 2400 strStyle = FX_LOCALEDATETIMESUBCATEGORY_Full; |
2385 break; | 2401 break; |
2386 default: | 2402 default: |
2387 strStyle = FX_LOCALEDATETIMESUBCATEGORY_Medium; | 2403 strStyle = FX_LOCALEDATETIMESUBCATEGORY_Medium; |
2388 break; | 2404 break; |
2389 } | 2405 } |
2390 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 2406 CXFA_FM2JSContext* pContext = |
| 2407 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
2391 CXFA_Document* pDoc = pContext->GetDocument(); | 2408 CXFA_Document* pDoc = pContext->GetDocument(); |
2392 if (!pDoc) { | 2409 if (!pDoc) { |
2393 return; | 2410 return; |
2394 } | 2411 } |
2395 IFX_LocaleMgr* pMgr = (IFX_LocaleMgr*)pDoc->GetLocalMgr(); | 2412 IFX_LocaleMgr* pMgr = (IFX_LocaleMgr*)pDoc->GetLocalMgr(); |
2396 IFX_Locale* pLocale = NULL; | 2413 IFX_Locale* pLocale = NULL; |
2397 if (szLocalStr.IsEmpty()) { | 2414 if (szLocalStr.IsEmpty()) { |
2398 CXFA_Node* pThisNode = ToNode(pDoc->GetScriptContext()->GetThisObject()); | 2415 CXFA_Node* pThisNode = ToNode(pDoc->GetScriptContext()->GetThisObject()); |
2399 ASSERT(pThisNode); | 2416 ASSERT(pThisNode); |
2400 CXFA_WidgetData widgetData(pThisNode); | 2417 CXFA_WidgetData widgetData(pThisNode); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2475 int32_t iLocalHour = pLocal->tm_hour; | 2492 int32_t iLocalHour = pLocal->tm_hour; |
2476 int32_t iLocalMin = pLocal->tm_min; | 2493 int32_t iLocalMin = pLocal->tm_min; |
2477 int32_t iLocalSec = pLocal->tm_sec; | 2494 int32_t iLocalSec = pLocal->tm_sec; |
2478 iHour = iLocalHour - iGMHour; | 2495 iHour = iLocalHour - iGMHour; |
2479 iMin = iLocalMin - iGMMin; | 2496 iMin = iLocalMin - iGMMin; |
2480 iSec = iLocalSec - iGMSec; | 2497 iSec = iLocalSec - iGMSec; |
2481 } | 2498 } |
2482 void CXFA_FM2JSContext::Apr(FXJSE_HOBJECT hThis, | 2499 void CXFA_FM2JSContext::Apr(FXJSE_HOBJECT hThis, |
2483 const CFX_ByteStringC& szFuncName, | 2500 const CFX_ByteStringC& szFuncName, |
2484 CFXJSE_Arguments& args) { | 2501 CFXJSE_Arguments& args) { |
2485 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 2502 CXFA_FM2JSContext* pContext = |
| 2503 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
2486 if (args.GetLength() == 3) { | 2504 if (args.GetLength() == 3) { |
2487 FX_BOOL bFlags = FALSE; | 2505 FX_BOOL bFlags = FALSE; |
2488 FX_DOUBLE nPrincipal = 0; | 2506 FX_DOUBLE nPrincipal = 0; |
2489 FX_DOUBLE nPayment = 0; | 2507 FX_DOUBLE nPayment = 0; |
2490 FX_DOUBLE nPeriods = 0; | 2508 FX_DOUBLE nPeriods = 0; |
2491 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); | 2509 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); |
2492 FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1); | 2510 FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1); |
2493 FXJSE_HVALUE argThree = GetSimpleHValue(hThis, args, 2); | 2511 FXJSE_HVALUE argThree = GetSimpleHValue(hThis, args, 2); |
2494 bFlags = (HValueIsNull(hThis, argOne) || HValueIsNull(hThis, argTwo) || | 2512 bFlags = (HValueIsNull(hThis, argOne) || HValueIsNull(hThis, argTwo) || |
2495 HValueIsNull(hThis, argThree)); | 2513 HValueIsNull(hThis, argThree)); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2540 FXJSE_Value_Release(argTwo); | 2558 FXJSE_Value_Release(argTwo); |
2541 FXJSE_Value_Release(argThree); | 2559 FXJSE_Value_Release(argThree); |
2542 } else { | 2560 } else { |
2543 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 2561 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
2544 L"Apr"); | 2562 L"Apr"); |
2545 } | 2563 } |
2546 } | 2564 } |
2547 void CXFA_FM2JSContext::CTerm(FXJSE_HOBJECT hThis, | 2565 void CXFA_FM2JSContext::CTerm(FXJSE_HOBJECT hThis, |
2548 const CFX_ByteStringC& szFuncName, | 2566 const CFX_ByteStringC& szFuncName, |
2549 CFXJSE_Arguments& args) { | 2567 CFXJSE_Arguments& args) { |
2550 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 2568 CXFA_FM2JSContext* pContext = |
| 2569 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
2551 if (args.GetLength() == 3) { | 2570 if (args.GetLength() == 3) { |
2552 FX_BOOL bFlags = FALSE; | 2571 FX_BOOL bFlags = FALSE; |
2553 FX_FLOAT nRate = 0; | 2572 FX_FLOAT nRate = 0; |
2554 FX_FLOAT nFutureValue = 0; | 2573 FX_FLOAT nFutureValue = 0; |
2555 FX_FLOAT nInitAmount = 0; | 2574 FX_FLOAT nInitAmount = 0; |
2556 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); | 2575 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); |
2557 FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1); | 2576 FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1); |
2558 FXJSE_HVALUE argThree = GetSimpleHValue(hThis, args, 2); | 2577 FXJSE_HVALUE argThree = GetSimpleHValue(hThis, args, 2); |
2559 bFlags = (HValueIsNull(hThis, argOne) || HValueIsNull(hThis, argTwo) || | 2578 bFlags = (HValueIsNull(hThis, argOne) || HValueIsNull(hThis, argTwo) || |
2560 HValueIsNull(hThis, argThree)); | 2579 HValueIsNull(hThis, argThree)); |
(...skipping 16 matching lines...) Expand all Loading... |
2577 FXJSE_Value_Release(argTwo); | 2596 FXJSE_Value_Release(argTwo); |
2578 FXJSE_Value_Release(argThree); | 2597 FXJSE_Value_Release(argThree); |
2579 } else { | 2598 } else { |
2580 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 2599 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
2581 L"CTerm"); | 2600 L"CTerm"); |
2582 } | 2601 } |
2583 } | 2602 } |
2584 void CXFA_FM2JSContext::FV(FXJSE_HOBJECT hThis, | 2603 void CXFA_FM2JSContext::FV(FXJSE_HOBJECT hThis, |
2585 const CFX_ByteStringC& szFuncName, | 2604 const CFX_ByteStringC& szFuncName, |
2586 CFXJSE_Arguments& args) { | 2605 CFXJSE_Arguments& args) { |
2587 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 2606 CXFA_FM2JSContext* pContext = |
| 2607 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
2588 if (args.GetLength() == 3) { | 2608 if (args.GetLength() == 3) { |
2589 FX_BOOL bFlags = FALSE; | 2609 FX_BOOL bFlags = FALSE; |
2590 FX_DOUBLE nAmount = 0; | 2610 FX_DOUBLE nAmount = 0; |
2591 FX_DOUBLE nRate = 0; | 2611 FX_DOUBLE nRate = 0; |
2592 FX_DOUBLE nPeriod = 0; | 2612 FX_DOUBLE nPeriod = 0; |
2593 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); | 2613 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); |
2594 FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1); | 2614 FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1); |
2595 FXJSE_HVALUE argThree = GetSimpleHValue(hThis, args, 2); | 2615 FXJSE_HVALUE argThree = GetSimpleHValue(hThis, args, 2); |
2596 bFlags = (HValueIsNull(hThis, argOne) || HValueIsNull(hThis, argTwo) || | 2616 bFlags = (HValueIsNull(hThis, argOne) || HValueIsNull(hThis, argTwo) || |
2597 HValueIsNull(hThis, argThree)); | 2617 HValueIsNull(hThis, argThree)); |
(...skipping 24 matching lines...) Expand all Loading... |
2622 FXJSE_Value_Release(argTwo); | 2642 FXJSE_Value_Release(argTwo); |
2623 FXJSE_Value_Release(argThree); | 2643 FXJSE_Value_Release(argThree); |
2624 } else { | 2644 } else { |
2625 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 2645 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
2626 L"FV"); | 2646 L"FV"); |
2627 } | 2647 } |
2628 } | 2648 } |
2629 void CXFA_FM2JSContext::IPmt(FXJSE_HOBJECT hThis, | 2649 void CXFA_FM2JSContext::IPmt(FXJSE_HOBJECT hThis, |
2630 const CFX_ByteStringC& szFuncName, | 2650 const CFX_ByteStringC& szFuncName, |
2631 CFXJSE_Arguments& args) { | 2651 CFXJSE_Arguments& args) { |
2632 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 2652 CXFA_FM2JSContext* pContext = |
| 2653 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
2633 if (args.GetLength() == 5) { | 2654 if (args.GetLength() == 5) { |
2634 FX_BOOL bFlags = FALSE; | 2655 FX_BOOL bFlags = FALSE; |
2635 FX_FLOAT nPrincpalAmount = 0; | 2656 FX_FLOAT nPrincpalAmount = 0; |
2636 FX_FLOAT nRate = 0; | 2657 FX_FLOAT nRate = 0; |
2637 FX_FLOAT nPayment = 0; | 2658 FX_FLOAT nPayment = 0; |
2638 FX_FLOAT nFirstMonth = 0; | 2659 FX_FLOAT nFirstMonth = 0; |
2639 FX_FLOAT nNumberOfMonths = 0; | 2660 FX_FLOAT nNumberOfMonths = 0; |
2640 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); | 2661 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); |
2641 FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1); | 2662 FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1); |
2642 FXJSE_HVALUE argThree = GetSimpleHValue(hThis, args, 2); | 2663 FXJSE_HVALUE argThree = GetSimpleHValue(hThis, args, 2); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2694 FXJSE_Value_Release(argFour); | 2715 FXJSE_Value_Release(argFour); |
2695 FXJSE_Value_Release(argFive); | 2716 FXJSE_Value_Release(argFive); |
2696 } else { | 2717 } else { |
2697 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 2718 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
2698 L"IPmt"); | 2719 L"IPmt"); |
2699 } | 2720 } |
2700 } | 2721 } |
2701 void CXFA_FM2JSContext::NPV(FXJSE_HOBJECT hThis, | 2722 void CXFA_FM2JSContext::NPV(FXJSE_HOBJECT hThis, |
2702 const CFX_ByteStringC& szFuncName, | 2723 const CFX_ByteStringC& szFuncName, |
2703 CFXJSE_Arguments& args) { | 2724 CFXJSE_Arguments& args) { |
2704 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 2725 CXFA_FM2JSContext* pContext = |
| 2726 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
2705 int32_t argc = args.GetLength(); | 2727 int32_t argc = args.GetLength(); |
2706 if (argc > 2) { | 2728 if (argc > 2) { |
2707 FX_BOOL bFlags = FALSE; | 2729 FX_BOOL bFlags = FALSE; |
2708 FXJSE_HVALUE* argValues = FX_Alloc(FXJSE_HVALUE, argc); | 2730 FXJSE_HVALUE* argValues = FX_Alloc(FXJSE_HVALUE, argc); |
2709 for (int32_t i = 0; i < argc; i++) { | 2731 for (int32_t i = 0; i < argc; i++) { |
2710 argValues[i] = GetSimpleHValue(hThis, args, i); | 2732 argValues[i] = GetSimpleHValue(hThis, args, i); |
2711 if (HValueIsNull(hThis, argValues[i])) { | 2733 if (HValueIsNull(hThis, argValues[i])) { |
2712 bFlags = TRUE; | 2734 bFlags = TRUE; |
2713 } | 2735 } |
2714 } | 2736 } |
(...skipping 29 matching lines...) Expand all Loading... |
2744 } | 2766 } |
2745 FX_Free(argValues); | 2767 FX_Free(argValues); |
2746 } else { | 2768 } else { |
2747 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 2769 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
2748 L"NPV"); | 2770 L"NPV"); |
2749 } | 2771 } |
2750 } | 2772 } |
2751 void CXFA_FM2JSContext::Pmt(FXJSE_HOBJECT hThis, | 2773 void CXFA_FM2JSContext::Pmt(FXJSE_HOBJECT hThis, |
2752 const CFX_ByteStringC& szFuncName, | 2774 const CFX_ByteStringC& szFuncName, |
2753 CFXJSE_Arguments& args) { | 2775 CFXJSE_Arguments& args) { |
2754 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 2776 CXFA_FM2JSContext* pContext = |
| 2777 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
2755 if (args.GetLength() == 3) { | 2778 if (args.GetLength() == 3) { |
2756 FX_BOOL bFlags = FALSE; | 2779 FX_BOOL bFlags = FALSE; |
2757 FX_FLOAT nPrincipal = 0; | 2780 FX_FLOAT nPrincipal = 0; |
2758 FX_FLOAT nRate = 0; | 2781 FX_FLOAT nRate = 0; |
2759 FX_FLOAT nPeriods = 0; | 2782 FX_FLOAT nPeriods = 0; |
2760 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); | 2783 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); |
2761 FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1); | 2784 FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1); |
2762 FXJSE_HVALUE argThree = GetSimpleHValue(hThis, args, 2); | 2785 FXJSE_HVALUE argThree = GetSimpleHValue(hThis, args, 2); |
2763 bFlags = (HValueIsNull(hThis, argOne) || HValueIsNull(hThis, argTwo) || | 2786 bFlags = (HValueIsNull(hThis, argOne) || HValueIsNull(hThis, argTwo) || |
2764 HValueIsNull(hThis, argThree)); | 2787 HValueIsNull(hThis, argThree)); |
(...skipping 21 matching lines...) Expand all Loading... |
2786 FXJSE_Value_Release(argTwo); | 2809 FXJSE_Value_Release(argTwo); |
2787 FXJSE_Value_Release(argThree); | 2810 FXJSE_Value_Release(argThree); |
2788 } else { | 2811 } else { |
2789 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 2812 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
2790 L"Pmt"); | 2813 L"Pmt"); |
2791 } | 2814 } |
2792 } | 2815 } |
2793 void CXFA_FM2JSContext::PPmt(FXJSE_HOBJECT hThis, | 2816 void CXFA_FM2JSContext::PPmt(FXJSE_HOBJECT hThis, |
2794 const CFX_ByteStringC& szFuncName, | 2817 const CFX_ByteStringC& szFuncName, |
2795 CFXJSE_Arguments& args) { | 2818 CFXJSE_Arguments& args) { |
2796 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 2819 CXFA_FM2JSContext* pContext = |
| 2820 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
2797 if (args.GetLength() == 5) { | 2821 if (args.GetLength() == 5) { |
2798 FX_BOOL bFlags = FALSE; | 2822 FX_BOOL bFlags = FALSE; |
2799 FX_FLOAT nPrincpalAmount = 0; | 2823 FX_FLOAT nPrincpalAmount = 0; |
2800 FX_FLOAT nRate = 0; | 2824 FX_FLOAT nRate = 0; |
2801 FX_FLOAT nPayment = 0; | 2825 FX_FLOAT nPayment = 0; |
2802 FX_FLOAT nFirstMonth = 0; | 2826 FX_FLOAT nFirstMonth = 0; |
2803 FX_FLOAT nNumberOfMonths = 0; | 2827 FX_FLOAT nNumberOfMonths = 0; |
2804 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); | 2828 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); |
2805 FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1); | 2829 FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1); |
2806 FXJSE_HVALUE argThree = GetSimpleHValue(hThis, args, 2); | 2830 FXJSE_HVALUE argThree = GetSimpleHValue(hThis, args, 2); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2859 FXJSE_Value_Release(argFour); | 2883 FXJSE_Value_Release(argFour); |
2860 FXJSE_Value_Release(argFive); | 2884 FXJSE_Value_Release(argFive); |
2861 } else { | 2885 } else { |
2862 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 2886 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
2863 L"PPmt"); | 2887 L"PPmt"); |
2864 } | 2888 } |
2865 } | 2889 } |
2866 void CXFA_FM2JSContext::PV(FXJSE_HOBJECT hThis, | 2890 void CXFA_FM2JSContext::PV(FXJSE_HOBJECT hThis, |
2867 const CFX_ByteStringC& szFuncName, | 2891 const CFX_ByteStringC& szFuncName, |
2868 CFXJSE_Arguments& args) { | 2892 CFXJSE_Arguments& args) { |
2869 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 2893 CXFA_FM2JSContext* pContext = |
| 2894 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
2870 if (args.GetLength() == 3) { | 2895 if (args.GetLength() == 3) { |
2871 FX_BOOL bFlags = FALSE; | 2896 FX_BOOL bFlags = FALSE; |
2872 FX_DOUBLE nAmount = 0; | 2897 FX_DOUBLE nAmount = 0; |
2873 FX_DOUBLE nRate = 0; | 2898 FX_DOUBLE nRate = 0; |
2874 FX_DOUBLE nPeriod = 0; | 2899 FX_DOUBLE nPeriod = 0; |
2875 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); | 2900 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); |
2876 FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1); | 2901 FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1); |
2877 FXJSE_HVALUE argThree = GetSimpleHValue(hThis, args, 2); | 2902 FXJSE_HVALUE argThree = GetSimpleHValue(hThis, args, 2); |
2878 bFlags = (HValueIsNull(hThis, argOne) || HValueIsNull(hThis, argTwo) || | 2903 bFlags = (HValueIsNull(hThis, argOne) || HValueIsNull(hThis, argTwo) || |
2879 HValueIsNull(hThis, argThree)); | 2904 HValueIsNull(hThis, argThree)); |
(...skipping 20 matching lines...) Expand all Loading... |
2900 FXJSE_Value_Release(argTwo); | 2925 FXJSE_Value_Release(argTwo); |
2901 FXJSE_Value_Release(argThree); | 2926 FXJSE_Value_Release(argThree); |
2902 } else { | 2927 } else { |
2903 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 2928 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
2904 L"PV"); | 2929 L"PV"); |
2905 } | 2930 } |
2906 } | 2931 } |
2907 void CXFA_FM2JSContext::Rate(FXJSE_HOBJECT hThis, | 2932 void CXFA_FM2JSContext::Rate(FXJSE_HOBJECT hThis, |
2908 const CFX_ByteStringC& szFuncName, | 2933 const CFX_ByteStringC& szFuncName, |
2909 CFXJSE_Arguments& args) { | 2934 CFXJSE_Arguments& args) { |
2910 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 2935 CXFA_FM2JSContext* pContext = |
| 2936 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
2911 if (args.GetLength() == 3) { | 2937 if (args.GetLength() == 3) { |
2912 FX_BOOL bFlags = FALSE; | 2938 FX_BOOL bFlags = FALSE; |
2913 FX_FLOAT nFuture = 0; | 2939 FX_FLOAT nFuture = 0; |
2914 FX_FLOAT nPresent = 0; | 2940 FX_FLOAT nPresent = 0; |
2915 FX_FLOAT nTotalNumber = 0; | 2941 FX_FLOAT nTotalNumber = 0; |
2916 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); | 2942 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); |
2917 FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1); | 2943 FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1); |
2918 FXJSE_HVALUE argThree = GetSimpleHValue(hThis, args, 2); | 2944 FXJSE_HVALUE argThree = GetSimpleHValue(hThis, args, 2); |
2919 bFlags = (HValueIsNull(hThis, argOne) || HValueIsNull(hThis, argTwo) || | 2945 bFlags = (HValueIsNull(hThis, argOne) || HValueIsNull(hThis, argTwo) || |
2920 HValueIsNull(hThis, argThree)); | 2946 HValueIsNull(hThis, argThree)); |
(...skipping 17 matching lines...) Expand all Loading... |
2938 FXJSE_Value_Release(argTwo); | 2964 FXJSE_Value_Release(argTwo); |
2939 FXJSE_Value_Release(argThree); | 2965 FXJSE_Value_Release(argThree); |
2940 } else { | 2966 } else { |
2941 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 2967 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
2942 L"Rate"); | 2968 L"Rate"); |
2943 } | 2969 } |
2944 } | 2970 } |
2945 void CXFA_FM2JSContext::Term(FXJSE_HOBJECT hThis, | 2971 void CXFA_FM2JSContext::Term(FXJSE_HOBJECT hThis, |
2946 const CFX_ByteStringC& szFuncName, | 2972 const CFX_ByteStringC& szFuncName, |
2947 CFXJSE_Arguments& args) { | 2973 CFXJSE_Arguments& args) { |
2948 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 2974 CXFA_FM2JSContext* pContext = |
| 2975 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
2949 if (args.GetLength() == 3) { | 2976 if (args.GetLength() == 3) { |
2950 FX_BOOL bFlags = FALSE; | 2977 FX_BOOL bFlags = FALSE; |
2951 FX_FLOAT nMount = 0; | 2978 FX_FLOAT nMount = 0; |
2952 FX_FLOAT nRate = 0; | 2979 FX_FLOAT nRate = 0; |
2953 FX_FLOAT nFuture = 0; | 2980 FX_FLOAT nFuture = 0; |
2954 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); | 2981 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); |
2955 FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1); | 2982 FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1); |
2956 FXJSE_HVALUE argThree = GetSimpleHValue(hThis, args, 2); | 2983 FXJSE_HVALUE argThree = GetSimpleHValue(hThis, args, 2); |
2957 bFlags = (FXJSE_Value_IsNull(argOne) || FXJSE_Value_IsNull(argTwo) || | 2984 bFlags = (FXJSE_Value_IsNull(argOne) || FXJSE_Value_IsNull(argTwo) || |
2958 FXJSE_Value_IsNull(argThree)); | 2985 FXJSE_Value_IsNull(argThree)); |
(...skipping 17 matching lines...) Expand all Loading... |
2976 FXJSE_Value_Release(argTwo); | 3003 FXJSE_Value_Release(argTwo); |
2977 FXJSE_Value_Release(argThree); | 3004 FXJSE_Value_Release(argThree); |
2978 } else { | 3005 } else { |
2979 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 3006 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
2980 L"Term"); | 3007 L"Term"); |
2981 } | 3008 } |
2982 } | 3009 } |
2983 void CXFA_FM2JSContext::Choose(FXJSE_HOBJECT hThis, | 3010 void CXFA_FM2JSContext::Choose(FXJSE_HOBJECT hThis, |
2984 const CFX_ByteStringC& szFuncName, | 3011 const CFX_ByteStringC& szFuncName, |
2985 CFXJSE_Arguments& args) { | 3012 CFXJSE_Arguments& args) { |
2986 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 3013 CXFA_FM2JSContext* pContext = |
| 3014 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
2987 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); | 3015 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); |
2988 int32_t argc = args.GetLength(); | 3016 int32_t argc = args.GetLength(); |
2989 if (argc > 1) { | 3017 if (argc > 1) { |
2990 FXJSE_HVALUE argOne = args.GetValue(0); | 3018 FXJSE_HVALUE argOne = args.GetValue(0); |
2991 FX_BOOL argOneIsNull = FALSE; | 3019 FX_BOOL argOneIsNull = FALSE; |
2992 int32_t iIndex = 0; | 3020 int32_t iIndex = 0; |
2993 argOneIsNull = HValueIsNull(hThis, argOne); | 3021 argOneIsNull = HValueIsNull(hThis, argOne); |
2994 if (!argOneIsNull) { | 3022 if (!argOneIsNull) { |
2995 iIndex = (int32_t)HValueToFloat(hThis, argOne); | 3023 iIndex = (int32_t)HValueToFloat(hThis, argOne); |
2996 } | 3024 } |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3052 } | 3080 } |
3053 FXJSE_Value_Release(argIndexValue); | 3081 FXJSE_Value_Release(argIndexValue); |
3054 iArgIndex++; | 3082 iArgIndex++; |
3055 } | 3083 } |
3056 if (!bFound) { | 3084 if (!bFound) { |
3057 FXJSE_Value_SetUTF8String(args.GetReturnValue(), ""); | 3085 FXJSE_Value_SetUTF8String(args.GetReturnValue(), ""); |
3058 } | 3086 } |
3059 } | 3087 } |
3060 } else { | 3088 } else { |
3061 CXFA_FM2JSContext* pContext = | 3089 CXFA_FM2JSContext* pContext = |
3062 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 3090 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
3063 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 3091 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
3064 L"Choose"); | 3092 L"Choose"); |
3065 } | 3093 } |
3066 } | 3094 } |
3067 void CXFA_FM2JSContext::Exists(FXJSE_HOBJECT hThis, | 3095 void CXFA_FM2JSContext::Exists(FXJSE_HOBJECT hThis, |
3068 const CFX_ByteStringC& szFuncName, | 3096 const CFX_ByteStringC& szFuncName, |
3069 CFXJSE_Arguments& args) { | 3097 CFXJSE_Arguments& args) { |
3070 if (args.GetLength() == 1) { | 3098 if (args.GetLength() == 1) { |
3071 FXJSE_HVALUE argOne = args.GetValue(0); | 3099 FXJSE_HVALUE argOne = args.GetValue(0); |
3072 FXJSE_Value_SetInteger(args.GetReturnValue(), FXJSE_Value_IsObject(argOne)); | 3100 FXJSE_Value_SetInteger(args.GetReturnValue(), FXJSE_Value_IsObject(argOne)); |
3073 FXJSE_Value_Release(argOne); | 3101 FXJSE_Value_Release(argOne); |
3074 } else { | 3102 } else { |
3075 CXFA_FM2JSContext* pContext = | 3103 CXFA_FM2JSContext* pContext = |
3076 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 3104 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
3077 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 3105 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
3078 L"Exists"); | 3106 L"Exists"); |
3079 } | 3107 } |
3080 } | 3108 } |
3081 void CXFA_FM2JSContext::HasValue(FXJSE_HOBJECT hThis, | 3109 void CXFA_FM2JSContext::HasValue(FXJSE_HOBJECT hThis, |
3082 const CFX_ByteStringC& szFuncName, | 3110 const CFX_ByteStringC& szFuncName, |
3083 CFXJSE_Arguments& args) { | 3111 CFXJSE_Arguments& args) { |
3084 if (args.GetLength() == 1) { | 3112 if (args.GetLength() == 1) { |
3085 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); | 3113 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); |
3086 if (FXJSE_Value_IsUTF8String(argOne)) { | 3114 if (FXJSE_Value_IsUTF8String(argOne)) { |
3087 CFX_ByteString valueStr; | 3115 CFX_ByteString valueStr; |
3088 FXJSE_Value_ToUTF8String(argOne, valueStr); | 3116 FXJSE_Value_ToUTF8String(argOne, valueStr); |
3089 valueStr.TrimLeft(); | 3117 valueStr.TrimLeft(); |
3090 FXJSE_Value_SetInteger(args.GetReturnValue(), (!valueStr.IsEmpty())); | 3118 FXJSE_Value_SetInteger(args.GetReturnValue(), (!valueStr.IsEmpty())); |
3091 } else if (FXJSE_Value_IsNumber(argOne) || FXJSE_Value_IsBoolean(argOne)) { | 3119 } else if (FXJSE_Value_IsNumber(argOne) || FXJSE_Value_IsBoolean(argOne)) { |
3092 FXJSE_Value_SetInteger(args.GetReturnValue(), TRUE); | 3120 FXJSE_Value_SetInteger(args.GetReturnValue(), TRUE); |
3093 } else { | 3121 } else { |
3094 FXJSE_Value_SetInteger(args.GetReturnValue(), FALSE); | 3122 FXJSE_Value_SetInteger(args.GetReturnValue(), FALSE); |
3095 } | 3123 } |
3096 FXJSE_Value_Release(argOne); | 3124 FXJSE_Value_Release(argOne); |
3097 } else { | 3125 } else { |
3098 CXFA_FM2JSContext* pContext = | 3126 CXFA_FM2JSContext* pContext = |
3099 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 3127 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
3100 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 3128 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
3101 L"HasValue"); | 3129 L"HasValue"); |
3102 } | 3130 } |
3103 } | 3131 } |
3104 void CXFA_FM2JSContext::Oneof(FXJSE_HOBJECT hThis, | 3132 void CXFA_FM2JSContext::Oneof(FXJSE_HOBJECT hThis, |
3105 const CFX_ByteStringC& szFuncName, | 3133 const CFX_ByteStringC& szFuncName, |
3106 CFXJSE_Arguments& args) { | 3134 CFXJSE_Arguments& args) { |
3107 int32_t argc = args.GetLength(); | 3135 int32_t argc = args.GetLength(); |
3108 if (argc > 1) { | 3136 if (argc > 1) { |
3109 FX_BOOL bFlags = FALSE; | 3137 FX_BOOL bFlags = FALSE; |
3110 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); | 3138 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); |
3111 FXJSE_HVALUE* parametersValue = 0; | 3139 FXJSE_HVALUE* parametersValue = 0; |
3112 int32_t iCount = 0; | 3140 int32_t iCount = 0; |
3113 unfoldArgs(hThis, args, parametersValue, iCount, 1); | 3141 unfoldArgs(hThis, args, parametersValue, iCount, 1); |
3114 for (int32_t i = 0; i < iCount; i++) { | 3142 for (int32_t i = 0; i < iCount; i++) { |
3115 if (simpleValueCompare(hThis, argOne, parametersValue[i])) { | 3143 if (simpleValueCompare(hThis, argOne, parametersValue[i])) { |
3116 bFlags = TRUE; | 3144 bFlags = TRUE; |
3117 break; | 3145 break; |
3118 } | 3146 } |
3119 } | 3147 } |
3120 FXJSE_Value_SetInteger(args.GetReturnValue(), bFlags); | 3148 FXJSE_Value_SetInteger(args.GetReturnValue(), bFlags); |
3121 FXJSE_Value_Release(argOne); | 3149 FXJSE_Value_Release(argOne); |
3122 for (int32_t i = 0; i < iCount; i++) { | 3150 for (int32_t i = 0; i < iCount; i++) { |
3123 FXJSE_Value_Release(parametersValue[i]); | 3151 FXJSE_Value_Release(parametersValue[i]); |
3124 } | 3152 } |
3125 FX_Free(parametersValue); | 3153 FX_Free(parametersValue); |
3126 parametersValue = 0; | 3154 parametersValue = 0; |
3127 } else { | 3155 } else { |
3128 CXFA_FM2JSContext* pContext = | 3156 CXFA_FM2JSContext* pContext = |
3129 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 3157 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
3130 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 3158 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
3131 L"Oneof"); | 3159 L"Oneof"); |
3132 } | 3160 } |
3133 } | 3161 } |
3134 void CXFA_FM2JSContext::Within(FXJSE_HOBJECT hThis, | 3162 void CXFA_FM2JSContext::Within(FXJSE_HOBJECT hThis, |
3135 const CFX_ByteStringC& szFuncName, | 3163 const CFX_ByteStringC& szFuncName, |
3136 CFXJSE_Arguments& args) { | 3164 CFXJSE_Arguments& args) { |
3137 int32_t argc = args.GetLength(); | 3165 int32_t argc = args.GetLength(); |
3138 if (argc == 3) { | 3166 if (argc == 3) { |
3139 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); | 3167 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); |
(...skipping 20 matching lines...) Expand all Loading... |
3160 args.GetReturnValue(), | 3188 args.GetReturnValue(), |
3161 ((oneString.Compare(lowString.AsStringC()) >= 0) && | 3189 ((oneString.Compare(lowString.AsStringC()) >= 0) && |
3162 (oneString.Compare(heightString.AsStringC()) <= 0))); | 3190 (oneString.Compare(heightString.AsStringC()) <= 0))); |
3163 } | 3191 } |
3164 FXJSE_Value_Release(argLow); | 3192 FXJSE_Value_Release(argLow); |
3165 FXJSE_Value_Release(argHeight); | 3193 FXJSE_Value_Release(argHeight); |
3166 } | 3194 } |
3167 FXJSE_Value_Release(argOne); | 3195 FXJSE_Value_Release(argOne); |
3168 } else { | 3196 } else { |
3169 CXFA_FM2JSContext* pContext = | 3197 CXFA_FM2JSContext* pContext = |
3170 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 3198 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
3171 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 3199 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
3172 L"Within"); | 3200 L"Within"); |
3173 } | 3201 } |
3174 } | 3202 } |
3175 void CXFA_FM2JSContext::If(FXJSE_HOBJECT hThis, | 3203 void CXFA_FM2JSContext::If(FXJSE_HOBJECT hThis, |
3176 const CFX_ByteStringC& szFuncName, | 3204 const CFX_ByteStringC& szFuncName, |
3177 CFXJSE_Arguments& args) { | 3205 CFXJSE_Arguments& args) { |
3178 if (args.GetLength() == 3) { | 3206 if (args.GetLength() == 3) { |
3179 FXJSE_HVALUE argCondition = GetSimpleHValue(hThis, args, 0); | 3207 FXJSE_HVALUE argCondition = GetSimpleHValue(hThis, args, 0); |
3180 FXJSE_HVALUE argFirstValue = GetSimpleHValue(hThis, args, 1); | 3208 FXJSE_HVALUE argFirstValue = GetSimpleHValue(hThis, args, 1); |
3181 FXJSE_HVALUE argSecondValue = GetSimpleHValue(hThis, args, 2); | 3209 FXJSE_HVALUE argSecondValue = GetSimpleHValue(hThis, args, 2); |
3182 FX_BOOL bCondition = FXJSE_Value_ToBoolean(argCondition); | 3210 FX_BOOL bCondition = FXJSE_Value_ToBoolean(argCondition); |
3183 FXJSE_Value_Set(args.GetReturnValue(), | 3211 FXJSE_Value_Set(args.GetReturnValue(), |
3184 bCondition ? argFirstValue : argSecondValue); | 3212 bCondition ? argFirstValue : argSecondValue); |
3185 FXJSE_Value_Release(argSecondValue); | 3213 FXJSE_Value_Release(argSecondValue); |
3186 FXJSE_Value_Release(argFirstValue); | 3214 FXJSE_Value_Release(argFirstValue); |
3187 FXJSE_Value_Release(argCondition); | 3215 FXJSE_Value_Release(argCondition); |
3188 } else { | 3216 } else { |
3189 CXFA_FM2JSContext* pContext = | 3217 CXFA_FM2JSContext* pContext = |
3190 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 3218 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
3191 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 3219 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
3192 L"If"); | 3220 L"If"); |
3193 } | 3221 } |
3194 } | 3222 } |
3195 void CXFA_FM2JSContext::Eval(FXJSE_HOBJECT hThis, | 3223 void CXFA_FM2JSContext::Eval(FXJSE_HOBJECT hThis, |
3196 const CFX_ByteStringC& szFuncName, | 3224 const CFX_ByteStringC& szFuncName, |
3197 CFXJSE_Arguments& args) { | 3225 CFXJSE_Arguments& args) { |
3198 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 3226 CXFA_FM2JSContext* pContext = |
| 3227 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
3199 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); | 3228 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); |
3200 if (args.GetLength() == 1) { | 3229 if (args.GetLength() == 1) { |
3201 FXJSE_HVALUE scriptValue = GetSimpleHValue(hThis, args, 0); | 3230 FXJSE_HVALUE scriptValue = GetSimpleHValue(hThis, args, 0); |
3202 CFX_ByteString utf8ScriptString; | 3231 CFX_ByteString utf8ScriptString; |
3203 HValueToUTF8String(scriptValue, utf8ScriptString); | 3232 HValueToUTF8String(scriptValue, utf8ScriptString); |
3204 if (utf8ScriptString.IsEmpty()) { | 3233 if (utf8ScriptString.IsEmpty()) { |
3205 FXJSE_Value_SetNull(args.GetReturnValue()); | 3234 FXJSE_Value_SetNull(args.GetReturnValue()); |
3206 } else { | 3235 } else { |
3207 CFX_WideTextBuf wsJavaScriptBuf; | 3236 CFX_WideTextBuf wsJavaScriptBuf; |
3208 CFX_WideString javaScript; | 3237 CFX_WideString javaScript; |
(...skipping 14 matching lines...) Expand all Loading... |
3223 } | 3252 } |
3224 FXJSE_Value_Release(scriptValue); | 3253 FXJSE_Value_Release(scriptValue); |
3225 } else { | 3254 } else { |
3226 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 3255 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
3227 L"Eval"); | 3256 L"Eval"); |
3228 } | 3257 } |
3229 } | 3258 } |
3230 void CXFA_FM2JSContext::Ref(FXJSE_HOBJECT hThis, | 3259 void CXFA_FM2JSContext::Ref(FXJSE_HOBJECT hThis, |
3231 const CFX_ByteStringC& szFuncName, | 3260 const CFX_ByteStringC& szFuncName, |
3232 CFXJSE_Arguments& args) { | 3261 CFXJSE_Arguments& args) { |
3233 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 3262 CXFA_FM2JSContext* pContext = |
| 3263 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
3234 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); | 3264 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); |
3235 if (args.GetLength() == 1) { | 3265 if (args.GetLength() == 1) { |
3236 FXJSE_HVALUE argOne = args.GetValue(0); | 3266 FXJSE_HVALUE argOne = args.GetValue(0); |
3237 if (FXJSE_Value_IsNull(argOne)) { | 3267 if (FXJSE_Value_IsNull(argOne)) { |
3238 FXJSE_HVALUE rgValues[3]; | 3268 FXJSE_HVALUE rgValues[3]; |
3239 for (int32_t i = 0; i < 3; i++) { | 3269 for (int32_t i = 0; i < 3; i++) { |
3240 rgValues[i] = FXJSE_Value_Create(pIsolate); | 3270 rgValues[i] = FXJSE_Value_Create(pIsolate); |
3241 } | 3271 } |
3242 FXJSE_Value_SetInteger(rgValues[0], 4); | 3272 FXJSE_Value_SetInteger(rgValues[0], 4); |
3243 FXJSE_Value_SetNull(rgValues[1]); | 3273 FXJSE_Value_SetNull(rgValues[1]); |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3407 FXJSE_Value_SetUTF8String(args.GetReturnValue(), "mp"); | 3437 FXJSE_Value_SetUTF8String(args.GetReturnValue(), "mp"); |
3408 break; | 3438 break; |
3409 default: | 3439 default: |
3410 FXJSE_Value_SetUTF8String(args.GetReturnValue(), "in"); | 3440 FXJSE_Value_SetUTF8String(args.GetReturnValue(), "in"); |
3411 break; | 3441 break; |
3412 } | 3442 } |
3413 } | 3443 } |
3414 FXJSE_Value_Release(unitspanValue); | 3444 FXJSE_Value_Release(unitspanValue); |
3415 } else { | 3445 } else { |
3416 CXFA_FM2JSContext* pContext = | 3446 CXFA_FM2JSContext* pContext = |
3417 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 3447 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
3418 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 3448 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
3419 L"UnitType"); | 3449 L"UnitType"); |
3420 } | 3450 } |
3421 } | 3451 } |
3422 void CXFA_FM2JSContext::UnitValue(FXJSE_HOBJECT hThis, | 3452 void CXFA_FM2JSContext::UnitValue(FXJSE_HOBJECT hThis, |
3423 const CFX_ByteStringC& szFuncName, | 3453 const CFX_ByteStringC& szFuncName, |
3424 CFXJSE_Arguments& args) { | 3454 CFXJSE_Arguments& args) { |
3425 int32_t argc = args.GetLength(); | 3455 int32_t argc = args.GetLength(); |
3426 if ((argc == 1) || (argc == 2)) { | 3456 if ((argc == 1) || (argc == 2)) { |
3427 FXJSE_HVALUE unitspanValue = GetSimpleHValue(hThis, args, 0); | 3457 FXJSE_HVALUE unitspanValue = GetSimpleHValue(hThis, args, 0); |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3566 } else { | 3596 } else { |
3567 FXJSE_Value_SetInteger(args.GetReturnValue(), 0); | 3597 FXJSE_Value_SetInteger(args.GetReturnValue(), 0); |
3568 } | 3598 } |
3569 } | 3599 } |
3570 FXJSE_Value_Release(unitspanValue); | 3600 FXJSE_Value_Release(unitspanValue); |
3571 if (argc == 2) { | 3601 if (argc == 2) { |
3572 FXJSE_Value_Release(unitValue); | 3602 FXJSE_Value_Release(unitValue); |
3573 } | 3603 } |
3574 } else { | 3604 } else { |
3575 CXFA_FM2JSContext* pContext = | 3605 CXFA_FM2JSContext* pContext = |
3576 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 3606 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
3577 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 3607 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
3578 L"UnitValue"); | 3608 L"UnitValue"); |
3579 } | 3609 } |
3580 } | 3610 } |
3581 void CXFA_FM2JSContext::At(FXJSE_HOBJECT hThis, | 3611 void CXFA_FM2JSContext::At(FXJSE_HOBJECT hThis, |
3582 const CFX_ByteStringC& szFuncName, | 3612 const CFX_ByteStringC& szFuncName, |
3583 CFXJSE_Arguments& args) { | 3613 CFXJSE_Arguments& args) { |
3584 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 3614 CXFA_FM2JSContext* pContext = |
| 3615 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
3585 if (args.GetLength() == 2) { | 3616 if (args.GetLength() == 2) { |
3586 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); | 3617 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); |
3587 FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1); | 3618 FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1); |
3588 if (HValueIsNull(hThis, argOne) || HValueIsNull(hThis, argTwo)) { | 3619 if (HValueIsNull(hThis, argOne) || HValueIsNull(hThis, argTwo)) { |
3589 FXJSE_Value_SetNull(args.GetReturnValue()); | 3620 FXJSE_Value_SetNull(args.GetReturnValue()); |
3590 } else { | 3621 } else { |
3591 CFX_ByteString stringTwo; | 3622 CFX_ByteString stringTwo; |
3592 HValueToUTF8String(argTwo, stringTwo); | 3623 HValueToUTF8String(argTwo, stringTwo); |
3593 if (stringTwo.IsEmpty()) { | 3624 if (stringTwo.IsEmpty()) { |
3594 FXJSE_Value_SetInteger(args.GetReturnValue(), 1); | 3625 FXJSE_Value_SetInteger(args.GetReturnValue(), 1); |
3595 } else { | 3626 } else { |
3596 CFX_ByteString stringOne; | 3627 CFX_ByteString stringOne; |
3597 HValueToUTF8String(argOne, stringOne); | 3628 HValueToUTF8String(argOne, stringOne); |
3598 FX_STRSIZE iPosition = stringOne.Find(stringTwo.AsStringC()); | 3629 FX_STRSIZE iPosition = stringOne.Find(stringTwo.AsStringC()); |
3599 FXJSE_Value_SetInteger(args.GetReturnValue(), iPosition + 1); | 3630 FXJSE_Value_SetInteger(args.GetReturnValue(), iPosition + 1); |
3600 } | 3631 } |
3601 } | 3632 } |
3602 FXJSE_Value_Release(argOne); | 3633 FXJSE_Value_Release(argOne); |
3603 FXJSE_Value_Release(argTwo); | 3634 FXJSE_Value_Release(argTwo); |
3604 } else { | 3635 } else { |
3605 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 3636 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
3606 L"At"); | 3637 L"At"); |
3607 } | 3638 } |
3608 } | 3639 } |
3609 void CXFA_FM2JSContext::Concat(FXJSE_HOBJECT hThis, | 3640 void CXFA_FM2JSContext::Concat(FXJSE_HOBJECT hThis, |
3610 const CFX_ByteStringC& szFuncName, | 3641 const CFX_ByteStringC& szFuncName, |
3611 CFXJSE_Arguments& args) { | 3642 CFXJSE_Arguments& args) { |
3612 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 3643 CXFA_FM2JSContext* pContext = |
| 3644 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
3613 int32_t argc = args.GetLength(); | 3645 int32_t argc = args.GetLength(); |
3614 if (argc >= 1) { | 3646 if (argc >= 1) { |
3615 CFX_ByteString resultString; | 3647 CFX_ByteString resultString; |
3616 FX_BOOL bAllNull = TRUE; | 3648 FX_BOOL bAllNull = TRUE; |
3617 FXJSE_HVALUE* argValues = FX_Alloc(FXJSE_HVALUE, argc); | 3649 FXJSE_HVALUE* argValues = FX_Alloc(FXJSE_HVALUE, argc); |
3618 for (int32_t i = 0; i < argc; i++) { | 3650 for (int32_t i = 0; i < argc; i++) { |
3619 argValues[i] = GetSimpleHValue(hThis, args, i); | 3651 argValues[i] = GetSimpleHValue(hThis, args, i); |
3620 if (!HValueIsNull(hThis, argValues[i])) { | 3652 if (!HValueIsNull(hThis, argValues[i])) { |
3621 CFX_ByteString valueStr; | 3653 CFX_ByteString valueStr; |
3622 HValueToUTF8String(argValues[i], valueStr); | 3654 HValueToUTF8String(argValues[i], valueStr); |
(...skipping 12 matching lines...) Expand all Loading... |
3635 resultString.AsStringC()); | 3667 resultString.AsStringC()); |
3636 } | 3668 } |
3637 } else { | 3669 } else { |
3638 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 3670 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
3639 L"Concat"); | 3671 L"Concat"); |
3640 } | 3672 } |
3641 } | 3673 } |
3642 void CXFA_FM2JSContext::Decode(FXJSE_HOBJECT hThis, | 3674 void CXFA_FM2JSContext::Decode(FXJSE_HOBJECT hThis, |
3643 const CFX_ByteStringC& szFuncName, | 3675 const CFX_ByteStringC& szFuncName, |
3644 CFXJSE_Arguments& args) { | 3676 CFXJSE_Arguments& args) { |
3645 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 3677 CXFA_FM2JSContext* pContext = |
| 3678 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
3646 int32_t argc = args.GetLength(); | 3679 int32_t argc = args.GetLength(); |
3647 if (argc == 1) { | 3680 if (argc == 1) { |
3648 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); | 3681 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); |
3649 if (HValueIsNull(hThis, argOne)) { | 3682 if (HValueIsNull(hThis, argOne)) { |
3650 FXJSE_Value_SetNull(args.GetReturnValue()); | 3683 FXJSE_Value_SetNull(args.GetReturnValue()); |
3651 } else { | 3684 } else { |
3652 CFX_ByteString toDecodeString; | 3685 CFX_ByteString toDecodeString; |
3653 HValueToUTF8String(argOne, toDecodeString); | 3686 HValueToUTF8String(argOne, toDecodeString); |
3654 CFX_ByteTextBuf resultBuf; | 3687 CFX_ByteTextBuf resultBuf; |
3655 DecodeURL(toDecodeString.AsStringC(), resultBuf); | 3688 DecodeURL(toDecodeString.AsStringC(), resultBuf); |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3905 iCode = 0; | 3938 iCode = 0; |
3906 } | 3939 } |
3907 wsXMLBuf.AppendChar(0); | 3940 wsXMLBuf.AppendChar(0); |
3908 szResultString.Clear(); | 3941 szResultString.Clear(); |
3909 szResultString << FX_UTF8Encode(wsXMLBuf.GetBuffer(), wsXMLBuf.GetLength()) | 3942 szResultString << FX_UTF8Encode(wsXMLBuf.GetBuffer(), wsXMLBuf.GetLength()) |
3910 .AsStringC(); | 3943 .AsStringC(); |
3911 } | 3944 } |
3912 void CXFA_FM2JSContext::Encode(FXJSE_HOBJECT hThis, | 3945 void CXFA_FM2JSContext::Encode(FXJSE_HOBJECT hThis, |
3913 const CFX_ByteStringC& szFuncName, | 3946 const CFX_ByteStringC& szFuncName, |
3914 CFXJSE_Arguments& args) { | 3947 CFXJSE_Arguments& args) { |
3915 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 3948 CXFA_FM2JSContext* pContext = |
| 3949 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
3916 int32_t argc = args.GetLength(); | 3950 int32_t argc = args.GetLength(); |
3917 if (argc == 1) { | 3951 if (argc == 1) { |
3918 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); | 3952 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); |
3919 if (HValueIsNull(hThis, argOne)) { | 3953 if (HValueIsNull(hThis, argOne)) { |
3920 FXJSE_Value_SetNull(args.GetReturnValue()); | 3954 FXJSE_Value_SetNull(args.GetReturnValue()); |
3921 } else { | 3955 } else { |
3922 CFX_ByteString toEncodeString; | 3956 CFX_ByteString toEncodeString; |
3923 HValueToUTF8String(argOne, toEncodeString); | 3957 HValueToUTF8String(argOne, toEncodeString); |
3924 CFX_ByteTextBuf resultBuf; | 3958 CFX_ByteTextBuf resultBuf; |
3925 EncodeURL(toEncodeString.AsStringC(), resultBuf); | 3959 EncodeURL(toEncodeString.AsStringC(), resultBuf); |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4315 iIndex++; | 4349 iIndex++; |
4316 } | 4350 } |
4317 if (patternType == XFA_VT_NULL) { | 4351 if (patternType == XFA_VT_NULL) { |
4318 patternType = XFA_VT_TEXT | XFA_VT_FLOAT; | 4352 patternType = XFA_VT_TEXT | XFA_VT_FLOAT; |
4319 } | 4353 } |
4320 return FALSE; | 4354 return FALSE; |
4321 } | 4355 } |
4322 void CXFA_FM2JSContext::Format(FXJSE_HOBJECT hThis, | 4356 void CXFA_FM2JSContext::Format(FXJSE_HOBJECT hThis, |
4323 const CFX_ByteStringC& szFuncName, | 4357 const CFX_ByteStringC& szFuncName, |
4324 CFXJSE_Arguments& args) { | 4358 CFXJSE_Arguments& args) { |
4325 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 4359 CXFA_FM2JSContext* pContext = |
| 4360 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
4326 int32_t argc = args.GetLength(); | 4361 int32_t argc = args.GetLength(); |
4327 if (argc >= 2) { | 4362 if (argc >= 2) { |
4328 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); | 4363 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); |
4329 FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1); | 4364 FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1); |
4330 CFX_ByteString szPattern; | 4365 CFX_ByteString szPattern; |
4331 HValueToUTF8String(argOne, szPattern); | 4366 HValueToUTF8String(argOne, szPattern); |
4332 CFX_ByteString szValue; | 4367 CFX_ByteString szValue; |
4333 HValueToUTF8String(argTwo, szValue); | 4368 HValueToUTF8String(argTwo, szValue); |
4334 CXFA_Document* pDoc = pContext->GetDocument(); | 4369 CXFA_Document* pDoc = pContext->GetDocument(); |
4335 IFX_LocaleMgr* pMgr = (IFX_LocaleMgr*)pDoc->GetLocalMgr(); | 4370 IFX_LocaleMgr* pMgr = (IFX_LocaleMgr*)pDoc->GetLocalMgr(); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4402 FXJSE_Value_Release(argOne); | 4437 FXJSE_Value_Release(argOne); |
4403 FXJSE_Value_Release(argTwo); | 4438 FXJSE_Value_Release(argTwo); |
4404 } else { | 4439 } else { |
4405 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 4440 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
4406 L"Format"); | 4441 L"Format"); |
4407 } | 4442 } |
4408 } | 4443 } |
4409 void CXFA_FM2JSContext::Left(FXJSE_HOBJECT hThis, | 4444 void CXFA_FM2JSContext::Left(FXJSE_HOBJECT hThis, |
4410 const CFX_ByteStringC& szFuncName, | 4445 const CFX_ByteStringC& szFuncName, |
4411 CFXJSE_Arguments& args) { | 4446 CFXJSE_Arguments& args) { |
4412 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 4447 CXFA_FM2JSContext* pContext = |
| 4448 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
4413 if (args.GetLength() == 2) { | 4449 if (args.GetLength() == 2) { |
4414 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); | 4450 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); |
4415 FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1); | 4451 FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1); |
4416 FX_BOOL argIsNull = FALSE; | 4452 FX_BOOL argIsNull = FALSE; |
4417 if ((HValueIsNull(hThis, argOne)) || (HValueIsNull(hThis, argTwo))) { | 4453 if ((HValueIsNull(hThis, argOne)) || (HValueIsNull(hThis, argTwo))) { |
4418 argIsNull = TRUE; | 4454 argIsNull = TRUE; |
4419 } | 4455 } |
4420 if (argIsNull) { | 4456 if (argIsNull) { |
4421 FXJSE_Value_SetNull(args.GetReturnValue()); | 4457 FXJSE_Value_SetNull(args.GetReturnValue()); |
4422 } else { | 4458 } else { |
4423 CFX_ByteString sourceString; | 4459 CFX_ByteString sourceString; |
4424 HValueToUTF8String(argOne, sourceString); | 4460 HValueToUTF8String(argOne, sourceString); |
4425 int32_t count = HValueToInteger(hThis, argTwo); | 4461 int32_t count = HValueToInteger(hThis, argTwo); |
4426 if (count < 0) { | 4462 if (count < 0) { |
4427 count = 0; | 4463 count = 0; |
4428 } | 4464 } |
4429 FXJSE_Value_SetUTF8String(args.GetReturnValue(), | 4465 FXJSE_Value_SetUTF8String(args.GetReturnValue(), |
4430 sourceString.Left(count).AsStringC()); | 4466 sourceString.Left(count).AsStringC()); |
4431 } | 4467 } |
4432 FXJSE_Value_Release(argOne); | 4468 FXJSE_Value_Release(argOne); |
4433 FXJSE_Value_Release(argTwo); | 4469 FXJSE_Value_Release(argTwo); |
4434 } else { | 4470 } else { |
4435 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 4471 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
4436 L"Left"); | 4472 L"Left"); |
4437 } | 4473 } |
4438 } | 4474 } |
4439 void CXFA_FM2JSContext::Len(FXJSE_HOBJECT hThis, | 4475 void CXFA_FM2JSContext::Len(FXJSE_HOBJECT hThis, |
4440 const CFX_ByteStringC& szFuncName, | 4476 const CFX_ByteStringC& szFuncName, |
4441 CFXJSE_Arguments& args) { | 4477 CFXJSE_Arguments& args) { |
4442 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 4478 CXFA_FM2JSContext* pContext = |
| 4479 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
4443 if (args.GetLength() == 1) { | 4480 if (args.GetLength() == 1) { |
4444 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); | 4481 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); |
4445 if (HValueIsNull(hThis, argOne)) { | 4482 if (HValueIsNull(hThis, argOne)) { |
4446 FXJSE_Value_SetNull(args.GetReturnValue()); | 4483 FXJSE_Value_SetNull(args.GetReturnValue()); |
4447 } else { | 4484 } else { |
4448 CFX_ByteString sourceString; | 4485 CFX_ByteString sourceString; |
4449 HValueToUTF8String(argOne, sourceString); | 4486 HValueToUTF8String(argOne, sourceString); |
4450 FXJSE_Value_SetInteger(args.GetReturnValue(), sourceString.GetLength()); | 4487 FXJSE_Value_SetInteger(args.GetReturnValue(), sourceString.GetLength()); |
4451 } | 4488 } |
4452 FXJSE_Value_Release(argOne); | 4489 FXJSE_Value_Release(argOne); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4494 args.GetReturnValue(), | 4531 args.GetReturnValue(), |
4495 FX_UTF8Encode(lowStringBuf.GetBuffer(), lowStringBuf.GetLength()) | 4532 FX_UTF8Encode(lowStringBuf.GetBuffer(), lowStringBuf.GetLength()) |
4496 .AsStringC()); | 4533 .AsStringC()); |
4497 if (argc == 2) { | 4534 if (argc == 2) { |
4498 FXJSE_Value_Release(localeValue); | 4535 FXJSE_Value_Release(localeValue); |
4499 } | 4536 } |
4500 } | 4537 } |
4501 FXJSE_Value_Release(argOne); | 4538 FXJSE_Value_Release(argOne); |
4502 } else { | 4539 } else { |
4503 CXFA_FM2JSContext* pContext = | 4540 CXFA_FM2JSContext* pContext = |
4504 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 4541 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
4505 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 4542 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
4506 L"Lower"); | 4543 L"Lower"); |
4507 } | 4544 } |
4508 } | 4545 } |
4509 void CXFA_FM2JSContext::Ltrim(FXJSE_HOBJECT hThis, | 4546 void CXFA_FM2JSContext::Ltrim(FXJSE_HOBJECT hThis, |
4510 const CFX_ByteStringC& szFuncName, | 4547 const CFX_ByteStringC& szFuncName, |
4511 CFXJSE_Arguments& args) { | 4548 CFXJSE_Arguments& args) { |
4512 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 4549 CXFA_FM2JSContext* pContext = |
| 4550 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
4513 if (args.GetLength() == 1) { | 4551 if (args.GetLength() == 1) { |
4514 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); | 4552 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); |
4515 if (HValueIsNull(hThis, argOne)) { | 4553 if (HValueIsNull(hThis, argOne)) { |
4516 FXJSE_Value_SetNull(args.GetReturnValue()); | 4554 FXJSE_Value_SetNull(args.GetReturnValue()); |
4517 } else { | 4555 } else { |
4518 CFX_ByteString sourceString; | 4556 CFX_ByteString sourceString; |
4519 HValueToUTF8String(argOne, sourceString); | 4557 HValueToUTF8String(argOne, sourceString); |
4520 sourceString.TrimLeft(); | 4558 sourceString.TrimLeft(); |
4521 FXJSE_Value_SetUTF8String(args.GetReturnValue(), | 4559 FXJSE_Value_SetUTF8String(args.GetReturnValue(), |
4522 sourceString.AsStringC()); | 4560 sourceString.AsStringC()); |
4523 } | 4561 } |
4524 FXJSE_Value_Release(argOne); | 4562 FXJSE_Value_Release(argOne); |
4525 } else { | 4563 } else { |
4526 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 4564 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
4527 L"Ltrim"); | 4565 L"Ltrim"); |
4528 } | 4566 } |
4529 } | 4567 } |
4530 void CXFA_FM2JSContext::Parse(FXJSE_HOBJECT hThis, | 4568 void CXFA_FM2JSContext::Parse(FXJSE_HOBJECT hThis, |
4531 const CFX_ByteStringC& szFuncName, | 4569 const CFX_ByteStringC& szFuncName, |
4532 CFXJSE_Arguments& args) { | 4570 CFXJSE_Arguments& args) { |
4533 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 4571 CXFA_FM2JSContext* pContext = |
| 4572 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
4534 if (args.GetLength() == 2) { | 4573 if (args.GetLength() == 2) { |
4535 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); | 4574 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); |
4536 FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1); | 4575 FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1); |
4537 if (HValueIsNull(hThis, argTwo)) { | 4576 if (HValueIsNull(hThis, argTwo)) { |
4538 FXJSE_Value_SetNull(args.GetReturnValue()); | 4577 FXJSE_Value_SetNull(args.GetReturnValue()); |
4539 } else { | 4578 } else { |
4540 CFX_ByteString szPattern; | 4579 CFX_ByteString szPattern; |
4541 HValueToUTF8String(argOne, szPattern); | 4580 HValueToUTF8String(argOne, szPattern); |
4542 CFX_ByteString szValue; | 4581 CFX_ByteString szValue; |
4543 HValueToUTF8String(argTwo, szValue); | 4582 HValueToUTF8String(argTwo, szValue); |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4722 } | 4761 } |
4723 resultString.AppendChar(0); | 4762 resultString.AppendChar(0); |
4724 FXJSE_Value_SetUTF8String(args.GetReturnValue(), resultString.AsStringC()); | 4763 FXJSE_Value_SetUTF8String(args.GetReturnValue(), resultString.AsStringC()); |
4725 FXJSE_Value_Release(argOne); | 4764 FXJSE_Value_Release(argOne); |
4726 FXJSE_Value_Release(argTwo); | 4765 FXJSE_Value_Release(argTwo); |
4727 if (argc == 3) { | 4766 if (argc == 3) { |
4728 FXJSE_Value_Release(argThree); | 4767 FXJSE_Value_Release(argThree); |
4729 } | 4768 } |
4730 } else { | 4769 } else { |
4731 CXFA_FM2JSContext* pContext = | 4770 CXFA_FM2JSContext* pContext = |
4732 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 4771 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
4733 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 4772 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
4734 L"Replace"); | 4773 L"Replace"); |
4735 } | 4774 } |
4736 } | 4775 } |
4737 void CXFA_FM2JSContext::Right(FXJSE_HOBJECT hThis, | 4776 void CXFA_FM2JSContext::Right(FXJSE_HOBJECT hThis, |
4738 const CFX_ByteStringC& szFuncName, | 4777 const CFX_ByteStringC& szFuncName, |
4739 CFXJSE_Arguments& args) { | 4778 CFXJSE_Arguments& args) { |
4740 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 4779 CXFA_FM2JSContext* pContext = |
| 4780 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
4741 if (args.GetLength() == 2) { | 4781 if (args.GetLength() == 2) { |
4742 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); | 4782 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); |
4743 FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1); | 4783 FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1); |
4744 FX_BOOL argIsNull = FALSE; | 4784 FX_BOOL argIsNull = FALSE; |
4745 if ((HValueIsNull(hThis, argOne)) || (HValueIsNull(hThis, argTwo))) { | 4785 if ((HValueIsNull(hThis, argOne)) || (HValueIsNull(hThis, argTwo))) { |
4746 argIsNull = TRUE; | 4786 argIsNull = TRUE; |
4747 } | 4787 } |
4748 if (argIsNull) { | 4788 if (argIsNull) { |
4749 FXJSE_Value_SetNull(args.GetReturnValue()); | 4789 FXJSE_Value_SetNull(args.GetReturnValue()); |
4750 } else { | 4790 } else { |
4751 CFX_ByteString sourceString; | 4791 CFX_ByteString sourceString; |
4752 HValueToUTF8String(argOne, sourceString); | 4792 HValueToUTF8String(argOne, sourceString); |
4753 int32_t count = HValueToInteger(hThis, argTwo); | 4793 int32_t count = HValueToInteger(hThis, argTwo); |
4754 if (count < 0) { | 4794 if (count < 0) { |
4755 count = 0; | 4795 count = 0; |
4756 } | 4796 } |
4757 FXJSE_Value_SetUTF8String(args.GetReturnValue(), | 4797 FXJSE_Value_SetUTF8String(args.GetReturnValue(), |
4758 sourceString.Right(count).AsStringC()); | 4798 sourceString.Right(count).AsStringC()); |
4759 } | 4799 } |
4760 FXJSE_Value_Release(argOne); | 4800 FXJSE_Value_Release(argOne); |
4761 FXJSE_Value_Release(argTwo); | 4801 FXJSE_Value_Release(argTwo); |
4762 } else { | 4802 } else { |
4763 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 4803 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
4764 L"Right"); | 4804 L"Right"); |
4765 } | 4805 } |
4766 } | 4806 } |
4767 void CXFA_FM2JSContext::Rtrim(FXJSE_HOBJECT hThis, | 4807 void CXFA_FM2JSContext::Rtrim(FXJSE_HOBJECT hThis, |
4768 const CFX_ByteStringC& szFuncName, | 4808 const CFX_ByteStringC& szFuncName, |
4769 CFXJSE_Arguments& args) { | 4809 CFXJSE_Arguments& args) { |
4770 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 4810 CXFA_FM2JSContext* pContext = |
| 4811 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
4771 if (args.GetLength() == 1) { | 4812 if (args.GetLength() == 1) { |
4772 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); | 4813 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); |
4773 if (HValueIsNull(hThis, argOne)) { | 4814 if (HValueIsNull(hThis, argOne)) { |
4774 FXJSE_Value_SetNull(args.GetReturnValue()); | 4815 FXJSE_Value_SetNull(args.GetReturnValue()); |
4775 } else { | 4816 } else { |
4776 CFX_ByteString sourceString; | 4817 CFX_ByteString sourceString; |
4777 HValueToUTF8String(argOne, sourceString); | 4818 HValueToUTF8String(argOne, sourceString); |
4778 sourceString.TrimRight(); | 4819 sourceString.TrimRight(); |
4779 FXJSE_Value_SetUTF8String(args.GetReturnValue(), | 4820 FXJSE_Value_SetUTF8String(args.GetReturnValue(), |
4780 sourceString.AsStringC()); | 4821 sourceString.AsStringC()); |
4781 } | 4822 } |
4782 FXJSE_Value_Release(argOne); | 4823 FXJSE_Value_Release(argOne); |
4783 } else { | 4824 } else { |
4784 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 4825 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
4785 L"Rtrim"); | 4826 L"Rtrim"); |
4786 } | 4827 } |
4787 } | 4828 } |
4788 void CXFA_FM2JSContext::Space(FXJSE_HOBJECT hThis, | 4829 void CXFA_FM2JSContext::Space(FXJSE_HOBJECT hThis, |
4789 const CFX_ByteStringC& szFuncName, | 4830 const CFX_ByteStringC& szFuncName, |
4790 CFXJSE_Arguments& args) { | 4831 CFXJSE_Arguments& args) { |
4791 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 4832 CXFA_FM2JSContext* pContext = |
| 4833 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
4792 if (args.GetLength() == 1) { | 4834 if (args.GetLength() == 1) { |
4793 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); | 4835 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); |
4794 if (FXJSE_Value_IsNull(argOne)) { | 4836 if (FXJSE_Value_IsNull(argOne)) { |
4795 FXJSE_Value_SetNull(args.GetReturnValue()); | 4837 FXJSE_Value_SetNull(args.GetReturnValue()); |
4796 } else { | 4838 } else { |
4797 int32_t count = 0; | 4839 int32_t count = 0; |
4798 count = HValueToInteger(hThis, argOne); | 4840 count = HValueToInteger(hThis, argOne); |
4799 count = (count < 0) ? 0 : count; | 4841 count = (count < 0) ? 0 : count; |
4800 CFX_ByteTextBuf spaceString; | 4842 CFX_ByteTextBuf spaceString; |
4801 int32_t index = 0; | 4843 int32_t index = 0; |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4926 } | 4968 } |
4927 FXJSE_Value_Release(numberValue); | 4969 FXJSE_Value_Release(numberValue); |
4928 if (argc > 1) { | 4970 if (argc > 1) { |
4929 FXJSE_Value_Release(widthValue); | 4971 FXJSE_Value_Release(widthValue); |
4930 if (argc == 3) { | 4972 if (argc == 3) { |
4931 FXJSE_Value_Release(precisionValue); | 4973 FXJSE_Value_Release(precisionValue); |
4932 } | 4974 } |
4933 } | 4975 } |
4934 } else { | 4976 } else { |
4935 CXFA_FM2JSContext* pContext = | 4977 CXFA_FM2JSContext* pContext = |
4936 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 4978 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
4937 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 4979 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
4938 L"Str"); | 4980 L"Str"); |
4939 } | 4981 } |
4940 } | 4982 } |
4941 void CXFA_FM2JSContext::Stuff(FXJSE_HOBJECT hThis, | 4983 void CXFA_FM2JSContext::Stuff(FXJSE_HOBJECT hThis, |
4942 const CFX_ByteStringC& szFuncName, | 4984 const CFX_ByteStringC& szFuncName, |
4943 CFXJSE_Arguments& args) { | 4985 CFXJSE_Arguments& args) { |
4944 int32_t argc = args.GetLength(); | 4986 int32_t argc = args.GetLength(); |
4945 if ((argc == 3) || (argc == 4)) { | 4987 if ((argc == 3) || (argc == 4)) { |
4946 CFX_ByteString sourceString; | 4988 CFX_ByteString sourceString; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4988 resultString.AppendChar(0); | 5030 resultString.AppendChar(0); |
4989 FXJSE_Value_SetUTF8String(args.GetReturnValue(), resultString.AsStringC()); | 5031 FXJSE_Value_SetUTF8String(args.GetReturnValue(), resultString.AsStringC()); |
4990 FXJSE_Value_Release(sourceValue); | 5032 FXJSE_Value_Release(sourceValue); |
4991 FXJSE_Value_Release(startValue); | 5033 FXJSE_Value_Release(startValue); |
4992 FXJSE_Value_Release(deleteValue); | 5034 FXJSE_Value_Release(deleteValue); |
4993 if (argc == 4) { | 5035 if (argc == 4) { |
4994 FXJSE_Value_Release(insertValue); | 5036 FXJSE_Value_Release(insertValue); |
4995 } | 5037 } |
4996 } else { | 5038 } else { |
4997 CXFA_FM2JSContext* pContext = | 5039 CXFA_FM2JSContext* pContext = |
4998 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 5040 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
4999 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 5041 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
5000 L"Stuff"); | 5042 L"Stuff"); |
5001 } | 5043 } |
5002 } | 5044 } |
5003 void CXFA_FM2JSContext::Substr(FXJSE_HOBJECT hThis, | 5045 void CXFA_FM2JSContext::Substr(FXJSE_HOBJECT hThis, |
5004 const CFX_ByteStringC& szFuncName, | 5046 const CFX_ByteStringC& szFuncName, |
5005 CFXJSE_Arguments& args) { | 5047 CFXJSE_Arguments& args) { |
5006 int32_t argc = args.GetLength(); | 5048 int32_t argc = args.GetLength(); |
5007 if (argc == 3) { | 5049 if (argc == 3) { |
5008 FXJSE_HVALUE stringValue = GetSimpleHValue(hThis, args, 0); | 5050 FXJSE_HVALUE stringValue = GetSimpleHValue(hThis, args, 0); |
(...skipping 25 matching lines...) Expand all Loading... |
5034 iStart -= 1; | 5076 iStart -= 1; |
5035 FXJSE_Value_SetUTF8String(args.GetReturnValue(), | 5077 FXJSE_Value_SetUTF8String(args.GetReturnValue(), |
5036 szSourceStr.Mid(iStart, iCount).AsStringC()); | 5078 szSourceStr.Mid(iStart, iCount).AsStringC()); |
5037 } | 5079 } |
5038 } | 5080 } |
5039 FXJSE_Value_Release(stringValue); | 5081 FXJSE_Value_Release(stringValue); |
5040 FXJSE_Value_Release(startValue); | 5082 FXJSE_Value_Release(startValue); |
5041 FXJSE_Value_Release(endValue); | 5083 FXJSE_Value_Release(endValue); |
5042 } else { | 5084 } else { |
5043 CXFA_FM2JSContext* pContext = | 5085 CXFA_FM2JSContext* pContext = |
5044 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 5086 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
5045 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 5087 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
5046 L"Substr"); | 5088 L"Substr"); |
5047 } | 5089 } |
5048 } | 5090 } |
5049 void CXFA_FM2JSContext::Uuid(FXJSE_HOBJECT hThis, | 5091 void CXFA_FM2JSContext::Uuid(FXJSE_HOBJECT hThis, |
5050 const CFX_ByteStringC& szFuncName, | 5092 const CFX_ByteStringC& szFuncName, |
5051 CFXJSE_Arguments& args) { | 5093 CFXJSE_Arguments& args) { |
5052 int32_t argc = args.GetLength(); | 5094 int32_t argc = args.GetLength(); |
5053 if ((argc == 0) || (argc == 1)) { | 5095 if ((argc == 0) || (argc == 1)) { |
5054 int32_t iNum = 0; | 5096 int32_t iNum = 0; |
5055 FXJSE_HVALUE argOne = 0; | 5097 FXJSE_HVALUE argOne = 0; |
5056 if (argc == 1) { | 5098 if (argc == 1) { |
5057 argOne = GetSimpleHValue(hThis, args, 0); | 5099 argOne = GetSimpleHValue(hThis, args, 0); |
5058 iNum = (int32_t)HValueToFloat(hThis, argOne); | 5100 iNum = (int32_t)HValueToFloat(hThis, argOne); |
5059 } | 5101 } |
5060 FX_GUID guid; | 5102 FX_GUID guid; |
5061 FX_GUID_CreateV4(&guid); | 5103 FX_GUID_CreateV4(&guid); |
5062 CFX_ByteString bsUId; | 5104 CFX_ByteString bsUId; |
5063 FX_GUID_ToString(&guid, bsUId, iNum); | 5105 FX_GUID_ToString(&guid, bsUId, iNum); |
5064 FXJSE_Value_SetUTF8String(args.GetReturnValue(), bsUId.AsStringC()); | 5106 FXJSE_Value_SetUTF8String(args.GetReturnValue(), bsUId.AsStringC()); |
5065 if (argc == 1) { | 5107 if (argc == 1) { |
5066 FXJSE_Value_Release(argOne); | 5108 FXJSE_Value_Release(argOne); |
5067 } | 5109 } |
5068 } else { | 5110 } else { |
5069 CXFA_FM2JSContext* pContext = | 5111 CXFA_FM2JSContext* pContext = |
5070 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 5112 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
5071 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 5113 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
5072 L"Uuid"); | 5114 L"Uuid"); |
5073 } | 5115 } |
5074 } | 5116 } |
5075 void CXFA_FM2JSContext::Upper(FXJSE_HOBJECT hThis, | 5117 void CXFA_FM2JSContext::Upper(FXJSE_HOBJECT hThis, |
5076 const CFX_ByteStringC& szFuncName, | 5118 const CFX_ByteStringC& szFuncName, |
5077 CFXJSE_Arguments& args) { | 5119 CFXJSE_Arguments& args) { |
5078 int32_t argc = args.GetLength(); | 5120 int32_t argc = args.GetLength(); |
5079 if ((argc > 0) && (argc < 3)) { | 5121 if ((argc > 0) && (argc < 3)) { |
5080 CFX_ByteString argString; | 5122 CFX_ByteString argString; |
(...skipping 30 matching lines...) Expand all Loading... |
5111 args.GetReturnValue(), | 5153 args.GetReturnValue(), |
5112 FX_UTF8Encode(upperStringBuf.GetBuffer(), upperStringBuf.GetLength()) | 5154 FX_UTF8Encode(upperStringBuf.GetBuffer(), upperStringBuf.GetLength()) |
5113 .AsStringC()); | 5155 .AsStringC()); |
5114 if (argc == 2) { | 5156 if (argc == 2) { |
5115 FXJSE_Value_Release(localeValue); | 5157 FXJSE_Value_Release(localeValue); |
5116 } | 5158 } |
5117 } | 5159 } |
5118 FXJSE_Value_Release(argOne); | 5160 FXJSE_Value_Release(argOne); |
5119 } else { | 5161 } else { |
5120 CXFA_FM2JSContext* pContext = | 5162 CXFA_FM2JSContext* pContext = |
5121 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 5163 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
5122 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 5164 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
5123 L"Upper"); | 5165 L"Upper"); |
5124 } | 5166 } |
5125 } | 5167 } |
5126 void CXFA_FM2JSContext::WordNum(FXJSE_HOBJECT hThis, | 5168 void CXFA_FM2JSContext::WordNum(FXJSE_HOBJECT hThis, |
5127 const CFX_ByteStringC& szFuncName, | 5169 const CFX_ByteStringC& szFuncName, |
5128 CFXJSE_Arguments& args) { | 5170 CFXJSE_Arguments& args) { |
5129 int32_t argc = args.GetLength(); | 5171 int32_t argc = args.GetLength(); |
5130 if ((argc > 0) && (argc < 4)) { | 5172 if ((argc > 0) && (argc < 4)) { |
5131 FX_BOOL bFlags = FALSE; | 5173 FX_BOOL bFlags = FALSE; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5171 } | 5213 } |
5172 FXJSE_Value_Release(numberValue); | 5214 FXJSE_Value_Release(numberValue); |
5173 if (argc > 1) { | 5215 if (argc > 1) { |
5174 FXJSE_Value_Release(identifierValue); | 5216 FXJSE_Value_Release(identifierValue); |
5175 if (argc == 3) { | 5217 if (argc == 3) { |
5176 FXJSE_Value_Release(localeValue); | 5218 FXJSE_Value_Release(localeValue); |
5177 } | 5219 } |
5178 } | 5220 } |
5179 } else { | 5221 } else { |
5180 CXFA_FM2JSContext* pContext = | 5222 CXFA_FM2JSContext* pContext = |
5181 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 5223 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
5182 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 5224 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
5183 L"WordNum"); | 5225 L"WordNum"); |
5184 } | 5226 } |
5185 } | 5227 } |
5186 void CXFA_FM2JSContext::TrillionUS(const CFX_ByteStringC& szData, | 5228 void CXFA_FM2JSContext::TrillionUS(const CFX_ByteStringC& szData, |
5187 CFX_ByteTextBuf& strBuf) { | 5229 CFX_ByteTextBuf& strBuf) { |
5188 CFX_ByteStringC pUnits[] = {"zero", "one", "two", "three", "four", | 5230 CFX_ByteStringC pUnits[] = {"zero", "one", "two", "three", "four", |
5189 "five", "six", "seven", "eight", "nine"}; | 5231 "five", "six", "seven", "eight", "nine"}; |
5190 CFX_ByteStringC pCapUnits[] = {"Zero", "One", "Two", "Three", "Four", | 5232 CFX_ByteStringC pCapUnits[] = {"Zero", "One", "Two", "Three", "Four", |
5191 "Five", "Six", "Seven", "Eight", "Nine"}; | 5233 "Five", "Six", "Seven", "Eight", "Nine"}; |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5374 strBuf << " Cents"; | 5416 strBuf << " Cents"; |
5375 } | 5417 } |
5376 } break; | 5418 } break; |
5377 default: | 5419 default: |
5378 break; | 5420 break; |
5379 } | 5421 } |
5380 } | 5422 } |
5381 void CXFA_FM2JSContext::Get(FXJSE_HOBJECT hThis, | 5423 void CXFA_FM2JSContext::Get(FXJSE_HOBJECT hThis, |
5382 const CFX_ByteStringC& szFuncName, | 5424 const CFX_ByteStringC& szFuncName, |
5383 CFXJSE_Arguments& args) { | 5425 CFXJSE_Arguments& args) { |
5384 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 5426 CXFA_FM2JSContext* pContext = |
| 5427 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
5385 int32_t argc = args.GetLength(); | 5428 int32_t argc = args.GetLength(); |
5386 if (argc == 1) { | 5429 if (argc == 1) { |
5387 CXFA_Document* pDoc = pContext->GetDocument(); | 5430 CXFA_Document* pDoc = pContext->GetDocument(); |
5388 if (!pDoc) { | 5431 if (!pDoc) { |
5389 return; | 5432 return; |
5390 } | 5433 } |
5391 IXFA_AppProvider* pAppProvider = | 5434 IXFA_AppProvider* pAppProvider = |
5392 pDoc->GetParser()->GetNotify()->GetAppProvider(); | 5435 pDoc->GetParser()->GetNotify()->GetAppProvider(); |
5393 if (!pAppProvider) { | 5436 if (!pAppProvider) { |
5394 return; | 5437 return; |
(...skipping 14 matching lines...) Expand all Loading... |
5409 } | 5452 } |
5410 FXJSE_Value_Release(argOne); | 5453 FXJSE_Value_Release(argOne); |
5411 } else { | 5454 } else { |
5412 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 5455 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
5413 L"Get"); | 5456 L"Get"); |
5414 } | 5457 } |
5415 } | 5458 } |
5416 void CXFA_FM2JSContext::Post(FXJSE_HOBJECT hThis, | 5459 void CXFA_FM2JSContext::Post(FXJSE_HOBJECT hThis, |
5417 const CFX_ByteStringC& szFuncName, | 5460 const CFX_ByteStringC& szFuncName, |
5418 CFXJSE_Arguments& args) { | 5461 CFXJSE_Arguments& args) { |
5419 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 5462 CXFA_FM2JSContext* pContext = |
| 5463 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
5420 int32_t argc = args.GetLength(); | 5464 int32_t argc = args.GetLength(); |
5421 if ((argc >= 2) && (argc <= 5)) { | 5465 if ((argc >= 2) && (argc <= 5)) { |
5422 CXFA_Document* pDoc = pContext->GetDocument(); | 5466 CXFA_Document* pDoc = pContext->GetDocument(); |
5423 if (!pDoc) { | 5467 if (!pDoc) { |
5424 return; | 5468 return; |
5425 } | 5469 } |
5426 IXFA_AppProvider* pAppProvider = | 5470 IXFA_AppProvider* pAppProvider = |
5427 pDoc->GetParser()->GetNotify()->GetAppProvider(); | 5471 pDoc->GetParser()->GetNotify()->GetAppProvider(); |
5428 if (!pAppProvider) { | 5472 if (!pAppProvider) { |
5429 return; | 5473 return; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5479 pContext->ThrowScriptErrorMessage(XFA_IDS_SERVER_DENY); | 5523 pContext->ThrowScriptErrorMessage(XFA_IDS_SERVER_DENY); |
5480 } | 5524 } |
5481 } else { | 5525 } else { |
5482 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 5526 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
5483 L"Post"); | 5527 L"Post"); |
5484 } | 5528 } |
5485 } | 5529 } |
5486 void CXFA_FM2JSContext::Put(FXJSE_HOBJECT hThis, | 5530 void CXFA_FM2JSContext::Put(FXJSE_HOBJECT hThis, |
5487 const CFX_ByteStringC& szFuncName, | 5531 const CFX_ByteStringC& szFuncName, |
5488 CFXJSE_Arguments& args) { | 5532 CFXJSE_Arguments& args) { |
5489 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 5533 CXFA_FM2JSContext* pContext = |
| 5534 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
5490 int32_t argc = args.GetLength(); | 5535 int32_t argc = args.GetLength(); |
5491 if ((argc == 2) || (argc == 3)) { | 5536 if ((argc == 2) || (argc == 3)) { |
5492 CXFA_Document* pDoc = pContext->GetDocument(); | 5537 CXFA_Document* pDoc = pContext->GetDocument(); |
5493 if (!pDoc) { | 5538 if (!pDoc) { |
5494 return; | 5539 return; |
5495 } | 5540 } |
5496 IXFA_AppProvider* pAppProvider = | 5541 IXFA_AppProvider* pAppProvider = |
5497 pDoc->GetParser()->GetNotify()->GetAppProvider(); | 5542 pDoc->GetParser()->GetNotify()->GetAppProvider(); |
5498 if (!pAppProvider) { | 5543 if (!pAppProvider) { |
5499 return; | 5544 return; |
(...skipping 25 matching lines...) Expand all Loading... |
5525 pContext->ThrowScriptErrorMessage(XFA_IDS_SERVER_DENY); | 5570 pContext->ThrowScriptErrorMessage(XFA_IDS_SERVER_DENY); |
5526 } | 5571 } |
5527 } else { | 5572 } else { |
5528 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 5573 pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
5529 L"Put"); | 5574 L"Put"); |
5530 } | 5575 } |
5531 } | 5576 } |
5532 void CXFA_FM2JSContext::assign_value_operator(FXJSE_HOBJECT hThis, | 5577 void CXFA_FM2JSContext::assign_value_operator(FXJSE_HOBJECT hThis, |
5533 const CFX_ByteStringC& szFuncName, | 5578 const CFX_ByteStringC& szFuncName, |
5534 CFXJSE_Arguments& args) { | 5579 CFXJSE_Arguments& args) { |
5535 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 5580 CXFA_FM2JSContext* pContext = |
| 5581 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
5536 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); | 5582 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); |
5537 if (args.GetLength() == 2) { | 5583 if (args.GetLength() == 2) { |
5538 FXJSE_HVALUE lValue = args.GetValue(0); | 5584 FXJSE_HVALUE lValue = args.GetValue(0); |
5539 FXJSE_HVALUE rValue = GetSimpleHValue(hThis, args, 1); | 5585 FXJSE_HVALUE rValue = GetSimpleHValue(hThis, args, 1); |
5540 FX_BOOL bSetStatus = TRUE; | 5586 FX_BOOL bSetStatus = TRUE; |
5541 if (FXJSE_Value_IsArray(lValue)) { | 5587 if (FXJSE_Value_IsArray(lValue)) { |
5542 FXJSE_HVALUE leftLengthValue = FXJSE_Value_Create(pIsolate); | 5588 FXJSE_HVALUE leftLengthValue = FXJSE_Value_Create(pIsolate); |
5543 FXJSE_Value_GetObjectProp(lValue, "length", leftLengthValue); | 5589 FXJSE_Value_GetObjectProp(lValue, "length", leftLengthValue); |
5544 int32_t iLeftLength = FXJSE_Value_ToInteger(leftLengthValue); | 5590 int32_t iLeftLength = FXJSE_Value_ToInteger(leftLengthValue); |
5545 FXJSE_Value_Release(leftLengthValue); | 5591 FXJSE_Value_Release(leftLengthValue); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5589 FXJSE_Value_SetNull(args.GetReturnValue()); | 5635 FXJSE_Value_SetNull(args.GetReturnValue()); |
5590 } else { | 5636 } else { |
5591 FX_FLOAT first = HValueToFloat(hThis, argFirst); | 5637 FX_FLOAT first = HValueToFloat(hThis, argFirst); |
5592 FX_FLOAT second = HValueToFloat(hThis, argSecond); | 5638 FX_FLOAT second = HValueToFloat(hThis, argSecond); |
5593 FXJSE_Value_SetInteger(args.GetReturnValue(), (first || second) ? 1 : 0); | 5639 FXJSE_Value_SetInteger(args.GetReturnValue(), (first || second) ? 1 : 0); |
5594 } | 5640 } |
5595 FXJSE_Value_Release(argFirst); | 5641 FXJSE_Value_Release(argFirst); |
5596 FXJSE_Value_Release(argSecond); | 5642 FXJSE_Value_Release(argSecond); |
5597 } else { | 5643 } else { |
5598 CXFA_FM2JSContext* pContext = | 5644 CXFA_FM2JSContext* pContext = |
5599 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 5645 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
5600 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); | 5646 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); |
5601 } | 5647 } |
5602 } | 5648 } |
5603 void CXFA_FM2JSContext::logical_and_operator(FXJSE_HOBJECT hThis, | 5649 void CXFA_FM2JSContext::logical_and_operator(FXJSE_HOBJECT hThis, |
5604 const CFX_ByteStringC& szFuncName, | 5650 const CFX_ByteStringC& szFuncName, |
5605 CFXJSE_Arguments& args) { | 5651 CFXJSE_Arguments& args) { |
5606 if (args.GetLength() == 2) { | 5652 if (args.GetLength() == 2) { |
5607 FXJSE_HVALUE argFirst = GetSimpleHValue(hThis, args, 0); | 5653 FXJSE_HVALUE argFirst = GetSimpleHValue(hThis, args, 0); |
5608 FXJSE_HVALUE argSecond = GetSimpleHValue(hThis, args, 1); | 5654 FXJSE_HVALUE argSecond = GetSimpleHValue(hThis, args, 1); |
5609 if (FXJSE_Value_IsNull(argFirst) && FXJSE_Value_IsNull(argSecond)) { | 5655 if (FXJSE_Value_IsNull(argFirst) && FXJSE_Value_IsNull(argSecond)) { |
5610 FXJSE_Value_SetNull(args.GetReturnValue()); | 5656 FXJSE_Value_SetNull(args.GetReturnValue()); |
5611 } else { | 5657 } else { |
5612 FX_FLOAT first = HValueToFloat(hThis, argFirst); | 5658 FX_FLOAT first = HValueToFloat(hThis, argFirst); |
5613 FX_FLOAT second = HValueToFloat(hThis, argSecond); | 5659 FX_FLOAT second = HValueToFloat(hThis, argSecond); |
5614 FXJSE_Value_SetInteger(args.GetReturnValue(), (first && second) ? 1 : 0); | 5660 FXJSE_Value_SetInteger(args.GetReturnValue(), (first && second) ? 1 : 0); |
5615 } | 5661 } |
5616 FXJSE_Value_Release(argFirst); | 5662 FXJSE_Value_Release(argFirst); |
5617 FXJSE_Value_Release(argSecond); | 5663 FXJSE_Value_Release(argSecond); |
5618 } else { | 5664 } else { |
5619 CXFA_FM2JSContext* pContext = | 5665 CXFA_FM2JSContext* pContext = |
5620 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 5666 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
5621 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); | 5667 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); |
5622 } | 5668 } |
5623 } | 5669 } |
5624 void CXFA_FM2JSContext::equality_operator(FXJSE_HOBJECT hThis, | 5670 void CXFA_FM2JSContext::equality_operator(FXJSE_HOBJECT hThis, |
5625 const CFX_ByteStringC& szFuncName, | 5671 const CFX_ByteStringC& szFuncName, |
5626 CFXJSE_Arguments& args) { | 5672 CFXJSE_Arguments& args) { |
5627 if (args.GetLength() == 2) { | 5673 if (args.GetLength() == 2) { |
5628 if (fm_ref_equal(hThis, args)) { | 5674 if (fm_ref_equal(hThis, args)) { |
5629 FXJSE_Value_SetInteger(args.GetReturnValue(), 1); | 5675 FXJSE_Value_SetInteger(args.GetReturnValue(), 1); |
5630 } else { | 5676 } else { |
(...skipping 17 matching lines...) Expand all Loading... |
5648 FX_DOUBLE first = HValueToDouble(hThis, argFirst); | 5694 FX_DOUBLE first = HValueToDouble(hThis, argFirst); |
5649 FX_DOUBLE second = HValueToDouble(hThis, argSecond); | 5695 FX_DOUBLE second = HValueToDouble(hThis, argSecond); |
5650 FXJSE_Value_SetInteger(args.GetReturnValue(), | 5696 FXJSE_Value_SetInteger(args.GetReturnValue(), |
5651 (first == second) ? 1 : 0); | 5697 (first == second) ? 1 : 0); |
5652 } | 5698 } |
5653 FXJSE_Value_Release(argFirst); | 5699 FXJSE_Value_Release(argFirst); |
5654 FXJSE_Value_Release(argSecond); | 5700 FXJSE_Value_Release(argSecond); |
5655 } | 5701 } |
5656 } else { | 5702 } else { |
5657 CXFA_FM2JSContext* pContext = | 5703 CXFA_FM2JSContext* pContext = |
5658 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 5704 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
5659 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); | 5705 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); |
5660 } | 5706 } |
5661 } | 5707 } |
5662 void CXFA_FM2JSContext::notequality_operator(FXJSE_HOBJECT hThis, | 5708 void CXFA_FM2JSContext::notequality_operator(FXJSE_HOBJECT hThis, |
5663 const CFX_ByteStringC& szFuncName, | 5709 const CFX_ByteStringC& szFuncName, |
5664 CFXJSE_Arguments& args) { | 5710 CFXJSE_Arguments& args) { |
5665 if (args.GetLength() == 2) { | 5711 if (args.GetLength() == 2) { |
5666 if (fm_ref_equal(hThis, args)) { | 5712 if (fm_ref_equal(hThis, args)) { |
5667 FXJSE_Value_SetInteger(args.GetReturnValue(), 0); | 5713 FXJSE_Value_SetInteger(args.GetReturnValue(), 0); |
5668 } else { | 5714 } else { |
(...skipping 16 matching lines...) Expand all Loading... |
5685 } else { | 5731 } else { |
5686 FX_DOUBLE first = HValueToDouble(hThis, argFirst); | 5732 FX_DOUBLE first = HValueToDouble(hThis, argFirst); |
5687 FX_DOUBLE second = HValueToDouble(hThis, argSecond); | 5733 FX_DOUBLE second = HValueToDouble(hThis, argSecond); |
5688 FXJSE_Value_SetInteger(args.GetReturnValue(), first != second); | 5734 FXJSE_Value_SetInteger(args.GetReturnValue(), first != second); |
5689 } | 5735 } |
5690 FXJSE_Value_Release(argFirst); | 5736 FXJSE_Value_Release(argFirst); |
5691 FXJSE_Value_Release(argSecond); | 5737 FXJSE_Value_Release(argSecond); |
5692 } | 5738 } |
5693 } else { | 5739 } else { |
5694 CXFA_FM2JSContext* pContext = | 5740 CXFA_FM2JSContext* pContext = |
5695 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 5741 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
5696 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); | 5742 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); |
5697 } | 5743 } |
5698 } | 5744 } |
5699 FX_BOOL CXFA_FM2JSContext::fm_ref_equal(FXJSE_HOBJECT hThis, | 5745 FX_BOOL CXFA_FM2JSContext::fm_ref_equal(FXJSE_HOBJECT hThis, |
5700 CFXJSE_Arguments& args) { | 5746 CFXJSE_Arguments& args) { |
5701 FX_BOOL bRet = FALSE; | 5747 FX_BOOL bRet = FALSE; |
5702 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 5748 CXFA_FM2JSContext* pContext = |
| 5749 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
5703 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); | 5750 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); |
5704 FXJSE_HVALUE argFirst = args.GetValue(0); | 5751 FXJSE_HVALUE argFirst = args.GetValue(0); |
5705 FXJSE_HVALUE argSecond = args.GetValue(0); | 5752 FXJSE_HVALUE argSecond = args.GetValue(0); |
5706 if (FXJSE_Value_IsArray(argFirst) && FXJSE_Value_IsArray(argSecond)) { | 5753 if (FXJSE_Value_IsArray(argFirst) && FXJSE_Value_IsArray(argSecond)) { |
5707 FXJSE_HVALUE firstFlagValue = FXJSE_Value_Create(pIsolate); | 5754 FXJSE_HVALUE firstFlagValue = FXJSE_Value_Create(pIsolate); |
5708 FXJSE_HVALUE secondFlagValue = FXJSE_Value_Create(pIsolate); | 5755 FXJSE_HVALUE secondFlagValue = FXJSE_Value_Create(pIsolate); |
5709 FXJSE_Value_GetObjectPropByIdx(argFirst, 0, firstFlagValue); | 5756 FXJSE_Value_GetObjectPropByIdx(argFirst, 0, firstFlagValue); |
5710 FXJSE_Value_GetObjectPropByIdx(argSecond, 0, secondFlagValue); | 5757 FXJSE_Value_GetObjectPropByIdx(argSecond, 0, secondFlagValue); |
5711 if ((FXJSE_Value_ToInteger(firstFlagValue) == 3) && | 5758 if ((FXJSE_Value_ToInteger(firstFlagValue) == 3) && |
5712 (FXJSE_Value_ToInteger(secondFlagValue) == 3)) { | 5759 (FXJSE_Value_ToInteger(secondFlagValue) == 3)) { |
5713 FXJSE_HVALUE firstJSObject = FXJSE_Value_Create(pIsolate); | 5760 FXJSE_HVALUE firstJSObject = FXJSE_Value_Create(pIsolate); |
5714 FXJSE_HVALUE secondJSObject = FXJSE_Value_Create(pIsolate); | 5761 FXJSE_HVALUE secondJSObject = FXJSE_Value_Create(pIsolate); |
5715 FXJSE_Value_GetObjectPropByIdx(argFirst, 2, firstJSObject); | 5762 FXJSE_Value_GetObjectPropByIdx(argFirst, 2, firstJSObject); |
5716 FXJSE_Value_GetObjectPropByIdx(argSecond, 2, secondJSObject); | 5763 FXJSE_Value_GetObjectPropByIdx(argSecond, 2, secondJSObject); |
5717 if (!FXJSE_Value_IsNull(firstJSObject) && | 5764 if (!FXJSE_Value_IsNull(firstJSObject) && |
5718 !FXJSE_Value_IsNull(secondJSObject)) { | 5765 !FXJSE_Value_IsNull(secondJSObject)) { |
5719 bRet = (FXJSE_Value_ToObject(firstJSObject) == | 5766 bRet = (FXJSE_Value_ToObject(firstJSObject, NULL) == |
5720 FXJSE_Value_ToObject(secondJSObject)); | 5767 FXJSE_Value_ToObject(secondJSObject, NULL)); |
5721 } | 5768 } |
5722 FXJSE_Value_Release(firstJSObject); | 5769 FXJSE_Value_Release(firstJSObject); |
5723 FXJSE_Value_Release(secondJSObject); | 5770 FXJSE_Value_Release(secondJSObject); |
5724 } | 5771 } |
5725 FXJSE_Value_Release(firstFlagValue); | 5772 FXJSE_Value_Release(firstFlagValue); |
5726 FXJSE_Value_Release(secondFlagValue); | 5773 FXJSE_Value_Release(secondFlagValue); |
5727 } | 5774 } |
5728 FXJSE_Value_Release(argFirst); | 5775 FXJSE_Value_Release(argFirst); |
5729 FXJSE_Value_Release(argSecond); | 5776 FXJSE_Value_Release(argSecond); |
5730 return bRet; | 5777 return bRet; |
(...skipping 17 matching lines...) Expand all Loading... |
5748 firstOutput.Compare(secondOutput.AsStringC()) == -1); | 5795 firstOutput.Compare(secondOutput.AsStringC()) == -1); |
5749 } else { | 5796 } else { |
5750 FX_DOUBLE first = HValueToDouble(hThis, argFirst); | 5797 FX_DOUBLE first = HValueToDouble(hThis, argFirst); |
5751 FX_DOUBLE second = HValueToDouble(hThis, argSecond); | 5798 FX_DOUBLE second = HValueToDouble(hThis, argSecond); |
5752 FXJSE_Value_SetInteger(args.GetReturnValue(), (first < second) ? 1 : 0); | 5799 FXJSE_Value_SetInteger(args.GetReturnValue(), (first < second) ? 1 : 0); |
5753 } | 5800 } |
5754 FXJSE_Value_Release(argFirst); | 5801 FXJSE_Value_Release(argFirst); |
5755 FXJSE_Value_Release(argSecond); | 5802 FXJSE_Value_Release(argSecond); |
5756 } else { | 5803 } else { |
5757 CXFA_FM2JSContext* pContext = | 5804 CXFA_FM2JSContext* pContext = |
5758 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 5805 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
5759 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); | 5806 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); |
5760 } | 5807 } |
5761 } | 5808 } |
5762 void CXFA_FM2JSContext::lessequal_operator(FXJSE_HOBJECT hThis, | 5809 void CXFA_FM2JSContext::lessequal_operator(FXJSE_HOBJECT hThis, |
5763 const CFX_ByteStringC& szFuncName, | 5810 const CFX_ByteStringC& szFuncName, |
5764 CFXJSE_Arguments& args) { | 5811 CFXJSE_Arguments& args) { |
5765 if (args.GetLength() == 2) { | 5812 if (args.GetLength() == 2) { |
5766 FXJSE_HVALUE argFirst = GetSimpleHValue(hThis, args, 0); | 5813 FXJSE_HVALUE argFirst = GetSimpleHValue(hThis, args, 0); |
5767 FXJSE_HVALUE argSecond = GetSimpleHValue(hThis, args, 1); | 5814 FXJSE_HVALUE argSecond = GetSimpleHValue(hThis, args, 1); |
5768 if (FXJSE_Value_IsNull(argFirst) || FXJSE_Value_IsNull(argSecond)) { | 5815 if (FXJSE_Value_IsNull(argFirst) || FXJSE_Value_IsNull(argSecond)) { |
(...skipping 12 matching lines...) Expand all Loading... |
5781 firstOutput.Compare(secondOutput.AsStringC()) != 1); | 5828 firstOutput.Compare(secondOutput.AsStringC()) != 1); |
5782 } else { | 5829 } else { |
5783 FX_DOUBLE first = HValueToDouble(hThis, argFirst); | 5830 FX_DOUBLE first = HValueToDouble(hThis, argFirst); |
5784 FX_DOUBLE second = HValueToDouble(hThis, argSecond); | 5831 FX_DOUBLE second = HValueToDouble(hThis, argSecond); |
5785 FXJSE_Value_SetInteger(args.GetReturnValue(), (first <= second) ? 1 : 0); | 5832 FXJSE_Value_SetInteger(args.GetReturnValue(), (first <= second) ? 1 : 0); |
5786 } | 5833 } |
5787 FXJSE_Value_Release(argFirst); | 5834 FXJSE_Value_Release(argFirst); |
5788 FXJSE_Value_Release(argSecond); | 5835 FXJSE_Value_Release(argSecond); |
5789 } else { | 5836 } else { |
5790 CXFA_FM2JSContext* pContext = | 5837 CXFA_FM2JSContext* pContext = |
5791 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 5838 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
5792 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); | 5839 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); |
5793 } | 5840 } |
5794 } | 5841 } |
5795 void CXFA_FM2JSContext::greater_operator(FXJSE_HOBJECT hThis, | 5842 void CXFA_FM2JSContext::greater_operator(FXJSE_HOBJECT hThis, |
5796 const CFX_ByteStringC& szFuncName, | 5843 const CFX_ByteStringC& szFuncName, |
5797 CFXJSE_Arguments& args) { | 5844 CFXJSE_Arguments& args) { |
5798 if (args.GetLength() == 2) { | 5845 if (args.GetLength() == 2) { |
5799 FXJSE_HVALUE argFirst = GetSimpleHValue(hThis, args, 0); | 5846 FXJSE_HVALUE argFirst = GetSimpleHValue(hThis, args, 0); |
5800 FXJSE_HVALUE argSecond = GetSimpleHValue(hThis, args, 1); | 5847 FXJSE_HVALUE argSecond = GetSimpleHValue(hThis, args, 1); |
5801 if (FXJSE_Value_IsNull(argFirst) || FXJSE_Value_IsNull(argSecond)) { | 5848 if (FXJSE_Value_IsNull(argFirst) || FXJSE_Value_IsNull(argSecond)) { |
5802 FXJSE_Value_SetInteger(args.GetReturnValue(), 0); | 5849 FXJSE_Value_SetInteger(args.GetReturnValue(), 0); |
5803 } else if (FXJSE_Value_IsUTF8String(argFirst) && | 5850 } else if (FXJSE_Value_IsUTF8String(argFirst) && |
5804 FXJSE_Value_IsUTF8String(argSecond)) { | 5851 FXJSE_Value_IsUTF8String(argSecond)) { |
5805 CFX_ByteString firstOutput; | 5852 CFX_ByteString firstOutput; |
5806 CFX_ByteString secondOutput; | 5853 CFX_ByteString secondOutput; |
5807 FXJSE_Value_ToUTF8String(argFirst, firstOutput); | 5854 FXJSE_Value_ToUTF8String(argFirst, firstOutput); |
5808 FXJSE_Value_ToUTF8String(argSecond, secondOutput); | 5855 FXJSE_Value_ToUTF8String(argSecond, secondOutput); |
5809 FXJSE_Value_SetInteger( | 5856 FXJSE_Value_SetInteger( |
5810 args.GetReturnValue(), | 5857 args.GetReturnValue(), |
5811 firstOutput.Compare(secondOutput.AsStringC()) == 1); | 5858 firstOutput.Compare(secondOutput.AsStringC()) == 1); |
5812 } else { | 5859 } else { |
5813 FX_DOUBLE first = HValueToDouble(hThis, argFirst); | 5860 FX_DOUBLE first = HValueToDouble(hThis, argFirst); |
5814 FX_DOUBLE second = HValueToDouble(hThis, argSecond); | 5861 FX_DOUBLE second = HValueToDouble(hThis, argSecond); |
5815 FXJSE_Value_SetInteger(args.GetReturnValue(), (first > second) ? 1 : 0); | 5862 FXJSE_Value_SetInteger(args.GetReturnValue(), (first > second) ? 1 : 0); |
5816 } | 5863 } |
5817 FXJSE_Value_Release(argFirst); | 5864 FXJSE_Value_Release(argFirst); |
5818 FXJSE_Value_Release(argSecond); | 5865 FXJSE_Value_Release(argSecond); |
5819 } else { | 5866 } else { |
5820 CXFA_FM2JSContext* pContext = | 5867 CXFA_FM2JSContext* pContext = |
5821 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 5868 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
5822 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); | 5869 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); |
5823 } | 5870 } |
5824 } | 5871 } |
5825 void CXFA_FM2JSContext::greaterequal_operator(FXJSE_HOBJECT hThis, | 5872 void CXFA_FM2JSContext::greaterequal_operator(FXJSE_HOBJECT hThis, |
5826 const CFX_ByteStringC& szFuncName, | 5873 const CFX_ByteStringC& szFuncName, |
5827 CFXJSE_Arguments& args) { | 5874 CFXJSE_Arguments& args) { |
5828 if (args.GetLength() == 2) { | 5875 if (args.GetLength() == 2) { |
5829 FXJSE_HVALUE argFirst = GetSimpleHValue(hThis, args, 0); | 5876 FXJSE_HVALUE argFirst = GetSimpleHValue(hThis, args, 0); |
5830 FXJSE_HVALUE argSecond = GetSimpleHValue(hThis, args, 1); | 5877 FXJSE_HVALUE argSecond = GetSimpleHValue(hThis, args, 1); |
5831 if (FXJSE_Value_IsNull(argFirst) || FXJSE_Value_IsNull(argSecond)) { | 5878 if (FXJSE_Value_IsNull(argFirst) || FXJSE_Value_IsNull(argSecond)) { |
(...skipping 12 matching lines...) Expand all Loading... |
5844 firstOutput.Compare(secondOutput.AsStringC()) != -1); | 5891 firstOutput.Compare(secondOutput.AsStringC()) != -1); |
5845 } else { | 5892 } else { |
5846 FX_DOUBLE first = HValueToDouble(hThis, argFirst); | 5893 FX_DOUBLE first = HValueToDouble(hThis, argFirst); |
5847 FX_DOUBLE second = HValueToDouble(hThis, argSecond); | 5894 FX_DOUBLE second = HValueToDouble(hThis, argSecond); |
5848 FXJSE_Value_SetInteger(args.GetReturnValue(), (first >= second) ? 1 : 0); | 5895 FXJSE_Value_SetInteger(args.GetReturnValue(), (first >= second) ? 1 : 0); |
5849 } | 5896 } |
5850 FXJSE_Value_Release(argFirst); | 5897 FXJSE_Value_Release(argFirst); |
5851 FXJSE_Value_Release(argSecond); | 5898 FXJSE_Value_Release(argSecond); |
5852 } else { | 5899 } else { |
5853 CXFA_FM2JSContext* pContext = | 5900 CXFA_FM2JSContext* pContext = |
5854 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 5901 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
5855 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); | 5902 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); |
5856 } | 5903 } |
5857 } | 5904 } |
5858 void CXFA_FM2JSContext::plus_operator(FXJSE_HOBJECT hThis, | 5905 void CXFA_FM2JSContext::plus_operator(FXJSE_HOBJECT hThis, |
5859 const CFX_ByteStringC& szFuncName, | 5906 const CFX_ByteStringC& szFuncName, |
5860 CFXJSE_Arguments& args) { | 5907 CFXJSE_Arguments& args) { |
5861 if (args.GetLength() == 2) { | 5908 if (args.GetLength() == 2) { |
5862 FXJSE_HVALUE argFirst = args.GetValue(0); | 5909 FXJSE_HVALUE argFirst = args.GetValue(0); |
5863 FXJSE_HVALUE argSecond = args.GetValue(1); | 5910 FXJSE_HVALUE argSecond = args.GetValue(1); |
5864 if (HValueIsNull(hThis, argFirst) && HValueIsNull(hThis, argSecond)) { | 5911 if (HValueIsNull(hThis, argFirst) && HValueIsNull(hThis, argSecond)) { |
5865 FXJSE_Value_SetNull(args.GetReturnValue()); | 5912 FXJSE_Value_SetNull(args.GetReturnValue()); |
5866 } else { | 5913 } else { |
5867 FX_DOUBLE first = HValueToDouble(hThis, argFirst); | 5914 FX_DOUBLE first = HValueToDouble(hThis, argFirst); |
5868 FX_DOUBLE second = HValueToDouble(hThis, argSecond); | 5915 FX_DOUBLE second = HValueToDouble(hThis, argSecond); |
5869 FXJSE_Value_SetDouble(args.GetReturnValue(), first + second); | 5916 FXJSE_Value_SetDouble(args.GetReturnValue(), first + second); |
5870 } | 5917 } |
5871 FXJSE_Value_Release(argFirst); | 5918 FXJSE_Value_Release(argFirst); |
5872 FXJSE_Value_Release(argSecond); | 5919 FXJSE_Value_Release(argSecond); |
5873 } else { | 5920 } else { |
5874 CXFA_FM2JSContext* pContext = | 5921 CXFA_FM2JSContext* pContext = |
5875 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 5922 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
5876 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); | 5923 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); |
5877 } | 5924 } |
5878 } | 5925 } |
5879 void CXFA_FM2JSContext::minus_operator(FXJSE_HOBJECT hThis, | 5926 void CXFA_FM2JSContext::minus_operator(FXJSE_HOBJECT hThis, |
5880 const CFX_ByteStringC& szFuncName, | 5927 const CFX_ByteStringC& szFuncName, |
5881 CFXJSE_Arguments& args) { | 5928 CFXJSE_Arguments& args) { |
5882 if (args.GetLength() == 2) { | 5929 if (args.GetLength() == 2) { |
5883 FXJSE_HVALUE argFirst = GetSimpleHValue(hThis, args, 0); | 5930 FXJSE_HVALUE argFirst = GetSimpleHValue(hThis, args, 0); |
5884 FXJSE_HVALUE argSecond = GetSimpleHValue(hThis, args, 1); | 5931 FXJSE_HVALUE argSecond = GetSimpleHValue(hThis, args, 1); |
5885 if (FXJSE_Value_IsNull(argFirst) && FXJSE_Value_IsNull(argSecond)) { | 5932 if (FXJSE_Value_IsNull(argFirst) && FXJSE_Value_IsNull(argSecond)) { |
5886 FXJSE_Value_SetNull(args.GetReturnValue()); | 5933 FXJSE_Value_SetNull(args.GetReturnValue()); |
5887 } else { | 5934 } else { |
5888 FX_DOUBLE first = HValueToDouble(hThis, argFirst); | 5935 FX_DOUBLE first = HValueToDouble(hThis, argFirst); |
5889 FX_DOUBLE second = HValueToDouble(hThis, argSecond); | 5936 FX_DOUBLE second = HValueToDouble(hThis, argSecond); |
5890 FXJSE_Value_SetDouble(args.GetReturnValue(), first - second); | 5937 FXJSE_Value_SetDouble(args.GetReturnValue(), first - second); |
5891 } | 5938 } |
5892 FXJSE_Value_Release(argFirst); | 5939 FXJSE_Value_Release(argFirst); |
5893 FXJSE_Value_Release(argSecond); | 5940 FXJSE_Value_Release(argSecond); |
5894 } else { | 5941 } else { |
5895 CXFA_FM2JSContext* pContext = | 5942 CXFA_FM2JSContext* pContext = |
5896 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 5943 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
5897 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); | 5944 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); |
5898 } | 5945 } |
5899 } | 5946 } |
5900 void CXFA_FM2JSContext::multiple_operator(FXJSE_HOBJECT hThis, | 5947 void CXFA_FM2JSContext::multiple_operator(FXJSE_HOBJECT hThis, |
5901 const CFX_ByteStringC& szFuncName, | 5948 const CFX_ByteStringC& szFuncName, |
5902 CFXJSE_Arguments& args) { | 5949 CFXJSE_Arguments& args) { |
5903 if (args.GetLength() == 2) { | 5950 if (args.GetLength() == 2) { |
5904 FXJSE_HVALUE argFirst = GetSimpleHValue(hThis, args, 0); | 5951 FXJSE_HVALUE argFirst = GetSimpleHValue(hThis, args, 0); |
5905 FXJSE_HVALUE argSecond = GetSimpleHValue(hThis, args, 1); | 5952 FXJSE_HVALUE argSecond = GetSimpleHValue(hThis, args, 1); |
5906 if (FXJSE_Value_IsNull(argFirst) && FXJSE_Value_IsNull(argSecond)) { | 5953 if (FXJSE_Value_IsNull(argFirst) && FXJSE_Value_IsNull(argSecond)) { |
5907 FXJSE_Value_SetNull(args.GetReturnValue()); | 5954 FXJSE_Value_SetNull(args.GetReturnValue()); |
5908 } else { | 5955 } else { |
5909 FX_DOUBLE first = HValueToDouble(hThis, argFirst); | 5956 FX_DOUBLE first = HValueToDouble(hThis, argFirst); |
5910 FX_DOUBLE second = HValueToDouble(hThis, argSecond); | 5957 FX_DOUBLE second = HValueToDouble(hThis, argSecond); |
5911 FXJSE_Value_SetDouble(args.GetReturnValue(), first * second); | 5958 FXJSE_Value_SetDouble(args.GetReturnValue(), first * second); |
5912 } | 5959 } |
5913 FXJSE_Value_Release(argFirst); | 5960 FXJSE_Value_Release(argFirst); |
5914 FXJSE_Value_Release(argSecond); | 5961 FXJSE_Value_Release(argSecond); |
5915 } else { | 5962 } else { |
5916 CXFA_FM2JSContext* pContext = | 5963 CXFA_FM2JSContext* pContext = |
5917 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 5964 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
5918 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); | 5965 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); |
5919 } | 5966 } |
5920 } | 5967 } |
5921 void CXFA_FM2JSContext::divide_operator(FXJSE_HOBJECT hThis, | 5968 void CXFA_FM2JSContext::divide_operator(FXJSE_HOBJECT hThis, |
5922 const CFX_ByteStringC& szFuncName, | 5969 const CFX_ByteStringC& szFuncName, |
5923 CFXJSE_Arguments& args) { | 5970 CFXJSE_Arguments& args) { |
5924 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 5971 CXFA_FM2JSContext* pContext = |
| 5972 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
5925 if (args.GetLength() == 2) { | 5973 if (args.GetLength() == 2) { |
5926 FXJSE_HVALUE argFirst = GetSimpleHValue(hThis, args, 0); | 5974 FXJSE_HVALUE argFirst = GetSimpleHValue(hThis, args, 0); |
5927 FXJSE_HVALUE argSecond = GetSimpleHValue(hThis, args, 1); | 5975 FXJSE_HVALUE argSecond = GetSimpleHValue(hThis, args, 1); |
5928 if (FXJSE_Value_IsNull(argFirst) && FXJSE_Value_IsNull(argSecond)) { | 5976 if (FXJSE_Value_IsNull(argFirst) && FXJSE_Value_IsNull(argSecond)) { |
5929 FXJSE_Value_SetNull(args.GetReturnValue()); | 5977 FXJSE_Value_SetNull(args.GetReturnValue()); |
5930 } else { | 5978 } else { |
5931 FX_DOUBLE first = HValueToDouble(hThis, argFirst); | 5979 FX_DOUBLE first = HValueToDouble(hThis, argFirst); |
5932 FX_DOUBLE second = HValueToDouble(hThis, argSecond); | 5980 FX_DOUBLE second = HValueToDouble(hThis, argSecond); |
5933 if (second == 0.0) { | 5981 if (second == 0.0) { |
5934 pContext->ThrowScriptErrorMessage(XFA_IDS_DIVIDE_ZERO); | 5982 pContext->ThrowScriptErrorMessage(XFA_IDS_DIVIDE_ZERO); |
(...skipping 15 matching lines...) Expand all Loading... |
5950 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); | 5998 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); |
5951 if (FXJSE_Value_IsNull(argOne)) { | 5999 if (FXJSE_Value_IsNull(argOne)) { |
5952 FXJSE_Value_SetNull(args.GetReturnValue()); | 6000 FXJSE_Value_SetNull(args.GetReturnValue()); |
5953 } else { | 6001 } else { |
5954 FXJSE_Value_SetDouble(args.GetReturnValue(), | 6002 FXJSE_Value_SetDouble(args.GetReturnValue(), |
5955 0.0 + HValueToDouble(hThis, argOne)); | 6003 0.0 + HValueToDouble(hThis, argOne)); |
5956 } | 6004 } |
5957 FXJSE_Value_Release(argOne); | 6005 FXJSE_Value_Release(argOne); |
5958 } else { | 6006 } else { |
5959 CXFA_FM2JSContext* pContext = | 6007 CXFA_FM2JSContext* pContext = |
5960 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 6008 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
5961 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); | 6009 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); |
5962 } | 6010 } |
5963 } | 6011 } |
5964 void CXFA_FM2JSContext::negative_operator(FXJSE_HOBJECT hThis, | 6012 void CXFA_FM2JSContext::negative_operator(FXJSE_HOBJECT hThis, |
5965 const CFX_ByteStringC& szFuncName, | 6013 const CFX_ByteStringC& szFuncName, |
5966 CFXJSE_Arguments& args) { | 6014 CFXJSE_Arguments& args) { |
5967 int32_t iLength = args.GetLength(); | 6015 int32_t iLength = args.GetLength(); |
5968 if (iLength == 1) { | 6016 if (iLength == 1) { |
5969 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); | 6017 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); |
5970 if (FXJSE_Value_IsNull(argOne)) { | 6018 if (FXJSE_Value_IsNull(argOne)) { |
5971 FXJSE_Value_SetNull(args.GetReturnValue()); | 6019 FXJSE_Value_SetNull(args.GetReturnValue()); |
5972 } else { | 6020 } else { |
5973 FXJSE_Value_SetDouble(args.GetReturnValue(), | 6021 FXJSE_Value_SetDouble(args.GetReturnValue(), |
5974 0.0 - HValueToDouble(hThis, argOne)); | 6022 0.0 - HValueToDouble(hThis, argOne)); |
5975 } | 6023 } |
5976 FXJSE_Value_Release(argOne); | 6024 FXJSE_Value_Release(argOne); |
5977 } else { | 6025 } else { |
5978 CXFA_FM2JSContext* pContext = | 6026 CXFA_FM2JSContext* pContext = |
5979 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 6027 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
5980 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); | 6028 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); |
5981 } | 6029 } |
5982 } | 6030 } |
5983 void CXFA_FM2JSContext::logical_not_operator(FXJSE_HOBJECT hThis, | 6031 void CXFA_FM2JSContext::logical_not_operator(FXJSE_HOBJECT hThis, |
5984 const CFX_ByteStringC& szFuncName, | 6032 const CFX_ByteStringC& szFuncName, |
5985 CFXJSE_Arguments& args) { | 6033 CFXJSE_Arguments& args) { |
5986 int32_t iLength = args.GetLength(); | 6034 int32_t iLength = args.GetLength(); |
5987 if (iLength == 1) { | 6035 if (iLength == 1) { |
5988 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); | 6036 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); |
5989 if (FXJSE_Value_IsNull(argOne)) { | 6037 if (FXJSE_Value_IsNull(argOne)) { |
5990 FXJSE_Value_SetNull(args.GetReturnValue()); | 6038 FXJSE_Value_SetNull(args.GetReturnValue()); |
5991 } else { | 6039 } else { |
5992 FX_DOUBLE first = HValueToDouble(hThis, argOne); | 6040 FX_DOUBLE first = HValueToDouble(hThis, argOne); |
5993 FXJSE_Value_SetInteger(args.GetReturnValue(), (first == 0.0) ? 1 : 0); | 6041 FXJSE_Value_SetInteger(args.GetReturnValue(), (first == 0.0) ? 1 : 0); |
5994 } | 6042 } |
5995 FXJSE_Value_Release(argOne); | 6043 FXJSE_Value_Release(argOne); |
5996 } else { | 6044 } else { |
5997 CXFA_FM2JSContext* pContext = | 6045 CXFA_FM2JSContext* pContext = |
5998 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 6046 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
5999 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); | 6047 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); |
6000 } | 6048 } |
6001 } | 6049 } |
6002 void CXFA_FM2JSContext::dot_accessor(FXJSE_HOBJECT hThis, | 6050 void CXFA_FM2JSContext::dot_accessor(FXJSE_HOBJECT hThis, |
6003 const CFX_ByteStringC& szFuncName, | 6051 const CFX_ByteStringC& szFuncName, |
6004 CFXJSE_Arguments& args) { | 6052 CFXJSE_Arguments& args) { |
6005 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 6053 CXFA_FM2JSContext* pContext = |
| 6054 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
6006 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); | 6055 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); |
6007 int32_t argc = args.GetLength(); | 6056 int32_t argc = args.GetLength(); |
6008 if ((argc == 4) || (argc == 5)) { | 6057 if ((argc == 4) || (argc == 5)) { |
6009 FX_BOOL bIsStar = TRUE; | 6058 FX_BOOL bIsStar = TRUE; |
6010 FXJSE_HVALUE argAccessor = args.GetValue(0); | 6059 FXJSE_HVALUE argAccessor = args.GetValue(0); |
6011 CFX_ByteString bsAccessorName = args.GetUTF8String(1); | 6060 CFX_ByteString bsAccessorName = args.GetUTF8String(1); |
6012 CFX_ByteString szName = args.GetUTF8String(2); | 6061 CFX_ByteString szName = args.GetUTF8String(2); |
6013 int32_t iIndexFlags = args.GetInt32(3); | 6062 int32_t iIndexFlags = args.GetInt32(3); |
6014 int32_t iIndexValue = 0; | 6063 int32_t iIndexValue = 0; |
6015 FXJSE_HVALUE argIndex = NULL; | 6064 FXJSE_HVALUE argIndex = NULL; |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6146 FXJSE_Value_Release(argIndex); | 6195 FXJSE_Value_Release(argIndex); |
6147 } | 6196 } |
6148 FXJSE_Value_Release(argAccessor); | 6197 FXJSE_Value_Release(argAccessor); |
6149 } else { | 6198 } else { |
6150 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); | 6199 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); |
6151 } | 6200 } |
6152 } | 6201 } |
6153 void CXFA_FM2JSContext::dotdot_accessor(FXJSE_HOBJECT hThis, | 6202 void CXFA_FM2JSContext::dotdot_accessor(FXJSE_HOBJECT hThis, |
6154 const CFX_ByteStringC& szFuncName, | 6203 const CFX_ByteStringC& szFuncName, |
6155 CFXJSE_Arguments& args) { | 6204 CFXJSE_Arguments& args) { |
6156 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 6205 CXFA_FM2JSContext* pContext = |
| 6206 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
6157 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); | 6207 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); |
6158 int32_t argc = args.GetLength(); | 6208 int32_t argc = args.GetLength(); |
6159 if ((argc == 4) || (argc == 5)) { | 6209 if ((argc == 4) || (argc == 5)) { |
6160 FX_BOOL bIsStar = TRUE; | 6210 FX_BOOL bIsStar = TRUE; |
6161 FXJSE_HVALUE argAccessor = args.GetValue(0); | 6211 FXJSE_HVALUE argAccessor = args.GetValue(0); |
6162 CFX_ByteString bsAccessorName = args.GetUTF8String(1); | 6212 CFX_ByteString bsAccessorName = args.GetUTF8String(1); |
6163 CFX_ByteString szName = args.GetUTF8String(2); | 6213 CFX_ByteString szName = args.GetUTF8String(2); |
6164 int32_t iIndexFlags = args.GetInt32(3); | 6214 int32_t iIndexFlags = args.GetInt32(3); |
6165 int32_t iIndexValue = 0; | 6215 int32_t iIndexValue = 0; |
6166 FXJSE_HVALUE argIndex = NULL; | 6216 FXJSE_HVALUE argIndex = NULL; |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6292 FXJSE_Value_Release(argIndex); | 6342 FXJSE_Value_Release(argIndex); |
6293 } | 6343 } |
6294 FXJSE_Value_Release(argAccessor); | 6344 FXJSE_Value_Release(argAccessor); |
6295 } else { | 6345 } else { |
6296 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); | 6346 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); |
6297 } | 6347 } |
6298 } | 6348 } |
6299 void CXFA_FM2JSContext::eval_translation(FXJSE_HOBJECT hThis, | 6349 void CXFA_FM2JSContext::eval_translation(FXJSE_HOBJECT hThis, |
6300 const CFX_ByteStringC& szFuncName, | 6350 const CFX_ByteStringC& szFuncName, |
6301 CFXJSE_Arguments& args) { | 6351 CFXJSE_Arguments& args) { |
6302 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 6352 CXFA_FM2JSContext* pContext = |
| 6353 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
6303 int32_t argc = args.GetLength(); | 6354 int32_t argc = args.GetLength(); |
6304 if (argc == 1) { | 6355 if (argc == 1) { |
6305 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); | 6356 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); |
6306 CFX_ByteString argString; | 6357 CFX_ByteString argString; |
6307 HValueToUTF8String(argOne, argString); | 6358 HValueToUTF8String(argOne, argString); |
6308 if (argString.IsEmpty()) { | 6359 if (argString.IsEmpty()) { |
6309 pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH); | 6360 pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH); |
6310 } else { | 6361 } else { |
6311 CFX_WideString scriptString = | 6362 CFX_WideString scriptString = |
6312 CFX_WideString::FromUTF8(argString.AsStringC()); | 6363 CFX_WideString::FromUTF8(argString.AsStringC()); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6350 FX_BOOL bIsArray = FXJSE_Value_IsArray(argOne); | 6401 FX_BOOL bIsArray = FXJSE_Value_IsArray(argOne); |
6351 FXJSE_Value_SetBoolean(args.GetReturnValue(), bIsArray); | 6402 FXJSE_Value_SetBoolean(args.GetReturnValue(), bIsArray); |
6352 FXJSE_Value_Release(argOne); | 6403 FXJSE_Value_Release(argOne); |
6353 } else { | 6404 } else { |
6354 FXJSE_Value_SetBoolean(args.GetReturnValue(), FALSE); | 6405 FXJSE_Value_SetBoolean(args.GetReturnValue(), FALSE); |
6355 } | 6406 } |
6356 } | 6407 } |
6357 void CXFA_FM2JSContext::get_fm_value(FXJSE_HOBJECT hThis, | 6408 void CXFA_FM2JSContext::get_fm_value(FXJSE_HOBJECT hThis, |
6358 const CFX_ByteStringC& szFuncName, | 6409 const CFX_ByteStringC& szFuncName, |
6359 CFXJSE_Arguments& args) { | 6410 CFXJSE_Arguments& args) { |
6360 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 6411 CXFA_FM2JSContext* pContext = |
| 6412 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
6361 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); | 6413 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); |
6362 int32_t iLength = args.GetLength(); | 6414 int32_t iLength = args.GetLength(); |
6363 if (iLength == 1) { | 6415 if (iLength == 1) { |
6364 FXJSE_HVALUE argOne = args.GetValue(0); | 6416 FXJSE_HVALUE argOne = args.GetValue(0); |
6365 if (FXJSE_Value_IsArray(argOne)) { | 6417 if (FXJSE_Value_IsArray(argOne)) { |
6366 FXJSE_HVALUE propertyValue = FXJSE_Value_Create(pIsolate); | 6418 FXJSE_HVALUE propertyValue = FXJSE_Value_Create(pIsolate); |
6367 FXJSE_HVALUE jsobjectValue = FXJSE_Value_Create(pIsolate); | 6419 FXJSE_HVALUE jsobjectValue = FXJSE_Value_Create(pIsolate); |
6368 FXJSE_Value_GetObjectPropByIdx(argOne, 1, propertyValue); | 6420 FXJSE_Value_GetObjectPropByIdx(argOne, 1, propertyValue); |
6369 FXJSE_Value_GetObjectPropByIdx(argOne, 2, jsobjectValue); | 6421 FXJSE_Value_GetObjectPropByIdx(argOne, 2, jsobjectValue); |
6370 if (FXJSE_Value_IsNull(propertyValue)) { | 6422 if (FXJSE_Value_IsNull(propertyValue)) { |
(...skipping 13 matching lines...) Expand all Loading... |
6384 } | 6436 } |
6385 FXJSE_Value_Release(argOne); | 6437 FXJSE_Value_Release(argOne); |
6386 } else { | 6438 } else { |
6387 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); | 6439 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); |
6388 } | 6440 } |
6389 } | 6441 } |
6390 void CXFA_FM2JSContext::get_fm_jsobj(FXJSE_HOBJECT hThis, | 6442 void CXFA_FM2JSContext::get_fm_jsobj(FXJSE_HOBJECT hThis, |
6391 const CFX_ByteStringC& szFuncName, | 6443 const CFX_ByteStringC& szFuncName, |
6392 CFXJSE_Arguments& args) { | 6444 CFXJSE_Arguments& args) { |
6393 CXFA_FM2JSContext* pContext = | 6445 CXFA_FM2JSContext* pContext = |
6394 static_cast<CXFA_FM2JSContext*>(FXJSE_Value_ToObject(hThis)); | 6446 static_cast<CXFA_FM2JSContext*>(FXJSE_Value_ToObject(hThis, nullptr)); |
6395 int32_t argc = args.GetLength(); | 6447 int32_t argc = args.GetLength(); |
6396 if (argc == 1) { | 6448 if (argc == 1) { |
6397 FXJSE_HVALUE argOne = args.GetValue(0); | 6449 FXJSE_HVALUE argOne = args.GetValue(0); |
6398 if (FXJSE_Value_IsArray(argOne)) { | 6450 if (FXJSE_Value_IsArray(argOne)) { |
6399 #ifndef NDEBUG | 6451 #ifndef NDEBUG |
6400 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); | 6452 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); |
6401 FXJSE_HVALUE lengthValue = FXJSE_Value_Create(pIsolate); | 6453 FXJSE_HVALUE lengthValue = FXJSE_Value_Create(pIsolate); |
6402 FXJSE_Value_GetObjectProp(argOne, "length", lengthValue); | 6454 FXJSE_Value_GetObjectProp(argOne, "length", lengthValue); |
6403 ASSERT(FXJSE_Value_ToInteger(lengthValue) >= 3); | 6455 ASSERT(FXJSE_Value_ToInteger(lengthValue) >= 3); |
6404 FXJSE_Value_Release(lengthValue); | 6456 FXJSE_Value_Release(lengthValue); |
6405 #endif | 6457 #endif |
6406 FXJSE_Value_GetObjectPropByIdx(argOne, 2, args.GetReturnValue()); | 6458 FXJSE_Value_GetObjectPropByIdx(argOne, 2, args.GetReturnValue()); |
6407 } else { | 6459 } else { |
6408 FXJSE_Value_Set(args.GetReturnValue(), argOne); | 6460 FXJSE_Value_Set(args.GetReturnValue(), argOne); |
6409 } | 6461 } |
6410 FXJSE_Value_Release(argOne); | 6462 FXJSE_Value_Release(argOne); |
6411 } else { | 6463 } else { |
6412 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); | 6464 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); |
6413 } | 6465 } |
6414 } | 6466 } |
6415 void CXFA_FM2JSContext::fm_var_filter(FXJSE_HOBJECT hThis, | 6467 void CXFA_FM2JSContext::fm_var_filter(FXJSE_HOBJECT hThis, |
6416 const CFX_ByteStringC& szFuncName, | 6468 const CFX_ByteStringC& szFuncName, |
6417 CFXJSE_Arguments& args) { | 6469 CFXJSE_Arguments& args) { |
6418 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 6470 CXFA_FM2JSContext* pContext = |
| 6471 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
6419 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); | 6472 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); |
6420 int32_t argc = args.GetLength(); | 6473 int32_t argc = args.GetLength(); |
6421 if (argc == 1) { | 6474 if (argc == 1) { |
6422 FXJSE_HVALUE argOne = args.GetValue(0); | 6475 FXJSE_HVALUE argOne = args.GetValue(0); |
6423 if (FXJSE_Value_IsArray(argOne)) { | 6476 if (FXJSE_Value_IsArray(argOne)) { |
6424 #ifndef NDEBUG | 6477 #ifndef NDEBUG |
6425 FXJSE_HVALUE lengthValue = FXJSE_Value_Create(pIsolate); | 6478 FXJSE_HVALUE lengthValue = FXJSE_Value_Create(pIsolate); |
6426 FXJSE_Value_GetObjectProp(argOne, "length", lengthValue); | 6479 FXJSE_Value_GetObjectProp(argOne, "length", lengthValue); |
6427 ASSERT(FXJSE_Value_ToInteger(lengthValue) >= 3); | 6480 ASSERT(FXJSE_Value_ToInteger(lengthValue) >= 3); |
6428 FXJSE_Value_Release(lengthValue); | 6481 FXJSE_Value_Release(lengthValue); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6463 FXJSE_Value_Release(simpleValue); | 6516 FXJSE_Value_Release(simpleValue); |
6464 } | 6517 } |
6465 FXJSE_Value_Release(argOne); | 6518 FXJSE_Value_Release(argOne); |
6466 } else { | 6519 } else { |
6467 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); | 6520 pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR); |
6468 } | 6521 } |
6469 } | 6522 } |
6470 void CXFA_FM2JSContext::concat_fm_object(FXJSE_HOBJECT hThis, | 6523 void CXFA_FM2JSContext::concat_fm_object(FXJSE_HOBJECT hThis, |
6471 const CFX_ByteStringC& szFuncName, | 6524 const CFX_ByteStringC& szFuncName, |
6472 CFXJSE_Arguments& args) { | 6525 CFXJSE_Arguments& args) { |
6473 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 6526 CXFA_FM2JSContext* pContext = |
| 6527 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
6474 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); | 6528 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); |
6475 uint32_t iLength = 0; | 6529 uint32_t iLength = 0; |
6476 int32_t argCount = args.GetLength(); | 6530 int32_t argCount = args.GetLength(); |
6477 FXJSE_HVALUE* argValues = FX_Alloc(FXJSE_HVALUE, argCount); | 6531 FXJSE_HVALUE* argValues = FX_Alloc(FXJSE_HVALUE, argCount); |
6478 for (int32_t i = 0; i < argCount; i++) { | 6532 for (int32_t i = 0; i < argCount; i++) { |
6479 argValues[i] = args.GetValue(i); | 6533 argValues[i] = args.GetValue(i); |
6480 if (FXJSE_Value_IsArray(argValues[i])) { | 6534 if (FXJSE_Value_IsArray(argValues[i])) { |
6481 FXJSE_HVALUE lengthValue = FXJSE_Value_Create(pIsolate); | 6535 FXJSE_HVALUE lengthValue = FXJSE_Value_Create(pIsolate); |
6482 FXJSE_Value_GetObjectProp(argValues[i], "length", lengthValue); | 6536 FXJSE_Value_GetObjectProp(argValues[i], "length", lengthValue); |
6483 int32_t length = FXJSE_Value_ToInteger(lengthValue); | 6537 int32_t length = FXJSE_Value_ToInteger(lengthValue); |
(...skipping 27 matching lines...) Expand all Loading... |
6511 } | 6565 } |
6512 FX_Free(argValues); | 6566 FX_Free(argValues); |
6513 for (int32_t i = 0; i < (int32_t)iLength; i++) { | 6567 for (int32_t i = 0; i < (int32_t)iLength; i++) { |
6514 FXJSE_Value_Release(returnValues[i]); | 6568 FXJSE_Value_Release(returnValues[i]); |
6515 } | 6569 } |
6516 FX_Free(returnValues); | 6570 FX_Free(returnValues); |
6517 } | 6571 } |
6518 FXJSE_HVALUE CXFA_FM2JSContext::GetSimpleHValue(FXJSE_HOBJECT hThis, | 6572 FXJSE_HVALUE CXFA_FM2JSContext::GetSimpleHValue(FXJSE_HOBJECT hThis, |
6519 CFXJSE_Arguments& args, | 6573 CFXJSE_Arguments& args, |
6520 uint32_t index) { | 6574 uint32_t index) { |
6521 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 6575 CXFA_FM2JSContext* pContext = |
| 6576 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
6522 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); | 6577 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); |
6523 ASSERT(index < (uint32_t)args.GetLength()); | 6578 ASSERT(index < (uint32_t)args.GetLength()); |
6524 FXJSE_HVALUE argIndex = args.GetValue(index); | 6579 FXJSE_HVALUE argIndex = args.GetValue(index); |
6525 if (FXJSE_Value_IsArray(argIndex)) { | 6580 if (FXJSE_Value_IsArray(argIndex)) { |
6526 FXJSE_HVALUE lengthValue = FXJSE_Value_Create(pIsolate); | 6581 FXJSE_HVALUE lengthValue = FXJSE_Value_Create(pIsolate); |
6527 FXJSE_Value_GetObjectProp(argIndex, "length", lengthValue); | 6582 FXJSE_Value_GetObjectProp(argIndex, "length", lengthValue); |
6528 int32_t iLength = FXJSE_Value_ToInteger(lengthValue); | 6583 int32_t iLength = FXJSE_Value_ToInteger(lengthValue); |
6529 FXJSE_Value_Release(lengthValue); | 6584 FXJSE_Value_Release(lengthValue); |
6530 FXJSE_HVALUE simpleValue = FXJSE_Value_Create(pIsolate); | 6585 FXJSE_HVALUE simpleValue = FXJSE_Value_Create(pIsolate); |
6531 if (iLength > 2) { | 6586 if (iLength > 2) { |
(...skipping 19 matching lines...) Expand all Loading... |
6551 } else if (FXJSE_Value_IsObject(argIndex)) { | 6606 } else if (FXJSE_Value_IsObject(argIndex)) { |
6552 FXJSE_HVALUE defaultValue = FXJSE_Value_Create(pIsolate); | 6607 FXJSE_HVALUE defaultValue = FXJSE_Value_Create(pIsolate); |
6553 GetObjectDefaultValue(argIndex, defaultValue); | 6608 GetObjectDefaultValue(argIndex, defaultValue); |
6554 FXJSE_Value_Release(argIndex); | 6609 FXJSE_Value_Release(argIndex); |
6555 return defaultValue; | 6610 return defaultValue; |
6556 } else { | 6611 } else { |
6557 return argIndex; | 6612 return argIndex; |
6558 } | 6613 } |
6559 } | 6614 } |
6560 FX_BOOL CXFA_FM2JSContext::HValueIsNull(FXJSE_HOBJECT hThis, FXJSE_HVALUE arg) { | 6615 FX_BOOL CXFA_FM2JSContext::HValueIsNull(FXJSE_HOBJECT hThis, FXJSE_HVALUE arg) { |
6561 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 6616 CXFA_FM2JSContext* pContext = |
| 6617 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
6562 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); | 6618 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); |
6563 FX_BOOL isNull = FALSE; | 6619 FX_BOOL isNull = FALSE; |
6564 if (FXJSE_Value_IsNull(arg)) { | 6620 if (FXJSE_Value_IsNull(arg)) { |
6565 isNull = TRUE; | 6621 isNull = TRUE; |
6566 } else if (FXJSE_Value_IsArray(arg)) { | 6622 } else if (FXJSE_Value_IsArray(arg)) { |
6567 int32_t iLength = hvalue_get_array_length(hThis, arg); | 6623 int32_t iLength = hvalue_get_array_length(hThis, arg); |
6568 if (iLength > 2) { | 6624 if (iLength > 2) { |
6569 FXJSE_HVALUE propertyValue = FXJSE_Value_Create(pIsolate); | 6625 FXJSE_HVALUE propertyValue = FXJSE_Value_Create(pIsolate); |
6570 FXJSE_HVALUE jsObjectValue = FXJSE_Value_Create(pIsolate); | 6626 FXJSE_HVALUE jsObjectValue = FXJSE_Value_Create(pIsolate); |
6571 FXJSE_Value_GetObjectPropByIdx(arg, 1, propertyValue); | 6627 FXJSE_Value_GetObjectPropByIdx(arg, 1, propertyValue); |
(...skipping 26 matching lines...) Expand all Loading... |
6598 GetObjectDefaultValue(arg, defaultValue); | 6654 GetObjectDefaultValue(arg, defaultValue); |
6599 if (FXJSE_Value_IsNull(defaultValue)) { | 6655 if (FXJSE_Value_IsNull(defaultValue)) { |
6600 isNull = TRUE; | 6656 isNull = TRUE; |
6601 } | 6657 } |
6602 FXJSE_Value_Release(defaultValue); | 6658 FXJSE_Value_Release(defaultValue); |
6603 } | 6659 } |
6604 return isNull; | 6660 return isNull; |
6605 } | 6661 } |
6606 int32_t CXFA_FM2JSContext::hvalue_get_array_length(FXJSE_HOBJECT hThis, | 6662 int32_t CXFA_FM2JSContext::hvalue_get_array_length(FXJSE_HOBJECT hThis, |
6607 FXJSE_HVALUE arg) { | 6663 FXJSE_HVALUE arg) { |
6608 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 6664 CXFA_FM2JSContext* pContext = |
| 6665 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
6609 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); | 6666 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); |
6610 int32_t iLength = 0; | 6667 int32_t iLength = 0; |
6611 if (FXJSE_Value_IsArray(arg)) { | 6668 if (FXJSE_Value_IsArray(arg)) { |
6612 FXJSE_HVALUE lengthValue = FXJSE_Value_Create(pIsolate); | 6669 FXJSE_HVALUE lengthValue = FXJSE_Value_Create(pIsolate); |
6613 FXJSE_Value_GetObjectProp(arg, "length", lengthValue); | 6670 FXJSE_Value_GetObjectProp(arg, "length", lengthValue); |
6614 iLength = FXJSE_Value_ToInteger(lengthValue); | 6671 iLength = FXJSE_Value_ToInteger(lengthValue); |
6615 FXJSE_Value_Release(lengthValue); | 6672 FXJSE_Value_Release(lengthValue); |
6616 } | 6673 } |
6617 return iLength; | 6674 return iLength; |
6618 } | 6675 } |
(...skipping 17 matching lines...) Expand all Loading... |
6636 FXJSE_Value_IsNull(secondValue)) { | 6693 FXJSE_Value_IsNull(secondValue)) { |
6637 bReturn = TRUE; | 6694 bReturn = TRUE; |
6638 } | 6695 } |
6639 return bReturn; | 6696 return bReturn; |
6640 } | 6697 } |
6641 void CXFA_FM2JSContext::unfoldArgs(FXJSE_HOBJECT hThis, | 6698 void CXFA_FM2JSContext::unfoldArgs(FXJSE_HOBJECT hThis, |
6642 CFXJSE_Arguments& args, | 6699 CFXJSE_Arguments& args, |
6643 FXJSE_HVALUE*& resultValues, | 6700 FXJSE_HVALUE*& resultValues, |
6644 int32_t& iCount, | 6701 int32_t& iCount, |
6645 int32_t iStart) { | 6702 int32_t iStart) { |
6646 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 6703 CXFA_FM2JSContext* pContext = |
| 6704 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
6647 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); | 6705 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); |
6648 iCount = 0; | 6706 iCount = 0; |
6649 int32_t argc = args.GetLength(); | 6707 int32_t argc = args.GetLength(); |
6650 FXJSE_HVALUE* argsValue = FX_Alloc(FXJSE_HVALUE, argc); | 6708 FXJSE_HVALUE* argsValue = FX_Alloc(FXJSE_HVALUE, argc); |
6651 for (int32_t i = iStart; i < argc; i++) { | 6709 for (int32_t i = iStart; i < argc; i++) { |
6652 argsValue[i] = args.GetValue(i); | 6710 argsValue[i] = args.GetValue(i); |
6653 if (FXJSE_Value_IsArray(argsValue[i])) { | 6711 if (FXJSE_Value_IsArray(argsValue[i])) { |
6654 FXJSE_HVALUE lengthValue = FXJSE_Value_Create(pIsolate); | 6712 FXJSE_HVALUE lengthValue = FXJSE_Value_Create(pIsolate); |
6655 FXJSE_Value_GetObjectProp(argsValue[i], "length", lengthValue); | 6713 FXJSE_Value_GetObjectProp(argsValue[i], "length", lengthValue); |
6656 int32_t iLength = FXJSE_Value_ToInteger(lengthValue); | 6714 int32_t iLength = FXJSE_Value_ToInteger(lengthValue); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6702 index++; | 6760 index++; |
6703 } | 6761 } |
6704 } | 6762 } |
6705 for (int32_t i = iStart; i < argc; i++) { | 6763 for (int32_t i = iStart; i < argc; i++) { |
6706 FXJSE_Value_Release(argsValue[i]); | 6764 FXJSE_Value_Release(argsValue[i]); |
6707 } | 6765 } |
6708 FX_Free(argsValue); | 6766 FX_Free(argsValue); |
6709 } | 6767 } |
6710 void CXFA_FM2JSContext::GetObjectDefaultValue(FXJSE_HVALUE hObjectValue, | 6768 void CXFA_FM2JSContext::GetObjectDefaultValue(FXJSE_HVALUE hObjectValue, |
6711 FXJSE_HVALUE hDefaultValue) { | 6769 FXJSE_HVALUE hDefaultValue) { |
6712 CXFA_Node* pNode = ToNode((CXFA_Object*)FXJSE_Value_ToObject(hObjectValue)); | 6770 CXFA_Node* pNode = |
| 6771 ToNode((CXFA_Object*)FXJSE_Value_ToObject(hObjectValue, NULL)); |
6713 if (pNode) { | 6772 if (pNode) { |
6714 pNode->Script_Som_DefaultValue(hDefaultValue, FALSE, (XFA_ATTRIBUTE)-1); | 6773 pNode->Script_Som_DefaultValue(hDefaultValue, FALSE, (XFA_ATTRIBUTE)-1); |
6715 } else { | 6774 } else { |
6716 FXJSE_Value_SetNull(hDefaultValue); | 6775 FXJSE_Value_SetNull(hDefaultValue); |
6717 } | 6776 } |
6718 } | 6777 } |
6719 FX_BOOL CXFA_FM2JSContext::SetObjectDefaultValue(FXJSE_HVALUE hObjectValue, | 6778 FX_BOOL CXFA_FM2JSContext::SetObjectDefaultValue(FXJSE_HVALUE hObjectValue, |
6720 FXJSE_HVALUE hNewValue) { | 6779 FXJSE_HVALUE hNewValue) { |
6721 CXFA_Node* pNode = ToNode((CXFA_Object*)FXJSE_Value_ToObject(hObjectValue)); | 6780 CXFA_Node* pNode = |
| 6781 ToNode((CXFA_Object*)FXJSE_Value_ToObject(hObjectValue, NULL)); |
6722 if (pNode) { | 6782 if (pNode) { |
6723 pNode->Script_Som_DefaultValue(hNewValue, TRUE, (XFA_ATTRIBUTE)-1); | 6783 pNode->Script_Som_DefaultValue(hNewValue, TRUE, (XFA_ATTRIBUTE)-1); |
6724 return TRUE; | 6784 return TRUE; |
6725 } | 6785 } |
6726 return FALSE; | 6786 return FALSE; |
6727 } | 6787 } |
6728 void CXFA_FM2JSContext::GenerateSomExpression(const CFX_ByteStringC& szName, | 6788 void CXFA_FM2JSContext::GenerateSomExpression(const CFX_ByteStringC& szName, |
6729 int32_t iIndexFlags, | 6789 int32_t iIndexFlags, |
6730 int32_t iIndexValue, | 6790 int32_t iIndexValue, |
6731 FX_BOOL bIsStar, | 6791 FX_BOOL bIsStar, |
(...skipping 20 matching lines...) Expand all Loading... |
6752 iIndexValue = (iIndexValue < 0) ? (0 - iIndexValue) : iIndexValue; | 6812 iIndexValue = (iIndexValue < 0) ? (0 - iIndexValue) : iIndexValue; |
6753 szSomExp += CFX_ByteString::FormatInteger(iIndexValue); | 6813 szSomExp += CFX_ByteString::FormatInteger(iIndexValue); |
6754 szSomExp += "]"; | 6814 szSomExp += "]"; |
6755 } | 6815 } |
6756 } | 6816 } |
6757 FX_BOOL CXFA_FM2JSContext::GetObjectByName( | 6817 FX_BOOL CXFA_FM2JSContext::GetObjectByName( |
6758 FXJSE_HOBJECT hThis, | 6818 FXJSE_HOBJECT hThis, |
6759 FXJSE_HVALUE accessorValue, | 6819 FXJSE_HVALUE accessorValue, |
6760 const CFX_ByteStringC& szAccessorName) { | 6820 const CFX_ByteStringC& szAccessorName) { |
6761 FX_BOOL bFlags = FALSE; | 6821 FX_BOOL bFlags = FALSE; |
6762 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 6822 CXFA_FM2JSContext* pContext = |
| 6823 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
6763 CXFA_Document* pDoc = pContext->GetDocument(); | 6824 CXFA_Document* pDoc = pContext->GetDocument(); |
6764 if (!pDoc) { | 6825 if (!pDoc) { |
6765 return bFlags; | 6826 return bFlags; |
6766 } | 6827 } |
6767 CXFA_ScriptContext* pScriptContext = pDoc->GetScriptContext(); | 6828 CXFA_ScriptContext* pScriptContext = pDoc->GetScriptContext(); |
6768 XFA_RESOLVENODE_RS resoveNodeRS; | 6829 XFA_RESOLVENODE_RS resoveNodeRS; |
6769 uint32_t dwFlags = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Properties | | 6830 uint32_t dwFlags = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Properties | |
6770 XFA_RESOLVENODE_Siblings | XFA_RESOLVENODE_Parent; | 6831 XFA_RESOLVENODE_Siblings | XFA_RESOLVENODE_Parent; |
6771 int32_t iRet = pScriptContext->ResolveObjects( | 6832 int32_t iRet = pScriptContext->ResolveObjects( |
6772 pScriptContext->GetThisObject(), | 6833 pScriptContext->GetThisObject(), |
6773 CFX_WideString::FromUTF8(szAccessorName).AsStringC(), resoveNodeRS, | 6834 CFX_WideString::FromUTF8(szAccessorName).AsStringC(), resoveNodeRS, |
6774 dwFlags); | 6835 dwFlags); |
6775 if (iRet >= 1 && resoveNodeRS.dwFlags == XFA_RESOVENODE_RSTYPE_Nodes) { | 6836 if (iRet >= 1 && resoveNodeRS.dwFlags == XFA_RESOVENODE_RSTYPE_Nodes) { |
6776 FXJSE_Value_Set(accessorValue, pScriptContext->GetJSValueFromMap( | 6837 FXJSE_Value_Set(accessorValue, pScriptContext->GetJSValueFromMap( |
6777 resoveNodeRS.nodes.GetAt(0))); | 6838 resoveNodeRS.nodes.GetAt(0))); |
6778 bFlags = TRUE; | 6839 bFlags = TRUE; |
6779 } | 6840 } |
6780 return bFlags; | 6841 return bFlags; |
6781 } | 6842 } |
6782 int32_t CXFA_FM2JSContext::ResolveObjects(FXJSE_HOBJECT hThis, | 6843 int32_t CXFA_FM2JSContext::ResolveObjects(FXJSE_HOBJECT hThis, |
6783 FXJSE_HVALUE hRefValue, | 6844 FXJSE_HVALUE hRefValue, |
6784 const CFX_ByteStringC& bsSomExp, | 6845 const CFX_ByteStringC& bsSomExp, |
6785 XFA_RESOLVENODE_RS& resoveNodeRS, | 6846 XFA_RESOLVENODE_RS& resoveNodeRS, |
6786 FX_BOOL bdotAccessor, | 6847 FX_BOOL bdotAccessor, |
6787 FX_BOOL bHasNoResolveName) { | 6848 FX_BOOL bHasNoResolveName) { |
6788 CFX_WideString wsSomExpression = CFX_WideString::FromUTF8(bsSomExp); | 6849 CFX_WideString wsSomExpression = CFX_WideString::FromUTF8(bsSomExp); |
6789 int32_t iRet = -1; | 6850 int32_t iRet = -1; |
6790 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 6851 CXFA_FM2JSContext* pContext = |
| 6852 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
6791 CXFA_Document* pDoc = pContext->GetDocument(); | 6853 CXFA_Document* pDoc = pContext->GetDocument(); |
6792 if (!pDoc) { | 6854 if (!pDoc) { |
6793 return iRet; | 6855 return iRet; |
6794 } | 6856 } |
6795 CXFA_ScriptContext* pScriptContext = pDoc->GetScriptContext(); | 6857 CXFA_ScriptContext* pScriptContext = pDoc->GetScriptContext(); |
6796 CXFA_Object* pNode = NULL; | 6858 CXFA_Object* pNode = NULL; |
6797 uint32_t dFlags = 0UL; | 6859 uint32_t dFlags = 0UL; |
6798 if (bdotAccessor) { | 6860 if (bdotAccessor) { |
6799 if (FXJSE_Value_IsNull(hRefValue)) { | 6861 if (FXJSE_Value_IsNull(hRefValue)) { |
6800 pNode = pScriptContext->GetThisObject(); | 6862 pNode = pScriptContext->GetThisObject(); |
6801 dFlags = XFA_RESOLVENODE_Siblings | XFA_RESOLVENODE_Parent; | 6863 dFlags = XFA_RESOLVENODE_Siblings | XFA_RESOLVENODE_Parent; |
6802 } else { | 6864 } else { |
6803 pNode = (CXFA_Object*)FXJSE_Value_ToObject(hRefValue); | 6865 pNode = (CXFA_Object*)FXJSE_Value_ToObject(hRefValue, NULL); |
6804 ASSERT(pNode); | 6866 ASSERT(pNode); |
6805 if (bHasNoResolveName) { | 6867 if (bHasNoResolveName) { |
6806 CFX_WideString wsName; | 6868 CFX_WideString wsName; |
6807 if (CXFA_Node* pXFANode = pNode->AsNode()) { | 6869 if (CXFA_Node* pXFANode = pNode->AsNode()) { |
6808 pXFANode->GetAttribute(XFA_ATTRIBUTE_Name, wsName, FALSE); | 6870 pXFANode->GetAttribute(XFA_ATTRIBUTE_Name, wsName, FALSE); |
6809 } | 6871 } |
6810 if (wsName.IsEmpty()) { | 6872 if (wsName.IsEmpty()) { |
6811 CFX_WideStringC className; | 6873 CFX_WideStringC className; |
6812 pNode->GetClassName(className); | 6874 pNode->GetClassName(className); |
6813 wsName = FX_WSTRC(L"#") + className; | 6875 wsName = FX_WSTRC(L"#") + className; |
6814 } | 6876 } |
6815 wsSomExpression = wsName + wsSomExpression; | 6877 wsSomExpression = wsName + wsSomExpression; |
6816 dFlags = XFA_RESOLVENODE_Siblings; | 6878 dFlags = XFA_RESOLVENODE_Siblings; |
6817 } else { | 6879 } else { |
6818 dFlags = (bsSomExp == "*") | 6880 dFlags = (bsSomExp == "*") |
6819 ? (XFA_RESOLVENODE_Children) | 6881 ? (XFA_RESOLVENODE_Children) |
6820 : (XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Attributes | | 6882 : (XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Attributes | |
6821 XFA_RESOLVENODE_Properties); | 6883 XFA_RESOLVENODE_Properties); |
6822 } | 6884 } |
6823 } | 6885 } |
6824 } else { | 6886 } else { |
6825 pNode = (CXFA_Object*)FXJSE_Value_ToObject(hRefValue); | 6887 pNode = (CXFA_Object*)FXJSE_Value_ToObject(hRefValue, NULL); |
6826 dFlags = XFA_RESOLVENODE_AnyChild; | 6888 dFlags = XFA_RESOLVENODE_AnyChild; |
6827 } | 6889 } |
6828 iRet = pScriptContext->ResolveObjects(pNode, wsSomExpression.AsStringC(), | 6890 iRet = pScriptContext->ResolveObjects(pNode, wsSomExpression.AsStringC(), |
6829 resoveNodeRS, dFlags); | 6891 resoveNodeRS, dFlags); |
6830 return iRet; | 6892 return iRet; |
6831 } | 6893 } |
6832 void CXFA_FM2JSContext::ParseResolveResult( | 6894 void CXFA_FM2JSContext::ParseResolveResult( |
6833 FXJSE_HOBJECT hThis, | 6895 FXJSE_HOBJECT hThis, |
6834 const XFA_RESOLVENODE_RS& resoveNodeRS, | 6896 const XFA_RESOLVENODE_RS& resoveNodeRS, |
6835 FXJSE_HVALUE hParentValue, | 6897 FXJSE_HVALUE hParentValue, |
6836 FXJSE_HVALUE*& resultValues, | 6898 FXJSE_HVALUE*& resultValues, |
6837 int32_t& iSize, | 6899 int32_t& iSize, |
6838 FX_BOOL& bAttribute) { | 6900 FX_BOOL& bAttribute) { |
6839 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 6901 CXFA_FM2JSContext* pContext = |
| 6902 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
6840 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); | 6903 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); |
6841 iSize = 0; | 6904 iSize = 0; |
6842 resultValues = NULL; | 6905 resultValues = NULL; |
6843 if (resoveNodeRS.dwFlags == XFA_RESOVENODE_RSTYPE_Nodes) { | 6906 if (resoveNodeRS.dwFlags == XFA_RESOVENODE_RSTYPE_Nodes) { |
6844 bAttribute = FALSE; | 6907 bAttribute = FALSE; |
6845 iSize = resoveNodeRS.nodes.GetSize(); | 6908 iSize = resoveNodeRS.nodes.GetSize(); |
6846 resultValues = FX_Alloc(FXJSE_HVALUE, iSize); | 6909 resultValues = FX_Alloc(FXJSE_HVALUE, iSize); |
6847 for (int32_t i = 0; i < iSize; i++) { | 6910 for (int32_t i = 0; i < iSize; i++) { |
6848 resultValues[i] = FXJSE_Value_Create(pIsolate); | 6911 resultValues[i] = FXJSE_Value_Create(pIsolate); |
6849 FXJSE_Value_Set( | 6912 FXJSE_Value_Set( |
(...skipping 17 matching lines...) Expand all Loading... |
6867 resultValues = FX_Alloc(FXJSE_HVALUE, iSize); | 6930 resultValues = FX_Alloc(FXJSE_HVALUE, iSize); |
6868 for (int32_t i = 0; i < iSize; i++) { | 6931 for (int32_t i = 0; i < iSize; i++) { |
6869 resultValues[i] = FXJSE_Value_Create(pIsolate); | 6932 resultValues[i] = FXJSE_Value_Create(pIsolate); |
6870 FXJSE_Value_Set(resultValues[i], objectProperties[i]); | 6933 FXJSE_Value_Set(resultValues[i], objectProperties[i]); |
6871 } | 6934 } |
6872 } | 6935 } |
6873 } | 6936 } |
6874 } | 6937 } |
6875 int32_t CXFA_FM2JSContext::HValueToInteger(FXJSE_HOBJECT hThis, | 6938 int32_t CXFA_FM2JSContext::HValueToInteger(FXJSE_HOBJECT hThis, |
6876 FXJSE_HVALUE hValue) { | 6939 FXJSE_HVALUE hValue) { |
6877 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 6940 CXFA_FM2JSContext* pContext = |
| 6941 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
6878 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); | 6942 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); |
6879 int32_t iValue = 0; | 6943 int32_t iValue = 0; |
6880 if (FXJSE_Value_IsArray(hValue)) { | 6944 if (FXJSE_Value_IsArray(hValue)) { |
6881 FXJSE_HVALUE propertyValue = FXJSE_Value_Create(pIsolate); | 6945 FXJSE_HVALUE propertyValue = FXJSE_Value_Create(pIsolate); |
6882 FXJSE_HVALUE jsobjectValue = FXJSE_Value_Create(pIsolate); | 6946 FXJSE_HVALUE jsobjectValue = FXJSE_Value_Create(pIsolate); |
6883 FXJSE_HVALUE newProperty = FXJSE_Value_Create(pIsolate); | 6947 FXJSE_HVALUE newProperty = FXJSE_Value_Create(pIsolate); |
6884 FXJSE_Value_GetObjectPropByIdx(hValue, 1, propertyValue); | 6948 FXJSE_Value_GetObjectPropByIdx(hValue, 1, propertyValue); |
6885 FXJSE_Value_GetObjectPropByIdx(hValue, 2, jsobjectValue); | 6949 FXJSE_Value_GetObjectPropByIdx(hValue, 2, jsobjectValue); |
6886 if (FXJSE_Value_IsNull(propertyValue)) { | 6950 if (FXJSE_Value_IsNull(propertyValue)) { |
6887 GetObjectDefaultValue(jsobjectValue, newProperty); | 6951 GetObjectDefaultValue(jsobjectValue, newProperty); |
(...skipping 22 matching lines...) Expand all Loading... |
6910 iValue = FXJSE_Value_ToInteger(hValue); | 6974 iValue = FXJSE_Value_ToInteger(hValue); |
6911 } | 6975 } |
6912 return iValue; | 6976 return iValue; |
6913 } | 6977 } |
6914 FX_DOUBLE CXFA_FM2JSContext::StringToDouble( | 6978 FX_DOUBLE CXFA_FM2JSContext::StringToDouble( |
6915 const CFX_ByteStringC& szStringVal) { | 6979 const CFX_ByteStringC& szStringVal) { |
6916 return XFA_ByteStringToDouble(szStringVal); | 6980 return XFA_ByteStringToDouble(szStringVal); |
6917 } | 6981 } |
6918 FX_FLOAT CXFA_FM2JSContext::HValueToFloat(FXJSE_HOBJECT hThis, | 6982 FX_FLOAT CXFA_FM2JSContext::HValueToFloat(FXJSE_HOBJECT hThis, |
6919 FXJSE_HVALUE arg) { | 6983 FXJSE_HVALUE arg) { |
6920 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 6984 CXFA_FM2JSContext* pContext = |
| 6985 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
6921 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); | 6986 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); |
6922 FX_FLOAT fRet = 0.0f; | 6987 FX_FLOAT fRet = 0.0f; |
6923 if (FXJSE_Value_IsArray(arg)) { | 6988 if (FXJSE_Value_IsArray(arg)) { |
6924 FXJSE_HVALUE propertyValue = FXJSE_Value_Create(pIsolate); | 6989 FXJSE_HVALUE propertyValue = FXJSE_Value_Create(pIsolate); |
6925 FXJSE_HVALUE jsobjectValue = FXJSE_Value_Create(pIsolate); | 6990 FXJSE_HVALUE jsobjectValue = FXJSE_Value_Create(pIsolate); |
6926 FXJSE_HVALUE newProperty = FXJSE_Value_Create(pIsolate); | 6991 FXJSE_HVALUE newProperty = FXJSE_Value_Create(pIsolate); |
6927 FXJSE_Value_GetObjectPropByIdx(arg, 1, propertyValue); | 6992 FXJSE_Value_GetObjectPropByIdx(arg, 1, propertyValue); |
6928 FXJSE_Value_GetObjectPropByIdx(arg, 2, jsobjectValue); | 6993 FXJSE_Value_GetObjectPropByIdx(arg, 2, jsobjectValue); |
6929 if (FXJSE_Value_IsNull(propertyValue)) { | 6994 if (FXJSE_Value_IsNull(propertyValue)) { |
6930 GetObjectDefaultValue(jsobjectValue, newProperty); | 6995 GetObjectDefaultValue(jsobjectValue, newProperty); |
(...skipping 18 matching lines...) Expand all Loading... |
6949 fRet = (FX_FLOAT)StringToDouble(bsOutput.AsStringC()); | 7014 fRet = (FX_FLOAT)StringToDouble(bsOutput.AsStringC()); |
6950 } else if (FXJSE_Value_IsUndefined(arg)) { | 7015 } else if (FXJSE_Value_IsUndefined(arg)) { |
6951 fRet = 0; | 7016 fRet = 0; |
6952 } else { | 7017 } else { |
6953 fRet = FXJSE_Value_ToFloat(arg); | 7018 fRet = FXJSE_Value_ToFloat(arg); |
6954 } | 7019 } |
6955 return fRet; | 7020 return fRet; |
6956 } | 7021 } |
6957 FX_DOUBLE CXFA_FM2JSContext::HValueToDouble(FXJSE_HOBJECT hThis, | 7022 FX_DOUBLE CXFA_FM2JSContext::HValueToDouble(FXJSE_HOBJECT hThis, |
6958 FXJSE_HVALUE arg) { | 7023 FXJSE_HVALUE arg) { |
6959 CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis); | 7024 CXFA_FM2JSContext* pContext = |
| 7025 (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); |
6960 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); | 7026 v8::Isolate* pIsolate = pContext->GetScriptRuntime(); |
6961 FX_DOUBLE dRet = 0; | 7027 FX_DOUBLE dRet = 0; |
6962 if (FXJSE_Value_IsArray(arg)) { | 7028 if (FXJSE_Value_IsArray(arg)) { |
6963 FXJSE_HVALUE propertyValue = FXJSE_Value_Create(pIsolate); | 7029 FXJSE_HVALUE propertyValue = FXJSE_Value_Create(pIsolate); |
6964 FXJSE_HVALUE jsobjectValue = FXJSE_Value_Create(pIsolate); | 7030 FXJSE_HVALUE jsobjectValue = FXJSE_Value_Create(pIsolate); |
6965 FXJSE_HVALUE newProperty = FXJSE_Value_Create(pIsolate); | 7031 FXJSE_HVALUE newProperty = FXJSE_Value_Create(pIsolate); |
6966 FXJSE_Value_GetObjectPropByIdx(arg, 1, propertyValue); | 7032 FXJSE_Value_GetObjectPropByIdx(arg, 1, propertyValue); |
6967 FXJSE_Value_GetObjectPropByIdx(arg, 2, jsobjectValue); | 7033 FXJSE_Value_GetObjectPropByIdx(arg, 2, jsobjectValue); |
6968 if (FXJSE_Value_IsNull(propertyValue)) { | 7034 if (FXJSE_Value_IsNull(propertyValue)) { |
6969 GetObjectDefaultValue(jsobjectValue, newProperty); | 7035 GetObjectDefaultValue(jsobjectValue, newProperty); |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7135 CFX_WideString wsFormat; | 7201 CFX_WideString wsFormat; |
7136 pAppProvider->LoadString(iStringID, wsFormat); | 7202 pAppProvider->LoadString(iStringID, wsFormat); |
7137 CFX_WideString wsMessage; | 7203 CFX_WideString wsMessage; |
7138 va_list arg_ptr; | 7204 va_list arg_ptr; |
7139 va_start(arg_ptr, iStringID); | 7205 va_start(arg_ptr, iStringID); |
7140 wsMessage.FormatV(wsFormat.c_str(), arg_ptr); | 7206 wsMessage.FormatV(wsFormat.c_str(), arg_ptr); |
7141 va_end(arg_ptr); | 7207 va_end(arg_ptr); |
7142 FXJSE_ThrowMessage( | 7208 FXJSE_ThrowMessage( |
7143 "", FX_UTF8Encode(wsMessage.c_str(), wsMessage.GetLength()).AsStringC()); | 7209 "", FX_UTF8Encode(wsMessage.c_str(), wsMessage.GetLength()).AsStringC()); |
7144 } | 7210 } |
OLD | NEW |