You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@royale.apache.org by Jim Page <ji...@redmatter.com> on 2020/12/10 14:32:36 UTC

Porting from flex: Uncaught TypeError: org.apache.royale.debugging.assert is not a function

Hi There

I am experiencing this error when running a debug build of a flex app I am
porting. The full uncaught error stack is:

Uncaught TypeError: org.apache.royale.debugging.assert is not a function
    at Object.org.apache.royale.debugging.assertType (assertType.js:25)
    at XML.addChildInternal (XML.js:874)
    at Function.XML.insertAttribute (XML.js:427)
    at Function.XML.iterateElement (XML.js:460)
    at XML.XML_parseXMLStr (XML.js:743)
    at new XML (XML.js:31)
    at globals.js:94

The code it's trying to invoke is:

/**
 * asserts an object is of the desired type.
 * @param {Object} obj
 * @param {Object} type
 * @param {string} message
 */
org.apache.royale.debugging.assertType = function(obj, type, message) {
  
  if (goog.DEBUG)
   
org.apache.royale.debugging.assert(org.apache.royale.utils.Language.is(obj,
type), message);
}

Clearly I could switch goog.DEBUG off (where do I set that by the way?) but
if there are underlying problems I'd like them to be visible so I can fix
them. 

Let me know what information you need if the answer is not immediately
obvious. I am running the nightly build of the royale SDK, built using
maven. I am on OSX big sur. I am using node's serve command to run a web
server locally from the is-debug directory built by mxmlc.

Thanks
Jim



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: Porting from flex: Uncaught TypeError: org.apache.royale.debugging.assert is not a function

Posted by Carlos Rovira <ca...@apache.org>.
Hi Jim,

glad to help, I think the ones here that came first try to help the new
ones, and at some time those new ones can have the sufficient knowledge to
support others coming so we can grow the community between all of us. That
will make Royale successful in the future and will be good for all of us.

Thanks!

El sáb, 12 dic 2020 a las 3:40, Jim Page (<ji...@redmatter.com>)
escribió:

> I think nabble performed an edit on my code! See my compiler bug report for
> the actual code.
>
>
>
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>


-- 
Carlos Rovira
Apache Member & Apache Royale PMC
*Apache Software Foundation*
http://about.me/carlosrovira

RE: Porting from flex: Uncaught TypeError: org.apache.royale.debugging.assert is not a function

Posted by Jim Page <ji...@redmatter.com>.
I think nabble performed an edit on my code! See my compiler bug report for
the actual code.



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

RE: Porting from flex: Uncaught TypeError: org.apache.royale.debugging.assert is not a function

Posted by Jim Page <ji...@redmatter.com>.
I was setting up a test case to submit as a compiler bug, and I think I have
found at least one source of bad things: see this extremely simple example:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:mx="library://ns.apache.org/royale/mx"
                   width="600" height="400" >
	<fx:Script>
		
	</fx:Script>
	<mx:Label text="Hello World"/>
</mx:Application>

If you initialise an XML variable in the first form (submit an XML string to
the constructor), everything works. If you use the second form (assigning an
XML literal as an initialiser) you get the missing assert function
exception, and the app doesn't initialise.

I will submit this but thought you might be interested as you have
experienced something similar.

Cheers
Jim



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

RE: Porting from flex: Uncaught TypeError: org.apache.royale.debugging.assert is not a function

Posted by Yishay Weiss <yi...@hotmail.com>.
Happy to help, Jim. We all feed off the same ecosystem. This forum has been gratifying to me as well.

From: Jim Page<ma...@redmatter.com>
Sent: Friday, December 11, 2020 3:20 PM
To: users@royale.apache.org<ma...@royale.apache.org>
Subject: RE: Porting from flex: Uncaught TypeError: org.apache.royale.debugging.assert is not a function

Thank you very much - I will. I am super impressed by the responsiveness and
level of support on this forum! It's very gratifying, especially given the
somewhat stressful situation given the timescale of this project!



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/


RE: Porting from flex: Uncaught TypeError: org.apache.royale.debugging.assert is not a function

Posted by Jim Page <ji...@redmatter.com>.
Thank you very much - I will. I am super impressed by the responsiveness and
level of support on this forum! It's very gratifying, especially given the
somewhat stressful situation given the timescale of this project!



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

RE: Porting from flex: Uncaught TypeError: org.apache.royale.debugging.assert is not a function

Posted by Yishay Weiss <yi...@hotmail.com>.
We have seen assertion bugs crop up with Xml as well. It would be good if you could file a compiler bug for that. In the meantime you could disable asserts.

In ant you can add a jvm arg to mxmlc like this

<jvamarg line=”-da”/>

I’m not sure about Maven, I thought they were disabled by default.


From: Jim Page<ma...@redmatter.com>
Sent: Thursday, December 10, 2020 4:40 PM
To: users@royale.apache.org<ma...@royale.apache.org>
Subject: Porting from flex: Uncaught TypeError: org.apache.royale.debugging.assert is not a function

Hi There

I am experiencing this error when running a debug build of a flex app I am
porting. The full uncaught error stack is:

Uncaught TypeError: org.apache.royale.debugging.assert is not a function
    at Object.org.apache.royale.debugging.assertType (assertType.js:25)
    at XML.addChildInternal (XML.js:874)
    at Function.XML.insertAttribute (XML.js:427)
    at Function.XML.iterateElement (XML.js:460)
    at XML.XML_parseXMLStr (XML.js:743)
    at new XML (XML.js:31)
    at globals.js:94

The code it's trying to invoke is:

/**
 * asserts an object is of the desired type.
 * @param {Object} obj
 * @param {Object} type
 * @param {string} message
 */
org.apache.royale.debugging.assertType = function(obj, type, message) {

  if (goog.DEBUG)

org.apache.royale.debugging.assert(org.apache.royale.utils.Language.is(obj,
type), message);
}

Clearly I could switch goog.DEBUG off (where do I set that by the way?) but
if there are underlying problems I'd like them to be visible so I can fix
them.

Let me know what information you need if the answer is not immediately
obvious. I am running the nightly build of the royale SDK, built using
maven. I am on OSX big sur. I am using node's serve command to run a web
server locally from the is-debug directory built by mxmlc.

Thanks
Jim



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/