aboutsummaryrefslogtreecommitdiffhomepage
path: root/js
diff options
context:
space:
mode:
authorGravatar Adam Cozzette <acozzette@google.com>2017-12-04 15:08:10 -0800
committerGravatar Adam Cozzette <acozzette@google.com>2017-12-05 10:41:31 -0800
commite372df5c975dc9720c9252e9b0b25c03e7c4b713 (patch)
treef1310305536257af74c2a830b34c4a8f020f48c2 /js
parent7bb8584f9d4114fda7360f9f677bcc04e718be18 (diff)
Fixed failing JS tests
Diffstat (limited to 'js')
-rw-r--r--js/commonjs/export_testdeps.js1
-rw-r--r--js/debug.js2
-rw-r--r--js/debug_test.js2
-rw-r--r--js/message_test.js9
4 files changed, 3 insertions, 11 deletions
diff --git a/js/commonjs/export_testdeps.js b/js/commonjs/export_testdeps.js
index 6f5cd083..96d3f347 100644
--- a/js/commonjs/export_testdeps.js
+++ b/js/commonjs/export_testdeps.js
@@ -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');
diff --git a/js/debug.js b/js/debug.js
index 0b2c5f6a..4ae3c2a2 100644
--- a/js/debug.js
+++ b/js/debug.js
@@ -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;
diff --git a/js/debug_test.js b/js/debug_test.js
index 73810871..d0d646a5 100644
--- a/js/debug_test.js
+++ b/js/debug_test.js
@@ -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();
diff --git a/js/message_test.js b/js/message_test.js
index 9944c741..0acebb75 100644
--- a/js/message_test.js
+++ b/js/message_test.js
@@ -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);
- });
-
});