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

Unified Diff: src/array.js

Issue 8701006: Clean up JavaScript files to better follow coding standard. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Remove more empty statments and fix bug. Created 9 years, 1 month 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 | src/d8.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/array.js
diff --git a/src/array.js b/src/array.js
index 3e01a74bc29305fb6ce9145fb6b493448bcb26dd..3d8e278b9ea07670ef7cce7b2103ede1b56d5c62 100644
--- a/src/array.js
+++ b/src/array.js
@@ -328,8 +328,9 @@ function SimpleSlice(array, start_i, del_count, len, deleted_elements) {
// would be the appropriate test. We follow KJS in consulting the
// prototype.
var current = array[index];
- if (!IS_UNDEFINED(current) || index in array)
+ if (!IS_UNDEFINED(current) || index in array) {
deleted_elements[i] = current;
+ }
}
}
@@ -495,12 +496,12 @@ function SparseReverse(array, len) {
if (j_complement <= i) {
high = j;
- while (keys[--high_counter] == j);
+ while (keys[--high_counter] == j) { }
low = j_complement;
}
if (j_complement >= i) {
low = i;
- while (keys[++low_counter] == i);
+ while (keys[++low_counter] == i) { }
high = len - i - 1;
}
@@ -576,10 +577,11 @@ function ArrayShift() {
var first = this[0];
- if (IS_ARRAY(this))
+ if (IS_ARRAY(this)) {
SmartMove(this, 0, 1, len, 0);
- else
+ } else {
SimpleMove(this, 0, 1, len, 0);
+ }
this.length = len - 1;
@@ -596,10 +598,11 @@ function ArrayUnshift(arg1) { // length == 1
var len = TO_UINT32(this.length);
var num_arguments = %_ArgumentsLength();
- if (IS_ARRAY(this))
+ if (IS_ARRAY(this)) {
SmartMove(this, 0, 0, len, num_arguments);
- else
+ } else {
SimpleMove(this, 0, 0, len, num_arguments);
+ }
for (var i = 0; i < num_arguments; i++) {
this[i] = %_Arguments(i);
« no previous file with comments | « no previous file | src/d8.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698