Skip to content

Commit

Permalink
When casting Strings to booleans, so s.length!=0
Browse files Browse the repository at this point in the history
  • Loading branch information
gfwilliams committed Feb 14, 2014
1 parent c8f0b9b commit 9da681c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Expand Up @@ -33,6 +33,7 @@
Fix parsing of '018' - it's not Octal after all (but 017 is)
More accurate values for PI and E
Fix charCodeAt being signed (should be unsigned)
When casting Strings to booleans, so s.length!=0


1v50 : Fix broken Web IDE caused by change to printing JSON for console.log (part of #206)
Expand Down
2 changes: 2 additions & 0 deletions src/jsvar.c
Expand Up @@ -1023,6 +1023,8 @@ void jsvSetInteger(JsVar *v, JsVarInt value) {
}

bool jsvGetBool(const JsVar *v) {
if (jsvIsString(v))
return jsvGetStringLength(v)!=0;
return jsvGetInteger(v)!=0;
}

Expand Down

0 comments on commit 9da681c

Please sign in to comment.