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

Unified Diff: Source/devtools/front_end/utilities.js

Issue 199793022: DevTools: Fix a bug in Array.remove (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Turned back to a simple version. Created 6 years, 9 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 | « LayoutTests/inspector/utilities-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/utilities.js
diff --git a/Source/devtools/front_end/utilities.js b/Source/devtools/front_end/utilities.js
index 66d9aacc83b5ff9f4aacce4c3fe94eda9bf9612e..38d6396e80464ef0f87bed6059d6b8f8e49e0e1f 100644
--- a/Source/devtools/front_end/utilities.js
+++ b/Source/devtools/front_end/utilities.js
@@ -374,23 +374,22 @@ Object.defineProperty(Array.prototype, "remove",
{
/**
* @param {!T} value
- * @param {boolean=} onlyFirst
+ * @param {boolean=} firstOnly
* @this {Array.<!T>}
* @template T
*/
- value: function(value, onlyFirst)
+ value: function(value, firstOnly)
{
- if (onlyFirst) {
+ if (firstOnly) {
var index = this.indexOf(value);
if (index !== -1)
this.splice(index, 1);
return;
}
- var length = this.length;
- for (var i = 0; i < length; ++i) {
+ for (var i = 0; i < this.length; ++i) {
if (this[i] === value)
- this.splice(i, 1);
+ this.splice(i--, 1);
}
}
});
« no previous file with comments | « LayoutTests/inspector/utilities-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698