regexSplitOptimization.js 576 B

1234567891011121314
  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 test0(){
  6. var s = "aabbcc";
  7. var r = new RegExp(/b/);
  8. r.lastIndex = 15;
  9. s.split(r);
  10. WScript.Echo(r.lastIndex !== 15 ? "Pass" : ("Fail actual value: " + r.lastIndex));
  11. }
  12. test0();
  13. test0();