mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-07 09:28:02 +00:00
Update to use JSON.{parse,stringify}
This commit is contained in:
1 parent
7c305c45fc
commit
b0470ca2d7
4 files changed
+5
-5
No files matched your search
@@ -491,7 +491,7 @@ var CPColorPanelSwatchesCookie = "CPColorPanelSwatchesCookie";
|
||||
var future = new Date();
|
||||
future.setYear(2019);
|
||||
|
||||
[_swatchCookie setValue: CPJSObjectCreateJSON(result) expires:future domain: nil];
|
||||
[_swatchCookie setValue: JSON.stringify(result) expires:future domain: nil];
|
||||
}
|
||||
|
||||
- (void)setColorPanel:(CPColorPanel)panel
|
||||
|
||||
@@ -85,7 +85,7 @@ var CPValueValueKey = @"CPValueValueKey";
|
||||
self = [super init];
|
||||
|
||||
if (self)
|
||||
_JSObject = CPJSObjectCreateWithJSON([aCoder decodeObjectForKey:CPValueValueKey]);
|
||||
_JSObject = JSON.parse([aCoder decodeObjectForKey:CPValueValueKey]);
|
||||
|
||||
return self;
|
||||
}
|
||||
@@ -96,7 +96,7 @@ var CPValueValueKey = @"CPValueValueKey";
|
||||
*/
|
||||
- (void)encodeWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
[aCoder encodeObject:CPJSObjectCreateJSON(_JSObject) forKey:CPValueValueKey];
|
||||
[aCoder encodeObject:JSON.stringify(_JSObject) forKey:CPValueValueKey];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ function readConfig(configFile)
|
||||
if (!fileData)
|
||||
throw new Error("Couldn't read file: " + configFile);
|
||||
|
||||
var configs = CPJSObjectCreateWithJSON(fileData);
|
||||
var configs = JSON.parse(fileData);
|
||||
|
||||
return configs;
|
||||
}
|
||||
|
||||
+1
-1
@@ -239,7 +239,7 @@ function main()
|
||||
|
||||
// add fake bundle response bookkeeping
|
||||
applicationJS.push("var __fakeDidReceiveBundleResponse = " + String(fakeDidReceiveBundleResponse));
|
||||
applicationJS.push("var __fakeBundleArchives = " + CPJSObjectCreateJSON(bundleArchives) + ";");
|
||||
applicationJS.push("var __fakeBundleArchives = " + JSON.stringify(bundleArchives) + ";");
|
||||
applicationJS.push("for (var i = 0; i < __fakeBundleArchives.length; i++) __fakeDidReceiveBundleResponse(__fakeBundleArchives[i]);")
|
||||
|
||||
// add each fragment, wrapped in a function, along with OBJJ_CURRENT_BUNDLE bookkeeping
|
||||
|
||||
Reference in new issue
Block a user