1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-15 00:24:19 +00:00

Added a parseFloat method to the Javascript parser

This commit is contained in:
jules 2016-05-03 17:24:04 +01:00
parent f2bca436d5
commit a0835a5ea9

View file

@ -67,12 +67,13 @@ struct JavascriptEngine::RootObject : public DynamicObject
{
RootObject()
{
setMethod ("exec", exec);
setMethod ("eval", eval);
setMethod ("trace", trace);
setMethod ("charToInt", charToInt);
setMethod ("parseInt", IntegerClass::parseInt);
setMethod ("typeof", typeof_internal);
setMethod ("exec", exec);
setMethod ("eval", eval);
setMethod ("trace", trace);
setMethod ("charToInt", charToInt);
setMethod ("parseInt", IntegerClass::parseInt);
setMethod ("typeof", typeof_internal);
setMethod ("parseFloat", parseFloat);
}
Time timeout;
@ -1677,6 +1678,7 @@ struct JavascriptEngine::RootObject : public DynamicObject
//==============================================================================
static var trace (Args a) { Logger::outputDebugString (JSON::toString (a.thisObject)); return var::undefined(); }
static var charToInt (Args a) { return (int) (getString (a, 0)[0]); }
static var parseFloat (Args a) { return getDouble (a, 0); }
static var typeof_internal (Args a)
{