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

Side by Side Diff: ui/webui/resources/js/assert.js

Issue 2597013002: Run clang-format on ui/webui/resources (Closed)
Patch Set: remove cr_shared_menu.js Created 3 years, 12 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 * @fileoverview Assertion support. 6 * @fileoverview Assertion support.
7 */ 7 */
8 8
9 /** 9 /**
10 * Verify |condition| is truthy and return |condition| if so. 10 * Verify |condition| is truthy and return |condition| if so.
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 * @param {*} value The value to check. 58 * @param {*} value The value to check.
59 * @param {function(new: T, ...)} type A user-defined constructor. 59 * @param {function(new: T, ...)} type A user-defined constructor.
60 * @param {string=} opt_message A message to show when this is hit. 60 * @param {string=} opt_message A message to show when this is hit.
61 * @return {T} 61 * @return {T}
62 * @template T 62 * @template T
63 */ 63 */
64 function assertInstanceof(value, type, opt_message) { 64 function assertInstanceof(value, type, opt_message) {
65 // We don't use assert immediately here so that we avoid constructing an error 65 // We don't use assert immediately here so that we avoid constructing an error
66 // message if we don't have to. 66 // message if we don't have to.
67 if (!(value instanceof type)) { 67 if (!(value instanceof type)) {
68 assertNotReached(opt_message || 'Value ' + value + 68 assertNotReached(
69 ' is not a[n] ' + (type.name || typeof type)); 69 opt_message ||
70 'Value ' + value + ' is not a[n] ' + (type.name || typeof type));
70 } 71 }
71 return value; 72 return value;
72 } 73 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698