ErrorDotStackAlreadyExists.js 876 B

12345678910111213141516171819202122232425
  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. try {
  6. var e = Error("123");
  7. e.somevalue = "xyz";
  8. e.stack = "abacaba";
  9. WScript.Echo("description = " + e.description);
  10. WScript.Echo("stack = " + e.stack);
  11. for (var p in e) {
  12. WScript.Echo(p + " = " + e[p]);
  13. }
  14. throw e;
  15. }
  16. catch (ex) {
  17. WScript.Echo("----------------------");
  18. WScript.Echo("description = " + e.description);
  19. WScript.Echo("stack = " + e.stack);
  20. for (var p in ex) {
  21. WScript.Echo(p + " = " + ex[p]);
  22. }
  23. }