mojo_private_custom_bindings.js 462 B

123456789101112131415
  1. // Copyright 2015 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. /**
  5. * Custom bindings for the mojoPrivate API.
  6. */
  7. apiBridge.registerCustomHook(function(bindingsAPI) {
  8. let apiFunctions = bindingsAPI.apiFunctions;
  9. apiFunctions.setHandleRequest('requireAsync', function(moduleName) {
  10. return Promise.resolve(require(moduleName).returnValue);
  11. });
  12. });