Lines Matching refs:status
56 napi_status status = napi_ok;
74 status = napi_define_class(env, "Locale", NAPI_AUTO_LENGTH, LocaleConstructor, nullptr,
76 if (status != napi_ok) {
81 status = napi_set_named_property(env, exports, "Locale", constructor);
82 if (status != napi_ok) {
91 status = napi_create_reference(env, constructor, 1, g_constructor);
92 if (status != napi_ok) {
101 napi_status status = napi_ok;
109 status = napi_define_class(env, "DateTimeFormat", NAPI_AUTO_LENGTH, DateTimeFormatConstructor, nullptr,
111 if (status != napi_ok) {
116 status = napi_set_named_property(env, exports, "DateTimeFormat", constructor);
117 if (status != napi_ok) {
126 napi_status status = napi_ok;
134 status = napi_define_class(env, "RelativeTimeFormat", NAPI_AUTO_LENGTH, RelativeTimeFormatConstructor, nullptr,
136 if (status != napi_ok) {
141 status = napi_set_named_property(env, exports, "RelativeTimeFormat", constructor);
142 if (status != napi_ok) {
151 napi_status status = napi_ok;
158 status = napi_define_class(env, "NumberFormat", NAPI_AUTO_LENGTH, NumberFormatConstructor, nullptr,
160 if (status != napi_ok) {
165 status = napi_set_named_property(env, exports, "NumberFormat", constructor);
166 if (status != napi_ok) {
178 napi_status status = napi_typeof(env, options, &type);
179 if (status != napi_ok && type != napi_object) {
186 status = napi_get_named_property(env, options, optionName.c_str(), &optionValue);
187 if (status == napi_ok) {
191 status = napi_get_value_string_utf8(env, optionValue, optionBuf.data(), len + 1, &len);
192 if (status != napi_ok) {
206 napi_status status = napi_typeof(env, options, &type);
207 if (status != napi_ok && type != napi_object) {
214 status = napi_get_named_property(env, options, optionName.c_str(), &optionValue);
215 if (status == napi_ok) {
216 status = napi_get_value_int64(env, optionValue, &integerValue);
217 if (status == napi_ok) {
230 napi_status status = napi_typeof(env, options, &type);
231 if (status != napi_ok && type != napi_object) {
238 status = napi_get_named_property(env, options, optionName.c_str(), &optionValue);
239 if (status == napi_ok) {
290 napi_status status = napi_get_value_string_utf8(env, argv, nullptr, 0, &len);
291 if (status != napi_ok) {
296 status = napi_get_value_string_utf8(env, argv, buf.data(), len + 1, &len);
297 if (status != napi_ok) {
314 napi_status status = napi_get_cb_info(env, info, &argc, argv, &thisVar, &data);
315 if (status != napi_ok) {
331 status =
333 if (status != napi_ok) {
348 napi_status status = napi_get_global(env, &global);
349 if (status != napi_ok) {
362 napi_status status = napi_get_value_string_utf8(env, rawLocaleTag, nullptr, 0, &len);
363 if (status != napi_ok) {
368 status = napi_get_value_string_utf8(env, rawLocaleTag, buf.data(), len + 1, &len);
369 if (status != napi_ok) {
382 napi_status status = napi_get_cb_info(env, info, &argc, argv, &thisVar, &data);
383 if (status != napi_ok) {
410 status =
412 if (status != napi_ok) {
428 napi_status status = napi_get_global(env, &global);
429 if (status != napi_ok) {
445 napi_status status = napi_get_cb_info(env, info, &argc, argv, &thisVar, &data);
446 if (status != napi_ok) {
473 status =
475 if (status != napi_ok) {
509 napi_status status = napi_unwrap(env, thisVar, reinterpret_cast<void **>(&obj));
510 if (status != napi_ok || !obj || !obj->datefmt_) {
516 status = napi_create_string_utf8(env, value.c_str(), NAPI_AUTO_LENGTH, &result);
517 if (status != napi_ok) {
541 napi_status status = napi_unwrap(env, thisVar, reinterpret_cast<void **>(&obj));
542 if (status != napi_ok || !obj || !obj->datefmt_) {
548 status = napi_create_string_utf8(env, value.c_str(), NAPI_AUTO_LENGTH, &result);
549 if (status != napi_ok) {
588 napi_status status = napi_get_cb_info(env, info, &argc, argv, &thisVar, &data);
589 if (status != napi_ok) {
617 status =
619 if (status != napi_ok) {
635 napi_status status = napi_get_global(env, &global);
636 if (status != napi_ok) {
649 napi_status status = napi_get_named_property(env, argv[index], "getTime", &funcGetDateInfo);
650 if (status != napi_ok) {
655 status = napi_call_function(env, argv[index], funcGetDateInfo, 0, nullptr, &ret_value);
656 if (status != napi_ok) {
661 status = napi_get_value_int64(env, ret_value, &milliseconds);
662 if (status != napi_ok) {
676 napi_status status = napi_unwrap(env, thisVar, reinterpret_cast<void **>(&obj));
677 if (status != napi_ok || !obj || !obj->locale_) {
684 status = napi_create_string_utf8(env, value.c_str(), NAPI_AUTO_LENGTH, &result);
685 if (status != napi_ok) {
699 napi_status status = napi_unwrap(env, thisVar, reinterpret_cast<void **>(&obj));
700 if (status != napi_ok || !obj || !obj->locale_) {
707 status = napi_create_string_utf8(env, value.c_str(), NAPI_AUTO_LENGTH, &result);
708 if (status != napi_ok) {
722 napi_status status = napi_unwrap(env, thisVar, reinterpret_cast<void **>(&obj));
723 if (status != napi_ok || !obj || !obj->locale_) {
730 status = napi_create_string_utf8(env, value.c_str(), NAPI_AUTO_LENGTH, &result);
731 if (status != napi_ok) {
745 napi_status status = napi_unwrap(env, thisVar, reinterpret_cast<void **>(&obj));
746 if (status != napi_ok || !obj || !obj->locale_) {
753 status = napi_create_string_utf8(env, value.c_str(), NAPI_AUTO_LENGTH, &result);
754 if (status != napi_ok) {
768 napi_status status = napi_unwrap(env, thisVar, reinterpret_cast<void **>(&obj));
769 if (status != napi_ok || !obj || !obj->locale_) {
776 status = napi_create_string_utf8(env, value.c_str(), NAPI_AUTO_LENGTH, &result);
777 if (status != napi_ok) {
791 napi_status status = napi_unwrap(env, thisVar, reinterpret_cast<void **>(&obj));
792 if (status != napi_ok || !obj || !obj->locale_) {
799 status = napi_create_string_utf8(env, value.c_str(), NAPI_AUTO_LENGTH, &result);
800 if (status != napi_ok) {
814 napi_status status = napi_unwrap(env, thisVar, reinterpret_cast<void **>(&obj));
815 if (status != napi_ok || !obj || !obj->locale_) {
822 status = napi_create_string_utf8(env, value.c_str(), NAPI_AUTO_LENGTH, &result);
823 if (status != napi_ok) {
837 napi_status status = napi_unwrap(env, thisVar, reinterpret_cast<void **>(&obj));
838 if (status != napi_ok || !obj || !obj->locale_) {
845 status = napi_create_string_utf8(env, value.c_str(), NAPI_AUTO_LENGTH, &result);
846 if (status != napi_ok) {
860 napi_status status = napi_unwrap(env, thisVar, reinterpret_cast<void **>(&obj));
861 if (status != napi_ok || !obj || !obj->locale_) {
868 status = napi_get_boolean(env, optionBoolValue, &result);
869 if (status != napi_ok) {
883 napi_status status = napi_unwrap(env, thisVar, reinterpret_cast<void **>(&obj));
884 if (status != napi_ok || !obj || !obj->locale_) {
890 status = napi_create_string_utf8(env, value.c_str(), NAPI_AUTO_LENGTH, &result);
891 if (status != napi_ok) {
905 napi_status status = napi_unwrap(env, thisVar, reinterpret_cast<void **>(&obj));
906 if (status != napi_ok || !obj || !obj->locale_) {
913 status = napi_create_string_utf8(env, value.c_str(), NAPI_AUTO_LENGTH, &result);
914 if (status != napi_ok) {
928 napi_status status = napi_unwrap(env, thisVar, reinterpret_cast<void **>(&obj));
929 if (status != napi_ok || !obj || !obj->locale_) {
936 status = napi_get_reference_value(env, *g_constructor, &constructor);
937 if (status != napi_ok) {
943 status = napi_create_string_utf8(env, localeTag.c_str(), NAPI_AUTO_LENGTH, &arg);
944 if (status != napi_ok) {
948 status = napi_new_instance(env, constructor, 1, &arg, &result);
949 if (status != napi_ok) {
963 napi_status status = napi_unwrap(env, thisVar, reinterpret_cast<void **>(&obj));
964 if (status != napi_ok || !obj || !obj->locale_) {
971 status = napi_get_reference_value(env, *g_constructor, &constructor);
972 if (status != napi_ok) {
978 status = napi_create_string_utf8(env, localeTag.c_str(), NAPI_AUTO_LENGTH, &arg);
979 if (status != napi_ok) {
983 status = napi_new_instance(env, constructor, 1, &arg, &result);
984 if (status != napi_ok) {
1012 int32_t status = 0;
1013 int64_t integerValue = ConvertString2Int(optionValue, status);
1014 if (status != -1) {
1048 napi_status status = napi_unwrap(env, thisVar, reinterpret_cast<void **>(&obj));
1049 if (status != napi_ok || !obj || !obj->relativetimefmt_) {
1071 napi_status status = napi_unwrap(env, thisVar, reinterpret_cast<void **>(&obj));
1072 if (status != napi_ok || !obj || !obj->datefmt_) {
1110 napi_status status = napi_unwrap(env, thisVar, reinterpret_cast<void **>(&obj));
1111 if (status != napi_ok || !obj || !obj->numberfmt_) {
1151 napi_status status = napi_unwrap(env, thisVar, reinterpret_cast<void **>(&obj));
1152 if (status != napi_ok || !obj || !obj->numberfmt_) {
1158 status = napi_create_string_utf8(env, value.c_str(), NAPI_AUTO_LENGTH, &result);
1159 if (status != napi_ok) {
1294 napi_status status = napi_ok;
1301 status = napi_define_class(env, "Collator", NAPI_AUTO_LENGTH, CollatorConstructor, nullptr,
1303 if (status != napi_ok) {
1308 status = napi_set_named_property(env, exports, "Collator", constructor);
1309 if (status != napi_ok) {
1322 napi_status status = napi_get_cb_info(env, info, &argc, argv, &thisVar, &data);
1323 if (status != napi_ok) {
1350 status =
1352 if (status != napi_ok) {
1368 napi_status status = napi_get_global(env, &global);
1369 if (status != napi_ok) {
1388 napi_status status = napi_get_value_string_utf8(env, value, nullptr, 0, &len);
1389 if (status != napi_ok) {
1394 status = napi_get_value_string_utf8(env, value, buf.data(), len + 1, &len);
1395 if (status != napi_ok) {
1410 napi_status status;
1412 status = napi_get_value_double(env, argv[0], &number);
1413 if (status != napi_ok) {
1422 status = napi_unwrap(env, thisVar, reinterpret_cast<void **>(&obj));
1423 if (status != napi_ok || !obj || !obj->relativetimefmt_) {
1429 status = napi_create_string_utf8(env, value.c_str(), NAPI_AUTO_LENGTH, &result);
1430 if (status != napi_ok) {
1437 void IntlAddon::FillInArrayElement(napi_env env, napi_value &result, napi_status &status,
1442 status = napi_create_string_utf8(env, timeVector[i][1].c_str(), NAPI_AUTO_LENGTH, &value);
1443 if (status != napi_ok) {
1448 status = napi_create_string_utf8(env, timeVector[i][0].c_str(), NAPI_AUTO_LENGTH, &type);
1449 if (status != napi_ok) {
1456 status = napi_create_string_utf8(env, timeVector[i][unitIndex].c_str(), NAPI_AUTO_LENGTH, &unit);
1457 if (status != napi_ok) {
1465 status = napi_create_object(env, &formatInfo);
1466 if (status != napi_ok) {
1473 status = napi_set_element(env, result, i, formatInfo);
1474 if (status != napi_ok) {
1495 napi_status status = napi_unwrap(env, thisVar, reinterpret_cast<void **>(&obj));
1496 if (status != napi_ok || !obj || !obj->relativetimefmt_) {
1503 status = napi_create_array_with_length(env, timeVector.size(), &result);
1504 if (status != napi_ok) {
1508 FillInArrayElement(env, result, status, timeVector);
1531 napi_status status = napi_unwrap(env, thisVar, reinterpret_cast<void **>(&obj));
1532 if (status != napi_ok || !obj || !obj->collator_) {
1539 status = napi_create_int32(env, compareResult, &result);
1540 if (status != napi_ok) {
1555 napi_status status = napi_unwrap(env, thisVar, reinterpret_cast<void **>(&obj));
1556 if (status != napi_ok || !obj || !obj->collator_) {
1596 int32_t status = 0;
1597 int n = ConvertString2Int(minimumIntegerDigits, status);
1598 if (status == -1 || n < 1 || n > 21) { // the valid range of minimumIntegerDigits is [1, 21]
1613 int32_t status = 0;
1614 int n = ConvertString2Int(minimumFractionDigits, status);
1615 if (status == -1 || n < 0 || n > 20) { // the valid range of minimumFractionDigits is [0, 20]
1625 int32_t status = 0;
1626 int n = ConvertString2Int(maximumFractionDigits, status);
1627 if (status == -1 || n < 0 || n > 20) { // the valid range of maximumFractionDigits is [0, 20]
1641 int32_t status = 0;
1642 int minSignificantInt = ConvertString2Int(minSignificantStr, status);
1644 if (status == -1 || minSignificantInt < 1 || minSignificantInt > 21) {
1657 int32_t status = 0;
1658 int maxSignificant = ConvertString2Int(maxSignificantStr, status);
1660 if (status == -1 || maxSignificant < minSignificant || maxSignificant > 21) {
1678 napi_status status = napi_ok;
1684 status = napi_define_class(env, "PluralRules", NAPI_AUTO_LENGTH, PluralRulesConstructor, nullptr,
1686 if (status != napi_ok) {
1691 status = napi_set_named_property(env, exports, "PluralRules", constructor);
1692 if (status != napi_ok) {
1705 napi_status status = napi_get_cb_info(env, info, &argc, argv, &thisVar, &data);
1706 if (status != napi_ok) {
1733 status =
1735 if (status != napi_ok) {
1751 napi_status status = napi_get_global(env, &global);
1752 if (status != napi_ok) {
1777 napi_status status = napi_get_value_double(env, argv[0], &number);
1778 if (status != napi_ok) {
1784 status = napi_unwrap(env, thisVar, reinterpret_cast<void **>(&obj));
1785 if (status != napi_ok || !obj || !obj->pluralrules_) {
1792 status = napi_create_string_utf8(env, res.c_str(), NAPI_AUTO_LENGTH, &result);
1793 if (status != napi_ok) {