Re: Newest little Harbs (was Re: Null pointer errors)

2018-05-03 Thread Carlos Rovira
hehe, not geek but very related! Beautiful name! :)

2018-05-03 22:14 GMT+02:00 Harbs :

> Funny, but you weren’t very far off… ;-)
>
> We named our daughter Malka which is Hebrew for queen. (No, it was not
> because of Royale. I might be a geek but my wife definitely is not. ;-p She
> was named after a grandmother.) So she does in fact have a “Royale” name…
>
> :-)
>
> Harbs
>
> > On May 2, 2018, at 6:50 PM, Alex Harui  wrote:
> >
> > Whatever you do, do not name her "Royale"
>
>


-- 
Carlos Rovira
http://about.me/carlosrovira


Re: Newest little Harbs (was Re: Null pointer errors)

2018-05-03 Thread Harbs
Funny, but you weren’t very far off… ;-)

We named our daughter Malka which is Hebrew for queen. (No, it was not because 
of Royale. I might be a geek but my wife definitely is not. ;-p She was named 
after a grandmother.) So she does in fact have a “Royale” name…

:-)

Harbs

> On May 2, 2018, at 6:50 PM, Alex Harui  wrote:
> 
> Whatever you do, do not name her "Royale"



Re: Newest little Harbs (was Re: Null pointer errors)

2018-05-02 Thread OmPrakash Muppirala
Fantastic news, Harbs.  Welcome to the little one :-)

Thanks,
Om

On Wed, May 2, 2018 at 9:10 AM, Dave Fisher  wrote:

> Harbs!
>
> Little Flexy! Mazel Tov!
>
> Regards,
> Dave
>
> > On May 2, 2018, at 9:03 AM, Alex Harui  wrote:
> >
> > That can be her middle name.
> >
> > -Alex
> >
> > PS: Really not liking Outlook 2016 on the Mac.  Can't figure out how to
> enter emojis.
> >
> > On 5/2/18, 9:01 AM, "Harbs"  wrote:
> >
> >What about Flex? FlexJS? ;-p
> >
> >> On May 2, 2018, at 6:50 PM, Alex Harui 
> wrote:
> >>
> >> Whatever you do, do not name her "Royale" __
> >
> >
> >
>
>


Re: Null pointer errors

2018-05-02 Thread Alex Harui
Harbs,

First, I can't believe you have time to code just after having another baby.

But anyway, is your goal to convert these structures to AS or to replicate the 
Restructure library in AS?  Seems like if you want lazy instantiation, you 
should be using Restructure in AS.

That said, in AS, we can use getters for lazy instantiation.

My 2 cents,
-Alex

On 5/2/18, 9:13 AM, "Harbs"  wrote:

Here’s a fun one:

var MinMax:Struct = new Struct({
minCoord:   new Pointer(r.uint16, BaseCoord),  // May be NULL
maxCoord:   new Pointer(r.uint16, BaseCoord),  // May be NULL
featMinMaxCount:r.uint16,// May be 0
featMinMaxRecords:  new ArrayStruct(FeatMinMaxRecord, 
'featMinMaxCount') // In alphabetical order
});

This struct is then used in another and so on:

var BaseLangSysRecord:Struct = new Struct({
tag:new StringStruct(4),  // 4-byte language system identification 
tag
minMax: new Pointer(r.uint16, MinMax, {type: 'parent'})
});

I believe one of the primary features of these classes is that they support 
lazy initialization and the structures can be evaluated as needed.

Harbs

> On May 2, 2018, at 6:36 PM, Alex Harui  wrote:
> 
> What do some of the actual structs look like?  The Restructure 
library/language looks like an attempt to strongly-type data structures.  I've 
been told that type-inferencing is a key part to performance in JS in the 
browser.  But as we look into the future at other output types, statically 
knowing types looks like it will be really important.
> 
> Having a way to output bracket notation might be a bunch of work, and you 
might be surprised by the results.  Every time you use an Array, the accessor 
is returning an Object, not whatever type you know is in there.
> 
> HTH,
> -Alex
> 
> On 5/2/18, 12:29 AM, "Harbs"  wrote:
> 
>Nope. They are data structures that are constructed from binary data. 
They are also generally lazily initialized (which makes a huge difference in 
performance and memory footprint). Basically, there are tens of tables which 
might, or might not exist in any given font. The tables might or might not have 
different pieces of information to describe features and functionality.
> 
>It took my a couple of weeks just to wrap my head around all this 
stuff… ;-)
> 
>It’s using this set of classes (also migrated to AS3):
>
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdevongovett%2Frestructure=02%7C01%7Caharui%40adobe.com%7C0dba99c3f32b410a1fd608d5affe6efd%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636608429687243487=%2Bn6rP8sRodUlqLqLlcia%2FWwQMAvBYpYDmlU%2BNE4YGDk%3D=0
 

> 
>There are 148 instances of Struct alone. Almost every one has a 
different set of variables. That does not even include VersionedStruct, Array 
structs, Number structs, LazyArray, etc.
> 
>Maybe there’s a way to infer types, but I don’t see how. Many of the 
variables can have different types depending on the context too. (Sometimes 
they can even be functions.)
> 
>Harbs
> 
>> On May 2, 2018, at 10:16 AM, Alex Harui  wrote:
>> 
>> Are the objects JSON objects?  We have a utility that tries to convert 
JSON to AS3 ValueObjects by guessing the data types.
>> 
>> If the objects are externally instantiated, then you only really need 
typedefs and can avoid the memory overhead of the definitions.
>> 
>> -Alex
>> 
>> On 5/1/18, 11:40 PM, "Harbs"  wrote:
>> 
>>   Well, with font parsing there are SOOO MANY different data structures 
that it’s almost impossible to avoid using Object. Even if it was possible 
(which I’m not sure of), it’ll probably take me weeks or months and countless 
classes (with all the memory penalties of doing so) to cover all the types.
>> 
>>   I’m going to try and add a compiler option to output bracket notation 
for Object types to deal with the renaming issue of using Objects.
>> 
>>   Harbs
>> 
>>> On May 2, 2018, at 9:36 AM, Alex Harui  wrote:
>>> 
>>> Hmm.  That's what you get for using Object __
>>> 
>>> The code expects the expression for the initial value to resolve to a 
definition (so we know if we need to coerce it), but once you switch to Object, 
it won't resolve.  In this case,we don't know the type of "offsets".   The 
quick fix is to just 

Re: Null pointer errors

2018-05-02 Thread Harbs
Here’s a fun one:

var MinMax:Struct = new Struct({
minCoord:   new Pointer(r.uint16, BaseCoord),  // May be NULL
maxCoord:   new Pointer(r.uint16, BaseCoord),  // May be NULL
featMinMaxCount:r.uint16,// May be 0
featMinMaxRecords:  new ArrayStruct(FeatMinMaxRecord, 'featMinMaxCount') // 
In alphabetical order
});

This struct is then used in another and so on:

var BaseLangSysRecord:Struct = new Struct({
tag:new StringStruct(4),  // 4-byte language system identification tag
minMax: new Pointer(r.uint16, MinMax, {type: 'parent'})
});

I believe one of the primary features of these classes is that they support 
lazy initialization and the structures can be evaluated as needed.

Harbs

