Index: src/runtime/runtime-object.cc |
diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc |
index 5a5ae335a5a47500c2d7e2ebdb68b3565a1ccafe..b470c9670516ee02e5d38042c263bbf0c3efebb1 100644 |
--- a/src/runtime/runtime-object.cc |
+++ b/src/runtime/runtime-object.cc |
@@ -721,6 +721,23 @@ RUNTIME_FUNCTION(Runtime_AddElement) { |
} |
+RUNTIME_FUNCTION(Runtime_AppendElement) { |
+ HandleScope scope(isolate); |
+ RUNTIME_ASSERT(args.length() == 2); |
+ |
+ CONVERT_ARG_HANDLE_CHECKED(JSArray, array, 0); |
+ CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); |
+ |
+ int index = Smi::cast(array->length())->value(); |
+ |
+ Handle<Object> result; |
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
+ isolate, result, JSObject::SetElement(array, index, value, NONE, SLOPPY, |
+ false, DEFINE_PROPERTY)); |
+ return *array; |
+} |
+ |
+ |
RUNTIME_FUNCTION(Runtime_DeleteProperty) { |
HandleScope scope(isolate); |
DCHECK(args.length() == 3); |