MissingPropertyCache1.js 700 B

1234567891011121314151617
  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. // Most basic test of missing property caching.
  6. function test() {
  7. var o = {};
  8. var v = o.a;
  9. WScript.Echo("v = " + v);
  10. }
  11. // Run once, walk the proto chain on the slow path not finding property v anywhere, cache it.
  12. test();
  13. // Retrieve the value of v (undefined) from the missing property cache.
  14. test();