Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 8B122200BE7 for ; Tue, 6 Dec 2016 00:45:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 89BD6160B18; Mon, 5 Dec 2016 23:45:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C8FF3160B21 for ; Tue, 6 Dec 2016 00:44:59 +0100 (CET) Received: (qmail 1612 invoked by uid 500); 5 Dec 2016 23:44:58 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 1368 invoked by uid 99); 5 Dec 2016 23:44:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Dec 2016 23:44:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 9B3D32C2A6D for ; Mon, 5 Dec 2016 23:44:58 +0000 (UTC) Date: Mon, 5 Dec 2016 23:44:58 +0000 (UTC) From: "Joe Bowser (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CB-12218) inconsistent null handling between EVAL and ONLINE bridge modes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 05 Dec 2016 23:45:00 -0000 [ https://issues.apache.org/jira/browse/CB-12218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15723759#comment-15723759 ] Joe Bowser commented on CB-12218: --------------------------------- [~akinzie] I agree, and we should be converting null to the string "null". since we're actually executing Javascript and not mucking about with the ONLINE_EVENT bridge passing strings. Which plugin does this fail the most on? That'd be helpful when writing tests for this thing. > inconsistent null handling between EVAL and ONLINE bridge modes > --------------------------------------------------------------- > > Key: CB-12218 > URL: https://issues.apache.org/jira/browse/CB-12218 > Project: Apache Cordova > Issue Type: Bug > Components: Android > Affects Versions: 6.0.0 > Environment: Android > Reporter: Alan Kinzie > > If the Android native code invokes the success callback like this: > callbackContext.success(null); > then the value given to the javascript callback changes depending on the bridge type used. > If the ONLINE_EVENT type is used, then null will be passed to the javascript callback. > ie: if result is the parameter of the javascript success callback then > result === null // will be true > result === "" // will be false > If the EVAL_BRIDGE type is used, then an empty string will be passed to the javascript callback. > ie: if result is the parameter of the javascript success callback then > result === null // will be false > result === "" // will be true > The value of the parameter given to the success callback should not change depending on the bridge type. Since ONLINE_EVENT was the default before cordova android 6.0.0, I am inclined to think the ONLINE bridge is doing the correct behaviour. Also, converting null to an empty string loses information. Therefore I think the EVAL mode should to be changed to be consistent with the ONLINE mode. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org For additional commands, e-mail: issues-help@cordova.apache.org