diff --git a/native_mate/converter.h b/native_mate/converter.h index 07c01d6..0574a8f 100644 --- a/native_mate/converter.h +++ b/native_mate/converter.h @@ -343,7 +343,7 @@ struct ToV8Traits { template bool TryConvertToV8(v8::Isolate* isolate, - T input, + const T& input, v8::Local* output) { return ToV8Traits::TryConvertToV8(isolate, input, output); } diff --git a/native_mate/dictionary.h b/native_mate/dictionary.h index 5a56a9e..9e80cb9 100644 --- a/native_mate/dictionary.h +++ b/native_mate/dictionary.h @@ -69,7 +69,7 @@ class Dictionary { } template - bool Set(const base::StringPiece& key, T val) { + bool Set(const base::StringPiece& key, const T& val) { v8::Local v8_value; if (!TryConvertToV8(isolate_, val, &v8_value)) return false;