Index: src/regexp.js |
diff --git a/src/regexp.js b/src/regexp.js |
index dc1b0429f7094c5c4fe80d5af5515c8fd2e5fb91..cc9723c8167bb0a3849bd84e4afed106e22f7169 100644 |
--- a/src/regexp.js |
+++ b/src/regexp.js |
@@ -71,32 +71,10 @@ function DoConstructRegExp(object, pattern, flags, isConstructorCall) { |
} |
} |
- if (isConstructorCall) { |
- // ECMA-262, section 15.10.7.1. |
- %SetProperty(object, 'source', pattern, |
- DONT_DELETE | READ_ONLY | DONT_ENUM); |
- |
- // ECMA-262, section 15.10.7.2. |
- %SetProperty(object, 'global', global, DONT_DELETE | READ_ONLY | DONT_ENUM); |
- |
- // ECMA-262, section 15.10.7.3. |
- %SetProperty(object, 'ignoreCase', ignoreCase, |
- DONT_DELETE | READ_ONLY | DONT_ENUM); |
- |
- // ECMA-262, section 15.10.7.4. |
- %SetProperty(object, 'multiline', multiline, |
- DONT_DELETE | READ_ONLY | DONT_ENUM); |
- |
- // ECMA-262, section 15.10.7.5. |
- %SetProperty(object, 'lastIndex', 0, DONT_DELETE | DONT_ENUM); |
- } else { // RegExp is being recompiled via RegExp.prototype.compile. |
- %IgnoreAttributesAndSetProperty(object, 'source', pattern); |
- %IgnoreAttributesAndSetProperty(object, 'global', global); |
- %IgnoreAttributesAndSetProperty(object, 'ignoreCase', ignoreCase); |
- %IgnoreAttributesAndSetProperty(object, 'multiline', multiline); |
- %IgnoreAttributesAndSetProperty(object, 'lastIndex', 0); |
+ if (!isConstructorCall) { |
regExpCache.type = 'none'; |
} |
+ %RegExpInitializeObject(object, pattern, global, ignoreCase, multiline); |
// Call internal function to compile the pattern. |
%RegExpCompile(object, pattern, flags); |