aboutsummaryrefslogtreecommitdiff
path: root/src/js/out/WebCoreJSBuiltins.cpp
diff options
context:
space:
mode:
authorGravatar dave caruso <me@paperdave.net> 2023-08-17 20:56:52 -0700
committerGravatar GitHub <noreply@github.com> 2023-08-17 20:56:52 -0700
commit6fd0043f6bf766cc488a88339059e8879fa07161 (patch)
treed5289bcaf0880a3bf1e2f0b1c681aff93188fe51 /src/js/out/WebCoreJSBuiltins.cpp
parent0424fd8f6e7549ed779788006acdc97a8467e287 (diff)
downloadbun-6fd0043f6bf766cc488a88339059e8879fa07161.tar.gz
bun-6fd0043f6bf766cc488a88339059e8879fa07161.tar.zst
bun-6fd0043f6bf766cc488a88339059e8879fa07161.zip
Add `util.inspect.custom` support to `util.inspect/Bun.inspect/console.log` (#4194)
* start work on util.inspect.custom * asdf * finish util inspect custom inspect * inspect * fix tests * revert * tidy * revert * oops * test * fix issues
Diffstat (limited to 'src/js/out/WebCoreJSBuiltins.cpp')
-rw-r--r--src/js/out/WebCoreJSBuiltins.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/js/out/WebCoreJSBuiltins.cpp b/src/js/out/WebCoreJSBuiltins.cpp
index f789f3d25..38114bab6 100644
--- a/src/js/out/WebCoreJSBuiltins.cpp
+++ b/src/js/out/WebCoreJSBuiltins.cpp
@@ -1339,6 +1339,32 @@ JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
#undef DEFINE_BUILTIN_GENERATOR
+/* UtilInspect.ts */
+// getStylizeWithColor
+const JSC::ConstructAbility s_utilInspectGetStylizeWithColorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_utilInspectGetStylizeWithColorCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_utilInspectGetStylizeWithColorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_utilInspectGetStylizeWithColorCodeLength = 261;
+static const JSC::Intrinsic s_utilInspectGetStylizeWithColorCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_utilInspectGetStylizeWithColorCode = "(function (inspect){\"use strict\";return function stylizeWithColor(str,styleType){const style=inspect.styles[styleType];if(style!==@undefined){const color=inspect.colors[style];if(color!==@undefined)return`\\x1B[${color[0]}m${str}\\x1B[${color[1]}m`}return str}})\n";
+
+// stylizeWithNoColor
+const JSC::ConstructAbility s_utilInspectStylizeWithNoColorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_utilInspectStylizeWithNoColorCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_utilInspectStylizeWithNoColorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_utilInspectStylizeWithNoColorCodeLength = 42;
+static const JSC::Intrinsic s_utilInspectStylizeWithNoColorCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_utilInspectStylizeWithNoColorCode = "(function (str){\"use strict\";return str})\n";
+
+#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
+JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
+{\
+ JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
+ return clientData->builtinFunctions().utilInspectBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().utilInspectBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
+}
+WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
+#undef DEFINE_BUILTIN_GENERATOR
+
/* ConsoleObject.ts */
// asyncIterator
const JSC::ConstructAbility s_consoleObjectAsyncIteratorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;