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

Unified Diff: src/js/string.js

Issue 1419823010: Implement flag and source getters on RegExp.prototype. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@rproto
Patch Set: new webkit expectations Created 5 years, 1 month 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
« src/bootstrapper.cc ('K') | « src/js/regexp.js ('k') | src/js/symbol.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/string.js
diff --git a/src/js/string.js b/src/js/string.js
index 0fdd7ae342f88225165304c25920a4ba574445f2..33ac96577e701e94899057909abbb27cec0aeae3 100644
--- a/src/js/string.js
+++ b/src/js/string.js
@@ -19,6 +19,7 @@ var MakeRangeError;
var MakeTypeError;
var RegExpExec;
var RegExpExecNoTests;
+var regExpFlagsSymbol = utils.ImportNow("regexp_flags_symbol");
var RegExpLastMatchInfo;
utils.Import(function(from) {
@@ -155,7 +156,7 @@ function StringMatchJS(regexp) {
var subject = TO_STRING(this);
if (IS_REGEXP(regexp)) {
- if (!regexp.global) return RegExpExecNoTests(regexp, subject, 0);
+ if (!REGEXP_GLOBAL(regexp)) return RegExpExecNoTests(regexp, subject, 0);
var result = %StringMatch(subject, regexp, RegExpLastMatchInfo);
regexp.lastIndex = 0;
return result;
@@ -225,7 +226,7 @@ function StringReplace(search, replace) {
if (!IS_CALLABLE(replace)) {
replace = TO_STRING(replace);
- if (!search.global) {
+ if (!REGEXP_GLOBAL(search)) {
// Non-global regexp search, string replace.
var match = RegExpExec(search, subject, 0);
if (match == null) {
@@ -247,7 +248,7 @@ function StringReplace(search, replace) {
subject, search, replace, RegExpLastMatchInfo);
}
- if (search.global) {
+ if (REGEXP_GLOBAL(search)) {
// Global regexp search, function replace.
return StringReplaceGlobalRegExpWithFunction(subject, search, replace);
}
« src/bootstrapper.cc ('K') | « src/js/regexp.js ('k') | src/js/symbol.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698