storeundecl_eval.js 664 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. function print(x) { WScript.Echo(x+''); }
  6. eval('function test2() { x = 10; }');
  7. try { test2(); } catch (e) { print(e); }
  8. Object.defineProperty(this, 'accessor', { configurable: true, get: function () { return false; } });
  9. try { test2(); } catch (e) { print(e); }
  10. let x;