Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

runtime: distinguish buffers

  • Loading branch information...
commit c9f034d08da027652ea4fbf497e422b0d2138b93 1 parent ecb0375
@indutny authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/runtime.cc
View
7 src/runtime.cc
@@ -1,4 +1,5 @@
#include "runtime.h"
+#include "bindings/buffer.h" // Buffer
#include <stdlib.h> // NULL
#include <stdio.h> // fprintf
@@ -18,7 +19,11 @@ void PrettyPrint(Value* value) {
fprintf(stdout, "\033[1;30m" "nil" "\033[0m");
break;
case Value::kCData:
- fprintf(stdout, "\033[1;31m" "cdata" "\033[0m");
+ if (Buffer::HasInstance(value)) {
+ fprintf(stdout, "\033[1;31m" "buffer" "\033[0m");
+ } else {
+ fprintf(stdout, "\033[1;31m" "cdata" "\033[0m");
+ }
break;
case Value::kFunction:
fprintf(stdout, "\033[1;36m" "function" "\033[0m");
Please sign in to comment.
Something went wrong with that request. Please try again.