fieldconstprop_ldmethodfld.js 625 B

12345678910111213141516171819202122
  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. // Testing constant prop into LdMethodFld
  6. function Test1()
  7. {
  8. var a = new Object();
  9. a.x = 1;
  10. return a.x(); // Generate LdMethodFld, and 1 is copy prop'd here.
  11. }
  12. try
  13. {
  14. Test1();
  15. }
  16. catch (e)
  17. {
  18. WScript.Echo("PASS");
  19. }