> On May 2, 2018, at 6:36 PM, Alex Harui  wrote:
> 
> What do some of the actual structs look like?  The Restructure 
> library/language looks like an attempt to strongly-type data structures.  
> I've been told that type-inferencing is a key part to performance in JS in 
> the browser.  But as we look into the future at other output types, 
> statically knowing types looks like it will be really important.
> 
> Having a way to output bracket notation might be a bunch of work, and you 
> might be surprised by the results.  Every time you use an Array, the accessor 
> is returning an Object, not whatever type you know is in there.
> 
> HTH,
> -Alex
> 
> On 5/2/18, 12:29 AM, "Harbs"  wrote:
> 
>Nope. They are data structures that are constructed from binary data. They 
> are also generally lazily initialized (which makes a huge difference in 
> performance and memory footprint). Basically, there are tens of tables which 
> might, or might not exist in any given font. The tables might or might not 
> have different pieces of information to describe features and functionality.
> 
>It took my a couple of weeks just to wrap my head around all this stuff… 
> ;-)
> 
>It’s using this set of classes (also migrated to AS3):
>
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdevongovett%2Frestructure=02%7C01%7Caharui%40adobe.com%7C0dba99c3f32b410a1fd608d5affe6efd%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636608429687243487=%2Bn6rP8sRodUlqLqLlcia%2FWwQMAvBYpYDmlU%2BNE4YGDk%3D=0
>  
> 
> 
>There are 148 instances of Struct alone. Almost every one has a different 
> set of variables. That does not even include VersionedStruct, Array structs, 
> Number structs, LazyArray, etc.
> 
>Maybe there’s a way to infer types, but I don’t see how. Many of the 
> variables can have different types depending on the context too. (Sometimes 
> they can even be functions.)
> 
>Harbs
> 
>> On May 2, 2018, at 10:16 AM, Alex Harui  wrote:
>> 
>> Are the objects JSON objects?  We have a utility that tries to convert JSON 
>> to AS3 ValueObjects by guessing the data types.
>> 
>> If the objects are externally instantiated, then you only really need 
>> typedefs and can avoid the memory overhead of the definitions.
>> 
>> -Alex
>> 
>> On 5/1/18, 11:40 PM, "Harbs"  wrote:
>> 
>>   Well, with font parsing there are SOOO MANY different data structures that 
>> it’s almost impossible to avoid using Object. Even if it was possible (which 
>> I’m not sure of), it’ll probably take me weeks or months and countless 
>> classes (with all the memory penalties of doing so) to cover all the types.
>> 
>>   I’m going to try and add a compiler option to output bracket notation for 
>> Object types to deal with the renaming issue of using Objects.
>> 
>>   Harbs
>> 
>>> On May 2, 2018, at 9:36 AM, Alex Harui  wrote:
>>> 
>>> Hmm.  That's what you get for using Object __
>>> 
>>> The code expects the expression for the initial value to resolve to a 
>>> definition (so we know if we need to coerce it), but once you switch to 
>>> Object, it won't resolve.  In this case,we don't know the type of 
>>> "offsets".   The quick fix is to just accept that it might not resolve and 
>>> just let the browser deal with it.  However, we don't know what the Google 
>>> Closure optimizer will do with the "offsets" property.  It may or may not 
>>> rename it.  I keep thinking we should be warning when folks use Object.  In 
>>> Royale you are asking for optimizer trouble if you are not completely 
>>> strongly-typed.
>>> 
>>> Thoughts?
>>> -Alex
>>> 
>>> On 5/1/18, 11:19 PM, "Harbs"  wrote:
>>> 
>>>  FYI, I just tried reverting some changes, and it seems that not all the 
>>> errors were due to void 0:
>>>  This code:
>>>

Re: Newest little Harbs (was Re: Null pointer errors)

2018-05-02 Thread Dave Fisher
Harbs!

Little Flexy! Mazel Tov!

Regards,
Dave

> On May 2, 2018, at 9:03 AM, Alex Harui  wrote:
> 
> That can be her middle name.
> 
> -Alex
> 
> PS: Really not liking Outlook 2016 on the Mac.  Can't figure out how to enter 
> emojis.
> 
> On 5/2/18, 9:01 AM, "Harbs"  wrote:
> 
>What about Flex? FlexJS? ;-p
> 
>> On May 2, 2018, at 6:50 PM, Alex Harui  wrote:
>> 
>> Whatever you do, do not name her "Royale" __
> 
> 
> 



signature.asc
Description: Message signed with OpenPGP


Re: Newest little Harbs (was Re: Null pointer errors)

2018-05-02 Thread Alex Harui
That can be her middle name.

-Alex

PS: Really not liking Outlook 2016 on the Mac.  Can't figure out how to enter 
emojis.

On 5/2/18, 9:01 AM, "Harbs"  wrote:

What about Flex? FlexJS? ;-p

> On May 2, 2018, at 6:50 PM, Alex Harui  wrote:
> 
> Whatever you do, do not name her "Royale" __





Re: Newest little Harbs (was Re: Null pointer errors)

2018-05-02 Thread Piotr Zarzycki
We are truly family! Choosing name for baby! :)

2018-05-02 18:00 GMT+02:00 Harbs :

> What about Flex? FlexJS? ;-p
>
> > On May 2, 2018, at 6:50 PM, Alex Harui  wrote:
> >
> > Whatever you do, do not name her "Royale" __
>
>


-- 

Piotr Zarzycki

Patreon: *https://www.patreon.com/piotrzarzycki
*


Re: Newest little Harbs (was Re: Null pointer errors)

2018-05-02 Thread Peter Ent
Congratulations! I hope all are doing well.
‹peter

On 5/2/18, 9:35 AM, "Harbs"  wrote:

>Well, how about a baby sister? ;-)
>
>We just had a baby girl about a half hour ago. :-)
>
>(I¹ll post a picture as soon as I take one.)
>
>Harbs
>
>> On May 1, 2018, at 11:33 PM, Alex Harui 
>>wrote:
>> 
>> I can think of better graduation gifts than the chance to learn the
>>compiler code __.
>



Re: Null pointer errors

2018-05-02 Thread Alex Harui
What do some of the actual structs look like?  The Restructure library/language 
looks like an attempt to strongly-type data structures.  I've been told that 
type-inferencing is a key part to performance in JS in the browser.  But as we 
look into the future at other output types, statically knowing types looks like 
it will be really important.

Having a way to output bracket notation might be a bunch of work, and you might 
be surprised by the results.  Every time you use an Array, the accessor is 
returning an Object, not whatever type you know is in there.

HTH,
-Alex

On 5/2/18, 12:29 AM, "Harbs"  wrote:

Nope. They are data structures that are constructed from binary data. They 
are also generally lazily initialized (which makes a huge difference in 
performance and memory footprint). Basically, there are tens of tables which 
might, or might not exist in any given font. The tables might or might not have 
different pieces of information to describe features and functionality.

It took my a couple of weeks just to wrap my head around all this stuff… ;-)

It’s using this set of classes (also migrated to AS3):

https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdevongovett%2Frestructure=02%7C01%7Caharui%40adobe.com%7C0dba99c3f32b410a1fd608d5affe6efd%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636608429687243487=%2Bn6rP8sRodUlqLqLlcia%2FWwQMAvBYpYDmlU%2BNE4YGDk%3D=0
 


There are 148 instances of Struct alone. Almost every one has a different 
set of variables. That does not even include VersionedStruct, Array structs, 
Number structs, LazyArray, etc.

Maybe there’s a way to infer types, but I don’t see how. Many of the 
variables can have different types depending on the context too. (Sometimes 
they can even be functions.)

Harbs

