Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: 'do JavaScript' still broken in Safari 3 beta
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 'do JavaScript' still broken in Safari 3 beta



On 6/21/07, has <email@hidden> wrote:
Looks like something in the JavaScript interpreter has changed from previous versions,
as "return 1" works fine in the version of JS used by Safari 2. Unfortunately,
I'm not a JS expert (as you can tell) so I've no idea if this is by
design or accident - anyone know?

I assume it's by design. According to the standard (ECMA-262, section 12.9):

   An ECMAScript program is considered syntactically incorrect if it contains a
    return statement that is not within a FunctionBody.

So there ya go.  But if the JS interpreter horks on the string passed
to it from AS, it seems like the AS code should get an indication of
that...

I've never understood JS's approach to exceptions and exception
handling, so ain't going there myself. :p

It's pretty similar to Java's, actually. But the treatment of syntax errors is somewhat implementation-dependent...

--
Mark J. Reed <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
References: 
 >Re: 'do JavaScript' still broken in Safari 3 beta (From: has <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.