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

Unified Diff: src/builtins.cc

Issue 1378533002: [es6] Introduce %ToInteger and %ToLength. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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 | « src/api.cc ('k') | src/compiler/linkage.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins.cc
diff --git a/src/builtins.cc b/src/builtins.cc
index 0742f08e9cb8fcc8578eb2bcedf5d335344ec898..444f9a308b4297012940a1aa1829593a00695146 100644
--- a/src/builtins.cc
+++ b/src/builtins.cc
@@ -1000,11 +1000,11 @@ bool IterateElements(Isolate* isolate, Handle<JSObject> receiver,
ASSIGN_RETURN_ON_EXCEPTION_VALUE(
isolate, val, Runtime::GetObjectProperty(isolate, receiver, key),
false);
+ ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, val,
+ Object::ToLength(isolate, val), false);
// TODO(caitp): Support larger element indexes (up to 2^53-1).
if (!val->ToUint32(&length)) {
- ASSIGN_RETURN_ON_EXCEPTION_VALUE(
- isolate, val, Execution::ToLength(isolate, val), false);
- val->ToUint32(&length);
+ length = 0;
}
}
« no previous file with comments | « src/api.cc ('k') | src/compiler/linkage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698