Changeset 289172 in webkit for trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
- Timestamp:
- Feb 6, 2022, 11:17:26 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
r288473 r289172 53 53 54 54 template<unsigned charactersCount> 55 static Bitmap<256> makeCharacterBitmap(const char (&characters)[charactersCount])55 static constexpr Bitmap<256> makeCharacterBitmap(const char (&characters)[charactersCount]) 56 56 { 57 57 static_assert(charactersCount > 0, "Since string literal is null terminated, characterCount is always larger than 0"); … … 545 545 JSC_DEFINE_HOST_FUNCTION(globalFuncDecodeURI, (JSGlobalObject* globalObject, CallFrame* callFrame)) 546 546 { 547 static const Bitmap<256>doNotUnescapeWhenDecodingURI = makeCharacterBitmap(547 static constexpr auto doNotUnescapeWhenDecodingURI = makeCharacterBitmap( 548 548 "#$&+,/:;=?@" 549 549 ); … … 554 554 JSC_DEFINE_HOST_FUNCTION(globalFuncDecodeURIComponent, (JSGlobalObject* globalObject, CallFrame* callFrame)) 555 555 { 556 static const Bitmap<256>emptyBitmap;556 static constexpr auto emptyBitmap; 557 557 return JSValue::encode(decode(globalObject, callFrame->argument(0), emptyBitmap, true)); 558 558 } … … 560 560 JSC_DEFINE_HOST_FUNCTION(globalFuncEncodeURI, (JSGlobalObject* globalObject, CallFrame* callFrame)) 561 561 { 562 static const Bitmap<256>doNotEscapeWhenEncodingURI = makeCharacterBitmap(562 static constexpr auto doNotEscapeWhenEncodingURI = makeCharacterBitmap( 563 563 "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 564 564 "abcdefghijklmnopqrstuvwxyz" … … 571 571 JSC_DEFINE_HOST_FUNCTION(globalFuncEncodeURIComponent, (JSGlobalObject* globalObject, CallFrame* callFrame)) 572 572 { 573 static const Bitmap<256>doNotEscapeWhenEncodingURIComponent = makeCharacterBitmap(573 static constexpr auto doNotEscapeWhenEncodingURIComponent = makeCharacterBitmap( 574 574 "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 575 575 "abcdefghijklmnopqrstuvwxyz" … … 583 583 { 584 584 return JSValue::encode(toStringView(globalObject, callFrame->argument(0), [&] (StringView view) -> JSString* { 585 static const Bitmap<256>doNotEscape = makeCharacterBitmap(585 static constexpr auto doNotEscape = makeCharacterBitmap( 586 586 "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 587 587 "abcdefghijklmnopqrstuvwxyz"
Note:
See TracChangeset
for help on using the changeset viewer.