Changeset 233657 in webkit for trunk/Source/JavaScriptCore/runtime/RegExp.cpp
- Timestamp:
- Jul 9, 2018, 2:29:41 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/RegExp.cpp
r233621 r233657 506 506 #endif 507 507 508 static CString regexpToSourceString(const RegExp* regExp) 509 { 510 char postfix[7] = { '/', 0, 0, 0, 0, 0, 0 }; 511 int index = 1; 512 if (regExp->global()) 513 postfix[index++] = 'g'; 514 if (regExp->ignoreCase()) 515 postfix[index++] = 'i'; 516 if (regExp->multiline()) 517 postfix[index] = 'm'; 518 if (regExp->dotAll()) 519 postfix[index++] = 's'; 520 if (regExp->unicode()) 521 postfix[index++] = 'u'; 522 if (regExp->sticky()) 523 postfix[index++] = 'y'; 524 525 return toCString("/", regExp->pattern().impl(), postfix); 526 } 527 528 void RegExp::dumpToStream(const JSCell* cell, PrintStream& out) 529 { 530 out.print(regexpToSourceString(jsCast<const RegExp*>(cell))); 531 } 532 508 533 } // namespace JSC
Note:
See TracChangeset
for help on using the changeset viewer.