sliceArrayForceBtreeBug616623.js 1.2 KB

123456789101112131415161718192021222324252627282930313233
  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. if (this.WScript && this.WScript.LoadScriptFile) { // Check for running in ch
  6. this.WScript.LoadScriptFile("..\\UnitTestFramework\\UnitTestFramework.js");
  7. }
  8. function test0()
  9. {
  10. var IntArr1 = new Array();
  11. IntArr1[9] = 9;
  12. for (var v1 = 10; v1 >= 0; v1--) {
  13. Object.prototype[v1] = "d";
  14. }
  15. Object.defineProperty(Array.prototype, '4', {value: "four"});
  16. return IntArr1.slice().toString();
  17. }
  18. var tests = [
  19. {
  20. name: "slice interpreted baseline test",
  21. body: function ()
  22. {
  23. var a = test0(); //interpreted
  24. var b = test0();
  25. assert.areEqual(a,b,"b should equal the results of the interpreted run");
  26. assert.areEqual("d,d,d,d,four,d,d,d,d,9",b,"redundant test to make sure both a and b did not change");
  27. }
  28. }
  29. ];
  30. testRunner.runTests(tests, { verbose: WScript.Arguments[0] != "summary" });