Skip to content

Commit cb3a9da

Browse files
committed
Adopt ASCIILiterals in makeString, tryMakeString, operator+ calls inside JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=252167 Reviewed by Darin Adler. Convert different cases of makeString(), tryMakeString() and StringAppend-producing operator+ calls from using native C string literals to using more-desired ASCIILiterals. * Source/JavaScriptCore/API/glib/JSCCallbackFunction.cpp: (JSC::JSCCallbackFunction::construct): * Source/JavaScriptCore/API/glib/JSCContext.cpp: (jscContextGArrayToJSArray): (jscContextJSArrayToGArray): (jscContextGValueToJSValue): (jscContextJSValueToGValue): * Source/JavaScriptCore/API/glib/JSCValue.cpp: (jsc_value_new_array): (jscValueCallFunction): * Source/JavaScriptCore/API/tests/ExecutionTimeLimitTest.cpp: (testExecutionTimeLimit): * Source/JavaScriptCore/API/tests/testapi.cpp: (TestAPI::markedJSValueArrayAndGC): * Source/JavaScriptCore/assembler/LinkBuffer.cpp: (JSC::LinkBuffer::linkComments): * Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::runSlowPathGenerators): (JSC::DFG::SpeculativeJIT::compileCurrentBlock): * Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq): * Source/JavaScriptCore/inspector/IdentifiersFactory.cpp: (Inspector::addPrefixToIdentifier): * Source/JavaScriptCore/inspector/InjectedScriptBase.cpp: (Inspector::InjectedScriptBase::makeCall): (Inspector::InjectedScriptBase::makeAsyncCall): * Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp: (Inspector::BackendDispatcher::dispatch): (Inspector::BackendDispatcher::getPropertyValue): * Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.cpp: (Inspector::JSGlobalObjectConsoleClient::profile): (Inspector::JSGlobalObjectConsoleClient::profileEnd): (Inspector::JSGlobalObjectConsoleClient::warnUnimplemented): * Source/JavaScriptCore/inspector/agents/InspectorAuditAgent.cpp: (Inspector::InspectorAuditAgent::run): * Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.cpp: (Inspector::InspectorConsoleAgent::enable): (Inspector::InspectorConsoleAgent::startTiming): (Inspector::InspectorConsoleAgent::logTiming): (Inspector::InspectorConsoleAgent::stopTiming): (Inspector::InspectorConsoleAgent::count): (Inspector::InspectorConsoleAgent::countReset): * Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp: (Inspector::objectGroupForBreakpointAction): (Inspector::InspectorDebuggerAgent::ProtocolBreakpoint::ProtocolBreakpoint): * Source/JavaScriptCore/interpreter/Interpreter.cpp: (JSC::Interpreter::executeEval): * Source/JavaScriptCore/jit/JIT.cpp: (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompileSlowCases): * Source/JavaScriptCore/jsc.cpp: (GlobalObject::moduleLoaderImportModule): (GlobalObject::moduleLoaderResolve): (GlobalObject::moduleLoaderFetch): (FunctionJSCStackFunctor::operator() const): (computeFilePath): * Source/JavaScriptCore/parser/Lexer.cpp: (JSC::Lexer<T>::invalidCharacterMessage const): (JSC::Lexer<LChar>::parseIdentifier): (JSC::Lexer<T>::scanRegExp): * Source/JavaScriptCore/parser/Parser.cpp: (JSC::Parser<LexerType>::parseInner): * Source/JavaScriptCore/parser/Parser.h: (JSC::Parser::updateErrorWithNameAndMessage): * Source/JavaScriptCore/runtime/AbstractModuleRecord.cpp: (JSC::AbstractModuleRecord::getModuleNamespace): (JSC::printableName): * Source/JavaScriptCore/runtime/BytecodeCacheError.cpp: (JSC::BytecodeCacheError::WriteError::message const): * Source/JavaScriptCore/runtime/Error.cpp: (JSC::makeDOMAttributeGetterTypeErrorMessage): (JSC::makeDOMAttributeSetterTypeErrorMessage): (JSC::throwConstructorCannotBeCalledAsFunctionTypeError): (JSC::createOutOfMemoryError): * Source/JavaScriptCore/runtime/ErrorInstance.cpp: (JSC::ErrorInstance::sanitizedToString): * Source/JavaScriptCore/runtime/ExceptionHelpers.cpp: (JSC::createUndefinedVariableError): (JSC::defaultApproximateSourceError): (JSC::defaultSourceAppender): (JSC::invalidParameterInSourceAppender): (JSC::invalidParameterInstanceofSourceAppender): (JSC::invalidPrototypeSourceAppender): (JSC::createErrorForInvalidGlobalAssignment): * Source/JavaScriptCore/runtime/FunctionConstructor.cpp: (JSC::stringifyFunction): * Source/JavaScriptCore/runtime/IntlCollator.cpp: (JSC::IntlCollator::initializeCollator): * Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp: (JSC::IntlDateTimeFormat::initializeDateTimeFormat): * Source/JavaScriptCore/runtime/IntlDurationFormat.cpp: (JSC::IntlDurationFormat::initializeDurationFormat): * Source/JavaScriptCore/runtime/IntlNumberFormat.cpp: (JSC::IntlNumberFormat::initializeNumberFormat): * Source/JavaScriptCore/runtime/IntlObject.cpp: (JSC::intlDefaultNumberOption): (JSC::canonicalizeLocaleList): * Source/JavaScriptCore/runtime/IntlRelativeTimeFormat.cpp: (JSC::IntlRelativeTimeFormat::initializeRelativeTimeFormat): * Source/JavaScriptCore/runtime/JSCJSValueInlines.h: (JSC::JSValue::toIndex const): (JSC::JSValue::toTypedArrayIndex const): * Source/JavaScriptCore/runtime/JSCustomGetterFunction.cpp: (JSC::JSCustomGetterFunction::create): * Source/JavaScriptCore/runtime/JSCustomSetterFunction.cpp: (JSC::JSCustomSetterFunction::create): * Source/JavaScriptCore/runtime/JSFunction.cpp: (JSC::makeNameWithOutOfMemoryCheck): * Source/JavaScriptCore/runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::init): * Source/JavaScriptCore/runtime/JSModuleLoader.cpp: (JSC::JSModuleLoader::importModule): (JSC::JSModuleLoader::fetch): * Source/JavaScriptCore/runtime/JSModuleRecord.cpp: (JSC::JSModuleRecord::instantiateDeclarations): * Source/JavaScriptCore/runtime/JSObject.cpp: (JSC::JSObject::putDirectNativeIntrinsicGetter): (JSC::JSObject::putDirectNativeIntrinsicGetterWithoutTransition): * Source/JavaScriptCore/runtime/LiteralParser.cpp: (JSC::LiteralParser<CharType>::Lexer::lex): (JSC::LiteralParser<CharType>::Lexer::lexStringSlow): (JSC::LiteralParser<CharType>::parsePrimitiveValue): * Source/JavaScriptCore/runtime/LiteralParser.h: (JSC::LiteralParser::getErrorMessage): * Source/JavaScriptCore/runtime/NumberPrototype.cpp: (JSC::throwVMToThisNumberError): * Source/JavaScriptCore/runtime/Options.cpp: (JSC::Options::setAliasedOption): * Source/JavaScriptCore/runtime/ProgramExecutable.cpp: (JSC::ProgramExecutable::initializeGlobalProperties): * Source/JavaScriptCore/runtime/ProxyObject.cpp: (JSC::ProxyObject::performPut): (JSC::ProxyObject::performDefineOwnProperty): (JSC::ProxyObject::performGetOwnPropertyNames): * Source/JavaScriptCore/runtime/SamplingProfiler.cpp: (JSC::SamplingProfiler::reportTopBytecodes): * Source/JavaScriptCore/runtime/Symbol.cpp: (JSC::Symbol::descriptiveString const): * Source/JavaScriptCore/wasm/WasmBBQPlan.cpp: (JSC::Wasm::BBQPlan::work): (JSC::Wasm::BBQPlan::compileFunction): (JSC::Wasm::BBQPlan::didCompleteCompilation): * Source/JavaScriptCore/wasm/WasmEntryPlan.cpp: (JSC::Wasm::EntryPlan::prepare): * Source/JavaScriptCore/wasm/WasmEntryPlan.h: (JSC::Wasm::EntryPlan::tryReserveCapacity): * Source/JavaScriptCore/wasm/WasmIndexOrName.cpp: (JSC::Wasm::makeString): * Source/JavaScriptCore/wasm/WasmLLIntPlan.cpp: (JSC::Wasm::LLIntPlan::compileFunction): (JSC::Wasm::LLIntPlan::didCompleteCompilation): * Source/JavaScriptCore/wasm/WasmOMGPlan.cpp: (JSC::Wasm::OMGPlan::work): * Source/JavaScriptCore/wasm/WasmOSREntryPlan.cpp: (JSC::Wasm::OSREntryPlan::work): * Source/JavaScriptCore/wasm/js/WebAssemblyExceptionPrototype.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): * Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp: (JSC::WebAssemblyModuleRecord::initializeImports): Canonical link: https://commits.webkit.org/261376@main
1 parent 8c9ef7c commit cb3a9da

