Merge branch 'master' of git@github.com:280north/cappuccino

This commit is contained in:
Francisco Ryan Tolmasky I committed 2009-01-06 23:57:34 -08:00
commit f61a82d0eb
1 file changed
+21
+21
View File
@@ -23,6 +23,7 @@
@import "CPObject.j"
@import "CPException.j"
@import "CPSortDescriptor.j"
@import "CPValue.j"
/*!
@@ -640,4 +641,24 @@ var CPStringHashes = new objj_dictionary();
@end
@implementation CPString (JSON)
/*!
Returns a string representing the supplied JavaScript object encoded as JSON.
*/
+ (CPString)JSONFromObject:(JSObject)anObject
{
return CPJSObjectCreateJSON(anObject);
}
/*!
Returns a JavaScript object decoded from the string's JSON representation.
*/
- (JSObject)objectFromJSON
{
return CPJSObjectCreateWithJSON(self);
}
@end
String.prototype.isa = CPString;