IntlInternalsHiddenFromFirstChanceExceptionStackTest.js 795 B

123456789101112131415161718
  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. // Tests that internal stack frames from Intl are hidden from the debugger when an exception is thrown.
  6. if (this.WScript) { WScript.LoadScriptFile("../UnitTestFramework/TrimStackTracePath.js"); }
  7. function testFirstChanceException() {
  8. var formatter = new Intl.NumberFormat("INVALID CURRENCY CODE");
  9. }
  10. try {
  11. testFirstChanceException();
  12. }
  13. catch (ex) {
  14. WScript.Echo(TrimStackTracePath(ex.stack));
  15. }