Skip to content

Commit 4d2212c

Browse files
authored
Fix broken Api.js
The change that tried to silence log messages instead broke most of the API methods. This change should fix that.
1 parent ee3f5a0 commit 4d2212c

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

src/cordova/Api.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ var shell = require('shelljs');
99
var path = require('path');
1010

1111
var CordovaLogger = require('cordova-common').CordovaLogger;
12-
var selfEvents = require('cordova-common').events;
12+
var events = require('cordova-common').events;
1313

1414
var PLATFORM_NAME = 'testplatform';
1515

1616
function setupEvents(externalEventEmitter) {
1717
if (externalEventEmitter) {
1818
// This will make the platform internal events visible outside
19-
selfEvents.forwardEventsTo(externalEventEmitter);
19+
events.forwardEventsTo(externalEventEmitter);
2020
return externalEventEmitter;
2121
}
2222

2323
// There is no logger if external emitter is not present,
2424
// so attach a console logger
25-
CordovaLogger.get().subscribe(selfEvents);
26-
return selfEvents;
25+
CordovaLogger.get().subscribe(events);
26+
return events;
2727
}
2828

2929
function Api(platform, platformRootDir, events) {
@@ -47,9 +47,9 @@ function Api(platform, platformRootDir, events) {
4747

4848
}
4949

50-
Api.createPlatform = function (destination, config, options, events) {
50+
Api.createPlatform = function (destination, config, options, externalEvents) {
5151

52-
events = setupEvents(events);
52+
events = setupEvents(externalEvents);
5353

5454
// create the destination and the standard place for our api to live
5555
// platforms/platformName/cordova/Api.js
@@ -74,7 +74,7 @@ Api.createPlatform = function (destination, config, options, events) {
7474
};
7575

7676

77-
Api.updatePlatform = function (destination, options, events) {
77+
Api.updatePlatform = function (destination, options) {
7878
events.emit('log', "test-platform:Api:updatePlatform");
7979
// todo?: create projectInstance and fulfill promise with it.
8080
return Promise.resolve();

0 commit comments

Comments
 (0)