|
|
| version 1.13, 2024/09/30 19:03:53 | version 1.14, 2024/10/02 00:07:57 |
|---|---|
| Line 46 static void _create_or_add(Request& r, M | Line 46 static void _create_or_add(Request& r, M |
| if(VArray* src=dynamic_cast<VArray*>(&vsrc)) { | if(VArray* src=dynamic_cast<VArray*>(&vsrc)) { |
| if(src==&self) | if(src==&self) |
| throw Exception(PARSER_RUNTIME, 0, "source and destination are the same array"); | return; |
| self_array.append(src->array()); | if(self_array.count()){ |
| for(ArrayValue::Iterator i(src->array()); i; i.next()){ | |
| if(i.value()) | |
| self_array.put(i.index(), i.value()); | |
| } | |
| } else { | |
| self_array.append(src->array()); | |
| } | |
| } else { | } else { |
| HashStringValue* src_hash=vsrc.get_hash(); | HashStringValue* src_hash=vsrc.get_hash(); |
| if(!src_hash) | if(!src_hash) |
| Line 1092 MArray::MArray(): Methoded(VARRAY_TYPE) | Line 1099 MArray::MArray(): Methoded(VARRAY_TYPE) |
| #ifdef FEATURE_GET_ELEMENT4CALL | #ifdef FEATURE_GET_ELEMENT4CALL |
| // aliases without "_" | // aliases without "_" |
| add_native_method("keys", Method::CT_DYNAMIC, _keys, 0, 1); | add_native_method("keys", Method::CT_DYNAMIC, _keys, 0, 1); |
| add_native_method("count", Method::CT_DYNAMIC, _count, 0, 0); | add_native_method("count", Method::CT_DYNAMIC, _count, 0, 1); |
| add_native_method("at", Method::CT_DYNAMIC, _at, 1, 2); | add_native_method("at", Method::CT_DYNAMIC, _at, 1, 2); |
| #endif | #endif |