Skip to content

Commit

Permalink
Add missing JS imports (#363)
Browse files Browse the repository at this point in the history
Add missing goog.require() statements into the JS code where needed.
Older versions of Closure Compiler were somewhat relaxed in requiring
these imports, but newer do require all of them to be explicitly
require()'ed.

This contributes to the JS modernization effort tracked by #264.
  • Loading branch information
emaxx-google authored Jul 26, 2021
1 parent 3ced08b commit 39e37b7
Show file tree
Hide file tree
Showing 31 changed files with 47 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ goog.provide('GoogleSmartCard.IntegrationTestController');
goog.require('GoogleSmartCard.NaclModule');
goog.require('GoogleSmartCard.RemoteCallMessage');
goog.require('GoogleSmartCard.Requester');
goog.require('goog.Promise');
goog.require('goog.testing.PropertyReplacer');

goog.setTestOnly();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
goog.provide('GoogleSmartCard.BackgroundPageUnloadPreventing.IFrameMain');

goog.require('GoogleSmartCard.Logging');
goog.require('goog.log.Logger');

goog.scope(function() {

Expand Down
1 change: 1 addition & 0 deletions common/js/src/deferred-processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ goog.require('GoogleSmartCard.Logging');
goog.require('GoogleSmartCard.PromiseHelpers');
goog.require('goog.Disposable');
goog.require('goog.Promise');
goog.require('goog.promise.Resolver');
goog.require('goog.structs.Queue');

goog.scope(function() {
Expand Down
2 changes: 2 additions & 0 deletions common/js/src/executable-module/emscripten-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ goog.require('GoogleSmartCard.Logging');
goog.require('GoogleSmartCard.PromiseHelpers');
goog.require('GoogleSmartCard.TypedMessage');
goog.require('goog.Promise');
goog.require('goog.asserts');
goog.require('goog.html.TrustedResourceUrl');
goog.require('goog.log.Logger');
goog.require('goog.messaging.AbstractChannel');
goog.require('goog.net.jsloader');
goog.require('goog.promise.Resolver');
goog.require('goog.string.Const');

goog.scope(function() {
Expand Down
1 change: 1 addition & 0 deletions common/js/src/i18n-unittest.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
goog.require('GoogleSmartCard.I18n');
goog.require('goog.dom');
goog.require('goog.testing');
goog.require('goog.testing.PropertyReplacer');
goog.require('goog.testing.jsunit');

goog.setTestOnly();
Expand Down
1 change: 1 addition & 0 deletions common/js/src/logging/crash-loop-detection-unittest.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

goog.require('GoogleSmartCard.Logging.CrashLoopDetection');
goog.require('goog.testing.PropertyReplacer');
goog.require('goog.testing.jsunit');

goog.setTestOnly();
Expand Down
1 change: 1 addition & 0 deletions common/js/src/logging/logging.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ goog.require('goog.debug.Console');
goog.require('goog.log');
goog.require('goog.log.Level');
goog.require('goog.log.Logger');
goog.require('goog.object');

goog.scope(function() {

Expand Down
1 change: 1 addition & 0 deletions common/js/src/messaging/message-channel-pair.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ goog.provide('GoogleSmartCard.MessageChannelPair');
goog.require('GoogleSmartCard.Logging');
goog.require('goog.Disposable');
goog.require('goog.async.nextTick');
goog.require('goog.log.Logger');
goog.require('goog.messaging.AbstractChannel');

goog.scope(function() {
Expand Down
1 change: 1 addition & 0 deletions common/js/src/messaging/message-channel-pinging.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ goog.require('goog.async.nextTick');
goog.require('goog.log');
goog.require('goog.log.Logger');
goog.require('goog.messaging.AbstractChannel');
goog.require('goog.object');

goog.scope(function() {

Expand Down
1 change: 1 addition & 0 deletions common/js/src/messaging/port-message-channel-unittest.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ goog.require('GoogleSmartCard.MockPort');
goog.require('GoogleSmartCard.PortMessageChannel');
goog.require('GoogleSmartCard.TypedMessage');
goog.require('goog.Promise');
goog.require('goog.asserts');
goog.require('goog.testing.PropertyReplacer');
goog.require('goog.testing.jsunit');
goog.require('goog.testing.mockmatchers');
Expand Down
1 change: 1 addition & 0 deletions common/js/src/messaging/port-message-channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ goog.require('GoogleSmartCard.TypedMessage');
goog.require('goog.asserts');
goog.require('goog.log.Logger');
goog.require('goog.messaging.AbstractChannel');
goog.require('goog.object');

goog.scope(function() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ goog.require('GoogleSmartCard.MessageChannelPinging.Pinger');
goog.require('GoogleSmartCard.SingleMessageBasedChannel');
goog.require('GoogleSmartCard.TypedMessage');
goog.require('goog.Promise');
goog.require('goog.asserts');
goog.require('goog.promise.Resolver');
goog.require('goog.testing');
goog.require('goog.testing.PropertyReplacer');
goog.require('goog.testing.StrictMock');
goog.require('goog.testing.jsunit');
goog.require('goog.testing.mockmatchers');

Expand Down
1 change: 1 addition & 0 deletions common/js/src/requesting/request-receiver.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ goog.require('GoogleSmartCard.Logging');
goog.require('GoogleSmartCard.RequesterMessage');
goog.require('GoogleSmartCard.RequesterMessage.RequestMessageData');
goog.require('GoogleSmartCard.RequesterMessage.ResponseMessageData');
goog.require('goog.Promise');
goog.require('goog.asserts');
goog.require('goog.log.Logger');
goog.require('goog.messaging.AbstractChannel');
Expand Down
1 change: 1 addition & 0 deletions example_cpp_smart_card_client_app/src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ goog.require('GoogleSmartCard.PcscLiteCommon.Constants');
goog.require('GoogleSmartCard.PopupWindow.Server');
goog.require('SmartCardClientApp.BuiltInPinDialog.Backend');
goog.require('SmartCardClientApp.CertificateProviderBridge.Backend');
goog.require('goog.asserts');
goog.require('goog.log.Level');
goog.require('goog.log.Logger');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ goog.provide('SmartCardClientApp.BuiltInPinDialog.Backend');
goog.require('GoogleSmartCard.PopupWindow.Server');
goog.require('GoogleSmartCard.RequestReceiver');
goog.require('goog.Promise');
goog.require('goog.log.Logger');
goog.require('goog.messaging.AbstractChannel');
goog.require('goog.object');
goog.require('goog.promise.Resolver');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ goog.require('GoogleSmartCard.RemoteCallMessage');
goog.require('GoogleSmartCard.RequestReceiver');
goog.require('GoogleSmartCard.Requester');
goog.require('goog.Disposable');
goog.require('goog.Promise');
goog.require('goog.array');
goog.require('goog.log.Logger');
goog.require('goog.object');
Expand Down
4 changes: 4 additions & 0 deletions example_cpp_smart_card_client_app/src/window.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ goog.require('GoogleSmartCard.Logging');
goog.require('GoogleSmartCard.ObjectHelpers');
goog.require('GoogleSmartCard.PopupWindow.Client');
goog.require('goog.dom');
goog.require('goog.events');
goog.require('goog.events.EventType');
goog.require('goog.log.Level');
goog.require('goog.log.Logger');
goog.require('goog.messaging.MessageChannel');

goog.scope(function() {
Expand Down
3 changes: 3 additions & 0 deletions smart_card_connector_app/src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ goog.require('GoogleSmartCard.PcscLiteServerClientsManagement.ClientHandler');
goog.require('GoogleSmartCard.PcscLiteServerClientsManagement.ReadinessTracker');
goog.require('GoogleSmartCard.PortMessageChannel');
goog.require('GoogleSmartCard.SingleMessageBasedChannel');
goog.require('goog.asserts');
goog.require('goog.log.Logger');
goog.require('goog.messaging.AbstractChannel');

goog.scope(function() {

Expand Down
1 change: 1 addition & 0 deletions smart_card_connector_app/src/window-about-showing.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
goog.provide('GoogleSmartCard.ConnectorApp.Window.AboutShowing');

goog.require('goog.dom');
goog.require('goog.events');
goog.require('goog.events.EventType');

goog.scope(function() {
Expand Down
1 change: 1 addition & 0 deletions smart_card_connector_app/src/window-apps-displaying.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ goog.require('GoogleSmartCard.DebugDump');
goog.require('GoogleSmartCard.Logging');
goog.require('GoogleSmartCard.PcscLiteServerClientsManagement.PermissionsChecking.KnownApp');
goog.require('GoogleSmartCard.PcscLiteServerClientsManagement.PermissionsChecking.KnownAppsRegistry');
goog.require('goog.Promise');
goog.require('goog.array');
goog.require('goog.asserts');
goog.require('goog.dom');
Expand Down
3 changes: 3 additions & 0 deletions smart_card_connector_app/src/window-devices-displaying.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ goog.require('GoogleSmartCard.PcscLiteServer.ReaderTracker');
goog.require('goog.asserts');
goog.require('goog.dom');
goog.require('goog.dom.dataset');
goog.require('goog.events');
goog.require('goog.events.EventType');
goog.require('goog.log.Logger');
goog.require('goog.string');

goog.scope(function() {

/**
Expand Down
1 change: 1 addition & 0 deletions smart_card_connector_app/src/window-help-showing.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
goog.provide('GoogleSmartCard.ConnectorApp.Window.HelpShowing');

goog.require('goog.dom');
goog.require('goog.events');
goog.require('goog.events.EventType');

goog.scope(function() {
Expand Down
1 change: 1 addition & 0 deletions smart_card_connector_app/src/window-logs-exporting.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ goog.require('GoogleSmartCard.Clipboard');
goog.require('GoogleSmartCard.Logging');
goog.require('goog.Timer');
goog.require('goog.dom');
goog.require('goog.events');
goog.require('goog.events.EventType');
goog.require('goog.log.Logger');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ goog.require('GoogleSmartCard.Requester');
goog.require('GoogleSmartCard.RequestReceiver');
goog.require('GoogleSmartCard.SingleMessageBasedChannel');
goog.require('goog.Promise');
goog.require('goog.array');
goog.require('goog.messaging.AbstractChannel');
goog.require('goog.testing');
goog.require('goog.testing.MockControl');
goog.require('goog.testing.PropertyReplacer');
goog.require('goog.testing.jsunit');
goog.require('goog.testing.mockmatchers');

Expand Down
3 changes: 3 additions & 0 deletions third_party/pcsc-lite/naclport/js_client/src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ goog.require('GoogleSmartCard.RemoteCallMessage');
goog.require('GoogleSmartCard.Requester');
goog.require('goog.Disposable');
goog.require('goog.Promise');
goog.require('goog.array');
goog.require('goog.asserts');
goog.require('goog.async.nextTick');
goog.require('goog.log.Logger');
goog.require('goog.messaging.AbstractChannel');

goog.scope(function() {
Expand Down
1 change: 1 addition & 0 deletions third_party/pcsc-lite/naclport/js_client/src/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ goog.require('GoogleSmartCard.PortMessageChannel');
goog.require('goog.Disposable');
goog.require('goog.array');
goog.require('goog.asserts');
goog.require('goog.async.nextTick');
goog.require('goog.log.Logger');
goog.require('goog.messaging.AbstractChannel');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ goog.require('GoogleSmartCard.Logging');
goog.require('GoogleSmartCard.PcscLiteClient.API');
goog.require('GoogleSmartCard.PcscLiteClient.Context');
goog.require('goog.array');
goog.require('goog.async.nextTick');
goog.require('goog.iter');
goog.require('goog.log.Logger');
goog.require('goog.messaging.AbstractChannel');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ goog.require('goog.iter.Iterator');
goog.require('goog.log.Logger');
goog.require('goog.messaging.AbstractChannel');
goog.require('goog.object');
goog.require('goog.string');

goog.scope(function() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ goog.provide('GoogleSmartCard.PcscLiteServerClientsManagement.PermissionsCheckin

goog.require('GoogleSmartCard.Logging');
goog.require('goog.Promise');
goog.require('goog.array');
goog.require('goog.log.Logger');
goog.require('goog.object');
goog.require('goog.promise.Resolver');

goog.scope(function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@ goog.provide('GoogleSmartCard.PcscLiteServerClientsManagement.PermissionsCheckin

goog.require('GoogleSmartCard.Logging');
goog.require('GoogleSmartCard.PopupWindow.Client');
goog.require('goog.asserts');
goog.require('goog.dom');
goog.require('goog.dom.classlist');
goog.require('goog.events');
goog.require('goog.log.Logger');
goog.require('goog.string');

goog.scope(function() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ goog.require('GoogleSmartCard.PopupWindow.Server');
goog.require('goog.Promise');
goog.require('goog.testing');
goog.require('goog.testing.MockControl');
goog.require('goog.testing.PropertyReplacer');
goog.require('goog.testing.jsunit');
goog.require('goog.testing.mockmatchers');

Expand Down

0 comments on commit 39e37b7

Please sign in to comment.