Return-Path: X-Original-To: apmail-flex-issues-archive@minotaur.apache.org Delivered-To: apmail-flex-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C005F19B74 for ; Mon, 11 Apr 2016 22:46:25 +0000 (UTC) Received: (qmail 53351 invoked by uid 500); 11 Apr 2016 22:46:25 -0000 Delivered-To: apmail-flex-issues-archive@flex.apache.org Received: (qmail 53283 invoked by uid 500); 11 Apr 2016 22:46:25 -0000 Mailing-List: contact issues-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list issues@flex.apache.org Received: (qmail 53249 invoked by uid 99); 11 Apr 2016 22:46:25 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Apr 2016 22:46:25 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 7C3C02C1F4E for ; Mon, 11 Apr 2016 22:46:25 +0000 (UTC) Date: Mon, 11 Apr 2016 22:46:25 +0000 (UTC) From: "Harbs (JIRA)" To: issues@flex.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (FLEX-35075) E4X filters need to be smarter MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Harbs created FLEX-35075: ---------------------------- Summary: E4X filters need to be smarter Key: FLEX-35075 URL: https://issues.apache.org/jira/browse/FLEX-35075 Project: Apache Flex Issue Type: Bug Components: FalconJX Affects Versions: Apache FalconJX 0.6.0 Reporter: Harbs The following expression: {code:actionscript} xmlSource.Set1.child.(year == "2015"); {code} compiles into: {code:javascript} xmlSource.child('Set1').child('child').filter(function(node){return (node.year == "2015")}); {code} This is all fine except for the filter expression. node.year means nothing in Javascript. I'm not sure the best way to compile this. The following will work, but it will probably get tricky covering all cases: {code:javascript} xmlSource.child('Set1').child('child').filter(function(node){return (node.child("year").toString() == "2015")}); {code} What might make more sense might be to add some helper functions like: XML.isEqual(randomObject); (mapped to ==) XML.isNotEqual(randomObject); (mapped to !=) XML.greaterThan(randomObject); (mapped to >) XML.lessThan(randomObject); (mapped to <) XML.greaterThanOrEqualTo(randomObject);(mapped to >=) XML.lessThanOrEqualTo(randomObject);(mapped to <=) And the code will figure out the best way to handle these comparisons based on the type at runtime. In that case, this would compile like this: xmlSource.child('Set1').child('child').filter(function(node){return (node.child("year").isEqualTo("2015"))}); Thoughts? -- This message was sent by Atlassian JIRA (v6.3.4#6332)