@@ -117,10 +117,9 @@ class ProWrapper : public Napi::ObjectWrap<ProWrapper> {
117117 private:
118118 static Napi::Value proFeaturesForMessage (const Napi::CallbackInfo& info) {
119119 return wrapResult (info, [&] {
120- // we expect two arguments that match :
120+ // we expect one argument that matches :
121121 // first: {
122122 // "utf16": string,
123- // "proFeaturesBitset": bigint,
124123 // }
125124
126125 assertInfoLength (info, 1 );
@@ -132,25 +131,20 @@ class ProWrapper : public Napi::ObjectWrap<ProWrapper> {
132131 if (first.IsEmpty ())
133132 throw std::invalid_argument (" proFeaturesForMessage first received empty" );
134133
135- assertIsBigint (
136- first.Get (" proFeaturesBitset" ), " proFeaturesForMessage.proFeaturesBitset" );
137-
138134 auto lossless = true ;
139- SESSION_PROTOCOL_PRO_FEATURES flags =
140- first.Get (" proFeaturesBitset" ).As <Napi::BigInt>().Uint64Value (&lossless);
141135
142136 assertIsString (first.Get (" utf16" ), " proFeaturesForMessage.utf16" );
143137 std::u16string utf16 = first.Get (" utf16" ).As <Napi::String>().Utf16Value ();
144- auto pro_features_msg =
145- session::pro_features_for_utf16 ((utf16.data ()), utf16.length (), flags );
138+ ProFeaturesForMsg pro_features_msg =
139+ session::pro_features_for_utf16 ((utf16.data ()), utf16.length ());
146140
147141 auto obj = Napi::Object::New (env);
148142
149143 obj[" status" ] = toJs (env, proBackendEnumToString (pro_features_msg.status ));
150144 obj[" error" ] =
151145 pro_features_msg.error .size () ? toJs (env, pro_features_msg.error ) : env.Null ();
152146 obj[" codepointCount" ] = toJs (env, pro_features_msg.codepoint_count );
153- obj[" proFeaturesBitset " ] = proFeaturesToJsBitset (env, pro_features_msg.features );
147+ obj[" proMessageBitset " ] = proMessageBitsetToJS (env, pro_features_msg.bitset );
154148
155149 return obj;
156150 });
0 commit comments