Index: src/d8.cc |
diff --git a/src/d8.cc b/src/d8.cc |
index 00a59e413e66eb533df3fe8860ce7619f29d722c..c58c172640edfd31fe0c2e876c8ab98f739cd869 100644 |
--- a/src/d8.cc |
+++ b/src/d8.cc |
@@ -656,9 +656,13 @@ void Shell::Write(const v8::FunctionCallbackInfo<v8::Value>& args) { |
// Explicitly catch potential exceptions in toString(). |
v8::TryCatch try_catch(args.GetIsolate()); |
+ Local<Value> arg = args[i]; |
Local<String> str_obj; |
- if (!args[i] |
- ->ToString(args.GetIsolate()->GetCurrentContext()) |
+ |
+ if (arg->IsSymbol()) { |
+ arg = Local<Symbol>::Cast(arg)->Name(); |
+ } |
+ if (!arg->ToString(args.GetIsolate()->GetCurrentContext()) |
.ToLocal(&str_obj)) { |
try_catch.ReThrow(); |
return; |