evenMoreFuncExpr3.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. var obj = [];
  7. var proto = [];
  8. var count = 2;
  9. for(var i = 0; i < count; ++i)
  10. {
  11. obj[i] = (new (g=function f() { this.x=3; })());
  12. proto[i] = g;
  13. }
  14. for(var i = 0; i < count; ++i)
  15. {
  16. write("Testing object " + i + "............");
  17. for(var j = 0; j < count; ++j)
  18. {
  19. write("obj[" + i + "] instanceof proto[" + j + "] : " + (obj[i] instanceof proto[j]));
  20. }
  21. }
  22. proto[0].prototype.z = "proto[0].z";
  23. proto[0].prototype.w = "proto[0].w";
  24. write("Checking properties .........");
  25. for(var i = 0; i < count; ++i)
  26. {
  27. write("obj[" + i + "].z : " + obj[i].z);
  28. write("obj[" + i + "].w : " + obj[i].w);
  29. }
  30. var a = function x() {
  31. function foo() {
  32. "use strict";
  33. x = 1;
  34. };
  35. }