> On May 2, 2018, at 10:16 AM, Alex Harui  wrote:
> 
> Are the objects JSON objects?  We have a utility that tries to convert 
JSON to AS3 ValueObjects by guessing the data types.
> 
> If the objects are externally instantiated, then you only really need 
typedefs and can avoid the memory overhead of the definitions.
> 
> -Alex
> 
> On 5/1/18, 11:40 PM, "Harbs"  wrote:
> 
>Well, with font parsing there are SOOO MANY different data structures 
that it’s almost impossible to avoid using Object. Even if it was possible 
(which I’m not sure of), it’ll probably take me weeks or months and countless 
classes (with all the memory penalties of doing so) to cover all the types.
> 
>I’m going to try and add a compiler option to output bracket notation 
for Object types to deal with the renaming issue of using Objects.
> 
>Harbs
> 
>> On May 2, 2018, at 9:36 AM, Alex Harui  wrote:
>> 
>> Hmm.  That's what you get for using Object __
>> 
>> The code expects the expression for the initial value to resolve to a 
definition (so we know if we need to coerce it), but once you switch to Object, 
it won't resolve.  In this case,we don't know the type of "offsets".   The 
quick fix is to just accept that it might not resolve and just let the browser 
deal with it.  However, we don't know what the Google Closure optimizer will do 
with the "offsets" property.  It may or may not rename it.  I keep thinking we 
should be warning when folks use Object.  In Royale you are asking for 
optimizer trouble if you are not completely strongly-typed.
>> 
>> Thoughts?
>> -Alex
>> 
>> On 5/1/18, 11:19 PM, "Harbs"  wrote:
>> 
>>   FYI, I just tried reverting some changes, and it seems that not all 
the errors were due to void 0:
>>   This code:
>>  var glyfPos:int = 
this._font.getTable('loca').offsets[this.id];
>>  var nextPos:int = 
this._font.getTable('loca').offsets[this.id + 1];
>> 
>>   Causes this error:
>> 
>>[java]at 
org.apache.royale.compiler.internal.codegen.js.jx.VarDeclarationEmitter.emit(VarDeclarationEmitter.java:153)
>>[java]at 
org.apache.royale.compiler.internal.codegen.js.royale.JSRoyaleEmitter.emitVarDeclaration(JSRoyaleEmitter.java:699)
>>[java]at 
org.apache.royale.compiler.internal.codegen.as.ASBlockWalker.visitVariable(ASBlockWalker.java:278)
>>[java]at 
org.apache.royale.compiler.internal.visitor.as.ASNodeSwitch.handle(ASNodeSwitch.java:162)
>>[java]at 

Re: Newest little Harbs (was Re: Null pointer errors)

2018-05-02 Thread Carlos Rovira
Congrats for the new baby Harbs, to you and your wife!

Hope the best in this new adventure!! :)

Carlos

2018-05-02 16:13 GMT+02:00 Olaf Krueger :

> Congratulations! That is great news!
> I wish you and your family all the best!!
>
> Olaf
>
>
>
> --
> Sent from: http://apache-royale-development.20373.n8.nabble.com/
>



-- 
Carlos Rovira
http://about.me/carlosrovira


Re: Newest little Harbs (was Re: Null pointer errors)

2018-05-02 Thread Olaf Krueger
Congratulations! That is great news!
I wish you and your family all the best!!

Olaf



--
Sent from: http://apache-royale-development.20373.n8.nabble.com/


Re: Newest little Harbs (was Re: Null pointer errors)

2018-05-02 Thread Angelo Lazzari
Congrats Harbs!!! and welcome to the new arrived!
El mié., 2 may. 2018 a las 15:58, Piotr Zarzycki ()
escribió:

> Wow! :) Congrats! Looking forward to the first contribution! :)
>
> 2018-05-02 15:54 GMT+02:00 Harbs :
>
> > Thanks! Good one! :-D
> >
> > Here’s me with the little one:
> > https://www.dropbox.com/s/1t64p020n7jw4e2/IMG_4571.JPG?dl=0 <
> > https://www.dropbox.com/s/1t64p020n7jw4e2/IMG_4571.JPG?dl=0>
> >
> > Harbs
> >
> > > On May 2, 2018, at 4:50 PM, Dany Dhondt  wrote:
> > >
> > > Congratulations!!! That's definitely a royale gift!
> > >
> > > -d
> > >
> > > Op 2 mei 2018 om 15:35 uur uur schreef Harbs :
> > >
> > >> Well, how about a baby sister? ;-)
> > >>
> > >> We just had a baby girl about a half hour ago. :-)
> > >>
> > >> (I’ll post a picture as soon as I take one.)
> > >>
> > >> Harbs
> > >>
> > >>> On May 1, 2018, at 11:33 PM, Alex Harui 
> > wrote:
> > >>>
> > >>> I can think of better graduation gifts than the chance to learn the
> > compiler code __.
> > >>
> >
> >
>
>
> --
>
> Piotr Zarzycki
>
> Patreon: *https://www.patreon.com/piotrzarzycki
> *
>


Re: Newest little Harbs (was Re: Null pointer errors)

2018-05-02 Thread Piotr Zarzycki
Wow! :) Congrats! Looking forward to the first contribution! :)

2018-05-02 15:54 GMT+02:00 Harbs :

> Thanks! Good one! :-D
>
> Here’s me with the little one:
> https://www.dropbox.com/s/1t64p020n7jw4e2/IMG_4571.JPG?dl=0 <
> https://www.dropbox.com/s/1t64p020n7jw4e2/IMG_4571.JPG?dl=0>
>
> Harbs
>
> > On May 2, 2018, at 4:50 PM, Dany Dhondt  wrote:
> >
> > Congratulations!!! That's definitely a royale gift!
> >
> > -d
> >
> > Op 2 mei 2018 om 15:35 uur uur schreef Harbs :
> >
> >> Well, how about a baby sister? ;-)
> >>
> >> We just had a baby girl about a half hour ago. :-)
> >>
> >> (I’ll post a picture as soon as I take one.)
> >>
> >> Harbs
> >>
> >>> On May 1, 2018, at 11:33 PM, Alex Harui 
> wrote:
> >>>
> >>> I can think of better graduation gifts than the chance to learn the
> compiler code __.
> >>
>
>


-- 

Piotr Zarzycki

Patreon: *https://www.patreon.com/piotrzarzycki
*


Re: Newest little Harbs (was Re: Null pointer errors)

2018-05-02 Thread Dany Dhondt

Congratulations!!! That's definitely a royale gift!

-d

Op 2 mei 2018 om 15:35 uur uur schreef Harbs :

Well, how about a baby sister? ;-)

We just had a baby girl about a half hour ago. :-)

(I’ll post a picture as soon as I take one.)

Harbs

On May 1, 2018, at 11:33 PM, Alex Harui  wrote:

I can think of better graduation gifts than the chance to learn the compiler 
code __.



Newest little Harbs (was Re: Null pointer errors)

2018-05-02 Thread Harbs
Well, how about a baby sister? ;-)

We just had a baby girl about a half hour ago. :-)

(I’ll post a picture as soon as I take one.)

Harbs

> On May 1, 2018, at 11:33 PM, Alex Harui  wrote:
> 
> I can think of better graduation gifts than the chance to learn the compiler 
> code __.



Re: Null pointer errors

2018-05-02 Thread Harbs
Nope. They are data structures that are constructed from binary data. They are 
also generally lazily initialized (which makes a huge difference in performance 
and memory footprint). Basically, there are tens of tables which might, or 
might not exist in any given font. The tables might or might not have different 
pieces of information to describe features and functionality.

It took my a couple of weeks just to wrap my head around all this stuff… ;-)

It’s using this set of classes (also migrated to AS3):
https://github.com/devongovett/restructure 


