| 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);
|
| }
|
|
|