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 CFA6F200CC7 for ; Sun, 16 Jul 2017 14:40:30 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id CDFC2164455; Sun, 16 Jul 2017 12:40:30 +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 A0626164454 for ; Sun, 16 Jul 2017 14:40:29 +0200 (CEST) Received: (qmail 65349 invoked by uid 500); 16 Jul 2017 12:40:28 -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 65341 invoked by uid 99); 16 Jul 2017 12:40:28 -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; Sun, 16 Jul 2017 12:40:28 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id CBF18E360F; Sun, 16 Jul 2017 12:40:27 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: harbs@apache.org To: commits@flex.apache.org Message-Id: <1d634dc0b1fa4225994e08f8b5e966be@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: [flex-asjs] [refs/heads/develop] - Added example which uses debugging functions Date: Sun, 16 Jul 2017 12:40:27 +0000 (UTC) archived-at: Sun, 16 Jul 2017 12:40:31 -0000 Repository: flex-asjs Updated Branches: refs/heads/develop a43fac345 -> 0cd271bf7 Added example which uses debugging functions Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/0cd271bf Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/0cd271bf Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/0cd271bf Branch: refs/heads/develop Commit: 0cd271bf7db0b04e2072dbd80f2587af8611d896 Parents: a43fac3 Author: Harbs Authored: Sun Jul 16 15:40:22 2017 +0300 Committer: Harbs Committed: Sun Jul 16 15:40:22 2017 +0300 ---------------------------------------------------------------------- examples/flexjs/DebuggingExample/README.txt | 37 +++++++ examples/flexjs/DebuggingExample/build.xml | 55 ++++++++++ examples/flexjs/DebuggingExample/pom.xml | 73 +++++++++++++ .../src/main/config/compile-app-config.xml | 23 +++++ .../src/main/flex/DebuggingExample.mxml | 34 ++++++ .../src/main/flex/MyInitialView.mxml | 103 +++++++++++++++++++ .../org/apache/flex/debugging/assertType.as | 6 +- .../flex/org/apache/flex/debugging/notNull.as | 6 +- 8 files changed, 333 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0cd271bf/examples/flexjs/DebuggingExample/README.txt ---------------------------------------------------------------------- diff --git a/examples/flexjs/DebuggingExample/README.txt b/examples/flexjs/DebuggingExample/README.txt new file mode 100644 index 0000000..628187f --- /dev/null +++ b/examples/flexjs/DebuggingExample/README.txt @@ -0,0 +1,37 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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. +// +//////////////////////////////////////////////////////////////////////////////// + +DESCRIPTION + +The DebuggingExample shows how to use the debugging package. + +This Flex application may be run as a Flash SWF or cross-compiled (using Falcon JX) +into JavaScript and HTML and run without Flash. + + +COMPONENTS and BEADS + +- TextButton +- Label +- TextArea + + +NOTES + +The Changing the content of the TextArea will reverse the passing and failing asserts. http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0cd271bf/examples/flexjs/DebuggingExample/build.xml ---------------------------------------------------------------------- diff --git a/examples/flexjs/DebuggingExample/build.xml b/examples/flexjs/DebuggingExample/build.xml new file mode 100644 index 0000000..a97723d --- /dev/null +++ b/examples/flexjs/DebuggingExample/build.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0cd271bf/examples/flexjs/DebuggingExample/pom.xml ---------------------------------------------------------------------- diff --git a/examples/flexjs/DebuggingExample/pom.xml b/examples/flexjs/DebuggingExample/pom.xml new file mode 100644 index 0000000..82ce380 --- /dev/null +++ b/examples/flexjs/DebuggingExample/pom.xml @@ -0,0 +1,73 @@ + + + + 4.0.0 + + + org.apache.flex.flexjs.examples + examples-flexjs + 0.9.0-SNAPSHOT + + + DataBindingExample + 0.9.0-SNAPSHOT + swf + + Apache Flex - FlexJS: Examples: FlexJS: DebuggingExample + + + + + org.apache.flex.flexjs.compiler + flexjs-maven-plugin + true + + DebuggingExample.mxml + + + + + + + + com.adobe.flash.framework + playerglobal + ${flash.version} + swc + provided + + + + org.apache.flex.flexjs.framework + Network + 0.9.0-SNAPSHOT + swc + swf + + + org.apache.flex.flexjs.framework + Network + 0.9.0-SNAPSHOT + swc + js + + + + http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0cd271bf/examples/flexjs/DebuggingExample/src/main/config/compile-app-config.xml ---------------------------------------------------------------------- diff --git a/examples/flexjs/DebuggingExample/src/main/config/compile-app-config.xml b/examples/flexjs/DebuggingExample/src/main/config/compile-app-config.xml new file mode 100644 index 0000000..b4290dc --- /dev/null +++ b/examples/flexjs/DebuggingExample/src/main/config/compile-app-config.xml @@ -0,0 +1,23 @@ + + + + skipFunctionCoercions + + http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0cd271bf/examples/flexjs/DebuggingExample/src/main/flex/DebuggingExample.mxml ---------------------------------------------------------------------- diff --git a/examples/flexjs/DebuggingExample/src/main/flex/DebuggingExample.mxml b/examples/flexjs/DebuggingExample/src/main/flex/DebuggingExample.mxml new file mode 100644 index 0000000..3e8dcf3 --- /dev/null +++ b/examples/flexjs/DebuggingExample/src/main/flex/DebuggingExample.mxml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0cd271bf/examples/flexjs/DebuggingExample/src/main/flex/MyInitialView.mxml ---------------------------------------------------------------------- diff --git a/examples/flexjs/DebuggingExample/src/main/flex/MyInitialView.mxml b/examples/flexjs/DebuggingExample/src/main/flex/MyInitialView.mxml new file mode 100644 index 0000000..16841d9 --- /dev/null +++ b/examples/flexjs/DebuggingExample/src/main/flex/MyInitialView.mxml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0cd271bf/frameworks/projects/Core/src/main/flex/org/apache/flex/debugging/assertType.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/debugging/assertType.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/debugging/assertType.as index 53bf4b5..f5fc367 100644 --- a/frameworks/projects/Core/src/main/flex/org/apache/flex/debugging/assertType.as +++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/debugging/assertType.as @@ -27,16 +27,16 @@ package org.apache.flex.debugging /** * asserts an object is of the desired type. */ - public function assertType(obj:Object,type:Class):void + public function assertType(obj:Object,type:Class,message:String):void { COMPILE::SWF { - assert((obj is type),"object is not the correct type"); + assert((obj is type),message); } COMPILE::JS { if(goog.DEBUG) - assert((obj is type),"object is not the correct type"); + assert((obj is type),message); } } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0cd271bf/frameworks/projects/Core/src/main/flex/org/apache/flex/debugging/notNull.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/debugging/notNull.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/debugging/notNull.as index eb4ba89..d5fe1f1 100644 --- a/frameworks/projects/Core/src/main/flex/org/apache/flex/debugging/notNull.as +++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/debugging/notNull.as @@ -36,7 +36,11 @@ package org.apache.flex.debugging COMPILE::JS { if(goog.DEBUG && obj == null) - throw new Error(typeof obj +" not allowed"); + { + var name:String = obj === null ? "null" : "undefined" + throw new Error(name +" not allowed"); + + } } } } \ No newline at end of file