Lines Matching defs:source
2 // Use of this source code is governed by a BSD-style license that can be
238 Handle<String> source,
249 return Initialize(regexp, source, flags.value());
263 int CountAdditionalEscapeChars(Handle<String> source, bool* needs_escapes_out) {
268 base::Vector<const Char> src = source->GetCharVector<Char>(no_gc);
317 Handle<StringType> WriteEscapedRegExpSource(Handle<String> source,
320 base::Vector<const Char> src = source->GetCharVector<Char>(no_gc);
371 Handle<String> source) {
372 DCHECK(source->IsFlat());
373 if (source->length() == 0) return isolate->factory()->query_colon_string();
374 bool one_byte = String::IsOneByteRepresentationUnderneath(*source);
377 one_byte ? CountAdditionalEscapeChars<uint8_t>(source, &needs_escapes)
378 : CountAdditionalEscapeChars<base::uc16>(source, &needs_escapes);
379 if (!needs_escapes) return source;
380 int length = source->length() + additional_escape_chars;
386 return WriteEscapedRegExpSource<uint8_t>(source, result);
392 return WriteEscapedRegExpSource<base::uc16>(source, result);
400 Handle<String> source, Flags flags,
404 // If source is the empty string we set it to "(?:)" instead as
406 if (source->length() == 0) source = factory->query_colon_string();
408 source = String::Flatten(isolate, source);
412 RegExp::Compile(isolate, regexp, source, JSRegExp::AsRegExpFlags(flags),
418 EscapeRegExpSource(isolate, source), JSRegExp);