| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // <include src="assert.js"> | 5 // <include src="assert.js"> |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Alias for document.getElementById. Found elements must be HTMLElements. | 8 * Alias for document.getElementById. Found elements must be HTMLElements. |
| 9 * @param {string} id The ID of the element to find. | 9 * @param {string} id The ID of the element to find. |
| 10 * @return {HTMLElement} The found element or null if not found. | 10 * @return {HTMLElement} The found element or null if not found. |
| (...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 case 0xdb: return '['; | 479 case 0xdb: return '['; |
| 480 case 0xdd: return ']'; | 480 case 0xdd: return ']'; |
| 481 } | 481 } |
| 482 return 'Unidentified'; | 482 return 'Unidentified'; |
| 483 } | 483 } |
| 484 }); | 484 }); |
| 485 } else { | 485 } else { |
| 486 window.console.log("KeyboardEvent.Key polyfill not required"); | 486 window.console.log("KeyboardEvent.Key polyfill not required"); |
| 487 } | 487 } |
| 488 // </if> /* is_ios */ | 488 // </if> /* is_ios */ |
| 489 |
| 490 /** |
| 491 * Helper to convert callback-based define() API to a promise-based API. |
| 492 * @suppress {undefinedVars} |
| 493 * @param {!Array<string>} moduleNames |
| 494 * @return {!Promise} |
| 495 */ |
| 496 function importModules(moduleNames) { |
| 497 return new Promise(function(resolve) { |
| 498 define(moduleNames, function() { |
| 499 resolve(Array.from(arguments)); |
| 500 }); |
| 501 }); |
| 502 } |
| OLD | NEW |