njs_value_t *value, *property, lvalue;
njs_property_query_t pq;
- value = njs_argument(args, 0);
-
- if (njs_is_null_or_undefined(value)) {
- njs_type_error(vm, "cannot convert %s argument to object",
- njs_type_string(value->type));
- return NJS_ERROR;
- }
-
property = njs_lvalue_arg(&lvalue, args, nargs, 1);
if (njs_slow_path(!njs_is_key(property))) {
}
}
+ value = njs_argument(args, 0);
+
+ if (njs_is_null_or_undefined(value)) {
+ njs_type_error(vm, "cannot convert %s argument to object",
+ njs_type_string(value->type));
+ return NJS_ERROR;
+ }
+
njs_property_query_init(&pq, NJS_PROPERTY_QUERY_GET, 1);
ret = njs_property_query_val(vm, &pq, value, property);
njs_object_prop_t *prop;
njs_property_query_t pq;
- value = njs_argument(args, 0);
-
- if (njs_is_null_or_undefined(value)) {
- njs_type_error(vm, "cannot convert %s argument to object",
- njs_type_string(value->type));
- return NJS_ERROR;
- }
-
property = njs_lvalue_arg(&lvalue, args, nargs, 1);
if (njs_slow_path(!njs_is_key(property))) {
}
}
+ value = njs_argument(args, 0);
+
+ if (njs_is_null_or_undefined(value)) {
+ njs_type_error(vm, "cannot convert %s argument to object",
+ njs_type_string(value->type));
+ return NJS_ERROR;
+ }
+
njs_property_query_init(&pq, NJS_PROPERTY_QUERY_GET, 1);
ret = njs_property_query_val(vm, &pq, value, property);
njs_value_t *prototype, *value;
njs_object_t *object, *proto;
+ value = njs_arg(args, nargs, 1);
+
+ if (njs_slow_path(!njs_is_object(value))) {
+ goto ret_false;
+ }
+
if (njs_slow_path(njs_is_null_or_undefined(njs_argument(args, 0)))) {
njs_type_error(vm, "cannot convert undefined to object");
return NJS_ERROR;
}
prototype = &args[0];
- value = njs_arg(args, nargs, 1);
- if (njs_is_object(prototype) && njs_is_object(value)) {
+ if (njs_is_object(prototype)) {
proto = njs_object(prototype);
object = njs_object(value);
} while (object != NULL);
}
+ret_false:
+
njs_set_boolean(retval, 0);
return NJS_OK;