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

Unified Diff: src/array.js

Issue 2840021: Fixes bug in Array.prototype.lastIndexOf when called with null or undefined a... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 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/regress/regress-754.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/array.js
===================================================================
--- src/array.js (revision 4949)
+++ src/array.js (working copy)
@@ -954,7 +954,7 @@
function ArrayIndexOf(element, index) {
var length = this.length;
- if (index == null) {
+ if (IS_UNDEFINED(index)) {
index = 0;
} else {
index = TO_INTEGER(index);
@@ -981,7 +981,7 @@
function ArrayLastIndexOf(element, index) {
var length = this.length;
- if (index == null) {
+ if (%_ArgumentsLength() < 2) {
index = length - 1;
} else {
index = TO_INTEGER(index);
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-754.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698