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

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

Issue 2603443002: Clang format JS: Disallow single line functions, conditionals, loops, and switch statements (Closed)
Patch Set: more options 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 PromiseResolver is a helper class that allows creating a 6 * @fileoverview PromiseResolver is a helper class that allows creating a
7 * Promise that will be fulfilled (resolved or rejected) some time later. 7 * Promise that will be fulfilled (resolved or rejected) some time later.
8 * 8 *
9 * Example: 9 * Example:
10 * var resolver = new PromiseResolver(); 10 * var resolver = new PromiseResolver();
(...skipping 18 matching lines...) Expand all
29 29
30 /** @private {!Promise<T>} */ 30 /** @private {!Promise<T>} */
31 this.promise_ = new Promise(function(resolve, reject) { 31 this.promise_ = new Promise(function(resolve, reject) {
32 this.resolve_ = resolve; 32 this.resolve_ = resolve;
33 this.reject_ = reject; 33 this.reject_ = reject;
34 }.bind(this)); 34 }.bind(this));
35 } 35 }
36 36
37 PromiseResolver.prototype = { 37 PromiseResolver.prototype = {
38 /** @return {!Promise<T>} */ 38 /** @return {!Promise<T>} */
39 get promise() { return this.promise_; }, 39 get promise() {
40 set promise(p) { assertNotReached(); }, 40 return this.promise_;
41 },
42 set promise(p) {
43 assertNotReached();
44 },
41 45
42 /** @return {function(T=): void} */ 46 /** @return {function(T=): void} */
43 get resolve() { return this.resolve_; }, 47 get resolve() {
44 set resolve(r) { assertNotReached(); }, 48 return this.resolve_;
49 },
50 set resolve(r) {
51 assertNotReached();
52 },
45 53
46 /** @return {function(*=): void} */ 54 /** @return {function(*=): void} */
47 get reject() { return this.reject_; }, 55 get reject() {
48 set reject(s) { assertNotReached(); }, 56 return this.reject_;
57 },
58 set reject(s) {
59 assertNotReached();
60 },
49 }; 61 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698