mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-11 05:07:13 +00:00
Update to use JSON.{parse,stringify}
This commit is contained in:
committed by
Francisco Ryan Tolmasky I
parent
774ea99319
commit
787e0c8afd
@@ -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
|
||||
|
||||
@@ -83,7 +83,7 @@ var CPValueValueKey = @"CPValueValueKey";
|
||||
self = [super init];
|
||||
|
||||
if (self)
|
||||
_JSObject = CPJSObjectCreateWithJSON([aCoder decodeObjectForKey:CPValueValueKey]);
|
||||
_JSObject = JSON.parse([aCoder decodeObjectForKey:CPValueValueKey]);
|
||||
|
||||
return self;
|
||||
}
|
||||
@@ -94,7 +94,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