Skip to content

Commit

Permalink
Fixed failing JS tests
Browse files Browse the repository at this point in the history
  • Loading branch information
acozzette committed Dec 5, 2017
1 parent 7bb8584 commit e372df5
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 11 deletions.
1 change: 1 addition & 0 deletions js/commonjs/export_testdeps.js
Expand Up @@ -12,6 +12,7 @@
goog.provide('jspb.ExportTestDeps');

goog.require('goog.crypt.base64');
goog.require('goog.testing.PropertyReplacer');
goog.require('jspb.arith.Int64');
goog.require('jspb.arith.UInt64');
goog.require('jspb.BinaryEncoder');
Expand Down
2 changes: 1 addition & 1 deletion js/debug.js
Expand Up @@ -79,7 +79,7 @@ jspb.debug.dump_ = function(thing) {
type == 'null' || type == 'undefined') {
return thing;
}
if (window.Uint8Array) {
if (typeof Uint8Array !== 'undefined') {
// Will fail on IE9, where Uint8Array doesn't exist.
if (message instanceof Uint8Array) {
return thing;
Expand Down
2 changes: 1 addition & 1 deletion js/debug_test.js
Expand Up @@ -77,7 +77,7 @@ describe('debugTest', function() {
});

it('testBytes', function() {
if (COMPILED || !window['Uint8Array']) {
if (COMPILED || typeof Uint8Array == 'undefined') {
return;
}
var message = new proto.jspb.test.TestAllTypes();
Expand Down
9 changes: 0 additions & 9 deletions js/message_test.js
Expand Up @@ -1052,13 +1052,4 @@ describe('Message test suite', function() {
assertNan(message.getDefaultDoubleField());
});

it('testSerializePreservesEmptyNestedField', function() {
var message = new proto.jspb.test.OptionalFields();
message.setANestedMessage(new proto.jspb.test.OptionalFields.Nested());
message.addARepeatedMessage(new proto.jspb.test.OptionalFields.Nested());
message = proto.jspb.test.OptionalFields.deserialize(message.serialize());
assertNotNullNorUndefined(message.getANestedMessage());
assertEquals(1, message.getARepeatedMessageList().length);
});

});

0 comments on commit e372df5

Please sign in to comment.