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

Unified Diff: test/mjsunit/json.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/instanceof-2.js ('k') | test/mjsunit/keyed-call-generic.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/json.js
diff --git a/test/mjsunit/json.js b/test/mjsunit/json.js
index bead376f84da7b82796ec6cdd18ab94a26254bc8..f237922acfdb2b03754eb384bbc8bc6026c851eb 100644
--- a/test/mjsunit/json.js
+++ b/test/mjsunit/json.js
@@ -27,8 +27,10 @@
// Date toJSON
assertEquals("1970-01-01T00:00:00.000Z", new Date(0).toJSON());
-assertEquals("1979-01-11T08:00:00.000Z", new Date("1979-01-11 08:00 GMT").toJSON());
-assertEquals("2005-05-05T05:05:05.000Z", new Date("2005-05-05 05:05:05 GMT").toJSON());
+assertEquals("1979-01-11T08:00:00.000Z",
+ new Date("1979-01-11 08:00 GMT").toJSON());
+assertEquals("2005-05-05T05:05:05.000Z",
+ new Date("2005-05-05 05:05:05 GMT").toJSON());
var n1 = new Date(10000);
n1.toISOString = function () { return "foo"; };
assertEquals("foo", n1.toJSON());
@@ -329,11 +331,17 @@ for (var i = 0; i < 65536; i++) {
expected = '\\' + string;
} else if ("\b\t\n\r\f".indexOf(string) >= 0) {
// Step 2.b
- if (string == '\b') expected = '\\b';
- else if (string == '\t') expected = '\\t';
- else if (string == '\n') expected = '\\n';
- else if (string == '\f') expected = '\\f';
- else if (string == '\r') expected = '\\r';
+ if (string == '\b') {
+ expected = '\\b';
+ } else if (string == '\t') {
+ expected = '\\t';
+ } else if (string == '\n') {
+ expected = '\\n';
+ } else if (string == '\f') {
+ expected = '\\f';
+ } else if (string == '\r') {
+ expected = '\\r';
+ }
} else if (i < 32) {
// Step 2.c
if (i < 16) {
@@ -357,7 +365,7 @@ numFoo.valueOf = "not callable";
numFoo.toString = function() { return "foo"; };
var numTrue = new Number(42);
-numTrue.valueOf = function() { return true; }
+numTrue.valueOf = function() { return true; };
var strFoo = new String("bar");
strFoo.toString = function() { return "foo"; };
@@ -367,7 +375,7 @@ str37.toString = "not callable";
str37.valueOf = function() { return 37; };
var strTrue = new String("bar");
-strTrue.toString = function() { return true; }
+strTrue.toString = function() { return true; };
var func = function() { /* Is callable */ };
@@ -408,7 +416,7 @@ oddball3.__proto__ = { __proto__: null,
toString: "not callable",
valueOf: function() { return true; } };
oddball2.__proto__ = { __proto__: null,
- toJSON: function () { return oddball3; } }
+ toJSON: function () { return oddball3; } };
assertEquals('"true"', JSON.stringify(oddball2));
@@ -427,6 +435,3 @@ assertEquals('"42"', JSON.stringify(falseNum));
var o = JSON.parse('{"__proto__":5}');
assertEquals(Object.prototype, o.__proto__); // __proto__ isn't changed.
assertEquals(0, Object.keys(o).length); // __proto__ isn't added as enumerable.
-
-
-
« no previous file with comments | « test/mjsunit/instanceof-2.js ('k') | test/mjsunit/keyed-call-generic.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698