[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-nashorn-dev
Subject:    Re: Bug report: iteration on dicts fails if index var is not used
From:       Attila Szegedi <attila.szegedi () oracle ! com>
Date:       2014-08-25 8:47:45
Message-ID: B2C4D62F-04AE-4CAF-BFC2-90C0D3C75469 () oracle ! com
[Download RAW message or body]

Thanks, I recorded this as <https://bugs.openjdk.java.net/browse/JDK-8055870> It \
seems to be related to the static local variable type inference logic that I'm \
responsible for. I'll look into this ASAP. We just pushed a backport of JDK 9 \
optimistic typing feature to 8u-dev, and local static type inference is part of that.

I'll also try to figure out internally who's resposible for the bugreport page and \
see to it that a "Nashorn" subcategory gets added.

Attila.

On Aug 25, 2014, at 6:26 AM, Tal Liron <tal.liron@threecrickets.com> wrote:

> Sorry for using the mailing list, still unclear for me how to open Nashorn bugs \
> (the standard form in bugreport.java.com does not have a "nashorn" subcategory). \
> The bug is on trunk in http://hg.openjdk.java.net/jdk8u/jdk8u-dev/nashorn. 
> The following program will cause an exception when "isEmpty2" is called:
> 
> Error: java.lang.ClassCastException: java.lang.String cannot be cast to \
> jdk.nashorn.internal.runtime.Undefined 
> The only difference between isEmpty1 and isEmpty2 is the actual use of "k". If "k" \
> is not referenced, the exception happens. 
> 
> function isEmpty1(v) {
> for (var k in v) {
> print(v[k]+'\n')
> return false
> }
> return true
> }
> 
> function isEmpty2(v) {
> for (var k in v) {
> return false
> }
> return true
> }
> 
> x = {test: 'test'}
> 
> isEmpty1(x)
> isEmpty2(x)
> 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic