[
https://issues.apache.org/jira/browse/CB-10940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15215469#comment-15215469
]
ASF GitHub Bot commented on CB-10940:
-------------------------------------
Github user daserge commented on a diff in the pull request:
https://github.com/apache/cordova-lib/pull/418#discussion_r57673750
--- Diff: cordova-common/spec/events.spec.js ---
@@ -0,0 +1,30 @@
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+var events = require('../src/events');
+
+describe('forwardEventsTo method', function () {
+ afterEach(function() {
+ events.forwardEventsTo(null);
+ });
+ it('should not go to infinite loop when trying to forward to self',
function () {
+ events.forwardEventsTo(events);
+ events.emit('log', 'test message');
--- End diff --
This test will fail if we go into an infinite recursion as the title says.
I will add another one for the `EVENTS_RECEIVER` internals check - although
would it be better not to use rewire but to verify that forwarding has been
reset after `events.forwardEventsTo(events)` call (the behavior change we are
discussing below)?
> Can't add Android platform from path
> ------------------------------------
>
> Key: CB-10940
> URL: https://issues.apache.org/jira/browse/CB-10940
> Project: Apache Cordova
> Issue Type: Bug
> Components: Android
> Affects Versions: Master
> Environment: Tried on Windows and Mac
> 6.1.1-dev ([email protected])
> Reporter: Karen Tran
> Assignee: Sergey Shakhnazarov
> Labels: android, platform
> Fix For: Master
>
>
> Ran into this issue when trying to create mobile-spec. I cannot add the
> android platform from a path. This only happens on master. If I switch
> cordova-android repo to 5.1.x branch, this issue doesn't happen.
> Error from Mac:
> {noformat}
> myComputer$ cordova platform add ../cordova-android -dd
> Executing "before_platform_add" hook for all plugins.
> Adding android project...
> PlatformApi successfully found for platform android
> /Users/myComputer/cordova_apache_master/cordova-cli/node_modules/cordova-common/src/CordovaLogger.js:212
> if(message.toUpperCase().indexOf('ERROR:') !== 0) {
> ^
> TypeError: Cannot call method 'toUpperCase' of undefined
> at formatError
> (/Users/myComputer/cordova_apache_master/cordova-cli/node_modules/cordova-common/src/CordovaLogger.js:212:16)
> at CordovaLogger.log
> (/Users/myComputer/cordova_apache_master/cordova-cli/node_modules/cordova-common/src/CordovaLogger.js:93:19)
> at process.<anonymous>
> (/Users/myComputer/cordova_apache_master/cordova-cli/src/cli.js:136:16)
> at process.EventEmitter.emit (events.js:95:17)
> at process._fatalException (node.js:272:26){noformat}
> Error from Windows:
> {noformat}
> Error: RangeError: Maximum call stack size exceeded
> at EventEmitter.module.exports.emit
> (C:\Users\myComputer\cordova_master\cordo
> va-lib\cordova-common\src\events.js:61:30)
> at EventEmitter.module.exports.emit
> (C:\Users\myComputer\cordova_master\cordo
> va-lib\cordova-common\src\events.js:61:30)
> at EventEmitter.module.exports.emit
> (C:\Users\myComputer\cordova_master\cordo
> va-lib\cordova-common\src\events.js:61:30)
> at EventEmitter.module.exports.emit
> (C:\Users\myComputer\cordova_master\cordo
> va-lib\cordova-common\src\events.js:61:30)
> at EventEmitter.module.exports.emit
> (C:\Users\myComputer\cordova_master\cordo
> va-lib\cordova-common\src\events.js:61:30)
> at EventEmitter.module.exports.emit
> (C:\Users\myComputer\cordova_master\cordo
> va-lib\cordova-common\src\events.js:61:30)
> at EventEmitter.module.exports.emit
> (C:\Users\myComputer\cordova_master\cordo
> va-lib\cordova-common\src\events.js:61:30)
> at EventEmitter.module.exports.emit
> (C:\Users\myComputer\cordova_master\cordo
> va-lib\cordova-common\src\events.js:61:30)
> at EventEmitter.module.exports.emit
> (C:\Users\myComputer\cordova_master\cordo
> va-lib\cordova-common\src\events.js:61:30)
> at EventEmitter.module.exports.emit
> (C:\Users\myComputer\cordova_master\cordo
> va-lib\cordova-common\src\events.js:61:30) {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]