@@ -1885,7 +1885,7 @@ void NativeCryptoKey::CreateCryptoKeyClass(
18851885}
18861886
18871887// Returns all of the key's internal slot values as a single Array:
1888- // [type, extractable, algorithm, usages, handle]. JS-side helpers
1888+ // [type enum , extractable, algorithm, usages, handle]. JS-side helpers
18891889// call this once per key to prime a per-instance cache, so subsequent
18901890// reads don't need to cross into C++ at all.
18911891void NativeCryptoKey::GetSlots (const FunctionCallbackInfo<Value>& args) {
@@ -1899,21 +1899,6 @@ void NativeCryptoKey::GetSlots(const FunctionCallbackInfo<Value>& args) {
18991899 Local<Object> obj = args[0 ].As <Object>();
19001900 NativeCryptoKey* native = Unwrap<NativeCryptoKey>(obj);
19011901
1902- const char * type_str;
1903- switch (native->handle_data_ .GetKeyType ()) {
1904- case kKeyTypeSecret :
1905- type_str = " secret" ;
1906- break ;
1907- case kKeyTypePublic :
1908- type_str = " public" ;
1909- break ;
1910- case kKeyTypePrivate :
1911- type_str = " private" ;
1912- break ;
1913- default :
1914- UNREACHABLE ();
1915- }
1916-
19171902 Local<Object> handle;
19181903 if (!KeyObjectHandle::Create (env, native->handle_data_ ).ToLocal (&handle)) {
19191904 return ;
@@ -1924,7 +1909,7 @@ void NativeCryptoKey::GetSlots(const FunctionCallbackInfo<Value>& args) {
19241909 CHECK (algorithm->IsObject ());
19251910 CHECK (usages->IsArray ());
19261911 Local<Value> slots[] = {
1927- OneByteString (isolate, type_str ),
1912+ Uint32::NewFromUnsigned (isolate, native-> handle_data_ . GetKeyType () ),
19281913 v8::Boolean::New (isolate, native->extractable_ ),
19291914 algorithm,
19301915 usages,
0 commit comments