There are 148 instances of Struct alone. Almost every one has a different set 
of variables. That does not even include VersionedStruct, Array structs, Number 
structs, LazyArray, etc.

Maybe there’s a way to infer types, but I don’t see how. Many of the variables 
can have different types depending on the context too. (Sometimes they can even 
be functions.)

Harbs

> On May 2, 2018, at 10:16 AM, Alex Harui  wrote:
> 
> Are the objects JSON objects?  We have a utility that tries to convert JSON 
> to AS3 ValueObjects by guessing the data types.
> 
> If the objects are externally instantiated, then you only really need 
> typedefs and can avoid the memory overhead of the definitions.
> 
> -Alex
> 
> On 5/1/18, 11:40 PM, "Harbs"  wrote:
> 
>Well, with font parsing there are SOOO MANY different data structures that 
> it’s almost impossible to avoid using Object. Even if it was possible (which 
> I’m not sure of), it’ll probably take me weeks or months and countless 
> classes (with all the memory penalties of doing so) to cover all the types.
> 
>I’m going to try and add a compiler option to output bracket notation for 
> Object types to deal with the renaming issue of using Objects.
> 
>Harbs
> 
>> On May 2, 2018, at 9:36 AM, Alex Harui  wrote:
>> 
>> Hmm.  That's what you get for using Object __
>> 
>> The code expects the expression for the initial value to resolve to a 
>> definition (so we know if we need to coerce it), but once you switch to 
>> Object, it won't resolve.  In this case,we don't know the type of "offsets". 
>>   The quick fix is to just accept that it might not resolve and just let the 
>> browser deal with it.  However, we don't know what the Google Closure 
>> optimizer will do with the "offsets" property.  It may or may not rename it. 
>>  I keep thinking we should be warning when folks use Object.  In Royale you 
>> are asking for optimizer trouble if you are not completely strongly-typed.
>> 
>> Thoughts?
>> -Alex
>> 
>> On 5/1/18, 11:19 PM, "Harbs"  wrote:
>> 
>>   FYI, I just tried reverting some changes, and it seems that not all the 
>> errors were due to void 0:
>>   This code:
>>  var glyfPos:int = 
>> this._font.getTable('loca').offsets[this.id];
>>  var nextPos:int = 
>> this._font.getTable('loca').offsets[this.id + 1];
>> 
>>   Causes this error:
>> 
>>[java]at 
>> org.apache.royale.compiler.internal.codegen.js.jx.VarDeclarationEmitter.emit(VarDeclarationEmitter.java:153)
>>[java]at 
>> org.apache.royale.compiler.internal.codegen.js.royale.JSRoyaleEmitter.emitVarDeclaration(JSRoyaleEmitter.java:699)
>>[java]at 
>> org.apache.royale.compiler.internal.codegen.as.ASBlockWalker.visitVariable(ASBlockWalker.java:278)
>>[java]at 
>> org.apache.royale.compiler.internal.visitor.as.ASNodeSwitch.handle(ASNodeSwitch.java:162)
>>[java]at 
>> org.apache.royale.compiler.internal.visitor.as.ASNodeHandler.handle(ASNodeHandler.java:85)
>>[java]at 
>> org.apache.royale.compiler.internal.visitor.as.BeforeAfterStrategy.handle(BeforeAfterStrategy.java:110)
>>[java]at 
>> org.apache.royale.compiler.internal.codegen.as.ASBlockWalker.walk(ASBlockWalker.java:159)
>>[java]at 
>> org.apache.royale.compiler.internal.codegen.js.jx.StatementEmitter.emit(StatementEmitter.java:40)
>>[java]at 
>> org.apache.royale.compiler.internal.codegen.js.jx.StatementEmitter.emit(StatementEmitter.java:29)
>>[java]at 
>> org.apache.royale.compiler.internal.codegen.js.JSEmitter.emitStatement(JSEmitter.java:323)
>>[java]at 
>> org.apache.royale.compiler.internal.codegen.js.royale.JSRoyaleEmitter.emitStatement(JSRoyaleEmitter.java:987)
>>[java]at 
>> org.apache.royale.compiler.internal.codegen.as.ASBlockWalker.visitBlock(ASBlockWalker.java:349)
>>[java]at 
>> org.apache.royale.compiler.internal.visitor.as.ASNodeSwitch.handle(ASNodeSwitch.java:278)
>>[java]at 
>> org.apache.royale.compiler.internal.visitor.as.ASNodeHandler.handle(ASNodeHandler.java:85)
>>[java]at 
>> 

Re: Null pointer errors

2018-05-02 Thread Alex Harui
Are the objects JSON objects?  We have a utility that tries to convert JSON to 
AS3 ValueObjects by guessing the data types.

If the objects are externally instantiated, then you only really need typedefs 
and can avoid the memory overhead of the definitions.

-Alex

On 5/1/18, 11:40 PM, "Harbs"  wrote:

Well, with font parsing there are SOOO MANY different data structures that 
it’s almost impossible to avoid using Object. Even if it was possible (which 
I’m not sure of), it’ll probably take me weeks or months and countless classes 
(with all the memory penalties of doing so) to cover all the types.

I’m going to try and add a compiler option to output bracket notation for 
Object types to deal with the renaming issue of using Objects.

Harbs

> On May 2, 2018, at 9:36 AM, Alex Harui  wrote:
> 
> Hmm.  That's what you get for using Object __
> 
> The code expects the expression for the initial value to resolve to a 
definition (so we know if we need to coerce it), but once you switch to Object, 
it won't resolve.  In this case,we don't know the type of "offsets".   The 
quick fix is to just accept that it might not resolve and just let the browser 
deal with it.  However, we don't know what the Google Closure optimizer will do 
with the "offsets" property.  It may or may not rename it.  I keep thinking we 
should be warning when folks use Object.  In Royale you are asking for 
optimizer trouble if you are not completely strongly-typed.
> 
> Thoughts?
> -Alex
> 
> On 5/1/18, 11:19 PM, "Harbs"  wrote:
> 
>FYI, I just tried reverting some changes, and it seems that not all 
the errors were due to void 0:
>This code:
>   var glyfPos:int = 
this._font.getTable('loca').offsets[this.id];
>   var nextPos:int = 
this._font.getTable('loca').offsets[this.id + 1];
> 
>Causes this error:
> 
> [java]at 
org.apache.royale.compiler.internal.codegen.js.jx.VarDeclarationEmitter.emit(VarDeclarationEmitter.java:153)
> [java]at 
org.apache.royale.compiler.internal.codegen.js.royale.JSRoyaleEmitter.emitVarDeclaration(JSRoyaleEmitter.java:699)
> [java]at 
org.apache.royale.compiler.internal.codegen.as.ASBlockWalker.visitVariable(ASBlockWalker.java:278)
> [java]at 
org.apache.royale.compiler.internal.visitor.as.ASNodeSwitch.handle(ASNodeSwitch.java:162)
> [java]at 
org.apache.royale.compiler.internal.visitor.as.ASNodeHandler.handle(ASNodeHandler.java:85)
> [java]at 
org.apache.royale.compiler.internal.visitor.as.BeforeAfterStrategy.handle(BeforeAfterStrategy.java:110)
> [java]at 
org.apache.royale.compiler.internal.codegen.as.ASBlockWalker.walk(ASBlockWalker.java:159)
> [java]at 
org.apache.royale.compiler.internal.codegen.js.jx.StatementEmitter.emit(StatementEmitter.java:40)
> [java]at 
org.apache.royale.compiler.internal.codegen.js.jx.StatementEmitter.emit(StatementEmitter.java:29)
> [java]at 
org.apache.royale.compiler.internal.codegen.js.JSEmitter.emitStatement(JSEmitter.java:323)
> [java]at 
org.apache.royale.compiler.internal.codegen.js.royale.JSRoyaleEmitter.emitStatement(JSRoyaleEmitter.java:987)
> [java]at 
org.apache.royale.compiler.internal.codegen.as.ASBlockWalker.visitBlock(ASBlockWalker.java:349)
> [java]at 
org.apache.royale.compiler.internal.visitor.as.ASNodeSwitch.handle(ASNodeSwitch.java:278)
> [java]at 
org.apache.royale.compiler.internal.visitor.as.ASNodeHandler.handle(ASNodeHandler.java:85)
> [java]at 
org.apache.royale.compiler.internal.visitor.as.BeforeAfterStrategy.handle(BeforeAfterStrategy.java:110)
> [java]at 
org.apache.royale.compiler.internal.codegen.as.ASBlockWalker.walk(ASBlockWalker.java:159)
> [java]at 
org.apache.royale.compiler.internal.codegen.as.ASEmitter.emitMethodScope(ASEmitter.java:867)
> [java]at 
org.apache.royale.compiler.internal.codegen.js.jx.MethodEmitter.emit(MethodEmitter.java:145)
> [java]at 
org.apache.royale.compiler.internal.codegen.js.royale.JSRoyaleEmitter.emitMethod(JSRoyaleEmitter.java:723)
> [java]at 
org.apache.royale.compiler.internal.codegen.js.jx.ClassEmitter.emit(ClassEmitter.java:176)
> [java]at 
org.apache.royale.compiler.internal.codegen.js.royale.JSRoyaleEmitter.emitClass(JSRoyaleEmitter.java:681)
> [java]at 
org.apache.royale.compiler.internal.codegen.as.ASBlockWalker.visitClass(ASBlockWalker.java:256)
> [java]at 
org.apache.royale.compiler.internal.visitor.as.ASNodeSwitch.handle(ASNodeSwitch.java:136)
> [java]at 

