| Index: ui/webui/resources/js/util.js
|
| diff --git a/ui/webui/resources/js/util.js b/ui/webui/resources/js/util.js
|
| index d33663fce350ae2e39295def3210a2775973a611..9f299674db0458edbfca59071dfc61aa917ea53a 100644
|
| --- a/ui/webui/resources/js/util.js
|
| +++ b/ui/webui/resources/js/util.js
|
| @@ -486,3 +486,17 @@ if (!('key' in KeyboardEvent.prototype)) {
|
| window.console.log("KeyboardEvent.Key polyfill not required");
|
| }
|
| // </if> /* is_ios */
|
| +
|
| +/**
|
| + * Helper to convert callback-based define() API to a promise-based API.
|
| + * @suppress {undefinedVars}
|
| + * @param {!Array<string>} moduleNames
|
| + * @return {!Promise}
|
| + */
|
| +function importModules(moduleNames) {
|
| + return new Promise(function(resolve) {
|
| + define(moduleNames, function() {
|
| + resolve(Array.from(arguments));
|
| + });
|
| + });
|
| +}
|
|
|