diff --git a/native_mate/converter.cc b/native_mate/converter.cc index 4750e5a30a1d..1bda229985c1 100644 --- a/native_mate/converter.cc +++ b/native_mate/converter.cc @@ -146,6 +146,19 @@ bool Converter >::FromV8(Isolate* isolate, Handle val, return true; } +Handle Converter >::ToV8(Isolate* isolate, + Handle val) { + return val; +} + +bool Converter >::FromV8(Isolate* isolate, Handle val, + Handle* out) { + if (!val->IsString()) + return false; + *out = Handle::Cast(val); + return true; +} + Handle Converter >::ToV8(Isolate* isolate, Handle val) { return val; diff --git a/native_mate/converter.h b/native_mate/converter.h index 8f94aa815440..457d4d3341c6 100644 --- a/native_mate/converter.h +++ b/native_mate/converter.h @@ -120,6 +120,15 @@ struct Converter > { v8::Handle* out); }; +template<> +struct Converter > { + static v8::Handle ToV8(v8::Isolate* isolate, + v8::Handle val); + static bool FromV8(v8::Isolate* isolate, + v8::Handle val, + v8::Handle* out); +}; + template<> struct Converter > { static v8::Handle ToV8(v8::Isolate* isolate,