Review request JDK-8007619: Add support for deprecated properties of RegExp constructor

Hannes Wallnoefer hannes.wallnoefer at oracle.com
Wed Feb 6 02:43:57 PST 2013


To be honest this looks a bit hacky to me. The properties on the 
constructor are configurable and writable (since they are technically 
not defined), and the __last_regexp_match__ property leaks out to the 
script.

I think ideally we should support getters on the constructor (which I 
think we currently do not):

     @Getter(where = Where.CONSTRUCTOR)
     public static Object lastMatch(Object self) {
         ...
     }

And maybe we could think of a way to let the getter know what to return 
without using a public property on the constructor?

Hannes

Am 2013-02-06 09:06, schrieb A. Sundararajan:
> Please review http://cr.openjdk.java.net/~sundar/8007619/
>
> Thanks,
> -Sundar



More information about the nashorn-dev mailing list