OLD | NEW |
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 // Module "console" | 5 // Module "console" |
6 // | 6 // |
7 // This module provides basic logging support. The reason to define this module | 7 // This module provides basic logging support. The reason to define this module |
8 // to forward calls to the |console| object exposed by the browser, instead of | 8 // to forward calls to the |console| object exposed by the browser, instead of |
9 // using that object directly: mojo JS bindings are currently loaded using gin | 9 // using that object directly: mojo JS bindings are currently loaded using gin |
10 // and the |console| object is not always available. | 10 // and the |console| object is not always available. When the Mojo JS bindings |
11 // | 11 // move away from gin, this module could be removed. |
12 // TODO(crbug.com/703380): When the Mojo JS bindings move away from gin, | |
13 // this module could be removed. | |
14 | 12 |
15 define("console", [], function() { | 13 define("console", [], function() { |
16 /** | 14 /** |
17 * Logs a message to the console. | 15 * Logs a message to the console. |
18 * @param {string} message to log. | 16 * @param {string} message to log. |
19 */ | 17 */ |
20 function log(message) { | 18 function log(message) { |
21 console.log(message); | 19 console.log(message); |
22 } | 20 } |
23 | 21 |
24 var exports = {}; | 22 var exports = {}; |
25 exports.log = log; | 23 exports.log = log; |
26 return exports; | 24 return exports; |
27 }); | 25 }); |
OLD | NEW |