Skip to content

Commit 81c2333

Browse files
Added check for trailing whitespaces and corrected existing violations.
Review URL: http://codereview.chromium.org/7826007 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@9094 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
1 parent 96abb63 commit 81c2333

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+187
-170
lines changed

benchmarks/crypto.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1406,7 +1406,7 @@ function rng_seed_int(x) {
14061406

14071407
// Mix in the current time (w/milliseconds) into the pool
14081408
function rng_seed_time() {
1409-
// Use pre-computed date to avoid making the benchmark
1409+
// Use pre-computed date to avoid making the benchmark
14101410
// results dependent on the current date.
14111411
rng_seed_int(1122926989487);
14121412
}

benchmarks/earley-boyer.js

+25-25
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ function sc_rempropBang(sym, key) {
134134
/*** META ((export #t)) */
135135
function sc_any2String(o) {
136136
return jsstring2string(sc_toDisplayString(o));
137-
}
137+
}
138138

139139
/*** META ((export #t)
140140
(peephole (infix 2 2 "==="))
@@ -923,7 +923,7 @@ function sc_dualAppendBang(l1, l2) {
923923
tmp.cdr = l2;
924924
return l1;
925925
}
926-
926+
927927
/*** META ((export #t)) */
928928
function sc_appendBang() {
929929
var res = null;
@@ -1163,7 +1163,7 @@ sc_Char.readable2char = {
11631163
"us": "\037",
11641164
"sp": "\040",
11651165
"del": "\177"};
1166-
1166+
11671167
sc_Char.prototype.toString = function() {
11681168
return this.val;
11691169
};
@@ -1533,7 +1533,7 @@ function sc_mapBang(proc, l1) {
15331533
}
15341534
return l1_orig;
15351535
}
1536-
1536+
15371537
/*** META ((export #t)) */
15381538
function sc_forEach(proc, l1) {
15391539
if (l1 === undefined)
@@ -1871,7 +1871,7 @@ function sc_jsNew(c) {
18711871
evalStr += ", arguments[" + i + "]";
18721872
evalStr +=")";
18731873
return eval(evalStr);
1874-
}
1874+
}
18751875

18761876
// ======================== RegExp ====================
18771877
/*** META ((export #t)) */
@@ -1883,9 +1883,9 @@ function sc_pregexp(re) {
18831883
function sc_pregexpMatch(re, s) {
18841884
var reg = (re instanceof RegExp) ? re : sc_pregexp(re);
18851885
var tmp = reg.exec(sc_string2jsstring(s));
1886-
1886+
18871887
if (tmp == null) return false;
1888-
1888+
18891889
var res = null;
18901890
for (var i = tmp.length-1; i >= 0; i--) {
18911891
if (tmp[i] !== null) {
@@ -1896,7 +1896,7 @@ function sc_pregexpMatch(re, s) {
18961896
}
18971897
return res;
18981898
}
1899-
1899+
19001900
/*** META ((export #t)) */
19011901
function sc_pregexpReplace(re, s1, s2) {
19021902
var reg;
@@ -1914,7 +1914,7 @@ function sc_pregexpReplace(re, s1, s2) {
19141914

19151915
return jss1.replace(reg, jss2);
19161916
}
1917-
1917+
19181918
/*** META ((export pregexp-replace*)) */
19191919
function sc_pregexpReplaceAll(re, s1, s2) {
19201920
var reg;
@@ -1945,7 +1945,7 @@ function sc_pregexpSplit(re, s) {
19451945

19461946
return sc_vector2list(tmp);
19471947
}
1948-
1948+
19491949

19501950
/* =========================================================================== */
19511951
/* Other library stuff */
@@ -2136,7 +2136,7 @@ sc_ErrorInputPort.prototype.getNextChar = function() {
21362136
sc_ErrorInputPort.prototype.isCharReady = function() {
21372137
return false;
21382138
};
2139-
2139+
21402140

21412141
/* .............. String port ..........................*/
21422142

@@ -2200,7 +2200,7 @@ sc_Tokenizer.prototype.readToken = function() {
22002200
};
22012201
sc_Tokenizer.prototype.nextToken = function() {
22022202
var port = this.port;
2203-
2203+
22042204
function isNumberChar(c) {
22052205
return (c >= "0" && c <= "9");
22062206
};
@@ -2280,7 +2280,7 @@ sc_Tokenizer.prototype.nextToken = function() {
22802280
else
22812281
return new sc_Token(12/*NUMBER*/, res - 0);
22822282
};
2283-
2283+
22842284
function skipWhitespaceAndComments() {
22852285
var done = false;
22862286
while (!done) {
@@ -2299,7 +2299,7 @@ sc_Tokenizer.prototype.nextToken = function() {
22992299
}
23002300
}
23012301
};
2302-
2302+
23032303
function readDot() {
23042304
if (isWhitespace(port.peekChar()))
23052305
return new sc_Token(10/*DOT*/);
@@ -2429,7 +2429,7 @@ sc_Reader.prototype.read = function() {
24292429

24302430
while (true) {
24312431
var token = tokenizer.peekToken();
2432-
2432+
24332433
switch (token.type) {
24342434
case 2/*CLOSE_PAR*/:
24352435
case 4/*CLOSE_BRACE*/:
@@ -2491,15 +2491,15 @@ sc_Reader.prototype.read = function() {
24912491
else
24922492
throw "bad reference: " + nb;
24932493
};
2494-
2494+
24952495
var tokenizer = this.tokenizer;
24962496

24972497
var token = tokenizer.readToken();
24982498

24992499
// handle error
25002500
if (token.type === 13/*ERROR*/)
25012501
throw token.val;
2502-
2502+
25032503
switch (token.type) {
25042504
case 1/*OPEN_PAR*/:
25052505
case 3/*OPEN_BRACE*/:
@@ -2550,7 +2550,7 @@ function sc_peekChar(port) {
25502550
port = SC_DEFAULT_IN; // THREAD: shared var...
25512551
var t = port.peekChar();
25522552
return t === SC_EOF_OBJECT? t: new sc_Char(t);
2553-
}
2553+
}
25542554
/*** META ((export #t)
25552555
(type bool))
25562556
*/
@@ -2722,7 +2722,7 @@ sc_StringOutputPort.prototype.close = function() {
27222722
function sc_getOutputString(sp) {
27232723
return sc_jsstring2string(sp.res);
27242724
}
2725-
2725+
27262726

27272727
function sc_ErrorOutputPort() {
27282728
}
@@ -2852,7 +2852,7 @@ function sc_newline(p) {
28522852
p = SC_DEFAULT_OUT;
28532853
p.appendJSString("\n");
28542854
}
2855-
2855+
28562856
/* ------------------ write-char ---------------------------------------------------*/
28572857

28582858
/*** META ((export #t)) */
@@ -2927,7 +2927,7 @@ sc_Pair.prototype.sc_toWriteCircleString = function(symb, inList) {
29272927
}
29282928

29292929
var res = "";
2930-
2930+
29312931
if (this[symb] !== undefined) { // implies > 0
29322932
this[symb + "use"] = true;
29332933
if (inList)
@@ -2939,10 +2939,10 @@ sc_Pair.prototype.sc_toWriteCircleString = function(symb, inList) {
29392939

29402940
if (!inList)
29412941
res += "(";
2942-
2942+
29432943
// print car
29442944
res += sc_genToWriteCircleString(this.car, symb);
2945-
2945+
29462946
if (sc_isPair(this.cdr)) {
29472947
res += " " + this.cdr.sc_toWriteCircleString(symb, true);
29482948
} else if (this.cdr !== null) {
@@ -3072,7 +3072,7 @@ function sc_format(s, args) {
30723072
p.appendJSString(arguments[j].toString(2));
30733073
i += 2; j++;
30743074
break;
3075-
3075+
30763076
case 37:
30773077
case 110:
30783078
// %, n
@@ -3186,7 +3186,7 @@ function sc_isEqual(o1, o2) {
31863186
function sc_number2symbol(x, radix) {
31873187
return sc_SYMBOL_PREFIX + sc_number2jsstring(x, radix);
31883188
}
3189-
3189+
31903190
/*** META ((export number->string integer->string)) */
31913191
var sc_number2string = sc_number2jsstring;
31923192

benchmarks/regexp.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
// the popularity of the pages where it occurs and the number of times
3434
// it is executed while loading each page. Furthermore the literal
3535
// letters in the data are encoded using ROT13 in a way that does not
36-
// affect how the regexps match their input. Finally the strings are
36+
// affect how the regexps match their input. Finally the strings are
3737
// scrambled to exercise the regexp engine on different input strings.
3838

3939

@@ -47,7 +47,7 @@ function RegExpSetup() {
4747
regExpBenchmark = new RegExpBenchmark();
4848
RegExpRun(); // run once to get system initialized
4949
}
50-
50+
5151
function RegExpRun() {
5252
regExpBenchmark.run();
5353
}
@@ -1759,6 +1759,6 @@ function RegExpBenchmark() {
17591759
runBlock11();
17601760
}
17611761
}
1762-
1762+
17631763
this.run = run;
17641764
}

build/all.gyp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
1+
# Copyright 2011 the V8 project authors. All rights reserved.
22
# Use of this source code is governed by a BSD-style license that can be
33
# found in the LICENSE file.
44

include/v8.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1656,7 +1656,7 @@ class Object : public Value {
16561656
V8EXPORT bool IsCallable();
16571657

16581658
/**
1659-
* Call an Object as a function if a callback is set by the
1659+
* Call an Object as a function if a callback is set by the
16601660
* ObjectTemplate::SetCallAsFunctionHandler method.
16611661
*/
16621662
V8EXPORT Local<Value> CallAsFunction(Handle<Object> recv,
@@ -3562,7 +3562,7 @@ class V8EXPORT Context {
35623562
* // V8 Now no longer locked.
35633563
* \endcode
35643564
*
3565-
*
3565+
*
35663566
*/
35673567
class V8EXPORT Unlocker {
35683568
public:

src/d8.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1786,7 +1786,7 @@ function decodeLolInfoResponse(body) {
17861786

17871787

17881788
function decodeLolListResponse(body, title) {
1789-
1789+
17901790
var result;
17911791
var total_count = body.count;
17921792
var total_size = body.size;

src/macros.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@
170170
const CAPTURE0 = 3;
171171
const CAPTURE1 = 4;
172172

173-
# PropertyDescriptor return value indices - must match
173+
# PropertyDescriptor return value indices - must match
174174
# PropertyDescriptorIndices in runtime.cc.
175175
const IS_ACCESSOR_INDEX = 0;
176176
const VALUE_INDEX = 1;

test/es5conform/es5conform.status

+3-3
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ chapter15/15.2/15.2.3/15.2.3.3/15.2.3.3-4-214: UNIMPLEMENTED
7575
# NOT IMPLEMENTED: RegExp.prototype.multiline
7676
chapter15/15.2/15.2.3/15.2.3.3/15.2.3.3-4-215: UNIMPLEMENTED
7777

78-
# All of the tests below marked SUBSETFAIL (in 15.2.3.4) fail because
78+
# All of the tests below marked SUBSETFAIL (in 15.2.3.4) fail because
7979
# the tests assumes that objects can not have more properties
80-
# than those described in the spec - but according to spec they can
80+
# than those described in the spec - but according to spec they can
8181
# have additional properties.
82-
# All compareArray calls in these tests could be exchanged with a
82+
# All compareArray calls in these tests could be exchanged with a
8383
# isSubsetOfArray call (I will upload a patch to the es5conform site).
8484

8585
# SUBSETFAIL

test/mjsunit/array-constructor.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ for (var i = 0; i < loop_count; i++) {
7373
a = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8);
7474
assertArrayEquals([0, 1, 2, 3, 4, 5, 6, 7, 8], a);
7575
a = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
76-
assertArrayEquals([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], a);
76+
assertArrayEquals([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], a);
7777
}
7878

7979

@@ -91,9 +91,9 @@ function testConstructOfSizeSize(n) {
9191
var a = eval('[' + str + ']');
9292
var b = eval('new Array(' + str + ')')
9393
var c = eval('Array(' + str + ')')
94-
assertEquals(n, a.length);
95-
assertArrayEquals(a, b);
96-
assertArrayEquals(a, c);
94+
assertEquals(n, a.length);
95+
assertArrayEquals(a, b);
96+
assertArrayEquals(a, c);
9797
}
9898

9999

test/mjsunit/array-iteration.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
a = [0,1];
135135
assertFalse(a.every(function(n, index, array) { array[index] = n + 1; return n == 1;}));
136136
assertArrayEquals([1,1], a);
137-
137+
138138
// Only loop through initial part of array eventhough elements are
139139
// added.
140140
a = [1,1];
@@ -156,23 +156,23 @@
156156
//
157157
(function() {
158158
var a = [0,1,2,3,4];
159-
159+
160160
// Simple use.
161161
var result = [1,2,3,4,5];
162162
assertArrayEquals(result, a.map(function(n) { return n + 1; }));
163163
assertEquals(a, a);
164-
164+
165165
// Use specified object as this object when calling the function.
166166
var o = { delta: 42 }
167167
result = [42,43,44,45,46];
168168
assertArrayEquals(result, a.map(function(n) { return this.delta + n; }, o));
169-
169+
170170
// Modify original array.
171171
a = [0,1,2,3,4];
172172
result = [1,2,3,4,5];
173173
assertArrayEquals(result, a.map(function(n, index, array) { array[index] = n + 1; return n + 1;}));
174174
assertArrayEquals(result, a);
175-
175+
176176
// Only loop through initial part of array eventhough elements are
177177
// added.
178178
a = [0,1,2,3,4];
@@ -197,7 +197,7 @@
197197
// Simple use.
198198
assertTrue(a.some(function(n) { return n == 3}));
199199
assertFalse(a.some(function(n) { return n == 5}));
200-
200+
201201
// Use specified object as this object when calling the function.
202202
var o = { element: 42 };
203203
a = [1,42,3];

test/mjsunit/array-sort.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ TestSpecialCasesInheritedElementSort();
392392

393393
// Test that sort calls compare function with global object as receiver,
394394
// and with only elements of the array as arguments.
395-
function o(v) {
395+
function o(v) {
396396
return {__proto__: o.prototype, val: v};
397397
}
398398
var arr = [o(1), o(2), o(4), o(8), o(16), o(32), o(64), o(128), o(256), o(-0)];

test/mjsunit/bugs/618.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ function C1() {
3232
var c1 = new C1();
3333
assertEquals(23, c1.x);
3434
assertEquals("undefined", typeof c1.y);
35-
35+
3636
// Add setter somewhere on the prototype chain after having constructed the
3737
// first instance.
3838
C1.prototype = { set x(value) { this.y = 23; } };
3939
var c1 = new C1();
4040
assertEquals("undefined", typeof c1.x);
4141
assertEquals(23, c1.y);
42-
42+
4343
// Simple class using inline constructor.
4444
function C2() {
4545
this.x = 23;

0 commit comments

Comments
 (0)