forIn.error.js 706 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. // WinBlue 194710: wrong line/col number in exception from inside for in.
  6. function foo()
  7. {
  8. for (var p in c) // Error: c is undefined.
  9. {
  10. addPropertyName(p);
  11. }
  12. }
  13. try
  14. {
  15. foo();
  16. }
  17. catch (ex)
  18. {
  19. var truncatedPathStack = ex.stack.replace(/\(.*\\/g, "(");
  20. WScript.Echo(truncatedPathStack);
  21. }