Compare commits

...

6 Commits

Author SHA1 Message Date
Jarred Sumner
bc102220e7 Set it everywhere 2024-07-15 17:24:56 -07:00
Jarred Sumner
88ed6f8d28 Update env.sh 2024-07-15 17:22:34 -07:00
Jarred Sumner
44abdfd113 Update CMakeLists.txt 2024-07-15 17:21:47 -07:00
Jarred Sumner
8808af1c99 Replace some Identifier::fromString usages with vm->propertyNames (#12575) 2024-07-15 16:15:56 -07:00
Jarred Sumner
b9d2a03ffc Make creating a BufferList (used in node:stream) slightly faster (#12577) 2024-07-15 16:15:10 -07:00
Jarred Sumner
157b56cca5 Update launch.json 2024-07-15 15:12:57 -07:00
35 changed files with 55 additions and 54 deletions

5
.vscode/launch.json generated vendored
View File

@@ -145,13 +145,14 @@
"request": "launch",
"name": "bun run [file]",
"program": "${workspaceFolder}/build/bun-debug",
"args": ["run", "/Users/dave/Downloads/pd-api-testnet/dist/app.js"],
"cwd": "/Users/dave/Downloads/pd-api-testnet",
"args": ["run", "${file}"],
"cwd": "${fileDirname}",
"env": {
"FORCE_COLOR": "0",
"BUN_DEBUG_QUIET_LOGS": "1",
"BUN_DEBUG_EventLoop": "1",
"BUN_GARBAGE_COLLECTOR_LEVEL": "2",
"BUN_DEBUG_ALL": "1",
},
"console": "internalConsole",
},

View File

@@ -1193,6 +1193,7 @@ else()
-fno-omit-frame-pointer
-mno-omit-leaf-frame-pointer
-faddrsig
-fno-asynchronous-unwind-tables
)
endif()

View File

