@@ -1757,32 +1757,30 @@ void writeStdio(jsg::Lock& js, VirtualFileSystem::Stdio type, kj::ArrayPtr<const
1757
1757
size_t endPos = chars.size ();
1758
1758
if (endPos > 0 && chars[endPos - 1 ] == ' \n ' ) endPos--;
1759
1759
1760
-
1761
1760
KJ_IF_SOME (console, js.global ().get (js, " console" _kj).tryCast <jsg::JsObject>()) {
1762
1761
auto method = console.get (js, " log" _kj);
1763
1762
if (method.isFunction ()) {
1764
1763
v8::Local<v8::Value> methodVal (method);
1765
- auto methodFunc = methodVal.As <v8::Function>();
1764
+ auto methodFunc = jsg::JsFunction ( methodVal.As <v8::Function>() );
1766
1765
1767
1766
kj::String outputStr;
1768
1767
auto processStdioPrefixed = Worker::Isolate::from (js).getProcessStdioPrefixed ();
1769
1768
if (processStdioPrefixed) {
1770
1769
if (endPos == 0 ) {
1771
- v8::Local<v8::Value> args[] = {
1772
- js.str (type == VirtualFileSystem::Stdio::OUT ? " stdout:" _kj : " stderr:" _kj)};
1773
- jsg::check (methodFunc->Call (js.v8Context (), console, 1 , args));
1770
+ methodFunc.call (js, console,
1771
+ js.str (type == VirtualFileSystem::Stdio::OUT ? " stdout:" _kj : " stderr:" _kj));
1774
1772
} else {
1775
- v8::Local<v8::Value> args[] = {
1776
- js.str (type == VirtualFileSystem::Stdio::OUT ? " stdout:" _kj : " stderr:" _kj),
1777
- js.str (chars.first (endPos))};
1778
- jsg::check (methodFunc->Call (js.v8Context (), console, 2 , args));
1773
+ methodFunc.call (js, console,
1774
+ js.str (type == VirtualFileSystem::Stdio::OUT ? " stdout:" _kj : " stderr:" _kj),
1775
+ js.str (chars.first (endPos)));
1779
1776
}
1780
1777
} else {
1781
- v8::Local<v8::Value> args[] = {js.str (chars.first (endPos))};
1782
- jsg::check (methodFunc->Call (js.v8Context (), console, 1 , args));
1778
+ methodFunc.call (js, console, js.str (chars.first (endPos)));
1783
1779
}
1780
+ return ;
1784
1781
}
1785
1782
}
1783
+ KJ_LOG (WARNING, " No console.log implementation available for stdio logging" );
1786
1784
}
1787
1785
1788
1786
// An StdioFile is a special file implementation used to represent stdin,
0 commit comments