constructor.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 foo(x) {
  6. this.x = x;
  7. }
  8. var f = new foo(10);
  9. foo.prototype = { y : 10 };
  10. var f1 = new foo(20);
  11. function bar(x, y) {
  12. this.x1 = x;
  13. this.x2 = x;
  14. this.x3 = x;
  15. this.x4 = x;
  16. this.x5 = x;
  17. this.x6 = x;
  18. this.x7 = x;
  19. this.x8 = x;
  20. this.x9 = x;
  21. this.y1 = y;
  22. this.y2 = y;
  23. this.y3 = y;
  24. this.y4 = y;
  25. this.y5 = y;
  26. this.y6 = y;
  27. this.y7 = y;
  28. this.y8 = y;
  29. this.y9 = y;
  30. }
  31. var b1 = new bar(10, 20);
  32. var b2 = new bar(30, 40);
  33. WScript.SetTimeout(testFunction, 50);
  34. /////////////////
  35. function testFunction()
  36. {
  37. telemetryLog(`f.y ${f.y}`, true);
  38. telemetryLog(`f1.y ${f1.y}`, true);
  39. telemetryLog(`b2.y8 ${b2.y8}`, true);
  40. emitTTDLog(ttdLogURI);
  41. }