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

Side by Side Diff: remoting/webapp/crd/js/typecheck.js

Issue 803653004: Update Chromoting to use /third_party/closure_compiler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 /** 5 /**
6 * Get the |key| attribute in the given |dict| and verify that it is an 6 * Get the |key| attribute in the given |dict| and verify that it is an
7 * array value. 7 * array value.
8 * 8 *
9 * If the attribute is not an array, then an exception will be thrown unless 9 * If the attribute is not an array, then an exception will be thrown unless
10 * a default value is specified in |opt_default|. 10 * a default value is specified in |opt_default|.
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 /** 130 /**
131 * Return a JSON object parsed from a string. 131 * Return a JSON object parsed from a string.
132 * 132 *
133 * If the string cannot be parsed, or does not result in an object, then an 133 * If the string cannot be parsed, or does not result in an object, then an
134 * exception will be thrown. 134 * exception will be thrown.
135 * 135 *
136 * @param {string} jsonString The JSON string to parse. 136 * @param {string} jsonString The JSON string to parse.
137 * @return {Object} The JSON object created from the |jsonString|. 137 * @return {Object} The JSON object created from the |jsonString|.
138 */ 138 */
139 function getJsonObjectFromString(jsonString) { 139 function getJsonObjectFromString(jsonString) {
140 var value = /** @type {Object} */ JSON.parse(jsonString); 140 var value = base.jsonParseSafe(jsonString);
141 if (typeof value != 'object') { 141 if (typeof value != 'object') {
142 throw 'Invalid data type (expected: Object, actual: ' + typeof value + ')'; 142 throw 'Invalid data type (expected: Object, actual: ' + typeof value + ')';
143 } 143 }
144 return value; 144 return value;
145 } 145 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698