symbolFor.js 1.0 KB

123456789101112131415161718192021222324252627282930
  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 y = Symbol.for('bob');
  6. WScript.SetTimeout(testFunction, 50);
  7. /////////////////
  8. function testFunction()
  9. {
  10. var x = Symbol.for('ted');
  11. var z = Symbol.for('bob');
  12. var sym1 = Symbol.for('A\0X');
  13. var sym2 = Symbol.for('A\0Y');
  14. var sym3 = Symbol.for('A\0X');
  15. telemetryLog(`x === y: ${x === y}`, true); //false
  16. telemetryLog(`z === y: ${z === y}`, true); //true
  17. telemetryLog(`sym1 === sym2: ${sym1 === sym2}`, true); //false
  18. telemetryLog(`sym1 === sym3: ${sym1 === sym3}`, true); //true
  19. var zo = Symbol('bob');
  20. telemetryLog(`zo === y: ${zo === y}`, true); //false
  21. emitTTDLog(ttdLogURI);
  22. }