Skip to content

Commit

Permalink
Quote string keys
Browse files Browse the repository at this point in the history
  • Loading branch information
stanley-cheung committed Apr 30, 2020
1 parent 5864e5d commit 5c1b6c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions javascript/net/grpc/web/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ closure_js_test(
":interceptor",
"@io_bazel_rules_closure//closure/library/crypt:base64",
"@io_bazel_rules_closure//closure/library/events",
"@io_bazel_rules_closure//closure/library/net:eventtype",
"@io_bazel_rules_closure//closure/library/structs:map",
"@io_bazel_rules_closure//closure/library/testing:jsunit",
"@io_bazel_rules_closure//closure/library/testing:testsuite",
Expand Down
10 changes: 5 additions & 5 deletions javascript/net/grpc/web/grpcwebclientbase_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ testSuite({
}
}, function(error, response) {
assertNull(error);
assertEquals(PROTO_FIELD_VALUE, response.field1);
assertEquals(PROTO_FIELD_VALUE, response['field1']);
});
dataCallback();
},

testStreamInterceptor: function() {
var interceptor = new StreamResponseInterceptor();
var client = new GrpcWebClientBase({streamInterceptors: [interceptor]});
var client = new GrpcWebClientBase({'streamInterceptors': [interceptor]});
client.newXhr_ = function() {
return new MockXhr({
// This parses to [ { DATA: [4,5,6] }, { TRAILER: "a: b" } ]
Expand All @@ -108,7 +108,7 @@ testSuite({
},
function(error, response) {
assertNull(error);
assertEquals('field2', response.field2);
assertEquals('field2', response['field2']);
});
dataCallback();
},
Expand Down Expand Up @@ -161,7 +161,7 @@ testSuite({
}
}, function(error, response) {
assertNull(error);
assertEquals(PROTO_FIELD_VALUE, response.field1);
assertEquals(PROTO_FIELD_VALUE, response['field1']);
});
call.on('metadata', (metadata) => {
assertEquals(metadata['sample-initial-metadata-1'],
Expand Down Expand Up @@ -292,7 +292,7 @@ StreamResponseInterceptor.prototype.intercept = function(request, invoker) {
InterceptedStream.prototype.on = function(eventType, callback) {
if (eventType == 'data') {
const newCallback = (response) => {
response.field2 = 'field2';
response['field2'] = 'field2';
callback(response);
};
this.stream.on(eventType, newCallback);
Expand Down

0 comments on commit 5c1b6c7

Please sign in to comment.