public void SerializeProperty(
     BsonWriter bsonWriter,
     object obj,
     BsonPropertyMap propertyMap
 )
 {
     var value = (BsonJavaScriptWithScope) propertyMap.Getter(obj);
     if (value == null) {
         bsonWriter.WriteNull(propertyMap.ElementName);
     } else {
         bsonWriter.WriteJavaScriptWithScope(propertyMap.ElementName, value.Code);
         value.Scope.WriteTo(bsonWriter);
     }
 }