Re: Null pointer errors

2018-05-02 Thread Harbs
Well, with font parsing there are SOOO MANY different data structures that it’s 
almost impossible to avoid using Object. Even if it was possible (which I’m not 
sure of), it’ll probably take me weeks or months and countless classes (with 
all the memory penalties of doing so) to cover all the types.

I’m going to try and add a compiler option to output bracket notation for 
Object types to deal with the renaming issue of using Objects.

Harbs

> On May 2, 2018, at 9:36 AM, Alex Harui  wrote:
> 
> Hmm.  That's what you get for using Object __
> 
> The code expects the expression for the initial value to resolve to a 
> definition (so we know if we need to coerce it), but once you switch to 
> Object, it won't resolve.  In this case,we don't know the type of "offsets".  
>  The quick fix is to just accept that it might not resolve and just let the 
> browser deal with it.  However, we don't know what the Google Closure 
> optimizer will do with the "offsets" property.  It may or may not rename it.  
> I keep thinking we should be warning when folks use Object.  In Royale you 
> are asking for optimizer trouble if you are not completely strongly-typed.
> 
> Thoughts?
> -Alex
> 
> On 5/1/18, 11:19 PM, "Harbs"  wrote:
> 
>FYI, I just tried reverting some changes, and it seems that not all the 
> errors were due to void 0:
>This code:
>   var glyfPos:int = 
> this._font.getTable('loca').offsets[this.id];
>   var nextPos:int = 
> this._font.getTable('loca').offsets[this.id + 1];
> 
>Causes this error:
> 
> [java]at 
> org.apache.royale.compiler.internal.codegen.js.jx.VarDeclarationEmitter.emit(VarDeclarationEmitter.java:153)
> [java]at 
> org.apache.royale.compiler.internal.codegen.js.royale.JSRoyaleEmitter.emitVarDeclaration(JSRoyaleEmitter.java:699)
> [java]at 
> org.apache.royale.compiler.internal.codegen.as.ASBlockWalker.visitVariable(ASBlockWalker.java:278)
> [java]at 
> org.apache.royale.compiler.internal.visitor.as.ASNodeSwitch.handle(ASNodeSwitch.java:162)
> [java]at 
> org.apache.royale.compiler.internal.visitor.as.ASNodeHandler.handle(ASNodeHandler.java:85)
> [java]at 
> org.apache.royale.compiler.internal.visitor.as.BeforeAfterStrategy.handle(BeforeAfterStrategy.java:110)
> [java]at 
> org.apache.royale.compiler.internal.codegen.as.ASBlockWalker.walk(ASBlockWalker.java:159)
> [java]at 
> org.apache.royale.compiler.internal.codegen.js.jx.StatementEmitter.emit(StatementEmitter.java:40)
> [java]at 
> org.apache.royale.compiler.internal.codegen.js.jx.StatementEmitter.emit(StatementEmitter.java:29)
> [java]at 
> org.apache.royale.compiler.internal.codegen.js.JSEmitter.emitStatement(JSEmitter.java:323)
> [java]at 
> org.apache.royale.compiler.internal.codegen.js.royale.JSRoyaleEmitter.emitStatement(JSRoyaleEmitter.java:987)
> [java]at 
> org.apache.royale.compiler.internal.codegen.as.ASBlockWalker.visitBlock(ASBlockWalker.java:349)
> [java]at 
> org.apache.royale.compiler.internal.visitor.as.ASNodeSwitch.handle(ASNodeSwitch.java:278)
> [java]at 
> org.apache.royale.compiler.internal.visitor.as.ASNodeHandler.handle(ASNodeHandler.java:85)
> [java]at 
> org.apache.royale.compiler.internal.visitor.as.BeforeAfterStrategy.handle(BeforeAfterStrategy.java:110)
> [java]at 
> org.apache.royale.compiler.internal.codegen.as.ASBlockWalker.walk(ASBlockWalker.java:159)
> [java]at 
> org.apache.royale.compiler.internal.codegen.as.ASEmitter.emitMethodScope(ASEmitter.java:867)
> [java]at 
> org.apache.royale.compiler.internal.codegen.js.jx.MethodEmitter.emit(MethodEmitter.java:145)
> [java]at 
> org.apache.royale.compiler.internal.codegen.js.royale.JSRoyaleEmitter.emitMethod(JSRoyaleEmitter.java:723)
> [java]at 
> org.apache.royale.compiler.internal.codegen.js.jx.ClassEmitter.emit(ClassEmitter.java:176)
> [java]at 
> org.apache.royale.compiler.internal.codegen.js.royale.JSRoyaleEmitter.emitClass(JSRoyaleEmitter.java:681)
> [java]at 
> org.apache.royale.compiler.internal.codegen.as.ASBlockWalker.visitClass(ASBlockWalker.java:256)
> [java]at 
> org.apache.royale.compiler.internal.visitor.as.ASNodeSwitch.handle(ASNodeSwitch.java:136)
> [java]at 
> org.apache.royale.compiler.internal.visitor.as.ASNodeHandler.handle(ASNodeHandler.java:85)
> [java]at 
> org.apache.royale.compiler.internal.visitor.as.BeforeAfterStrategy.handle(BeforeAfterStrategy.java:110)
> [java]at 
> org.apache.royale.compiler.internal.codegen.as.ASBlockWalker.walk(ASBlockWalker.java:159)
> [java]at 
> 

Re: Null pointer errors

2018-05-02 Thread Alex Harui
Hmm.  That's what you get for using Object __

