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

Unified Diff: src/runtime.cc

Issue 359173002: Make Map.set() and Set.add() chainable (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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 | test/mjsunit/es6/weak_collections.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index eba17a19437b86de7c502faf8f1f3d99cf2ba8f8..8e59a0c940d1e1de0747c6c874154752c105bf4f 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -1548,7 +1548,7 @@ RUNTIME_FUNCTION(Runtime_SetAdd) {
Handle<OrderedHashSet> table(OrderedHashSet::cast(holder->table()));
table = OrderedHashSet::Add(table, key);
holder->set_table(*table);
- return isolate->heap()->undefined_value();
+ return *holder;
}
@@ -1686,7 +1686,7 @@ RUNTIME_FUNCTION(Runtime_MapSet) {
Handle<OrderedHashMap> table(OrderedHashMap::cast(holder->table()));
Handle<OrderedHashMap> new_table = OrderedHashMap::Put(table, key, value);
holder->set_table(*new_table);
- return isolate->heap()->undefined_value();
+ return *holder;
}
@@ -1800,7 +1800,7 @@ RUNTIME_FUNCTION(Runtime_WeakCollectionSet) {
RUNTIME_ASSERT(table->IsKey(*key));
Handle<ObjectHashTable> new_table = ObjectHashTable::Put(table, key, value);
weak_collection->set_table(*new_table);
- return isolate->heap()->undefined_value();
+ return *weak_collection;
}
« no previous file with comments | « no previous file | test/mjsunit/es6/weak_collections.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698