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

Unified Diff: src/ic.cc

Issue 660174: Return length passed instead of receiver to allow chained assignments like (Closed)
Patch Set: Created 10 years, 10 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/array-length.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic.cc
diff --git a/src/ic.cc b/src/ic.cc
index 31ece04a0b820beac92c3f3b3a46182628339937..8fd777a362c1997240d850bb4f3d1bc486df9e50 100644
--- a/src/ic.cc
+++ b/src/ic.cc
@@ -1365,7 +1365,9 @@ Object* StoreIC_ArrayLength(Arguments args) {
JSObject* receiver = JSObject::cast(args[0]);
Object* len = args[1];
- return receiver->SetElementsLength(len);
+ Object* result = receiver->SetElementsLength(len);
+ if (result->IsFailure()) return result;
+ return len;
}
« no previous file with comments | « no previous file | test/mjsunit/array-length.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698