forked from facebook/hermes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement RegExp.prototype[@@search] in JS
Summary: Implement `RegExp.prototype[@search]` in JS Reviewed By: dulinriley Differential Revision: D18256656 fbshipit-source-id: af47c639823e1dfda05260ce58f93212201984c3
- Loading branch information
1 parent
bed3129
commit 3d4f268
Showing
4 changed files
with
155 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
|
||
(function() { | ||
var numIter = 200000; | ||
var len = 2000; | ||
var s = 'abcd'.repeat(len); | ||
var rx = /d.+d/g; | ||
|
||
var _SymbolSearch = Symbol.search; | ||
for (var i = 0; i < numIter; i++) { | ||
rx[_SymbolSearch](s); | ||
} | ||
|
||
print('done'); | ||
})(); |