Closed GoogleCodeExporter closed 9 years ago
Thanks, that's great! is it ok to pull those changes back into this project?
Out of interest, is there any reason you couldn't work off a branch on this
project? Everyone seems to be starting a whole new repository - I just wondered
if it's because I somehow disabled write access :)
Original comment by pur3m...@googlemail.com
on 2 Sep 2010 at 9:53
of course you can pull back my changes to your project
Original comment by ArminDie...@gmail.com
on 2 Sep 2010 at 11:34
When you me join as commiter, i have no problem to work of a branch.
I have created my own repository because my reflexion was that everyone only in
the "trunk" looks ;-)
Join me and i will remove my fork and work on a branch.
Original comment by ArminDie...@gmail.com
on 2 Sep 2010 at 11:52
Thanks, I've just added you.
I updated the trunk with your changes to the lexer, the leak, and sprintf/etc,
as well as some memory leak fixes I found too. If you're happy to do so you
could put your changes into trunk if you want to - either that or branch them
and we can pull back when you're happy?
Original comment by pur3m...@googlemail.com
on 3 Sep 2010 at 6:12
Original comment by ArminDie...@gmail.com
on 6 Sep 2010 at 5:10
Thanks for adding all the changes, using the map seems like it could improve
speed quite a lot!
Did you run the automated tests in run_tests on it? It seems to fail a few of
them now and segfaults when dumping empty classes (at least on Linux).
I don't know if you want to commit this? I don't want to mess with your branch,
but this fixes the segfault for empty classes.
Index: TinyJS.cpp
===================================================================
--- TinyJS.cpp (revision 26)
+++ TinyJS.cpp (working copy)
@@ -1135,10 +1135,10 @@
ostringstream funcStr;
funcStr << "function (";
// get list of parameters
- SCRIPTVAR_CHILDS::iterator last_it = --(Childs.end());
+ int count = Childs.size();
for(SCRIPTVAR_CHILDS::iterator it = Childs.begin(); it != Childs.end(); ++it) {
funcStr << it->first;
- if (it != last_it) funcStr << ", ";
+ if (--count) funcStr << ", ";
}
// add function body
funcStr << ") " << getString();
@@ -1157,7 +1157,7 @@
string indentedLinePrefix = linePrefix+" ";
// children - handle with bracketed list
destination << "{ \n";
- SCRIPTVAR_CHILDS::iterator last_it = --(Childs.end());
+ int count = Childs.size();
for(SCRIPTVAR_CHILDS::iterator it = Childs.begin(); it != Childs.end(); ++it) {
destination << indentedLinePrefix;
if (isAlphaNum(it->first))
@@ -1166,9 +1166,8 @@
destination << getJSString(it->first);
destination << " : ";
it->second->var->getJSON(destination, indentedLinePrefix);
- if (it != last_it) {
+ if (--count)
destination << ",\n";
- }
}
destination << "\n" << linePrefix << "}";
} else if (isArray()) {
Index: TinyJS_Functions.cpp
===================================================================
--- TinyJS_Functions.cpp (revision 26)
+++ TinyJS_Functions.cpp (working copy)
@@ -41,7 +41,7 @@
using namespace std;
// ----------------------------------------------- Actual Functions
-void scTrace(CScriptVar *UNUSED(c), void * userdata) {
+void scTrace(CScriptVar *c, void * userdata) {
CTinyJS *js = (CTinyJS*)userdata;
js->root->trace();
}
Original comment by pur3m...@googlemail.com
on 6 Sep 2010 at 12:17
thanks for fixing this segfaults-bug
yes the result of "--(Childs.end())" by a blank "map" does not exist or is bad.
I have not thought of it.;-)
i have fix my branch
Original comment by ArminDie...@gmail.com
on 6 Sep 2010 at 7:20
Original issue reported on code.google.com by
ArminDie...@gmail.com
on 1 Sep 2010 at 5:49