mirror of
https://github.com/openharmony/miscservices_time.git
synced 2026-07-19 20:03:38 -04:00
!36 修改时间设置js接口参数类型判断语句
Merge pull request !36 from guduhanyan/OpenHarmony-3.0-LTS
This commit is contained in:
@@ -108,7 +108,7 @@ napi_value ParseParametersBySetTime(const napi_env &env, const napi_value (&argv
|
||||
|
||||
// argv[0]: times or date object
|
||||
NAPI_CALL(env, napi_typeof(env, argv[0], &valueType));
|
||||
NAPI_ASSERT(env, valueType == napi_string || valueType == napi_object, "Wrong argument type. string expected.");
|
||||
NAPI_ASSERT(env, valueType == napi_number || valueType == napi_object, "Wrong argument type. string expected.");
|
||||
if (valueType == napi_number) {
|
||||
napi_get_value_int64(env, argv[0], ×);
|
||||
NAPI_ASSERT(env, times >= 0, "Wrong argument timer. Positive number expected.");
|
||||
|
||||
Reference in New Issue
Block a user