If the scope is empty, bson_append_code_with_scope delegates instead to bson_append_code, changing the requested type.
This behavior is undocumented.
The offending lines appear to be 955-957 in bson.c:
if (bson_empty0 (scope)) { return bson_append_code (bson, key, key_length, javascript); }
- is duplicated by
-
CDRIVER-1335 libbson does not properly serialize the Code type to JSON
- Closed
- related to
-
CDRIVER-1879 libbson truncates code_with_scope with embedded nulls in javascript
- Closed
-
PHPC-714 Implement BSON corpus test suite
- Closed