lotsOfLocals.js 637 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. const txt = `
  6. return function() {
  7. "use asm";
  8. function foo() {
  9. ${Array(50000).fill().map((_, i) => `var l${i} = 0.0;`).join("\n")}
  10. }
  11. return foo;
  12. }
  13. `;
  14. const asmModule = (new Function(txt))();
  15. const asmFn = asmModule();
  16. asmFn();
  17. print("PASSED");