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

Unified Diff: test/mjsunit/arguments-read-and-assignment.js

Issue 8888006: Make more JS files beter match the coding standard. Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments Created 9 years 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 | « test/mjsunit/arguments-escape.js ('k') | test/mjsunit/array-concat.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/arguments-read-and-assignment.js
diff --git a/test/mjsunit/arguments-read-and-assignment.js b/test/mjsunit/arguments-read-and-assignment.js
index c5d34bfa9b1a96f0eac540db8079a4eadea9f20b..1b521154863eb3faf5d9a919f907c92e89b65b52 100644
--- a/test/mjsunit/arguments-read-and-assignment.js
+++ b/test/mjsunit/arguments-read-and-assignment.js
@@ -27,24 +27,24 @@
// Testing basic functionality of the arguments object.
// Introduced to ensure that the fast compiler does the right thing.
// The arguments object itself.
-assertEquals(42, function(){ return arguments;}(42)[0],
+assertEquals(42, function(){ return arguments; }(42)[0],
"return arguments value");
-assertEquals(42, function(){ return arguments;}(42)[0],
+assertEquals(42, function(){ return arguments; }(42)[0],
"arguments in plain value context");
-assertEquals(42, function(){ arguments;return 42}(37),
+assertEquals(42, function(){ arguments; return 42; }(37),
"arguments in effect context");
-assertEquals(42, function(){ if(arguments)return 42;}(),
+assertEquals(42, function(){ if (arguments) return 42; }(),
"arguments in a boolean context");
-assertEquals(42, function(){ return arguments || true;}(42)[0],
+assertEquals(42, function(){ return arguments || true; }(42)[0],
"arguments in a short-circuit boolean context - or");
-assertEquals(true, function(){ return arguments && [true];}(42)[0],
+assertEquals(true, function(){ return arguments && [true]; }(42)[0],
"arguments in a short-circuit boolean context - and");
-assertEquals(42, function(){ arguments = 42; return 42;}(),
+assertEquals(42, function(){ arguments = 42; return 42; }(),
"arguments assignment");
// Properties of the arguments object.
assertEquals(42, function(){ return arguments[0]; }(42),
"args[0] value returned");
-assertEquals(42, function(){ arguments[0]; return 42}(),
+assertEquals(42, function(){ arguments[0]; return 42; }(),
"args[0] value ignored");
assertEquals(42, function(){ if (arguments[0]) return 42; }(37),
"args[0] to boolean");
@@ -121,10 +121,12 @@ assertEquals(42,
"deep nested capture");
// Assignment to captured parameters.
-assertEquals(42, function(a,b) {
- arguments[1] = 11;
- return a + function(){ a = b; return a; }() + a;
- }(20, 37), "captured assignment");
+assertEquals(42,
+ function(a,b) {
+ arguments[1] = 11;
+ return a + function(){ a = b; return a; }() + a;
+ }(20, 37),
+ "captured assignment");
// Inside non-function scopes.
assertEquals(42,
@@ -150,14 +152,16 @@ assertEquals(42,
arguments[0] = 12;
with ({ b : 22 }) {
return function f() {
- try { throw 8 } catch(e) { return e + a };
- }() + b;
+ try { throw 8; } catch(e) { return e + a; }
+ }() + b;
}
}(37),
"in a catch in a named function captured a in with ");
// Escaping arguments.
-function weirdargs(a,b,c) { if (!a) return arguments;
- return [b[2],c]; }
+function weirdargs(a, b, c) {
+ if (!a) return arguments;
+ return [b[2],c];
+}
var args1 = weirdargs(false, null, 40);
var res = weirdargs(true, args1, 15);
assertEquals(40, res[0], "return old args element");
« no previous file with comments | « test/mjsunit/arguments-escape.js ('k') | test/mjsunit/array-concat.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698