Mac OS X javascript
Harri Porten
porten at kde.org
Sun Feb 8 20:11:04 CET 2004
Hi Douglas,
I'm not employed by Apple Computers. So I can't give you a definite answer
but I'll try my best to answer your questions. I've also allowed myself to
CC a list of developers where your bug report might be picked up.
On Sun, 8 Feb 2004, Douglas Tedsen wrote:
[...]
> I noticed today that a certain feature (it happened to be how the
> "constructor" property) was handled differently in Safari from all
> other browser/platform implementations. The following code:
>
> <script language="Javascript">
> function Circle(radius) {this.r = radius;}
> var c = new Circle(1.0); // Create an instance of the Circle
> class.
> if (c.constructor == Circle) {alert("Circle");} else {alert("What?");}
> </script>
>
> produced "What?" in Safari, but "Circle" everywhere else.
Works fine in Konqueror from KDE 3.2. Guess there's patch missing in the
JavaScriptCore tree.
> This lead me to wonder what version of Javascript is being used, and
> how it's implemented across browser and platform. Seeing the System
> Profiler entry makes me wonder if there is a core Javascript
> implementation at the OS level, and other variations at the browser
> level, maybe "Client side"?
JS is normally not considered to be part of the OS. JavaScriptCore may be
a core library of Mac OS X these days but this library is not shared by
other browsers.
> Because Safari reacts differently than IE or Mozilla, I know there's
> some kind of variation, but I don't know the the "what" or "how" of it.
> Could you shed some light on this? Also, how can I know what version of
> Javascript is implemented?
The JavaScript version 1.5 you have mentioned belongs the versioning
scheme used by Netscape. Microsoft has a different numbering scheme for
JScript. They are all based on the ECMA 262 Edition 3 standard, though.
And that's what is implemented by KDE and Apple as well.
Harri.
More information about the Khtml-devel
mailing list