58 files changed

Lines changed: 162 additions & 157 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Source/JavaScriptCore/API/glib/JSCCallbackFunction.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ JSObjectRef JSCCallbackFunction::construct(JSContextRef callerContext, size_t ar
226226
*exception = toRef(JSC::createTypeError(toJS(jsContext), "constructor returned null"_s));
227227
break;
228228
default:
229-
*exception = toRef(JSC::createTypeError(toJS(jsContext), makeString("invalid type ", g_type_name(G_VALUE_TYPE(&returnValue)), " returned by constructor")));
229+
*exception = toRef(JSC::createTypeError(toJS(jsContext), makeString("invalid type "_s, g_type_name(G_VALUE_TYPE(&returnValue)), " returned by constructor"_s)));
230230
break;
231231
}
232232
g_value_unset(&returnValue);

‎Source/JavaScriptCore/API/glib/JSCContext.cpp‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ JSValueRef jscContextGArrayToJSArray(JSCContext* context, GPtrArray* gArray, JSV
294294
else if (JSC_IS_VALUE(item))
295295
JSObjectSetPropertyAtIndex(priv->jsContext.get(), jsArrayObject, i, jscValueGetJSValue(JSC_VALUE(item)), exception);
296296
else
297-
*exception = toRef(JSC::createTypeError(globalObject, makeString("invalid item type in GPtrArray")));
297+
*exception = toRef(JSC::createTypeError(globalObject, "invalid item type in GPtrArray"_s));
298298

299299
if (*exception)
300300
return JSValueMakeUndefined(priv->jsContext.get());
@@ -313,7 +313,7 @@ static GRefPtr<GPtrArray> jscContextJSArrayToGArray(JSCContext* context, JSValue
313313
return nullptr;
314314

315315
if (!JSValueIsArray(priv->jsContext.get(), jsArray)) {
316-
*exception = toRef(JSC::createTypeError(globalObject, makeString("invalid js type for GPtrArray")));
316+
*exception = toRef(JSC::createTypeError(globalObject, "invalid js type for GPtrArray"_s));
317317
return nullptr;
318318
}
319319

@@ -352,7 +352,7 @@ GUniquePtr<char*> jscContextJSArrayToGStrv(JSCContext* context, JSValueRef jsArr
352352
return nullptr;
353353

354354
if (!JSValueIsArray(priv->jsContext.get(), jsArray)) {
355-
*exception = toRef(JSC::createTypeError(globalObject, makeString("invalid js type for GStrv")));
355+
*exception = toRef(JSC::createTypeError(globalObject, "invalid js type for GStrv"_s));
356356
return nullptr;
357357
}
358358

@@ -377,7 +377,7 @@ GUniquePtr<char*> jscContextJSArrayToGStrv(JSCContext* context, JSValueRef jsArr
377377

378378
auto jsValueItem = jscContextGetOrCreateValue(context, jsItem);
379379
if (!jsc_value_is_string(jsValueItem.get())) {
380-
*exception = toRef(JSC::createTypeError(globalObject, makeString("invalid js type for GStrv: item ", String::number(i), " is not a string")));
380+
*exception = toRef(JSC::createTypeError(globalObject, makeString("invalid js type for GStrv: item "_s, i, " is not a string"_s)));
381381
return nullptr;
382382
}
383383

@@ -459,7 +459,7 @@ JSValueRef jscContextGValueToJSValue(JSCContext* context, const GValue* value, J
459459
break;
460460
}
461461

462-
*exception = toRef(JSC::createTypeError(globalObject, makeString("unsupported type ", g_type_name(G_VALUE_TYPE(value)))));
462+
*exception = toRef(JSC::createTypeError(globalObject, makeString("unsupported type "_s, g_type_name(G_VALUE_TYPE(value)))));
463463
return JSValueMakeUndefined(priv->jsContext.get());
464464
}
465465

@@ -579,7 +579,7 @@ void jscContextJSValueToGValue(JSCContext* context, JSValueRef jsValue, GType ty
579579
case G_TYPE_INTERFACE:
580580
case G_TYPE_VARIANT:
581581
default:
582-
*exception = toRef(JSC::createTypeError(globalObject, makeString("unsupported type ", g_type_name(G_VALUE_TYPE(value)))));
582+
*exception = toRef(JSC::createTypeError(globalObject, makeString("unsupported type "_s, g_type_name(G_VALUE_TYPE(value)))));
583583
break;
584584
}
585585
}

‎Source/JavaScriptCore/API/glib/JSCValue.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ JSCValue* jsc_value_new_array(JSCContext* context, GType firstItemType, ...)
497497
GUniqueOutPtr<char> error;
498498
G_VALUE_COLLECT_INIT(&item, itemType, args, G_VALUE_NOCOPY_CONTENTS, &error.outPtr());
499499
if (error) {
500-
exception = toRef(JSC::createTypeError(globalObject, makeString("failed to collect array item: ", error.get())));
500+
exception = toRef(JSC::createTypeError(globalObject, makeString("failed to collect array item: "_s, error.get())));
501501
jscContextHandleExceptionIfNeeded(context, exception);
502502
jsArray = nullptr;
503503
break;
@@ -893,7 +893,7 @@ static GRefPtr<JSCValue> jscValueCallFunction(JSCValue* value, JSObjectRef funct
893893
GUniqueOutPtr<char> error;
894894
G_VALUE_COLLECT_INIT(&parameter, parameterType, args, G_VALUE_NOCOPY_CONTENTS, &error.outPtr());
895895
if (error) {
896-
exception = toRef(JSC::createTypeError(globalObject, makeString("failed to collect function paramater: ", error.get())));
896+
exception = toRef(JSC::createTypeError(globalObject, makeString("failed to collect function paramater: "_s, error.get())));
897897
jscContextHandleExceptionIfNeeded(priv->context.get(), exception);
898898
return adoptGRef(jsc_value_new_undefined(priv->context.get()));
899899
}

‎Source/JavaScriptCore/API/tests/ExecutionTimeLimitTest.cpp‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,10 @@ int testExecutionTimeLimit()
228228
"var startTime = currentCPUTime();"
229229
"while (true) {"
230230
"for (var i = 0; i < 1000; i++);"
231-
"if (currentCPUTime() - startTime > ", timeAfterWatchdogShouldHaveFired.seconds(), ") break;"
231+
"if (currentCPUTime() - startTime > "_s, timeAfterWatchdogShouldHaveFired.seconds(), ") break;"
232232
"}"
233233
"}"
234-
"foo();"
234+
"foo();"_s
235235
).utf8();
236236

237237
JSStringRef script = JSStringCreateWithUTF8CString(scriptText.data());
@@ -271,10 +271,10 @@ int testExecutionTimeLimit()
271271
"function recurse(i) {"
272272
"'use strict';"
273273
"if (i % 1000 === 0) {"
274-
"if (currentCPUTime() - startTime >", timeAfterWatchdogShouldHaveFired.seconds(), ") { return; }"
274+
"if (currentCPUTime() - startTime >"_s, timeAfterWatchdogShouldHaveFired.seconds(), ") { return; }"
275275
"}"
276276
"return recurse(i + 1); }"
277-
"recurse(0);"
277+
"recurse(0);"_s
278278
).utf8();
279279

280280
JSStringRef script = JSStringCreateWithUTF8CString(scriptText.data());
@@ -315,11 +315,11 @@ int testExecutionTimeLimit()
315315
"try {"
316316
"while (true) {"
317317
"for (var i = 0; i < 1000; i++);"
318-
"if (currentCPUTime() - startTime > ", timeAfterWatchdogShouldHaveFired.seconds(), ") break;"
318+
"if (currentCPUTime() - startTime > "_s, timeAfterWatchdogShouldHaveFired.seconds(), ") break;"
319319
"}"
320320
"} catch(e) { }"
321321
"}"
322-
"foo();"
322+
"foo();"_s
323323
).utf8();
324324

325325
JSStringRef script = JSStringCreateWithUTF8CString(scriptText.data());
@@ -361,10 +361,10 @@ int testExecutionTimeLimit()
361361
"var startTime = currentCPUTime();"
362362
"while (true) {"
363363
"for (var i = 0; i < 1000; i++);"
364-
"if (currentCPUTime() - startTime > ", timeAfterWatchdogShouldHaveFired.seconds(), ") break;"
364+
"if (currentCPUTime() - startTime > "_s, timeAfterWatchdogShouldHaveFired.seconds(), ") break;"
365365
"}"
366366
"}"
367-
"foo();"
367+
"foo();"_s
368368
).utf8();
369369

