Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Unified Diff: src/api.cc

Issue 1378403004: [api] expose Array Iterators to API (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased u_u Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/v8.h ('k') | src/array-iterator.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 5795e26837a9b02bafbd712cf2296a8ed6b5d90f..ae2c8a73d65178fba5f134f3bc2f9be2d7541aaf 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -6094,6 +6094,33 @@ Local<Object> Array::CloneElementAt(uint32_t index) {
}
+Local<Function> Array::GetKeysIterator(Isolate* isolate) {
+ i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
+ i::Handle<i::JSFunction> keys(
+ i_isolate->native_context()->array_keys_iterator(), i_isolate);
+ DCHECK(!keys.is_null());
+ return Utils::ToLocal(keys);
+}
+
+
+Local<Function> Array::GetValuesIterator(Isolate* isolate) {
+ i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
+ i::Handle<i::JSFunction> values(
+ i_isolate->native_context()->array_values_iterator(), i_isolate);
+ DCHECK(!values.is_null());
+ return Utils::ToLocal(values);
+}
+
+
+Local<Function> Array::GetEntriesIterator(Isolate* isolate) {
+ i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
+ i::Handle<i::JSFunction> entries(
+ i_isolate->native_context()->array_entries_iterator(), i_isolate);
+ DCHECK(!entries.is_null());
+ return Utils::ToLocal(entries);
+}
+
+
Local<v8::Map> v8::Map::New(Isolate* isolate) {
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
LOG_API(i_isolate, "Map::New");
« no previous file with comments | « include/v8.h ('k') | src/array-iterator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698