Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of TinyJS by
Diff: TinyJS_Functions.cpp
- Revision:
- 9:f80cf055f03d
- Parent:
- 0:aae260bdcdd9
diff -r 819934a27c2d -r f80cf055f03d TinyJS_Functions.cpp --- a/TinyJS_Functions.cpp Mon Jan 20 00:07:35 2014 +0000 +++ b/TinyJS_Functions.cpp Wed Sep 10 08:41:53 2014 +0000 @@ -216,14 +216,23 @@ string sep = c->getParameter("separator")->getString(); CScriptVar *arr = c->getParameter("this"); +#ifndef MBED ostringstream sstr; int l = arr->getArrayLength(); for (int i=0;i<l;i++) { if (i>0) sstr << sep; sstr << arr->getArrayIndex(i)->getString(); } - c->getReturnVar()->setString(sstr.str()); +#else + std::string sstr; + int l = arr->getArrayLength(); + for (int i=0;i<l;i++) { + if (i>0) sstr += sep; + sstr += arr->getArrayIndex(i)->getString(); + } + c->getReturnVar()->setString(sstr); +#endif } // ----------------------------------------------- Register Functions