inlinecache.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 write(v) { WScript.Echo(v + ""); }
  6. function Test1() {
  7. write(Math.PI);
  8. write(Math.PI);
  9. Math.PI++;
  10. write(Math.PI);
  11. write(Math.PI);
  12. }
  13. Test1();
  14. function Test2() {
  15. var a = [ 10, 20]
  16. write(a.concat());
  17. write(a.concat());
  18. }
  19. Test2();
  20. function Test3() {
  21. function f() { write("in f"); }
  22. var o = {};
  23. Object.defineProperty(o, "x", { writable: false, value: f });
  24. write(o.x);
  25. o.x();
  26. o.x();
  27. write(o.x);
  28. }
  29. Test3();
  30. function Test4() {
  31. Object.defineProperty(this, "x", ({get: function(){}}));
  32. eval("for(var i=0;i< 10; i++ ) {x=20;}");
  33. }
  34. Test4();