boxedObject.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 xb = new Boolean(true);
  6. var yb = xb;
  7. yb.foob = 3;
  8. var zb = new Boolean(true);
  9. var xn = new Number(5);
  10. var yn = xn;
  11. yn.foon = 3;
  12. var zn = new Number(5);
  13. var xs = new String("bob");
  14. var ys = xs;
  15. ys.foos = 3;
  16. var zs = new String("bob");
  17. WScript.SetTimeout(testFunction, 50);
  18. /////////////////
  19. function testFunction()
  20. {
  21. telemetryLog(`typeof (xb): ${typeof (xb)}`, true); //object"
  22. telemetryLog(`xb === yb: ${xb === yb}`, true); //true
  23. telemetryLog(`xb !== zb: ${xb !== zb}`, true); //true
  24. telemetryLog(`xb == true: ${xb == true}`, true); //true
  25. telemetryLog(`xb === true: ${xb === true}`, true); //false
  26. telemetryLog(`xb.foob: ${xb.foob}`, true); //3
  27. telemetryLog(`typeof (xn): ${typeof (xn)}`, true); //object"
  28. telemetryLog(`xn === yn: ${xn === yn}`, true); //true
  29. telemetryLog(`xn !== zn: ${xn !== zn}`, true); //true
  30. telemetryLog(`xn == 5: ${xn == 5}`, true); //true
  31. telemetryLog(`xn === 5: ${xn === 5}`, true); //false
  32. telemetryLog(`xn.foon: ${xn.foon}`, true); //3
  33. telemetryLog(`typeof (xs): ${typeof (xs)}`, true); //object"
  34. telemetryLog(`xs === ys: ${xs === ys}`, true); //true
  35. telemetryLog(`xs !== zs: ${xs !== zs}`, true); //true
  36. telemetryLog(`xs == \'bob\': ${xs == "bob"}`, true); //true
  37. telemetryLog(`xs === \'bob\': ${xs === "bob"}`, true); //false
  38. telemetryLog(`xs.foos: ${xs.foos}`, true); //3
  39. }