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

Unified Diff: src/js/macros.py

Issue 1706213002: Tune Array.forEach, fix Array functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: correctify inherited elements Created 4 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
Index: src/js/macros.py
diff --git a/src/js/macros.py b/src/js/macros.py
index 94c9b9479b81f3d20a5bde78b479244ede75c4f8..e192d51296846a45404b8f5e430bb117d0d260e3 100644
--- a/src/js/macros.py
+++ b/src/js/macros.py
@@ -123,7 +123,7 @@ macro TO_PRIMITIVE_STRING(arg) = (%_ToPrimitive_String(arg));
macro TO_NAME(arg) = (%_ToName(arg));
macro JSON_NUMBER_TO_STRING(arg) = ((%_IsSmi(%IS_VAR(arg)) || arg - arg == 0) ? %_NumberToString(arg) : "null");
macro HAS_OWN_PROPERTY(arg, index) = (%_Call(ObjectHasOwnProperty, arg, index));
-macro HAS_INDEX(array, index, is_array) = ((is_array && %_HasFastPackedElements(%IS_VAR(array))) ? (index < array.length) : (index in array));
+macro HAS_INDEX(array, index, is_array) = ((is_array && %_HasFastPackedElements(%IS_VAR(array)) && (index < array.length)) || (index in array));
# Private names.
macro IS_PRIVATE(sym) = (%SymbolIsPrivate(sym));
« src/js/array.js ('K') | « src/js/array.js ('k') | test/mjsunit/array-foreach.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698