diff options
Diffstat (limited to 'src/bun.js/bindings/ZigGlobalObject.cpp')
-rw-r--r-- | src/bun.js/bindings/ZigGlobalObject.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/bun.js/bindings/ZigGlobalObject.cpp b/src/bun.js/bindings/ZigGlobalObject.cpp index bcb462d42..0f4fe92e2 100644 --- a/src/bun.js/bindings/ZigGlobalObject.cpp +++ b/src/bun.js/bindings/ZigGlobalObject.cpp @@ -1137,6 +1137,15 @@ enum ReadableStreamTag : int32_t { Bytes = 4, }; +JSC_DEFINE_HOST_FUNCTION(functionCallNotImplemented, + (JSC::JSGlobalObject * globalObject, JSC::CallFrame* callFrame)) +{ + auto& vm = globalObject->vm(); + auto scope = DECLARE_THROW_SCOPE(vm); + throwTypeError(globalObject, scope, "Not implemented yet in Bun :("_s); + return JSC::JSValue::encode(JSC::JSValue {}); +} + // we're trying out a new way to do this lazy loading static JSC_DEFINE_HOST_FUNCTION(functionLazyLoad, (JSC::JSGlobalObject * globalObject, JSC::CallFrame* callFrame)) @@ -1156,6 +1165,7 @@ JSC: static NeverDestroyed<const String> bunStreamString(MAKE_STATIC_STRING_IMPL("bun:stream")); static NeverDestroyed<const String> noopString(MAKE_STATIC_STRING_IMPL("noop")); static NeverDestroyed<const String> createImportMeta(MAKE_STATIC_STRING_IMPL("createImportMeta")); + static NeverDestroyed<const String> masqueradesAsUndefined(MAKE_STATIC_STRING_IMPL("masqueradesAsUndefined")); JSC::JSValue moduleName = callFrame->argument(0); if (moduleName.isNumber()) { @@ -1235,6 +1245,10 @@ JSC: return JSValue::encode(obj); } + if (string == masqueradesAsUndefined) { + return JSValue::encode(InternalFunction::createFunctionThatMasqueradesAsUndefined(vm, globalObject, 0, String(), functionCallNotImplemented)); + } + if (UNLIKELY(string == noopString)) { auto* obj = constructEmptyObject(globalObject); obj->putDirectCustomAccessor(vm, JSC::PropertyName(JSC::Identifier::fromString(vm, "getterSetter"_s)), JSC::CustomGetterSetter::create(vm, noop_getter, noop_setter), 0); |