OS_917200.js 753 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. WScript.LoadScriptFile("..\\UnitTestFramework\\UnitTestFramework.js");
  6. function foo() {
  7. function bar() {
  8. eval('[a] = this;');
  9. }
  10. let a;
  11. bar();
  12. }
  13. assert.throws(function () { foo(); }, ReferenceError, "Invalid assignment to array throws runtime reference error when destructuring is disabled", "Invalid left-hand side in assignment");
  14. WScript.Echo("PASS");