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

Unified Diff: src/bootstrapper.cc

Issue 259883002: ES6: Add support for Map and Set Iterator (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: cleanup Created 6 years, 8 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 | « no previous file | src/collection-iterator.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index f99c852eaf0a23ff24ad698694c60603cb4d0a02..cdeb2ed5cb42a6ec6872e6cf67503ab785806ab6 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -1311,14 +1311,31 @@ void Genesis::InitializeExperimentalGlobal() {
Builtins::kIllegal, true, true);
}
{ // -- S e t I t e r a t o r
- Handle<Map> map = isolate()->factory()->NewMap(
- JS_SET_ITERATOR_TYPE, JSSetIterator::kSize);
- native_context()->set_set_iterator_map(*map);
+ Handle<JSObject> builtins(native_context()->builtins());
+ Handle<JSObject> set_iterator_prototype =
+ factory()->NewJSObject(isolate()->object_function(), TENURED);
+ Handle<JSFunction> set_iterator_function =
+ InstallFunction(builtins, "SetIterator", JS_SET_ITERATOR_TYPE,
+ JSSetIterator::kSize,
+ set_iterator_prototype,
+ Builtins::kIllegal, true, false);
+
+ Map* map = set_iterator_function->initial_map();
+ native_context()->set_set_iterator_map(map);
}
{ // -- M a p I t e r a t o r
- Handle<Map> map = isolate()->factory()->NewMap(
- JS_MAP_ITERATOR_TYPE, JSMapIterator::kSize);
- native_context()->set_map_iterator_map(*map);
+ Handle<JSObject> builtins(native_context()->builtins());
+ Handle<JSObject> map_iterator_prototype =
+ factory()->NewJSObject(isolate()->object_function(), TENURED);
+
+ Handle<JSFunction> map_iterator_function =
+ InstallFunction(builtins, "MapIterator", JS_MAP_ITERATOR_TYPE,
+ JSMapIterator::kSize,
+ map_iterator_prototype,
+ Builtins::kIllegal, true, false);
+
+ Map* map = map_iterator_function->initial_map();
+ native_context()->set_map_iterator_map(map);
}
}
@@ -1991,6 +2008,8 @@ bool Genesis::InstallExperimentalNatives() {
INSTALL_EXPERIMENTAL_NATIVE(i, strings, "harmony-string.js")
INSTALL_EXPERIMENTAL_NATIVE(i, arrays, "harmony-array.js")
INSTALL_EXPERIMENTAL_NATIVE(i, maths, "harmony-math.js")
+ INSTALL_EXPERIMENTAL_NATIVE(i, collection_iterators,
+ "collection-iterator.js")
}
InstallExperimentalNativeFunctions();
« no previous file with comments | « no previous file | src/collection-iterator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698