The code expects the expression for the initial value to resolve to a 
definition (so we know if we need to coerce it), but once you switch to Object, 
it won't resolve.  In this case,we don't know the type of "offsets".   The 
quick fix is to just accept that it might not resolve and just let the browser 
deal with it.  However, we don't know what the Google Closure optimizer will do 
with the "offsets" property.  It may or may not rename it.  I keep thinking we 
should be warning when folks use Object.  In Royale you are asking for 
optimizer trouble if you are not completely strongly-typed.

Thoughts?
-Alex

On 5/1/18, 11:19 PM, "Harbs"  wrote:

FYI, I just tried reverting some changes, and it seems that not all the 
errors were due to void 0:
This code:
var glyfPos:int = 
this._font.getTable('loca').offsets[this.id];
var nextPos:int = 
this._font.getTable('loca').offsets[this.id + 1];

Causes this error:

 [java] at 
org.apache.royale.compiler.internal.codegen.js.jx.VarDeclarationEmitter.emit(VarDeclarationEmitter.java:153)
 [java] at 
org.apache.royale.compiler.internal.codegen.js.royale.JSRoyaleEmitter.emitVarDeclaration(JSRoyaleEmitter.java:699)
 [java] at 
org.apache.royale.compiler.internal.codegen.as.ASBlockWalker.visitVariable(ASBlockWalker.java:278)
 [java] at 
org.apache.royale.compiler.internal.visitor.as.ASNodeSwitch.handle(ASNodeSwitch.java:162)
 [java] at 
org.apache.royale.compiler.internal.visitor.as.ASNodeHandler.handle(ASNodeHandler.java:85)
 [java] at 
org.apache.royale.compiler.internal.visitor.as.BeforeAfterStrategy.handle(BeforeAfterStrategy.java:110)
 [java] at 
org.apache.royale.compiler.internal.codegen.as.ASBlockWalker.walk(ASBlockWalker.java:159)
 [java] at 
org.apache.royale.compiler.internal.codegen.js.jx.StatementEmitter.emit(StatementEmitter.java:40)
 [java] at 
org.apache.royale.compiler.internal.codegen.js.jx.StatementEmitter.emit(StatementEmitter.java:29)
 [java] at 
org.apache.royale.compiler.internal.codegen.js.JSEmitter.emitStatement(JSEmitter.java:323)
 [java] at 
org.apache.royale.compiler.internal.codegen.js.royale.JSRoyaleEmitter.emitStatement(JSRoyaleEmitter.java:987)
 [java] at 
org.apache.royale.compiler.internal.codegen.as.ASBlockWalker.visitBlock(ASBlockWalker.java:349)
 [java] at 
org.apache.royale.compiler.internal.visitor.as.ASNodeSwitch.handle(ASNodeSwitch.java:278)
 [java] at 
org.apache.royale.compiler.internal.visitor.as.ASNodeHandler.handle(ASNodeHandler.java:85)
 [java] at 
org.apache.royale.compiler.internal.visitor.as.BeforeAfterStrategy.handle(BeforeAfterStrategy.java:110)
 [java] at 
org.apache.royale.compiler.internal.codegen.as.ASBlockWalker.walk(ASBlockWalker.java:159)
 [java] at 
org.apache.royale.compiler.internal.codegen.as.ASEmitter.emitMethodScope(ASEmitter.java:867)
 [java] at 
org.apache.royale.compiler.internal.codegen.js.jx.MethodEmitter.emit(MethodEmitter.java:145)
 [java] at 
org.apache.royale.compiler.internal.codegen.js.royale.JSRoyaleEmitter.emitMethod(JSRoyaleEmitter.java:723)
 [java] at 
org.apache.royale.compiler.internal.codegen.js.jx.ClassEmitter.emit(ClassEmitter.java:176)
 [java] at 
org.apache.royale.compiler.internal.codegen.js.royale.JSRoyaleEmitter.emitClass(JSRoyaleEmitter.java:681)
 [java] at 
org.apache.royale.compiler.internal.codegen.as.ASBlockWalker.visitClass(ASBlockWalker.java:256)
 [java] at 
org.apache.royale.compiler.internal.visitor.as.ASNodeSwitch.handle(ASNodeSwitch.java:136)
 [java] at 
org.apache.royale.compiler.internal.visitor.as.ASNodeHandler.handle(ASNodeHandler.java:85)
 [java] at 
org.apache.royale.compiler.internal.visitor.as.BeforeAfterStrategy.handle(BeforeAfterStrategy.java:110)
 [java] at 
org.apache.royale.compiler.internal.codegen.as.ASBlockWalker.walk(ASBlockWalker.java:159)
 [java] at 
org.apache.royale.compiler.internal.codegen.js.goog.JSGoogEmitter.emitPackageContents(JSGoogEmitter.java:182)
 [java] at 
org.apache.royale.compiler.internal.codegen.as.ASBlockWalker.visitPackage(ASBlockWalker.java:244)
 [java] at 
org.apache.royale.compiler.internal.visitor.as.ASNodeSwitch.handle(ASNodeSwitch.java:132)
 [java] at 
org.apache.royale.compiler.internal.visitor.as.ASNodeHandler.handle(ASNodeHandler.java:85)
 [java] at 
org.apache.royale.compiler.internal.visitor.as.BeforeAfterStrategy.handle(BeforeAfterStrategy.java:110)
 [java] at 

Re: Null pointer errors

2018-05-02 Thread Harbs
FYI, I just tried reverting some changes, and it seems that not all the errors 
were due to void 0:
This code:
var glyfPos:int = 
this._font.getTable('loca').offsets[this.id];
var nextPos:int = 
this._font.getTable('loca').offsets[this.id + 1];

Causes this error:

 [java] at 
org.apache.royale.compiler.internal.codegen.js.jx.VarDeclarationEmitter.emit(VarDeclarationEmitter.java:153)
 [java] at 
org.apache.royale.compiler.internal.codegen.js.royale.JSRoyaleEmitter.emitVarDeclaration(JSRoyaleEmitter.java:699)
 [java] at 
org.apache.royale.compiler.internal.codegen.as.ASBlockWalker.visitVariable(ASBlockWalker.java:278)
 [java] at 
org.apache.royale.compiler.internal.visitor.as.ASNodeSwitch.handle(ASNodeSwitch.java:162)
 [java] at 
org.apache.royale.compiler.internal.visitor.as.ASNodeHandler.handle(ASNodeHandler.java:85)
 [java] at 
org.apache.royale.compiler.internal.visitor.as.BeforeAfterStrategy.handle(BeforeAfterStrategy.java:110)
 [java] at 
org.apache.royale.compiler.internal.codegen.as.ASBlockWalker.walk(ASBlockWalker.java:159)
 [java] at 
org.apache.royale.compiler.internal.codegen.js.jx.StatementEmitter.emit(StatementEmitter.java:40)
 [java] at 
org.apache.royale.compiler.internal.codegen.js.jx.StatementEmitter.emit(StatementEmitter.java:29)
 [java] at 
org.apache.royale.compiler.internal.codegen.js.JSEmitter.emitStatement(JSEmitter.java:323)
 [java] at 
org.apache.royale.compiler.internal.codegen.js.royale.JSRoyaleEmitter.emitStatement(JSRoyaleEmitter.java:987)
 [java] at 
org.apache.royale.compiler.internal.codegen.as.ASBlockWalker.visitBlock(ASBlockWalker.java:349)
 [java] at 
org.apache.royale.compiler.internal.visitor.as.ASNodeSwitch.handle(ASNodeSwitch.java:278)
 [java] at 
org.apache.royale.compiler.internal.visitor.as.ASNodeHandler.handle(ASNodeHandler.java:85)
 [java] at 
