bug_OS17830745.js 1.1 KB

1234567891011121314151617181920212223242526
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. // Resolving module2 will result in error (can't find the module file).
  6. // This causes us to mark module3 as having an error.
  7. // Later we resolve module0 which parses correctly.
  8. // This causes us to notify parents which will try to instantiate module3 because
  9. // module0 did not have an error. However, module3 has children modules which were
  10. // not parsed. That put module3 into error state, we should skip instantiating
  11. // module3.
  12. WScript.RegisterModuleSource('module0.js', `
  13. console.log('fail');
  14. `);
  15. WScript.RegisterModuleSource('module3.js', `
  16. import { default as _default } from 'module0.js';
  17. export { } from 'module2.js';
  18. console.log('fail');
  19. `);
  20. WScript.LoadScriptFile('module3.js', 'module');
  21. console.log('pass');