Skip to content
This repository was archived by the owner on Sep 23, 2024. It is now read-only.

Commit 5189f85

Browse files
committed
fix(symbol): upgrade deprecated symbol type to string
1 parent 4d4a3a7 commit 5189f85

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Diff for: ext/bson.cc

+3-6
Original file line numberDiff line numberDiff line change
@@ -1007,12 +1007,9 @@ Local<Value> BSONDeserializer::DeserializeValue(BsonType type, bool raw)
10071007
case BSON_TYPE_OBJECT:
10081008
return DeserializeDocument(raw);
10091009

1010-
case BSON_TYPE_SYMBOL: {
1011-
const Local<String>& string = ReadString();
1012-
Local<Value> argv[] = { string };
1013-
Nan::MaybeLocal<Object> obj = Nan::NewInstance(Nan::New(bson->symbolConstructor), 1, argv);
1014-
return obj.ToLocalChecked();
1015-
}
1010+
case BSON_TYPE_SYMBOL:
1011+
// symbol is deprecated, upgrade to string
1012+
return ReadString();
10161013

10171014
case BSON_TYPE_MIN_KEY: {
10181015
Nan::MaybeLocal<Object> obj = Nan::NewInstance(Nan::New(bson->minKeyConstructor));

0 commit comments

Comments
 (0)