370370
JSStringRef script = JSStringCreateWithUTF8CString(scriptText.data());
@@ -406,10 +406,10 @@ int testExecutionTimeLimit()
406406
"var startTime = currentCPUTime();"
407407
"while (true) {"
408408
"for (var i = 0; i < 1000; i++);"
409-
"if (currentCPUTime() - startTime > ", timeAfterWatchdogShouldHaveFired.seconds(), ") break;"
409+
"if (currentCPUTime() - startTime > "_s, timeAfterWatchdogShouldHaveFired.seconds(), ") break;"
410410
"}"
411411
"}"
412-
"foo();"
412+
"foo();"_s
413413
).utf8();
414414

415415
JSStringRef script = JSStringCreateWithUTF8CString(scriptText.data());
@@ -451,10 +451,10 @@ int testExecutionTimeLimit()
451451
"var startTime = currentCPUTime();"
452452
"while (true) {"
453453
"for (var i = 0; i < 1000; i++);"
454-
"if (currentCPUTime() - startTime > ", maxBusyLoopTime.seconds(), ") break;"
454+
"if (currentCPUTime() - startTime > "_s, maxBusyLoopTime.seconds(), ") break;"
455455
"}"
456456
"}"
457-
"foo();"
457+
"foo();"_s
458458
).utf8();
459459

