catchsymbolvar.js 693 B

123456789101112131415161718192021
  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. function echo(m) { this.WScript ? WScript.Echo(m) : console.log(m); }
  6. function foo() {
  7. function bar() {
  8. eval("throw new Error('bar')");
  9. }
  10. try {
  11. bar();
  12. } catch (e) {
  13. var e = new Error(); // Win8: 749251. "e" is catch symbol.
  14. echo("pass");
  15. }
  16. }
  17. foo();