#include "JSBuffer.h" #include "_NativeModule.h" namespace Zig { using namespace WebCore; JSC_DEFINE_HOST_FUNCTION(jsFunctionTty_isatty, (JSGlobalObject * globalObject, CallFrame *callFrame)) { VM &vm = globalObject->vm(); if (callFrame->argumentCount() < 1) { return JSValue::encode(jsBoolean(false)); } auto scope = DECLARE_CATCH_SCOPE(vm); int fd = callFrame->argument(0).toInt32(globalObject); RETURN_IF_EXCEPTION(scope, encodedJSValue()); return JSValue::encode(jsBoolean(isatty(fd))); } JSC_DEFINE_HOST_FUNCTION(jsFunctionNotImplementedYet, (JSGlobalObject * globalObject, CallFrame *callFrame)) { VM &vm = globalObject->vm(); auto throwScope = DECLARE_THROW_SCOPE(vm); throwException(globalObject, throwScope, createError(globalObject, "Not implemented yet"_s)); return JSValue::encode(jsUndefined()); } DEFINE_NATIVE_MODULE(NodeTTY) { INIT_NATIVE_MODULE(3); auto *isattyFunction = JSFunction::create(vm, globalObject, 1, "isatty"_s, jsFunctionTty_isatty, ImplementationVisibility::Public); auto *notimpl = JSFunction::create(vm, globalObject, 0, "notimpl"_s, jsFunctionNotImplementedYet, ImplementationVisibility::Public, NoIntrinsic, jsFunctionNotImplementedYet); putNativeFn(Identifier::fromString(vm, "isatty"_s), jsFunctionTty_isatty); put(Identifier::fromString(vm, "ReadStream"_s), notimpl); put(Identifier::fromString(vm, "WriteStream"_s), notimpl); RETURN_NATIVE_MODULE(); } } // namespace Zig iro/proxy-connect-tests Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/bench/snippets/spawn-hugemem.node.mjs (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2023-01-04buffer list clean-ups (#1721)Gravatar Alex Lam S.L 1-37/+68
2023-01-04Support non-classes in node:net (#1712)Gravatar Jarred Sumner 1-198/+216
2023-01-04Fixes #1716Gravatar Jarred Sumner 1-2/+2
2023-01-0410x faster `new Buffer` (#1717)Gravatar Jarred Sumner 19-520/+480
2023-01-03Update README.mdGravatar Jarred Sumner 1-2/+2
2023-01-03Add sqlite to vendorGravatar Jarred Sumner 1-4/+8
2023-01-03Fixes https://github.com/oven-sh/bun/issues/1695Gravatar Jarred Sumner 1-1/+1
2023-01-03Remove usages of std.xGravatar Jarred Sumner 7-98/+75
2023-01-03[streams] speed up `Readable` in some cases (#1708)Gravatar Alex Lam S.L 3-14/+140
2023-01-03Fix crash in BufferListGravatar Jarred Sumner 1-2/+2