moduleImportTheError.js 666 B

123456789101112131415161718192021222324
  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. import {throwError} from "moduleThrowAnError.js";
  6. try
  7. {
  8. throwError();
  9. }
  10. catch(e)
  11. {
  12. let index = e.stack.indexOf("moduleThrowAnError.js");
  13. if(index == -1)
  14. {
  15. WScript.Echo("Fail - url not in stack for module error");
  16. }
  17. else
  18. {
  19. WScript.Echo("Pass");
  20. }
  21. }