Hmm... I don't think there is any spec. word on preventing additional/extension global functions, objects and constructors.

In fact, ECMAScript specification explicitly permits extensions. Also, I don't know any implementation of ECMAScript that does not extend global environment or built-in objects.

-Sundar

On Sunday 26 January 2014 12:45 PM, James Ladd wrote:
Hi nashorners ,

Preter M wrote about a new Nashorn environment containing functions that should 
not have been there as per spec.

He made a very good point about new releases putting other functions into the 
environment without developers knowing.

What is happening in regards to this?

- James

From: [email protected]
Subject: nashorn-dev Digest, Vol 14, Issue 23
To: [email protected]
Date: Sat, 25 Jan 2014 12:00:02 -0800

Send nashorn-dev mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://mail.openjdk.java.net/mailman/listinfo/nashorn-dev
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of nashorn-dev digest..."


Today's Topics:

    1. Unable to iterate over Enums... (Walter Higgins)


----------------------------------------------------------------------

Message: 1
Date: Fri, 24 Jan 2014 23:37:07 +0000
From: Walter Higgins <[email protected]>
Subject: Unable to iterate over Enums...
To: [email protected]
Message-ID:
        <CAGoN+nm4ufQ32VZXRvx_hzvgwBKbx2gHoxFQOK7G=jn9r4_...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Say I have a Java Enum type, In previous versions of the Javascript engine,
I could iterator over each value like this...

for (var m in MaterialEnum){
     if (MaterialEnum[m] &&
         MaterialEnum[m].ordinal)
     {
         println(MaterialEnum[m]);
     }
}

In Nashorn, this is no longer possible. Is this a bug or is it by design?

--
Walter Higgins
Mobile: (+353) 086 8511600
Website: http://walterhiggins.net/


End of nashorn-dev Digest, Vol 14, Issue 23
*******************************************
                                        

Reply via email to