@@ -713,18 +713,21 @@ inline kj::String KJ_STRINGIFY(const JsValue& value) {
713713 return value.toString (jsg::Lock::current ());
714714}
715715
716+ template <typename T>
717+ concept JsValueType = std::is_assignable_v<JsValue, T>;
718+
716719template <typename TypeWrapper>
717720struct JsValueWrapper {
718721#define TYPES_TO_WRAP (V ) \
719722 V (Value) \
720723 JS_TYPE_CLASSES (V)
721724
722- template <typename T, typename = kj::EnableIf<std::is_assignable_v<JsValue, T>> >
725+ template <JsValueType T >
723726 static constexpr const std::type_info& getName (T*) {
724727 return typeid (T);
725728 }
726729
727- template <typename T, typename = kj::EnableIf<std::is_assignable_v<JsValue, T>> >
730+ template <JsValueType T >
728731 static constexpr const std::type_info& getName (JsRef<T>*) {
729732 return typeid (T);
730733 }
@@ -742,7 +745,7 @@ struct JsValueWrapper {
742745 TYPES_TO_WRAP (V)
743746#undef V
744747
745- template <typename T, typename = kj::EnableIf<std::is_assignable_v<JsValue, T>> >
748+ template <JsValueType T >
746749 kj::Maybe<T> tryUnwrap (Lock& js,
747750 v8::Local<v8::Context> context,
748751 v8::Local<v8::Value> handle,
@@ -763,7 +766,7 @@ struct JsValueWrapper {
763766 }
764767 }
765768
766- template <typename T, typename = kj::EnableIf<std::is_assignable_v<JsValue, T>> >
769+ template <JsValueType T >
767770 kj::Maybe<JsRef<T>> tryUnwrap (Lock& js,
768771 v8::Local<v8::Context> context,
769772 v8::Local<v8::Value> handle,
0 commit comments