Skip to content

Commit

Permalink
Added a parseFloat method to the Javascript parser
Browse files Browse the repository at this point in the history
  • Loading branch information
julianstorer committed May 3, 2016
1 parent f2bca43 commit a0835a5
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions modules/juce_core/javascript/juce_Javascript.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit a0835a5

Please sign in to comment.