summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-06-10 02:02:40 +0200
committerRyan Dahl <ry@tinyclouds.org>2018-06-10 02:02:40 +0200
commit9df9cdae07048564a9d81e9ea67159d49196a1df (patch)
tree1414a7444fa1b2569ef8c00d4ade13b30996986f
parentf7e99424ee2b422989eee18bf825e2a6f59c2625 (diff)
deno2 Simplify Print binding.
-rw-r--r--deno2/deno.cc18
1 files changed, 5 insertions, 13 deletions
diff --git a/deno2/deno.cc b/deno2/deno.cc
index db7abb116..d42879780 100644
--- a/deno2/deno.cc
+++ b/deno2/deno.cc
@@ -98,20 +98,12 @@ void ExitOnPromiseRejectCallback(
}
void Print(const v8::FunctionCallbackInfo<v8::Value>& args) {
- bool first = true;
+ assert(args.Length() == 1);
auto* isolate = args.GetIsolate();
- for (int i = 0; i < args.Length(); i++) {
- v8::HandleScope handle_scope(isolate);
- if (first) {
- first = false;
- } else {
- printf(" ");
- }
- v8::String::Utf8Value str(isolate, args[i]);
- const char* cstr = ToCString(str);
- printf("%s", cstr);
- }
- printf("\n");
+ v8::HandleScope handle_scope(isolate);
+ v8::String::Utf8Value str(isolate, args[0]);
+ const char* cstr = ToCString(str);
+ printf("%s\n", cstr);
fflush(stdout);
}