witheval.js 963 B

1234567891011121314151617181920212223242526272829303132
  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. var x = { a: "x.a", f: function() { return this.a; } };
  6. var y = { a: "y.a", f: function() { return this.a; } };
  7. var a = "glo.a";
  8. function f() {
  9. return this.a;
  10. }
  11. with (x) {
  12. with (y) {
  13. eval("WScript.Echo(f())");
  14. eval("WScript.Echo(x.f(), f())");
  15. }
  16. eval("WScript.Echo(x.f(), f())");
  17. }
  18. eval("WScript.Echo(y.f(), x.f(), f())");
  19. with (Math) {
  20. with (9) {
  21. with (8) {
  22. with (7) {
  23. with (6) {
  24. WScript.Echo(eval("abs(valueOf())"));
  25. }
  26. }
  27. }
  28. }
  29. }