marshalbug.js 811 B

12345678910111213141516171819
  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. const crossSiteDate =
  6. WScript.LoadScript("var x = new Date()", "samethread").x;
  7. // Run every Date method on the cross-site instance
  8. Object.getOwnPropertyNames(Date.prototype)
  9. .filter(name => !name.match(/^set/))
  10. .forEach(name => {
  11. print(name);
  12. try {
  13. print(Date.prototype[name].call(crossSiteDate));
  14. } catch(e) {
  15. // Ignore. Just to catch assertions on debug build.
  16. }
  17. });