jsonerrorbuffer.js 584 B

1234567891011121314
  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. let desiredLength = 10 * 1000 * 1000;
  6. let threw = false;
  7. const json = `"${'a'.repeat(desiredLength - 3)}",`;
  8. try {
  9. JSON.parse(json);
  10. } catch(e) {
  11. threw = true;
  12. }
  13. print(threw ? "Pass" : "Fail");