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

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: Code review changes Created 6 years, 7 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.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 2f27b05a7b3999863e5a849474b18f734acd1806..7e7196f33161829ee4498f84cd921fe1adcf9f2f 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -1343,16 +1343,24 @@ void Genesis::InitializeExperimentalGlobal() {
InstallFunction(global, "Set", JS_SET_TYPE, JSSet::kSize,
isolate()->initial_object_prototype(), Builtins::kIllegal);
{ // -- S e t I t e r a t o r
- Handle<Map> map = isolate()->factory()->NewMap(
- JS_SET_ITERATOR_TYPE, JSSetIterator::kSize);
- map->set_constructor(native_context()->closure());
- native_context()->set_set_iterator_map(*map);
+ Handle<JSObject> builtins(native_context()->builtins());
+ Handle<JSFunction> set_iterator_function =
+ InstallFunction(builtins, "SetIterator", JS_SET_ITERATOR_TYPE,
+ JSSetIterator::kSize,
+ isolate()->initial_object_prototype(),
+ Builtins::kIllegal);
+ native_context()->set_set_iterator_map(
+ set_iterator_function->initial_map());
}
{ // -- M a p I t e r a t o r
- Handle<Map> map = isolate()->factory()->NewMap(
- JS_MAP_ITERATOR_TYPE, JSMapIterator::kSize);
- map->set_constructor(native_context()->closure());
- native_context()->set_map_iterator_map(*map);
+ Handle<JSObject> builtins(native_context()->builtins());
+ Handle<JSFunction> map_iterator_function =
+ InstallFunction(builtins, "MapIterator", JS_MAP_ITERATOR_TYPE,
+ JSMapIterator::kSize,
+ isolate()->initial_object_prototype(),
+ Builtins::kIllegal);
+ native_context()->set_map_iterator_map(
+ map_iterator_function->initial_map());
}
}
@@ -2009,6 +2017,7 @@ bool Genesis::InstallExperimentalNatives() {
INSTALL_EXPERIMENTAL_NATIVE(i, symbols, "symbol.js")
INSTALL_EXPERIMENTAL_NATIVE(i, proxies, "proxy.js")
INSTALL_EXPERIMENTAL_NATIVE(i, collections, "collection.js")
+ INSTALL_EXPERIMENTAL_NATIVE(i, collections, "collection-iterator.js")
INSTALL_EXPERIMENTAL_NATIVE(i, generators, "generator.js")
INSTALL_EXPERIMENTAL_NATIVE(i, iteration, "array-iterator.js")
INSTALL_EXPERIMENTAL_NATIVE(i, strings, "harmony-string.js")
« no previous file with comments | « no previous file | src/collection.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698