@@ -65,8 +65,7 @@ DUK_INTERNAL duk_bool_t duk_get_prop_stridx(duk_context *ctx, duk_idx_t obj_idx,
6565 duk_hthread * thr = (duk_hthread * ) ctx ;
6666
6767 DUK_ASSERT_CTX_VALID (ctx );
68- DUK_ASSERT_DISABLE (stridx >= 0 );
69- DUK_ASSERT (stridx < DUK_HEAP_NUM_STRINGS );
68+ DUK_ASSERT_STRIDX_VALID (stridx );
7069 DUK_UNREF (thr );
7170
7271 obj_idx = duk_require_normalize_index (ctx , obj_idx );
@@ -78,8 +77,7 @@ DUK_INTERNAL duk_bool_t duk_get_prop_stridx_boolean(duk_context *ctx, duk_idx_t
7877 duk_bool_t rc ;
7978
8079 DUK_ASSERT_CTX_VALID (ctx );
81- DUK_ASSERT_DISABLE (stridx >= 0 );
82- DUK_ASSERT (stridx < DUK_HEAP_NUM_STRINGS );
80+ DUK_ASSERT_STRIDX_VALID (stridx );
8381
8482 rc = duk_get_prop_stridx (ctx , obj_idx , stridx );
8583 if (out_has_prop ) {
@@ -160,8 +158,7 @@ DUK_INTERNAL duk_bool_t duk_put_prop_stridx(duk_context *ctx, duk_idx_t obj_idx,
160158 duk_hthread * thr = (duk_hthread * ) ctx ;
161159
162160 DUK_ASSERT_CTX_VALID (ctx );
163- DUK_ASSERT_DISABLE (stridx >= 0 );
164- DUK_ASSERT (stridx < DUK_HEAP_NUM_STRINGS );
161+ DUK_ASSERT_STRIDX_VALID (stridx );
165162 DUK_UNREF (thr );
166163
167164 obj_idx = duk_require_normalize_index (ctx , obj_idx );
@@ -223,8 +220,7 @@ DUK_INTERNAL duk_bool_t duk_del_prop_stridx(duk_context *ctx, duk_idx_t obj_idx,
223220 duk_hthread * thr = (duk_hthread * ) ctx ;
224221
225222 DUK_ASSERT_CTX_VALID (ctx );
226- DUK_ASSERT_DISABLE (stridx >= 0 );
227- DUK_ASSERT (stridx < DUK_HEAP_NUM_STRINGS );
223+ DUK_ASSERT_STRIDX_VALID (stridx );
228224 DUK_UNREF (thr );
229225
230226 obj_idx = duk_require_normalize_index (ctx , obj_idx );
@@ -284,8 +280,7 @@ DUK_INTERNAL duk_bool_t duk_has_prop_stridx(duk_context *ctx, duk_idx_t obj_idx,
284280 duk_hthread * thr = (duk_hthread * ) ctx ;
285281
286282 DUK_ASSERT_CTX_VALID (ctx );
287- DUK_ASSERT_DISABLE (stridx >= 0 );
288- DUK_ASSERT (stridx < DUK_HEAP_NUM_STRINGS );
283+ DUK_ASSERT_STRIDX_VALID (stridx );
289284 DUK_UNREF (thr );
290285
291286 obj_idx = duk_require_normalize_index (ctx , obj_idx );
@@ -335,8 +330,7 @@ DUK_INTERNAL void duk_xdef_prop_stridx(duk_context *ctx, duk_idx_t obj_idx, duk_
335330 duk_hstring * key ;
336331
337332 DUK_ASSERT_CTX_VALID (ctx );
338- DUK_ASSERT_DISABLE (stridx >= 0 );
339- DUK_ASSERT (stridx < DUK_HEAP_NUM_STRINGS );
333+ DUK_ASSERT_STRIDX_VALID (stridx );
340334
341335 obj = duk_require_hobject (ctx , obj_idx );
342336 DUK_ASSERT (obj != NULL );
@@ -354,10 +348,8 @@ DUK_INTERNAL void duk_xdef_prop_stridx_builtin(duk_context *ctx, duk_idx_t obj_i
354348 duk_hstring * key ;
355349
356350 DUK_ASSERT_CTX_VALID (ctx );
357- DUK_ASSERT_DISABLE (stridx >= 0 );
358- DUK_ASSERT (stridx < DUK_HEAP_NUM_STRINGS );
359- DUK_ASSERT_DISABLE (builtin_idx >= 0 );
360- DUK_ASSERT (builtin_idx < DUK_NUM_BUILTINS );
351+ DUK_ASSERT_STRIDX_VALID (stridx );
352+ DUK_ASSERT_BIDX_VALID (builtin_idx );
361353
362354 obj = duk_require_hobject (ctx , obj_idx );
363355 DUK_ASSERT (obj != NULL );
0 commit comments