Home | History | Annotate | Download | only in src

Lines Matching refs:RegExp

31 var $RegExp = global.RegExp;
36 // RegExp : Called as constructor; see ECMA-262, section 15.10.4.
90 // RegExp : Called as function; see ECMA-262, section 15.10.3.1.
94 return new $RegExp(pattern, flags);
98 // Deprecated RegExp.prototype.compile method. We behave like the constructor
99 // were called again. In SpiderMonkey, this method returns the regexp object.
107 // RegExp.prototype.compile and in the constructor, where they are
110 if (this == $RegExp.prototype) {
111 // We don't allow recompiling RegExp.prototype.
113 ['RegExp.prototype.compile', this]);
123 function DoRegExpExec(regexp, string, index) {
124 var result = %_RegExpExec(regexp, string, index, lastMatchInfo);
160 function RegExpExecNoTests(regexp, string, start) {
161 // Must be called with RegExp, string and positive integer as arguments.
162 var matchInfo = %_RegExpExec(regexp, string, start, lastMatchInfo);
174 ['RegExp.prototype.exec', this]);
180 // Conversion is required by the ES5 specification (RegExp.prototype.exec
194 %_Log('regexp', 'regexp-exec,%0r,%1S,%2i', [this, string, lastIndex]);
212 // One-element cache for the simplified test regexp.
223 ['RegExp.prototype.test', this]);
229 // Conversion is required by the ES5 specification (RegExp.prototype.exec
238 %_Log('regexp', 'regexp-exec,%0r,%1S,%2i', [this, string, lastIndex]);
249 // Non-global regexp.
250 // Remove irrelevant preceeding '.*' in a non-global test regexp.
253 var regexp = this;
254 if (%_StringCharCodeAt(regexp.source, 0) == 46 && // '.'
255 %_StringCharCodeAt(regexp.source, 1) == 42 && // '*'
256 %_StringCharCodeAt(regexp.source, 2) != 63) { // '?'
257 regexp = TrimRegExp(regexp);
259 %_Log('regexp', 'regexp-exec,%0r,%1S,%2i', [regexp, string, lastIndex]);
261 var matchIndices = %_RegExpExec(regexp, string, 0, lastMatchInfo);
268 function TrimRegExp(regexp) {
269 if (!%_ObjectEquals(regexp_key, regexp)) {
270 regexp_key = regexp;
272 new $RegExp(SubString(regexp.source, 2, regexp.source.length),
273 (regexp.ignoreCase ? regexp.multiline ? "im" : "i"
274 : regexp.multiline ? "m" : ""));
283 // ecma_2/RegExp/properties-001.js.
294 // rightContext of the RegExp constructor. The properties are computed based
380 // regexp match. The property lastMatchInfo includes the matchIndices
381 // array of the last successful regexp match (an array of start/end index
394 // Used internally by replace regexp with function.
403 %FunctionSetInstanceClassName($RegExp, 'RegExp');
404 %SetProperty($RegExp.prototype, 'constructor', $RegExp, DONT_ENUM);
405 %SetCode($RegExp, RegExpConstructor);
407 InstallFunctions($RegExp.prototype, DONT_ENUM, $Array(
415 %FunctionSetLength($RegExp.prototype.compile, 1);
428 %DefineOrRedefineAccessorProperty($RegExp, 'input', RegExpGetInput,
430 %DefineOrRedefineAccessorProperty($RegExp, '$_', RegExpGetInput,
432 %DefineOrRedefineAccessorProperty($RegExp, '$input', RegExpGetInput,
438 // the value of the expression 'RegExp.multiline = null' (for instance) is the
447 %DefineOrRedefineAccessorProperty($RegExp, 'multiline', RegExpGetMultiline,
449 %DefineOrRedefineAccessorProperty($RegExp, '$*', RegExpGetMultiline,
458 %DefineOrRedefineAccessorProperty($RegExp, 'lastMatch', RegExpGetLastMatch,
460 %DefineOrRedefineAccessorProperty($RegExp, '$&', RegExpGetLastMatch,
462 %DefineOrRedefineAccessorProperty($RegExp, 'lastParen', RegExpGetLastParen,
464 %DefineOrRedefineAccessorProperty($RegExp, '$+', RegExpGetLastParen,
466 %DefineOrRedefineAccessorProperty($RegExp, 'leftContext',
469 %DefineOrRedefineAccessorProperty($RegExp, '$`', RegExpGetLeftContext,
471 %DefineOrRedefineAccessorProperty($RegExp, 'rightContext',
474 %DefineOrRedefineAccessorProperty($RegExp, "$'", RegExpGetRightContext,
478 %DefineOrRedefineAccessorProperty($RegExp, '$' + i,