Commit 5f3868f3 authored by cbruni's avatar cbruni Committed by Commit bot

[d8] Add support for printing symbols

BUG=

Review URL: https://codereview.chromium.org/1550113002

Cr-Commit-Position: refs/heads/master@{#33055}
parent 2545f188
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment