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

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/common/chromevox_json.js

Issue 2757623003: Initial support for accessible text fields and focus tracking in ARC++ (Closed)
Patch Set: Address nits. Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 goog.provide('cvox.ChromeVoxJSON'); 5 goog.provide('cvox.ChromeVoxJSON');
6 6
7 7
8 /** 8 /**
9 * @fileoverview A simple wrapper around the JSON APIs. 9 * @fileoverview A simple wrapper around the JSON APIs.
10 * If it is possible to use the browser's built in native JSON, then 10 * If it is possible to use the browser's built in native JSON, then
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 return isFinite(this.valueOf()) ? 49 return isFinite(this.valueOf()) ?
50 this.getUTCFullYear() + '-' + 50 this.getUTCFullYear() + '-' +
51 f(this.getUTCMonth() + 1) + '-' + 51 f(this.getUTCMonth() + 1) + '-' +
52 f(this.getUTCDate()) + 'T' + 52 f(this.getUTCDate()) + 'T' +
53 f(this.getUTCHours()) + ':' + 53 f(this.getUTCHours()) + ':' +
54 f(this.getUTCMinutes()) + ':' + 54 f(this.getUTCMinutes()) + ':' +
55 f(this.getUTCSeconds()) + 'Z' : 'null'; 55 f(this.getUTCSeconds()) + 'Z' : 'null';
56 }; 56 };
57 57
58 String.prototype.toJSON = 58 Boolean.prototype.toJSON =
59 Number.prototype.toJSON = 59 Number.prototype.toJSON =
60 Boolean.prototype.toJSON = function(key) { 60 String.prototype.toJSON = function(key) {
61 return /** @type {string} */ (this.valueOf()); 61 return /** @type {string} */ (this.valueOf());
62 }; 62 };
63 } 63 }
64 64
65 var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u 202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, 65 var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u 202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
66 escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b 5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, 66 escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b 5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
67 gap, 67 gap,
68 indent, 68 indent,
69 meta = { // table of character substitutions 69 meta = { // table of character substitutions
70 '\b': '\\b', 70 '\b': '\\b',
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 return typeof reviver === 'function' ? walk({'': j}, '') : j; 359 return typeof reviver === 'function' ? walk({'': j}, '') : j;
360 } 360 }
361 361
362 // If the text is not JSON parseable, then a SyntaxError is thrown. 362 // If the text is not JSON parseable, then a SyntaxError is thrown.
363 363
364 throw new SyntaxError('JSON.parse'); 364 throw new SyntaxError('JSON.parse');
365 }; 365 };
366 } 366 }
367 }()); 367 }());
368 } 368 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698