Return-Path: X-Original-To: apmail-flex-commits-archive@www.apache.org Delivered-To: apmail-flex-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 293FA18C8E for ; Thu, 26 Nov 2015 18:14:43 +0000 (UTC) Received: (qmail 13948 invoked by uid 500); 26 Nov 2015 18:14:42 -0000 Delivered-To: apmail-flex-commits-archive@flex.apache.org Received: (qmail 13883 invoked by uid 500); 26 Nov 2015 18:14:42 -0000 Mailing-List: contact commits-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 commits@flex.apache.org Received: (qmail 13702 invoked by uid 99); 26 Nov 2015 18:14:42 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Nov 2015 18:14:42 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4DE2EE2C51; Thu, 26 Nov 2015 18:14:42 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aharui@apache.org To: commits@flex.apache.org Date: Thu, 26 Nov 2015 18:14:47 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [06/12] git commit: [flex-asjs] [refs/heads/core_js_to_as] - use 'in' since a missing property won't always throw use 'in' since a missing property won't always throw Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/755ed103 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/755ed103 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/755ed103 Branch: refs/heads/core_js_to_as Commit: 755ed103ec7efe5110e353642502f1734666d04f Parents: 8177f91 Author: Alex Harui Authored: Wed Nov 25 14:03:02 2015 -0800 Committer: Alex Harui Committed: Wed Nov 25 14:03:02 2015 -0800 ---------------------------------------------------------------------- .../src/org/apache/flex/binding/ConstantBinding.as | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/755ed103/frameworks/projects/Binding/as/src/org/apache/flex/binding/ConstantBinding.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Binding/as/src/org/apache/flex/binding/ConstantBinding.as b/frameworks/projects/Binding/as/src/org/apache/flex/binding/ConstantBinding.as index 0bc7a55..0a2ae83 100644 --- a/frameworks/projects/Binding/as/src/org/apache/flex/binding/ConstantBinding.as +++ b/frameworks/projects/Binding/as/src/org/apache/flex/binding/ConstantBinding.as @@ -134,12 +134,17 @@ package org.apache.flex.binding else source = document; var val:*; - try + if (sourcePropertyName in source) { - val = source[sourcePropertyName]; - destination[destinationPropertyName] = val; - } - catch (e:Error) + try { + val = source[sourcePropertyName]; + destination[destinationPropertyName] = val; + } + catch (e:Error) + { + } + } + else if (sourcePropertyName in source.constructor) { try { val = source.constructor[sourcePropertyName];