@@ -27,14 +27,16 @@ export CPUS=${CPUS:-$(nproc || sysctl -n hw.ncpu || echo 1)}
export CMAKE_CXX_COMPILER=${CXX}
export CMAKE_C_COMPILER=${CC}
export CFLAGS='-O3 -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer'
export CXXFLAGS='-O3 -fno-exceptions -fno-rtti -fvisibility=hidden -fvisibility-inlines-hidden -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer'
export CFLAGS='-O3 -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-asynchronous-unwind-tables '
export CXXFLAGS='-O3 -fno-exceptions -fno-rtti -fvisibility=hidden -fvisibility-inlines-hidden -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-asynchronous-unwind-tables '
if [[ $(uname -s) == 'Linux' && ($(uname -m) == 'aarch64' || $(uname -m) == 'arm64') ]]; then
export CFLAGS="$CFLAGS -march=armv8-a+crc -mtune=ampere1 "
export CXXFLAGS="$CXXFLAGS -march=armv8-a+crc -mtune=ampere1 "
fi
export CMAKE_FLAGS=(
-DCMAKE_C_COMPILER="${CC}"
-DCMAKE_CXX_COMPILER="${CXX}"

View File

@@ -33,7 +33,7 @@ JSValue BunInjectedScriptHost::subtype(JSGlobalObject* exec, JSValue value)
static JSObject* constructInternalProperty(VM& vm, JSGlobalObject* exec, const String& name, JSValue value)
{
auto* object = constructEmptyObject(exec);
object->putDirect(vm, Identifier::fromString(vm, "name"_s), jsString(vm, name));
object->putDirect(vm, vm.propertyNames->name, jsString(vm, name));
object->putDirect(vm, Identifier::fromString(vm, "value"_s), value);
return object;
}
@@ -41,7 +41,7 @@ static JSObject* constructInternalProperty(VM& vm, JSGlobalObject* exec, const S
static JSObject* constructInternalProperty(VM& vm, JSGlobalObject* exec, const Identifier& name, JSValue value)
{
auto* object = constructEmptyObject(exec);
object->putDirect(vm, Identifier::fromString(vm, "name"_s), JSC::identifierToJSValue(vm, name));
object->putDirect(vm, vm.propertyNames->name, JSC::identifierToJSValue(vm, name));
object->putDirect(vm, Identifier::fromString(vm, "value"_s), value);
return object;
}

View File

@@ -205,7 +205,7 @@ static JSValue constructProcessReleaseObject(VM& vm, JSObject* processObject)
auto* release = JSC::constructEmptyObject(globalObject);
// SvelteKit compatibility hack
release->putDirect(vm, Identifier::fromString(vm, "name"_s), jsString(vm, WTF::String("node"_s)), 0);
release->putDirect(vm, vm.propertyNames->name, jsString(vm, WTF::String("node"_s)), 0);
release->putDirect(vm, Identifier::fromString(vm, "lts"_s), jsBoolean(false), 0);
release->putDirect(vm, Identifier::fromString(vm, "sourceUrl"_s), jsString(vm, WTF::String(std::span { Bun__githubURL, strlen(Bun__githubURL) })), 0);
@@ -1068,7 +1068,7 @@ JSC_DEFINE_HOST_FUNCTION(Process_emitWarning, (JSGlobalObject * lexicalGlobalObj
return createError(globalObject, str);
})();
errorInstance->putDirect(vm, Identifier::fromString(vm, "name"_s), jsString(vm, String("warn"_s)), JSC::PropertyAttribute::DontEnum | 0);
errorInstance->putDirect(vm, vm.propertyNames->name, jsString(vm, String("warn"_s)), JSC::PropertyAttribute::DontEnum | 0);
auto ident = Identifier::fromString(vm, "warning"_s);
if (process->wrapped().hasEventListeners(ident)) {

View File

@@ -27,10 +27,6 @@ static JSC_DEFINE_CUSTOM_GETTER(JSBufferList_getLength, (JSC::JSGlobalObject * g
void JSBufferList::finishCreation(JSC::VM& vm, JSC::JSGlobalObject* globalObject)
{
Base::finishCreation(vm);
putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "length"_s),
JSC::CustomGetterSetter::create(vm, JSBufferList_getLength, nullptr),
JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly);
}
JSC::JSValue JSBufferList::concat(JSC::VM& vm, JSC::JSGlobalObject* lexicalGlobalObject, size_t n)
@@ -413,6 +409,7 @@ static const HashTableValue JSBufferListPrototypeTableValues[]
{ "concat"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsBufferListPrototypeFunction_concat, 1 } },
{ "join"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsBufferListPrototypeFunction_join, 1 } },
{ "consume"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsBufferListPrototypeFunction_consume, 2 } },
{ "length"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { HashTableValue::GetterSetterType, JSBufferList_getLength, 0 } },
};
void JSBufferListPrototype::finishCreation(VM& vm, JSC::JSGlobalObject* globalThis)

View File

@@ -711,14 +711,14 @@ extern Structure* createMockResultStructure(JSC::VM& vm, JSC::JSGlobalObject* gl
structure = structure->addPropertyTransition(
vm,
structure,
JSC::Identifier::fromString(vm, "type"_s),
vm.propertyNames->type,
0,
offset);
structure = structure->addPropertyTransition(
vm,
structure,
JSC::Identifier::fromString(vm, "value"_s),
vm.propertyNames->value,
0, offset);
return structure;
}

View File