org.apache.royale.compiler.internal.visitor.as.BeforeAfterStrategy.handle(BeforeAfterStrategy.java:110)
 [java] at 
org.apache.royale.compiler.internal.codegen.as.ASBlockWalker.walk(ASBlockWalker.java:159)
 [java] at 
org.apache.royale.compiler.internal.codegen.as.ASEmitter.emitMethodScope(ASEmitter.java:867)
 [java] at 
org.apache.royale.compiler.internal.codegen.js.jx.MethodEmitter.emit(MethodEmitter.java:145)
 [java] at 
org.apache.royale.compiler.internal.codegen.js.royale.JSRoyaleEmitter.emitMethod(JSRoyaleEmitter.java:723)
 [java] at 
org.apache.royale.compiler.internal.codegen.js.jx.ClassEmitter.emit(ClassEmitter.java:176)
 [java] at 
org.apache.royale.compiler.internal.codegen.js.royale.JSRoyaleEmitter.emitClass(JSRoyaleEmitter.java:681)
 [java] at 
org.apache.royale.compiler.internal.codegen.as.ASBlockWalker.visitClass(ASBlockWalker.java:256)
 [java] at 
org.apache.royale.compiler.internal.visitor.as.ASNodeSwitch.handle(ASNodeSwitch.java:136)
 [java] at 
org.apache.royale.compiler.internal.visitor.as.ASNodeHandler.handle(ASNodeHandler.java:85)
 [java] at 
org.apache.royale.compiler.internal.visitor.as.BeforeAfterStrategy.handle(BeforeAfterStrategy.java:110)
 [java] at 
org.apache.royale.compiler.internal.codegen.as.ASBlockWalker.walk(ASBlockWalker.java:159)
 [java] at 
org.apache.royale.compiler.internal.codegen.js.goog.JSGoogEmitter.emitPackageContents(JSGoogEmitter.java:182)
 [java] at 
org.apache.royale.compiler.internal.codegen.as.ASBlockWalker.visitPackage(ASBlockWalker.java:244)
 [java] at 
org.apache.royale.compiler.internal.visitor.as.ASNodeSwitch.handle(ASNodeSwitch.java:132)
 [java] at 
org.apache.royale.compiler.internal.visitor.as.ASNodeHandler.handle(ASNodeHandler.java:85)
 [java] at 
org.apache.royale.compiler.internal.visitor.as.BeforeAfterStrategy.handle(BeforeAfterStrategy.java:110)
 [java] at 
org.apache.royale.compiler.internal.codegen.as.ASBlockWalker.walk(ASBlockWalker.java:159)
 [java] at 
org.apache.royale.compiler.internal.codegen.as.ASBlockWalker.visitFile(ASBlockWalker.java:223)
 [java] at 
org.apache.royale.compiler.internal.visitor.as.ASNodeSwitch.handle(ASNodeSwitch.java:128)
 [java] at 
org.apache.royale.compiler.internal.visitor.as.ASNodeHandler.handle(ASNodeHandler.java:85)
 [java] at 
org.apache.royale.compiler.internal.visitor.as.BeforeAfterStrategy.handle(BeforeAfterStrategy.java:110)
 [java] at 
org.apache.royale.compiler.internal.codegen.as.ASBlockWalker.walk(ASBlockWalker.java:159)
 [java] at 
org.apache.royale.compiler.internal.codegen.as.ASBlockWalker.visitCompilationUnit(ASBlockWalker.java:188)
 [java] at 
org.apache.royale.compiler.internal.codegen.js.JSWriter.writeTo(JSWriter.java:98)
 [java] at 
org.apache.royale.compiler.internal.codegen.js.JSWriter.writeTo(JSWriter.java:82)
 [java] at 

Re: Null pointer errors

2018-05-01 Thread Piotr Zarzycki
Harbs,

+1 for a new committer! :)

Piotr

2018-05-01 19:44 GMT+02:00 Harbs :

> Yeah. I was planning on spending time on the compiler, but time has not
> been recently as forthcoming as I was hoping… ;-)
>
> FWIW, my daughter is finishing school soon and I’m going to have her try
> and learn the compiler. I’ll see how that goes…
>
> Harbs
>
> > On May 1, 2018, at 7:53 PM, Alex Harui  wrote:
> >
> > Sorry,  I thought the link was to the source so I didn't click on it.
> >
> > This could be a good exercise for anyone wanting to learn more about the
> compiler to figure out how to catch this situation (maybe by detecting the
> AST for "void 0") and outputting an error instead of an NPE, or swapping in
> "undefined".
> >
> > -Alex
> >
> > On 5/1/18, 9:35 AM, "Harbs"  wrote:
> >
> >I attached a paste of the stack in my email.
> >
> >I just finished resolving all my errors. It was hard to trace them
> down, but I just discovered that there were uses of "void 0" in the code. I
> replaced all those cases with “undefined" and poof! All my errors went
> away! :-)
> >
> >My theory is that use of void 0 was confusing the compiler and
> causing errors elsewhere… I’m not sure how to demonstrate this…
> >
> >Harbs
> >
> >(P.S. Sorry I’ve been so quiet lately. Life has been pretty busy… ;) )
> >
> >> On May 1, 2018, at 7:03 PM, Alex Harui 
> wrote:
> >>
> >> What is the call stack for the null pointer?
> >>
> >> On 5/1/18, 5:05 AM, "Harbs"  wrote:
> >>
> >>   I’m trying to compile a library using comic and I’m getting a **LOT**
> of null pointer errors. They seem to be related to missing type
> information, although I’m not completely sure why the missing type
> information is causing these errors.
> >>
> >>   Some of the errors are resolved-able by adding type info, but not all.
> >>
> >>   I picked one at random to track down the issue:
> >>   https://na01.safelinks.protection.outlook.com/?url=
> https%3A%2F%2Fpaste.apache.org%2F8pLB=02%7C01%7Caharui%40adobe.com%
> 7C31fb16c8d65948a50da008d5af5bd2c6%7Cfa7b1b5a7b34438794aed2c178de
> cee1%7C0%7C0%7C636607731304191116=ik%2FnmWaooQD%
> 2BwLT6VM1JN1ypa4BdOXe8VS1NfyF5FUw%3D=0  protection.outlook.com/?url=https%3A%2F%2Fpaste.apache.
> org%2F8pLB=02%7C01%7Caharui%40adobe.com%
> 7C31fb16c8d65948a50da008d5af5bd2c6%7Cfa7b1b5a7b34438794aed2c178de
> cee1%7C0%7C0%7C636607731304191116=ik%2FnmWaooQD%
> 2BwLT6VM1JN1ypa4BdOXe8VS1NfyF5FUw%3D=0>
> >>
> >>   The line in question looks like this:
> >>   var codepoint:int = glyphs[i].codePoints[0];
> >>
> >>   glyphs[I] is a “GlyphInfo” instance. Either of the following two
> changes make this particular error go away:
> >>   var codepoint:* = glyphs[i].codePoints[0];
> >>   var codepoint:int = (glyphs[i] as GlyphInfo).codePoints[0];
> >>
> >>   I’m not really sure why these changes are necessary though…
> >>
> >>   Thoughts?
> >>   Harbs
> >>
> >
> >
> >
>
>


-- 

Piotr Zarzycki

Patreon: *https://www.patreon.com/piotrzarzycki
*


Re: Null pointer errors

2018-05-01 Thread Harbs
Yeah. I was planning on spending time on the compiler, but time has not been 
recently as forthcoming as I was hoping… ;-)

FWIW, my daughter is finishing school soon and I’m going to have her try and 
learn the compiler. I’ll see how that goes…

