Just to pitch in, V8 does support x.toString() and parseFloat(x), which are both supported by other browsers and provide pretty similar functionality.
A quick check on Firefox shows that it doesn't have ToNumber and ToString either. On Mar 18, 2:14 pm, Søren Gjesse <[email protected]> wrote: > There is a flag --expose-natives-as which can be used to expose the > content of the native context to a global context. E.g. > > ./v8 --expose-natives-as x > > v8> x.ToNumber > > However this flag is mostly used for experiments and testing, so don't > rely on it as a long term solution. > > Regards, > Søren > > On 3/18/09, Erik Corry <[email protected]> wrote: > > > > > 2009/3/18 MJ <[email protected]>: > > >> Oh ok, I did not know that. So they are unusable by other scripts? > > > As far as I know, yes. > > >> On Mar 18, 9:03 am, Erik Corry <[email protected]> wrote: > >>> 2009/3/18 MJ <[email protected]>: > > >>> > There are a bunch of ECMA spec fucntions like ToNumber, ToString and > >>> > such defined in runtime.js in V8. Although when you try to use them in > >>> > script they are undefined. Has anyone seen this or know why this is? > > >>> The policy-based explanation is that they are not really part of the > >>> ECMAScript standard. They are only used to explain the algorithms > >>> that are in the spec. > > >>> The technical explanation is that files like runtime.js have a > >>> different global object than other scripts. > > >>> -- > >>> Erik Corry, Software Engineer > >>> Google Denmark ApS. CVR nr. 28 86 69 84 > >>> c/o Philip & Partners, 7 Vognmagergade, P.O. Box 2227, DK-1018 > >>> Copenhagen K, Denmark. > > > -- > > Erik Corry, Software Engineer > > Google Denmark ApS. CVR nr. 28 86 69 84 > > c/o Philip & Partners, 7 Vognmagergade, P.O. Box 2227, DK-1018 > > Copenhagen K, Denmark. --~--~---------~--~----~------------~-------~--~----~ v8-users mailing list [email protected] http://groups.google.com/group/v8-users -~----------~----~----~----~------~----~------~--~---