@@ -550,7 +550,7 @@ JSC_DEFINE_HOST_FUNCTION(KeyObject__createPrivateKey, (JSC::JSGlobalObject * glo
}
}
if (format == "der"_s) {
JSValue typeJSValue = options->getIfPropertyExists(globalObject, PropertyName(Identifier::fromString(vm, "type"_s)));
JSValue typeJSValue = options->getIfPropertyExists(globalObject, PropertyName(vm.propertyNames->type));
WTF::String type = "pkcs8"_s;
if (!typeJSValue.isUndefinedOrNull() && !typeJSValue.isEmpty()) {
if (!typeJSValue.isString()) {
@@ -1138,7 +1138,7 @@ JSC_DEFINE_HOST_FUNCTION(KeyObject__createPublicKey, (JSC::JSGlobalObject * glob
}
}
if (format == "der"_s) {
JSValue typeJSValue = options->getIfPropertyExists(globalObject, PropertyName(Identifier::fromString(vm, "type"_s)));
JSValue typeJSValue = options->getIfPropertyExists(globalObject, PropertyName(vm.propertyNames->type));
WTF::String type = "spki"_s;
if (!typeJSValue.isUndefinedOrNull() && !typeJSValue.isEmpty()) {
if (!typeJSValue.isString()) {
@@ -1800,7 +1800,7 @@ JSC_DEFINE_HOST_FUNCTION(KeyObject__Exports, (JSC::JSGlobalObject * globalObject
auto id = wrapped.keyClass();
if (auto* options = jsDynamicCast<JSC::JSObject*>(callFrame->argument(1))) {
JSValue formatJSValue = options->getIfPropertyExists(globalObject, PropertyName(Identifier::fromString(vm, "format"_s)));
JSValue typeJSValue = options->getIfPropertyExists(globalObject, PropertyName(Identifier::fromString(vm, "type"_s)));
JSValue typeJSValue = options->getIfPropertyExists(globalObject, PropertyName(vm.propertyNames->type));
JSValue passphraseJSValue = options->getIfPropertyExists(globalObject, PropertyName(Identifier::fromString(vm, "passphrase"_s)));
KeyPassphrase passphrase(passphraseJSValue, globalObject, scope);
RETURN_IF_EXCEPTION(scope, encodedJSValue());

View File

@@ -235,7 +235,7 @@ static inline EncodedJSValue jsPerformanceEntryPrototypeFunction_toJSONBody(JSGl
auto* result = constructEmptyObject(lexicalGlobalObject);
auto nameValue = toJS<IDLDOMString>(*lexicalGlobalObject, throwScope, impl.name());
RETURN_IF_EXCEPTION(throwScope, {});
result->putDirect(vm, Identifier::fromString(vm, "name"_s), nameValue);
result->putDirect(vm, vm.propertyNames->name, nameValue);
auto entryTypeValue = toJS<IDLDOMString>(*lexicalGlobalObject, throwScope, impl.entryType());
RETURN_IF_EXCEPTION(throwScope, {});
result->putDirect(vm, Identifier::fromString(vm, "entryType"_s), entryTypeValue);

View File

@@ -95,7 +95,7 @@ template<> PerformanceObserver::Init convertDictionary<PerformanceObserver::Init
if (isNullOrUndefined)
typeValue = jsUndefined();
else {
typeValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "type"_s));
typeValue = object->get(&lexicalGlobalObject, vm.propertyNames->type);
RETURN_IF_EXCEPTION(throwScope, {});
}
if (!typeValue.isUndefined()) {

View File

@@ -131,7 +131,7 @@ template<> JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSWorkerDOMConstructor::
options.bun.unref = false;
if (JSObject* optionsObject = JSC::jsDynamicCast<JSC::JSObject*>(argument1.value())) {
if (auto nameValue = optionsObject->getIfPropertyExists(lexicalGlobalObject, Identifier::fromString(vm, "name"_s))) {
if (auto nameValue = optionsObject->getIfPropertyExists(lexicalGlobalObject, vm.propertyNames->name)) {
if (nameValue.isString()) {
options.name = nameValue.toWTFString(lexicalGlobalObject);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());

View File

@@ -57,7 +57,7 @@ template<> WorkerOptions convertDictionary<WorkerOptions>(JSGlobalObject& lexica
if (isNullOrUndefined)
nameValue = jsUndefined();
else {
nameValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "name"_s));
nameValue = object->get(&lexicalGlobalObject, vm.propertyNames->name);
RETURN_IF_EXCEPTION(throwScope, {});
}
if (!nameValue.isUndefined()) {

View File

@@ -50,7 +50,7 @@ template<> CryptoAlgorithmAesCbcCfbParams convertDictionary<CryptoAlgorithmAesCb
if (isNullOrUndefined)
nameValue = jsUndefined();
else {
nameValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "name"_s));
nameValue = object->get(&lexicalGlobalObject, vm.propertyNames->name);
RETURN_IF_EXCEPTION(throwScope, {});
}
if (!nameValue.isUndefined()) {

View File

@@ -51,7 +51,7 @@ template<> CryptoAlgorithmAesCtrParams convertDictionary<CryptoAlgorithmAesCtrPa
if (isNullOrUndefined)
nameValue = jsUndefined();
else {
nameValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "name"_s));
nameValue = object->get(&lexicalGlobalObject, vm.propertyNames->name);
RETURN_IF_EXCEPTION(throwScope, {});
}
if (!nameValue.isUndefined()) {

View File

@@ -51,7 +51,7 @@ template<> CryptoAlgorithmAesGcmParams convertDictionary<CryptoAlgorithmAesGcmPa
if (isNullOrUndefined)
nameValue = jsUndefined();
else {
nameValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "name"_s));
nameValue = object->get(&lexicalGlobalObject, vm.propertyNames->name);
RETURN_IF_EXCEPTION(throwScope, {});
}
if (!nameValue.isUndefined()) {

View File

@@ -48,7 +48,7 @@ template<> CryptoAlgorithmAesKeyParams convertDictionary<CryptoAlgorithmAesKeyPa
if (isNullOrUndefined)
nameValue = jsUndefined();
else {
nameValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "name"_s));
nameValue = object->get(&lexicalGlobalObject, vm.propertyNames->name);
RETURN_IF_EXCEPTION(throwScope, {});
}
if (!nameValue.isUndefined()) {

View File

@@ -50,7 +50,7 @@ template<> CryptoAesKeyAlgorithm convertDictionary<CryptoAesKeyAlgorithm>(JSGlob
if (isNullOrUndefined)
nameValue = jsUndefined();
else {
nameValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "name"_s));
nameValue = object->get(&lexicalGlobalObject, vm.propertyNames->name);
RETURN_IF_EXCEPTION(throwScope, {});
}
if (!nameValue.isUndefined()) {
@@ -86,10 +86,10 @@ JSC::JSObject* convertDictionaryToJS(JSC::JSGlobalObject& lexicalGlobalObject, J
auto nameValue = toJS<IDLDOMString>(lexicalGlobalObject, throwScope, dictionary.name);
RETURN_IF_EXCEPTION(throwScope, {});
result->putDirect(vm, JSC::Identifier::fromString(vm, "name"_s), nameValue);
result->putDirect(vm, vm.propertyNames->name, nameValue);
auto lengthValue = toJS<IDLUnsignedShort>(lexicalGlobalObject, throwScope, dictionary.length);
RETURN_IF_EXCEPTION(throwScope, {});
result->putDirect(vm, JSC::Identifier::fromString(vm, "length"_s), lengthValue);
result->putDirect(vm, vm.propertyNames->length, lengthValue);
return result;
}

View File

@@ -47,7 +47,7 @@ template<> CryptoAlgorithmParameters convertDictionary<CryptoAlgorithmParameters
if (isNullOrUndefined)
nameValue = jsUndefined();
else {
nameValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "name"_s));
nameValue = object->get(&lexicalGlobalObject, vm.propertyNames->name);
RETURN_IF_EXCEPTION(throwScope, {});
}
if (!nameValue.isUndefined()) {

View File

@@ -49,7 +49,7 @@ template<> CryptoEcKeyAlgorithm convertDictionary<CryptoEcKeyAlgorithm>(JSGlobal
if (isNullOrUndefined)
nameValue = jsUndefined();
else {
nameValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "name"_s));
nameValue = object->get(&lexicalGlobalObject, vm.propertyNames->name);
RETURN_IF_EXCEPTION(throwScope, {});
}
if (!nameValue.isUndefined()) {
@@ -85,7 +85,7 @@ JSC::JSObject* convertDictionaryToJS(JSC::JSGlobalObject& lexicalGlobalObject, J
auto nameValue = toJS<IDLDOMString>(lexicalGlobalObject, throwScope, dictionary.name);
RETURN_IF_EXCEPTION(throwScope, {});
result->putDirect(vm, JSC::Identifier::fromString(vm, "name"_s), nameValue);
result->putDirect(vm, vm.propertyNames->name, nameValue);
auto namedCurveValue = toJS<IDLDOMString>(lexicalGlobalObject, throwScope, dictionary.namedCurve);
RETURN_IF_EXCEPTION(throwScope, {});
result->putDirect(vm, JSC::Identifier::fromString(vm, "namedCurve"_s), namedCurveValue);

View File

@@ -51,7 +51,7 @@ template<> CryptoHmacKeyAlgorithm convertDictionary<CryptoHmacKeyAlgorithm>(JSGl
if (isNullOrUndefined)
nameValue = jsUndefined();
else {
nameValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "name"_s));
nameValue = object->get(&lexicalGlobalObject, vm.propertyNames->name);
RETURN_IF_EXCEPTION(throwScope, {});
}
if (!nameValue.isUndefined()) {
@@ -101,13 +101,13 @@ JSC::JSObject* convertDictionaryToJS(JSC::JSGlobalObject& lexicalGlobalObject, J
auto nameValue = toJS<IDLDOMString>(lexicalGlobalObject, throwScope, dictionary.name);
RETURN_IF_EXCEPTION(throwScope, {});
result->putDirect(vm, JSC::Identifier::fromString(vm, "name"_s), nameValue);
result->putDirect(vm, vm.propertyNames->name, nameValue);
auto hashValue = toJS<IDLDictionary<CryptoKeyAlgorithm>>(lexicalGlobalObject, globalObject, throwScope, dictionary.hash);
RETURN_IF_EXCEPTION(throwScope, {});
result->putDirect(vm, JSC::Identifier::fromString(vm, "hash"_s), hashValue);
auto lengthValue = toJS<IDLUnsignedLong>(lexicalGlobalObject, throwScope, dictionary.length);
RETURN_IF_EXCEPTION(throwScope, {});
result->putDirect(vm, JSC::Identifier::fromString(vm, "length"_s), lengthValue);
result->putDirect(vm, vm.propertyNames->length, lengthValue);
return result;
}

View File

@@ -49,7 +49,7 @@ template<> CryptoKeyAlgorithm convertDictionary<CryptoKeyAlgorithm>(JSGlobalObje
if (isNullOrUndefined)
nameValue = jsUndefined();
else {
nameValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "name"_s));
nameValue = object->get(&lexicalGlobalObject, vm.propertyNames->name);
RETURN_IF_EXCEPTION(throwScope, {});
}
if (!nameValue.isUndefined()) {
@@ -71,7 +71,7 @@ JSC::JSObject* convertDictionaryToJS(JSC::JSGlobalObject& lexicalGlobalObject, J
auto nameValue = toJS<IDLDOMString>(lexicalGlobalObject, throwScope, dictionary.name);
RETURN_IF_EXCEPTION(throwScope, {});
result->putDirect(vm, JSC::Identifier::fromString(vm, "name"_s), nameValue);
result->putDirect(vm, vm.propertyNames->name, nameValue);
return result;
}

View File

@@ -52,7 +52,7 @@ template<> CryptoRsaHashedKeyAlgorithm convertDictionary<CryptoRsaHashedKeyAlgor
if (isNullOrUndefined)
nameValue = jsUndefined();
else {
nameValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "name"_s));
nameValue = object->get(&lexicalGlobalObject, vm.propertyNames->name);
RETURN_IF_EXCEPTION(throwScope, {});
}
if (!nameValue.isUndefined()) {
@@ -116,7 +116,7 @@ JSC::JSObject* convertDictionaryToJS(JSC::JSGlobalObject& lexicalGlobalObject, J
auto nameValue = toJS<IDLDOMString>(lexicalGlobalObject, throwScope, dictionary.name);
RETURN_IF_EXCEPTION(throwScope, {});
result->putDirect(vm, JSC::Identifier::fromString(vm, "name"_s), nameValue);
result->putDirect(vm, vm.propertyNames->name, nameValue);
auto modulusLengthValue = toJS<IDLUnsignedLong>(lexicalGlobalObject, throwScope, dictionary.modulusLength);
RETURN_IF_EXCEPTION(throwScope, {});
result->putDirect(vm, JSC::Identifier::fromString(vm, "modulusLength"_s), modulusLengthValue);

View File

@@ -51,7 +51,7 @@ template<> CryptoRsaKeyAlgorithm convertDictionary<CryptoRsaKeyAlgorithm>(JSGlob
if (isNullOrUndefined)
nameValue = jsUndefined();
else {
nameValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "name"_s));
nameValue = object->get(&lexicalGlobalObject, vm.propertyNames->name);
RETURN_IF_EXCEPTION(throwScope, {});
}
if (!nameValue.isUndefined()) {
@@ -101,7 +101,7 @@ JSC::JSObject* convertDictionaryToJS(JSC::JSGlobalObject& lexicalGlobalObject, J
auto nameValue = toJS<IDLDOMString>(lexicalGlobalObject, throwScope, dictionary.name);
RETURN_IF_EXCEPTION(throwScope, {});
result->putDirect(vm, JSC::Identifier::fromString(vm, "name"_s), nameValue);
result->putDirect(vm, vm.propertyNames->name, nameValue);
auto modulusLengthValue = toJS<IDLUnsignedLong>(lexicalGlobalObject, throwScope, dictionary.modulusLength);
RETURN_IF_EXCEPTION(throwScope, {});
result->putDirect(vm, JSC::Identifier::fromString(vm, "modulusLength"_s), modulusLengthValue);

View File

@@ -47,7 +47,7 @@ template<> CryptoAlgorithmEcKeyParams convertDictionary<CryptoAlgorithmEcKeyPara
if (isNullOrUndefined)
nameValue = jsUndefined();
else {
nameValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "name"_s));
nameValue = object->get(&lexicalGlobalObject, vm.propertyNames->name);
RETURN_IF_EXCEPTION(throwScope, {});
}
if (!nameValue.isUndefined()) {

View File

@@ -49,7 +49,7 @@ template<> CryptoAlgorithmEcdhKeyDeriveParams convertDictionary<CryptoAlgorithmE
if (isNullOrUndefined)
nameValue = jsUndefined();
else {
nameValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "name"_s));
nameValue = object->get(&lexicalGlobalObject, vm.propertyNames->name);
RETURN_IF_EXCEPTION(throwScope, {});
}
if (!nameValue.isUndefined()) {

View File

@@ -50,7 +50,7 @@ template<> CryptoAlgorithmEcdsaParams convertDictionary<CryptoAlgorithmEcdsaPara
if (isNullOrUndefined)
nameValue = jsUndefined();
else {
nameValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "name"_s));
nameValue = object->get(&lexicalGlobalObject, vm.propertyNames->name);
RETURN_IF_EXCEPTION(throwScope, {});
}
if (!nameValue.isUndefined()) {

View File

@@ -51,7 +51,7 @@ template<> CryptoAlgorithmHkdfParams convertDictionary<CryptoAlgorithmHkdfParams
if (isNullOrUndefined)
nameValue = jsUndefined();
else {
nameValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "name"_s));
nameValue = object->get(&lexicalGlobalObject, vm.propertyNames->name);
RETURN_IF_EXCEPTION(throwScope, {});
}
if (!nameValue.isUndefined()) {

View File

@@ -51,7 +51,7 @@ template<> CryptoAlgorithmHmacKeyParams convertDictionary<CryptoAlgorithmHmacKey
if (isNullOrUndefined)
nameValue = jsUndefined();
else {
nameValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "name"_s));
nameValue = object->get(&lexicalGlobalObject, vm.propertyNames->name);
RETURN_IF_EXCEPTION(throwScope, {});
}
if (!nameValue.isUndefined()) {

View File

@@ -52,7 +52,7 @@ template<> CryptoAlgorithmPbkdf2Params convertDictionary<CryptoAlgorithmPbkdf2Pa
if (isNullOrUndefined)
nameValue = jsUndefined();
else {
nameValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "name"_s));
nameValue = object->get(&lexicalGlobalObject, vm.propertyNames->name);
RETURN_IF_EXCEPTION(throwScope, {});
}
if (!nameValue.isUndefined()) {

View File

@@ -50,7 +50,7 @@ template<> CryptoAlgorithmRsaHashedImportParams convertDictionary<CryptoAlgorith
if (isNullOrUndefined)
nameValue = jsUndefined();
else {
nameValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "name"_s));
nameValue = object->get(&lexicalGlobalObject, vm.propertyNames->name);
RETURN_IF_EXCEPTION(throwScope, {});
}
if (!nameValue.isUndefined()) {

View File

@@ -52,7 +52,7 @@ template<> CryptoAlgorithmRsaHashedKeyGenParams convertDictionary<CryptoAlgorith
if (isNullOrUndefined)
nameValue = jsUndefined();
else {
nameValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "name"_s));
nameValue = object->get(&lexicalGlobalObject, vm.propertyNames->name);
RETURN_IF_EXCEPTION(throwScope, {});
}
if (!nameValue.isUndefined()) {

View File

@@ -49,7 +49,7 @@ template<> CryptoAlgorithmRsaKeyGenParams convertDictionary<CryptoAlgorithmRsaKe
if (isNullOrUndefined)
nameValue = jsUndefined();
else {
nameValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "name"_s));
nameValue = object->get(&lexicalGlobalObject, vm.propertyNames->name);
RETURN_IF_EXCEPTION(throwScope, {});
}
if (!nameValue.isUndefined()) {

View File

@@ -50,7 +50,7 @@ template<> CryptoAlgorithmRsaOaepParams convertDictionary<CryptoAlgorithmRsaOaep
if (isNullOrUndefined)
nameValue = jsUndefined();
else {
nameValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "name"_s));
nameValue = object->get(&lexicalGlobalObject, vm.propertyNames->name);
RETURN_IF_EXCEPTION(throwScope, {});
}
if (!nameValue.isUndefined()) {

View File

@@ -48,7 +48,7 @@ template<> CryptoAlgorithmRsaPssParams convertDictionary<CryptoAlgorithmRsaPssPa
if (isNullOrUndefined)
nameValue = jsUndefined();
else {
nameValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "name"_s));
nameValue = object->get(&lexicalGlobalObject, vm.propertyNames->name);
RETURN_IF_EXCEPTION(throwScope, {});
}
if (!nameValue.isUndefined()) {

View File

@@ -111,7 +111,7 @@ static ExceptionOr<std::unique_ptr<CryptoAlgorithmParameters>> normalizeCryptoAl
if (std::holds_alternative<String>(algorithmIdentifier)) {
auto newParams = Strong<JSObject>(vm, constructEmptyObject(&state));
newParams->putDirect(vm, Identifier::fromString(vm, "name"_s), jsString(vm, std::get<String>(algorithmIdentifier)));
newParams->putDirect(vm, vm.propertyNames->name, jsString(vm, std::get<String>(algorithmIdentifier)));
return normalizeCryptoAlgorithmParameters(state, newParams, operation);
}
@@ -268,10 +268,10 @@ static ExceptionOr<std::unique_ptr<CryptoAlgorithmParameters>> normalizeCryptoAl
switch (*identifier) {
case CryptoAlgorithmIdentifier::ECDH: {
// Remove this hack once https://bugs.webkit.org/show_bug.cgi?id=169333 is fixed.
JSValue nameValue = value.get()->get(&state, Identifier::fromString(vm, "name"_s));
JSValue nameValue = value.get()->get(&state, vm.propertyNames->name);
JSValue publicValue = value.get()->get(&state, Identifier::fromString(vm, "public"_s));
JSObject* newValue = constructEmptyObject(&state);
newValue->putDirect(vm, Identifier::fromString(vm, "name"_s), nameValue);
newValue->putDirect(vm, vm.propertyNames->name, nameValue);
newValue->putDirect(vm, Identifier::fromString(vm, "publicKey"_s), publicValue);
auto params = convertDictionary<CryptoAlgorithmEcdhKeyDeriveParams>(state, newValue);