Browse Source

update calls to duk_push_this_coercible_to_{string,object}

pull/1/head
Sami Vaarala 11 years ago
parent
commit
03d1e0130c
  1. 6
      src/duk_builtin_array.c
  2. 7
      src/duk_builtin_object.c
  3. 3
      src/duk_hobject_props.c

6
src/duk_builtin_array.c

@ -26,7 +26,7 @@
static unsigned int push_this_obj_len_u32(duk_context *ctx) {
unsigned int len;
duk_push_this_coercible_to_object(ctx);
(void) duk_push_this_coercible_to_object(ctx);
duk_get_prop_stridx(ctx, -1, DUK_STRIDX_LENGTH);
len = duk_to_uint32(ctx, -1);
@ -91,7 +91,7 @@ int duk_builtin_array_constructor_is_array(duk_context *ctx) {
*/
int duk_builtin_array_prototype_to_string(duk_context *ctx) {
duk_push_this_coercible_to_object(ctx);
(void) duk_push_this_coercible_to_object(ctx);
duk_get_prop_stridx(ctx, -1, DUK_STRIDX_JOIN);
/* [ ... this func ] */
@ -138,7 +138,7 @@ int duk_builtin_array_prototype_concat(duk_context *ctx) {
* (as the element is dup()'d anyway).
*/
duk_push_this_coercible_to_object(ctx);
(void) duk_push_this_coercible_to_object(ctx);
duk_insert(ctx, 0);
n = duk_get_top(ctx);
duk_push_array(ctx); /* -> [ ToObject(this) item1 ... itemN arr ] */

7
src/duk_builtin_object.c

@ -232,7 +232,7 @@ int duk_builtin_object_prototype_to_string(duk_context *ctx) {
int duk_builtin_object_prototype_to_locale_string(duk_context *ctx) {
DUK_ASSERT_TOP(ctx, 0);
duk_push_this_coercible_to_object(ctx);
(void) duk_push_this_coercible_to_object(ctx);
duk_get_prop_stridx(ctx, 0, DUK_STRIDX_TO_STRING);
if (!duk_is_callable(ctx, 1)) {
return DUK_RET_TYPE_ERROR;
@ -243,7 +243,7 @@ int duk_builtin_object_prototype_to_locale_string(duk_context *ctx) {
}
int duk_builtin_object_prototype_value_of(duk_context *ctx) {
duk_push_this_coercible_to_object(ctx);
(void) duk_push_this_coercible_to_object(ctx);
return 1;
}
@ -260,8 +260,7 @@ int duk_builtin_object_prototype_is_prototype_of(duk_context *ctx) {
return 1;
}
duk_push_this_coercible_to_object(ctx);
h_obj = duk_get_hobject(ctx, 1);
h_obj = duk_push_this_coercible_to_object(ctx);
DUK_ASSERT(h_obj != NULL);
/* E5.1 Section 15.2.4.6, step 3.a, lookup proto once before compare */

3
src/duk_hobject_props.c

@ -4494,8 +4494,7 @@ int duk_hobject_object_ownprop_helper(duk_context *ctx, int required_desc_flags)
h_v = duk_to_hstring(ctx, 0);
DUK_ASSERT(h_v != NULL);
duk_push_this_coercible_to_object(ctx);
h_obj = duk_get_hobject(ctx, 1);
h_obj = duk_push_this_coercible_to_object(ctx);
DUK_ASSERT(h_obj != NULL);
ret = get_own_property_desc(thr, h_obj, h_v, &desc, 0 /*push_value*/);

Loading…
Cancel
Save