letconst_global_bug.js 830 B

12345678910111213141516
  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. // Bug OS 101821 (BLUE 588397)
  6. let x = 5;
  7. // If the inline slot capacity of the GlobalObject was increased (to at least 116?)
  8. // then this assignment, this.x = 10, ended up throwing a Use Before Declaration error
  9. // which, of course, is incorrect. It should allow it and create a property on the
  10. // global object named x which is then shadowed by the let variable for naked accesses
  11. // to x (root accesses).
  12. this.x = 10;
  13. WScript.Echo("pass");