Skip to content

Commit

Permalink
Remove checks for $stderr methods in KernelModule::print
Browse files Browse the repository at this point in the history
This TODO with hooks for setting the global has been done.
  • Loading branch information
herwinw committed Jul 9, 2024
1 parent f26dc33 commit c97b8d3
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/kernel_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -510,16 +510,6 @@ Value KernelModule::p(Env *env, Args args) {
Value KernelModule::print(Env *env, Args args) {
auto _stdout = env->global_get("$stdout"_s);
assert(_stdout);
// NATFIXME: This prevents crashes when $stdout is set to an object that
// doesn't have a write method. Technically this should be done when
// setting the global, but we dont have a hook for that yet, so this will
// do for now.
if (!_stdout->respond_to(env, "write"_s)) {
env->raise("TypeError", "$stdout must have write method, {} given", _stdout->klass()->inspect_str());
}
if (!_stdout->respond_to(env, "print"_s)) {
env->raise("TypeError", "$stdout must have print method, {} given", _stdout->klass()->inspect_str());
}
if (args.size() == 0)
args = Args { env->global_get("$_"_s) };
// NATFIXME: Kernel.print should actually call IO.print and not
Expand Down

0 comments on commit c97b8d3

Please sign in to comment.