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

Unified Diff: src/js/regexp.js

Issue 2295273003: [regexp] Port RegExpCompile and RegExpToString (Closed)
Patch Set: Split up patch Created 4 years, 3 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/builtins/builtins-regexp.cc ('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 e51a6d227a8d40ef2308cfeb1eed557c44656f4f..584d4cdf41bdbe58c76cb3bd9ee22249f34f494a 100644
--- a/src/js/regexp.js
+++ b/src/js/regexp.js
@@ -71,36 +71,6 @@ function RegExpInitialize(object, pattern, flags) {
}
-function PatternFlags(pattern) {
- return (REGEXP_GLOBAL(pattern) ? 'g' : '') +
- (REGEXP_IGNORE_CASE(pattern) ? 'i' : '') +
- (REGEXP_MULTILINE(pattern) ? 'm' : '') +
- (REGEXP_UNICODE(pattern) ? 'u' : '') +
- (REGEXP_STICKY(pattern) ? 'y' : '');
-}
-
-
-// ES#sec-regexp.prototype.compile RegExp.prototype.compile (pattern, flags)
-function RegExpCompileJS(pattern, flags) {
- if (!IS_REGEXP(this)) {
- throw %make_type_error(kIncompatibleMethodReceiver,
- "RegExp.prototype.compile", this);
- }
-
- if (IS_REGEXP(pattern)) {
- if (!IS_UNDEFINED(flags)) throw %make_type_error(kRegExpFlags);
-
- flags = PatternFlags(pattern);
- pattern = REGEXP_SOURCE(pattern);
- }
-
- RegExpInitialize(this, pattern, flags);
-
- // Return undefined for compatibility with JSC.
- // See http://crbug.com/585775 for web compat details.
-}
-
-
function DoRegExpExec(regexp, string, index) {
return %_RegExpExec(regexp, string, index, RegExpLastMatchInfo);
}
@@ -335,18 +305,6 @@ function TrimRegExp(regexp) {
}
-function RegExpToString() {
- if (!IS_RECEIVER(this)) {
- throw %make_type_error(
- kIncompatibleMethodReceiver, 'RegExp.prototype.toString', this);
- }
- if (this === GlobalRegExp.prototype) {
- %IncrementUseCounter(kRegExpPrototypeToString);
- }
- return '/' + TO_STRING(this.source) + '/' + TO_STRING(this.flags);
-}
-
-
function AtSurrogatePair(subject, index) {
if (index + 1 >= subject.length) return false;
var first = %_StringCharCodeAt(subject, index);
@@ -929,8 +887,6 @@ function RegExpSubclassSearch(string) {
utils.InstallFunctions(GlobalRegExp.prototype, DONT_ENUM, [
"exec", RegExpSubclassExecJS,
"test", RegExpSubclassTest,
- "toString", RegExpToString,
- "compile", RegExpCompileJS,
matchSymbol, RegExpSubclassMatch,
replaceSymbol, RegExpSubclassReplace,
searchSymbol, RegExpSubclassSearch,
« no previous file with comments | « src/builtins/builtins-regexp.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698