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

Side by Side Diff: ui/webui/resources/js/cr/event_target.js

Issue 588713002: Compile print_preview, part 3: reduce down to 185 errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@I_print_preview_2
Patch Set: fix assert Created 6 years, 2 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
« no previous file with comments | « chrome/browser/resources/print_preview/settings/more_settings.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 This contains an implementation of the EventTarget interface 6 * @fileoverview This contains an implementation of the EventTarget interface
7 * as defined by DOM Level 2 Events. 7 * as defined by DOM Level 2 Events.
8 */ 8 */
9 9
10 /** 10 /**
11 * @typedef {EventListener|function(!Event):(boolean|undefined)} 11 * @typedef {EventListener|function(!Event):*}
12 */ 12 */
13 var EventListenerType; 13 var EventListenerType;
14 14
15 cr.define('cr', function() { 15 cr.define('cr', function() {
16 16
17 /** 17 /**
18 * Creates a new EventTarget. This class implements the DOM level 2 18 * Creates a new EventTarget. This class implements the DOM level 2
19 * EventTarget interface and can be used wherever those are used. 19 * EventTarget interface and can be used wherever those are used.
20 * @constructor 20 * @constructor
21 * @implements {EventTarget} 21 * @implements {EventTarget}
22 */ 22 */
23 function EventTarget() { 23 function EventTarget() {
24 } 24 }
25 25
26 EventTarget.prototype = { 26 EventTarget.prototype = {
27
28 /** 27 /**
29 * Adds an event listener to the target. 28 * Adds an event listener to the target.
30 * @param {string} type The name of the event. 29 * @param {string} type The name of the event.
31 * @param {EventListenerType} handler The handler for the event. This is 30 * @param {EventListenerType} handler The handler for the event. This is
32 * called when the event is dispatched. 31 * called when the event is dispatched.
33 */ 32 */
34 addEventListener: function(type, handler) { 33 addEventListener: function(type, handler) {
35 if (!this.listeners_) 34 if (!this.listeners_)
36 this.listeners_ = Object.create(null); 35 this.listeners_ = Object.create(null);
37 if (!(type in this.listeners_)) { 36 if (!(type in this.listeners_)) {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 96
98 return !prevented && !event.defaultPrevented; 97 return !prevented && !event.defaultPrevented;
99 } 98 }
100 }; 99 };
101 100
102 // Export 101 // Export
103 return { 102 return {
104 EventTarget: EventTarget 103 EventTarget: EventTarget
105 }; 104 };
106 }); 105 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/print_preview/settings/more_settings.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698