Harbs

> On May 1, 2018, at 7:53 PM, Alex Harui  wrote:
> 
> Sorry,  I thought the link was to the source so I didn't click on it.
> 
> This could be a good exercise for anyone wanting to learn more about the 
> compiler to figure out how to catch this situation (maybe by detecting the 
> AST for "void 0") and outputting an error instead of an NPE, or swapping in 
> "undefined".
> 
> -Alex
> 
> On 5/1/18, 9:35 AM, "Harbs"  wrote:
> 
>I attached a paste of the stack in my email.
> 
>I just finished resolving all my errors. It was hard to trace them down, 
> but I just discovered that there were uses of "void 0" in the code. I 
> replaced all those cases with “undefined" and poof! All my errors went away! 
> :-)
> 
>My theory is that use of void 0 was confusing the compiler and causing 
> errors elsewhere… I’m not sure how to demonstrate this…
> 
>Harbs
> 
>(P.S. Sorry I’ve been so quiet lately. Life has been pretty busy… ;) )
> 
>> On May 1, 2018, at 7:03 PM, Alex Harui  wrote:
>> 
>> What is the call stack for the null pointer?
>> 
>> On 5/1/18, 5:05 AM, "Harbs"  wrote:
>> 
>>   I’m trying to compile a library using comic and I’m getting a **LOT** of 
>> null pointer errors. They seem to be related to missing type information, 
>> although I’m not completely sure why the missing type information is causing 
>> these errors.
>> 
>>   Some of the errors are resolved-able by adding type info, but not all.
>> 
>>   I picked one at random to track down the issue:
>>   
>> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpaste.apache.org%2F8pLB=02%7C01%7Caharui%40adobe.com%7C31fb16c8d65948a50da008d5af5bd2c6%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636607731304191116=ik%2FnmWaooQD%2BwLT6VM1JN1ypa4BdOXe8VS1NfyF5FUw%3D=0
>>  
>> 
>> 
>>   The line in question looks like this:
>>   var codepoint:int = glyphs[i].codePoints[0];
>> 
>>   glyphs[I] is a “GlyphInfo” instance. Either of the following two changes 
>> make this particular error go away:
>>   var codepoint:* = glyphs[i].codePoints[0];
>>   var codepoint:int = (glyphs[i] as GlyphInfo).codePoints[0];
>> 
>>   I’m not really sure why these changes are necessary though…
>> 
>>   Thoughts?
>>   Harbs
>> 
> 
> 
> 



Re: Null pointer errors

2018-05-01 Thread Alex Harui
Sorry,  I thought the link was to the source so I didn't click on it.

This could be a good exercise for anyone wanting to learn more about the 
compiler to figure out how to catch this situation (maybe by detecting the AST 
for "void 0") and outputting an error instead of an NPE, or swapping in 
"undefined".

-Alex

On 5/1/18, 9:35 AM, "Harbs"  wrote:

I attached a paste of the stack in my email.

I just finished resolving all my errors. It was hard to trace them down, 
but I just discovered that there were uses of "void 0" in the code. I replaced 
all those cases with “undefined" and poof! All my errors went away! :-)

My theory is that use of void 0 was confusing the compiler and causing 
errors elsewhere… I’m not sure how to demonstrate this…

Harbs

(P.S. Sorry I’ve been so quiet lately. Life has been pretty busy… ;) )

> On May 1, 2018, at 7:03 PM, Alex Harui  wrote:
> 
> What is the call stack for the null pointer?
> 
> On 5/1/18, 5:05 AM, "Harbs"  wrote:
> 
>I’m trying to compile a library using comic and I’m getting a **LOT** 
of null pointer errors. They seem to be related to missing type information, 
although I’m not completely sure why the missing type information is causing 
these errors.
> 
>Some of the errors are resolved-able by adding type info, but not all.
> 
>I picked one at random to track down the issue:
>
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpaste.apache.org%2F8pLB=02%7C01%7Caharui%40adobe.com%7C31fb16c8d65948a50da008d5af5bd2c6%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636607731304191116=ik%2FnmWaooQD%2BwLT6VM1JN1ypa4BdOXe8VS1NfyF5FUw%3D=0
 

> 
>The line in question looks like this:
>var codepoint:int = glyphs[i].codePoints[0];
> 
>glyphs[I] is a “GlyphInfo” instance. Either of the following two 
changes make this particular error go away:
>var codepoint:* = glyphs[i].codePoints[0];
>var codepoint:int = (glyphs[i] as GlyphInfo).codePoints[0];
> 
>I’m not really sure why these changes are necessary though…
> 
>Thoughts?
>Harbs
> 





Re: Null pointer errors

2018-05-01 Thread Harbs
I attached a paste of the stack in my email.

I just finished resolving all my errors. It was hard to trace them down, but I 
just discovered that there were uses of "void 0" in the code. I replaced all 
those cases with “undefined" and poof! All my errors went away! :-)

My theory is that use of void 0 was confusing the compiler and causing errors 
elsewhere… I’m not sure how to demonstrate this…

Harbs

(P.S. Sorry I’ve been so quiet lately. Life has been pretty busy… ;) )

> On May 1, 2018, at 7:03 PM, Alex Harui  wrote:
> 
> What is the call stack for the null pointer?
> 
> On 5/1/18, 5:05 AM, "Harbs"  wrote:
> 
>I’m trying to compile a library using comic and I’m getting a **LOT** of 
> null pointer errors. They seem to be related to missing type information, 
> although I’m not completely sure why the missing type information is causing 
> these errors.
> 
>Some of the errors are resolved-able by adding type info, but not all.
> 
>I picked one at random to track down the issue:
>
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpaste.apache.org%2F8pLB=02%7C01%7Caharui%40adobe.com%7C31fb16c8d65948a50da008d5af5bd2c6%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636607731304191116=ik%2FnmWaooQD%2BwLT6VM1JN1ypa4BdOXe8VS1NfyF5FUw%3D=0
>  
> 
> 
>The line in question looks like this:
>var codepoint:int = glyphs[i].codePoints[0];
> 
>glyphs[I] is a “GlyphInfo” instance. Either of the following two changes 
> make this particular error go away:
>var codepoint:* = glyphs[i].codePoints[0];
>var codepoint:int = (glyphs[i] as GlyphInfo).codePoints[0];
> 
>I’m not really sure why these changes are necessary though…
> 
>Thoughts?
>Harbs
> 



Re: Null pointer errors

2018-05-01 Thread Alex Harui
What is the call stack for the null pointer?

On 5/1/18, 5:05 AM, "Harbs"  wrote:

I’m trying to compile a library using comic and I’m getting a **LOT** of 
null pointer errors. They seem to be related to missing type information, 
although I’m not completely sure why the missing type information is causing 
these errors.

Some of the errors are resolved-able by adding type info, but not all.

I picked one at random to track down the issue:

https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpaste.apache.org%2F8pLB=02%7C01%7Caharui%40adobe.com%7C31fb16c8d65948a50da008d5af5bd2c6%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636607731304191116=ik%2FnmWaooQD%2BwLT6VM1JN1ypa4BdOXe8VS1NfyF5FUw%3D=0
 


The line in question looks like this:
var codepoint:int = glyphs[i].codePoints[0];

glyphs[I] is a “GlyphInfo” instance. Either of the following two changes 
make this particular error go away:
var codepoint:* = glyphs[i].codePoints[0];
var codepoint:int = (glyphs[i] as GlyphInfo).codePoints[0];

I’m not really sure why these changes are necessary though…

Thoughts?
Harbs