460460
JSStringRef script = JSStringCreateWithUTF8CString(scriptText.data());

‎Source/JavaScriptCore/API/tests/testapi.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -664,13 +664,13 @@ void TestAPI::markedJSValueArrayAndGC()
664664
JSC::JSLockHolder locker(globalObject->vm());
665665
JSC::MarkedJSValueRefArray values(context, count);
666666
for (unsigned index = 0; index < count; ++index) {
667-
JSValueRef string = JSValueMakeString(context, APIString(makeString("Prefix", index)));
667+
JSValueRef string = JSValueMakeString(context, APIString(makeString("Prefix"_s, index)));
668668
values[index] = string;
669669
}
670670
JSSynchronousGarbageCollectForDebugging(context);
671671
bool ok = true;
672672
for (unsigned index = 0; index < count; ++index) {
673-
JSValueRef string = JSValueMakeString(context, APIString(makeString("Prefix", index)));
673+
JSValueRef string = JSValueMakeString(context, APIString(makeString("Prefix"_s, index)));
674674
if (!JSValueIsStrictEqual(context, values[index], string))
675675
ok = false;
676676
}

‎Source/JavaScriptCore/assembler/LinkBuffer.cpp‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -477,13 +477,16 @@ void LinkBuffer::linkComments(MacroAssembler& assembler)
477477
if (LIKELY(!Options::needDisassemblySupport()) || !m_executableMemory)
478478
return;
479479
AssemblyCommentRegistry::CommentMap map;
480-
for (const auto& [label, str] : assembler.m_comments) {
481-
void* commentLocation = locationOf<DisassemblyPtrTag>(label).dataLocation();
480+
for (auto& comment : assembler.m_comments) {
481+
void* commentLocation = locationOf<DisassemblyPtrTag>(comment.first).dataLocation();
482482
auto key = reinterpret_cast<uintptr_t>(commentLocation);
483-
String strCopy = str.isolatedCopy();
484-
if (map.contains(key))
485-
strCopy = map.get(key).isolatedCopy() + "\n; " + strCopy;
486-
map.set(key, WTFMove(strCopy));
483+
484+
auto& string = comment.second;
485+
auto addResult = map.ensure(key, [&] {
486+
return string.isolatedCopy();
487+
});
488+
if (!addResult.isNewEntry)
489+
addResult.iterator->value = addResult.iterator->value + "\n; "_s + string;
487490
}
488491

489492
AssemblyCommentRegistry::singleton().registerCodeRange(m_executableMemory->start().untaggedPtr(), m_executableMemory->end().untaggedPtr(), WTFMove(map));

‎Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ void SpeculativeJIT::runSlowPathGenerators(PCToCodeOriginMapBuilder& pcToCodeOri
635635
auto markSlowPathIfNeeded = [&] (Node* node) {
636636
std::optional<JITSizeStatistics::Marker> sizeMarker;
637637
if (UNLIKELY(Options::dumpDFGJITSizeStatistics())) {
638-
String id = makeString("DFG_slow_", m_graph.opName(node->op()));
638+
String id = makeString("DFG_slow_"_s, m_graph.opName(node->op()));
639639
sizeMarker = vm().jitSizeStatistics->markStart(id, *this);
640640
}
641641
return sizeMarker;
@@ -2580,7 +2580,7 @@ void SpeculativeJIT::compileCurrentBlock()
25802580

25812581
std::optional<JITSizeStatistics::Marker> sizeMarker;
25822582
if (UNLIKELY(Options::dumpDFGJITSizeStatistics())) {
2583-
String id = makeString("DFG_fast_", m_graph.opName(m_currentNode->op()));
2583+
String id = makeString("DFG_fast_"_s, m_graph.opName(m_currentNode->op()));
25842584
sizeMarker = vm().jitSizeStatistics->markStart(id, *this);
25852585
}
25862586

‎Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19556,7 +19556,7 @@ IGNORE_CLANG_WARNINGS_END
1955619556
return result;
1955719557
}
1955819558

19559-
DFG_CRASH(m_graph, m_node, makeString("Value not defined: ", String::number(edge.node()->index())).ascii().data());
19559+
DFG_CRASH(m_graph, m_node, makeString("Value not defined: "_s, edge.node()->index()).ascii().data());
1956019560
return nullptr;
1956119561
}
1956219562

‎Source/JavaScriptCore/inspector/IdentifiersFactory.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static unsigned long s_lastUsedIdentifier = 0;
3737

3838
static String addPrefixToIdentifier(unsigned long identifier)
3939
{
40-
return makeString("0.", identifier);
40+
return makeString("0."_s, identifier);
4141
}
4242

4343
String IdentifiersFactory::createIdentifier()

‎Source/JavaScriptCore/inspector/InjectedScriptBase.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ Ref<JSON::Value> InjectedScriptBase::makeCall(Deprecated::ScriptFunctionCall& fu
9595

9696
auto resultJSONValue = toInspectorValue(globalObject, value);
9797
if (!resultJSONValue)
98-
return JSON::Value::create(makeString("Object has too long reference chain (must not be longer than ", JSON::Value::maxDepth, ')'));
98+
return JSON::Value::create(makeString("Object has too long reference chain (must not be longer than "_s, JSON::Value::maxDepth, ')'));
9999

100100
return resultJSONValue.releaseNonNull();
101101
}
@@ -125,7 +125,7 @@ void InjectedScriptBase::makeAsyncCall(Deprecated::ScriptFunctionCall& function,
125125
else if (auto resultJSONValue = toInspectorValue(globalObject, callFrame->argument(0)))
126126
checkAsyncCallResult(resultJSONValue, callback);
127127
else
128-
checkAsyncCallResult(JSON::Value::create(makeString("Object has too long reference chain (must not be longer than ", JSON::Value::maxDepth, ')')), callback);
128+
checkAsyncCallResult(JSON::Value::create(makeString("Object has too long reference chain (must not be longer than "_s, JSON::Value::maxDepth, ')')), callback);
129129
return JSC::JSValue::encode(JSC::jsUndefined());
130130
});
131131
}

0 commit comments

Comments
 (0)