262.js 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft Corporation and contributors. All rights reserved.
  3. // Copyright (c) 2021 ChakraCore Project Contributors. All rights reserved.
  4. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  5. //-------------------------------------------------------------------------------------------------------
  6. R"====(
  7. var $262 = {
  8. createRealm: () => WScript.LoadScript('', 'samethread').$262,
  9. global: this,
  10. agent: {
  11. start(src) {
  12. WScript.LoadScript(`
  13. $262 = {
  14. agent: {
  15. receiveBroadcast: WScript.ReceiveBroadcast,
  16. report: WScript.Report,
  17. leaving: WScript.Leaving,
  18. monotonicNow: WScript.monotonicNow
  19. }
  20. };
  21. ${ src }
  22. `, 'crossthread');
  23. },
  24. broadcast: WScript.Broadcast,
  25. sleep: WScript.Sleep,
  26. getReport: WScript.GetReport,
  27. monotonicNow: WScript.monotonicNow
  28. }
  29. };
  30. )===="