diff options
-rw-r--r-- | src/bun.js/bindings/ZigGlobalObject.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/bun.js/bindings/ZigGlobalObject.cpp b/src/bun.js/bindings/ZigGlobalObject.cpp index 93f9a0fa2..15647cd24 100644 --- a/src/bun.js/bindings/ZigGlobalObject.cpp +++ b/src/bun.js/bindings/ZigGlobalObject.cpp @@ -2206,9 +2206,17 @@ static inline EncodedJSValue functionPerformanceNowBody(JSGlobalObject* globalOb return JSValue::encode(jsDoubleNumber(result)); } +static inline EncodedJSValue functionPerformanceGetEntriesByNameBody(JSGlobalObject* globalObject) { + auto& vm = globalObject->vm(); + auto* global = reinterpret_cast<GlobalObject*>(globalObject); + auto* array = JSC::constructEmptyArray(globalObject, nullptr); + return JSValue::encode(array); +} + extern "C" { class JSPerformanceObject; static JSC_DECLARE_HOST_FUNCTION(functionPerformanceNow); +static JSC_DECLARE_HOST_FUNCTION(functionPerformanceGetEntriesByName); static JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(functionPerformanceNowWithoutTypeCheck, JSC::EncodedJSValue, (JSC::JSGlobalObject*, JSPerformanceObject*)); } @@ -2270,6 +2278,10 @@ private: this->putDirect(vm, JSC::Identifier::fromString(vm, "markResourceTiming"_s), noopNotImplemented, 0); this->putDirect(vm, JSC::Identifier::fromString(vm, "measure"_s), noopNotImplemented, 0); + // this is a stub impl for getEntriesByName(https://github.com/oven-sh/bun/issues/6537) + JSFunction* getEntriesByName = JSFunction::create( + vm, globalObject(), 0, String("getEntriesByName"_s), functionPerformanceGetEntriesByName, ImplementationVisibility::Public, NoIntrinsic, functionPerformanceGetEntriesByName, nullptr); + this->putDirect(vm, JSC::Identifier::fromString(vm, "getEntriesByName"_s), getEntriesByName, 0); this->putDirect( vm, JSC::Identifier::fromString(vm, "timeOrigin"_s), @@ -2284,6 +2296,12 @@ JSC_DEFINE_HOST_FUNCTION(functionPerformanceNow, (JSGlobalObject * globalObject, return functionPerformanceNowBody(globalObject); } + +JSC_DEFINE_HOST_FUNCTION(functionPerformanceGetEntriesByName, (JSGlobalObject * globalObject, JSC::CallFrame* callFrame)) +{ + return functionPerformanceGetEntriesByNameBody(globalObject); +} + JSC_DEFINE_JIT_OPERATION(functionPerformanceNowWithoutTypeCheck, JSC::EncodedJSValue, (JSC::JSGlobalObject * lexicalGlobalObject, JSPerformanceObject* castedThis)) { VM& vm = JSC::getVM(lexicalGlobalObject); |