Forwards-compatible syntax proposal
Nathan de Vries
nathan at atnan.com
Mon May 26 18:21:34 PDT 2008
On Mon, 2008-05-26 at 10:22 -0400, Mike Shaver wrote:
> > The main reason I'm interested in an ES4 script accessing an ES3
> > script (I presume the the reverse is not possible?)
>
> The reverse is indeed possible.
Is there any reading material you could point me to as to how this would
work? I thought the entire purpose of versioned <script /> tags was to
allow vendors to evaluate one script as ES3 and another as ES4. In that
context:
<script type="application/javascript">
/*<![CDATA[*/
var ES3ProtoClass = Class({
initialize: function() {
this.es4instance = new ES4Class;
}
});
/*]]>*/
</script>
<script type="application/javascript;version=2">
/*<![CDATA[*/
class ES4Class() {
private const es3instance;
function ES4Class() {
es3instance = new ES3ProtoClass();
}
}
/*]]>*/
</script>
What does "new ES4Class" mean to a user agent that does not yet support
ES4, or one that supports both ES3 & 4, but treats "app/javascript" as
ES3.
Am I missing something?
Regards,
--
Nathan de Vries
More information about the Es4-discuss
mailing list