Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Unified Diff: src/js/regexp.js

Issue 2384613004: [regexp] Port RegExpConstructor to C++ (Closed)
Patch Set: Rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap-symbols.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/regexp.js
diff --git a/src/js/regexp.js b/src/js/regexp.js
index 2640726fdf1f5b8ab42868f31e631015f2f3a35f..49da45b84c82e28606c0b552b80f14ef22737ef8 100644
--- a/src/js/regexp.js
+++ b/src/js/regexp.js
@@ -81,37 +81,6 @@ function PatternFlags(pattern) {
}
-// ES#sec-regexp-pattern-flags
-// RegExp ( pattern, flags )
-function RegExpConstructor(pattern, flags) {
- var newtarget = new.target;
- var pattern_is_regexp = IsRegExp(pattern);
-
- if (IS_UNDEFINED(newtarget)) {
- newtarget = GlobalRegExp;
-
- // ES6 section 21.2.3.1 step 3.b
- if (pattern_is_regexp && IS_UNDEFINED(flags) &&
- pattern.constructor === newtarget) {
- return pattern;
- }
- }
-
- if (IS_REGEXP(pattern)) {
- if (IS_UNDEFINED(flags)) flags = PatternFlags(pattern);
- pattern = REGEXP_SOURCE(pattern);
-
- } else if (pattern_is_regexp) {
- var input_pattern = pattern;
- pattern = pattern.source;
- if (IS_UNDEFINED(flags)) flags = input_pattern.flags;
- }
-
- var object = %_NewObject(GlobalRegExp, newtarget);
- return RegExpInitialize(object, pattern, flags);
-}
-
-
// ES#sec-regexp.prototype.compile RegExp.prototype.compile (pattern, flags)
function RegExpCompileJS(pattern, flags) {
if (!IS_REGEXP(this)) {
@@ -973,9 +942,6 @@ function RegExpSpecies() {
// -------------------------------------------------------------------
-%FunctionSetInstanceClassName(GlobalRegExp, 'RegExp');
-%SetCode(GlobalRegExp, RegExpConstructor);
-
utils.InstallGetter(GlobalRegExp, speciesSymbol, RegExpSpecies);
utils.InstallFunctions(GlobalRegExp.prototype, DONT_ENUM, [
« no previous file with comments | « src/heap-symbols.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698