CPJSONPConnection Missing imports and self check

This commit is contained in:
Stephen Ierodiaconou committed 2010-12-26 01:34:43 +02:00
1 parent 66b6b44f86
commit bfe03a8874
1 file changed
+12 -8
+12 -8
View File
@@ -20,8 +20,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "CPException.j"
@import "CPObject.j"
@import "CPRunLoop.j"
CPJSONPConnectionCallbacks = {};
@@ -68,16 +69,19 @@ CPJSONPCallbackReplacementString = @"${JSONP_CALLBACK}";
{
self = [super init];
_request = aRequest;
_delegate = aDelegate;
if (self)
{
_request = aRequest;
_delegate = aDelegate;
_callbackParameter = aString;
_callbackParameter = aString;
if (!_callbackParameter && [[_request URL] absoluteString].indexOf(CPJSONPCallbackReplacementString) < 0)
[CPException raise:CPInvalidArgumentException reason:@"JSONP source specified without callback parameter or CPJSONPCallbackReplacementString in URL."];
if (!_callbackParameter && [[_request URL] absoluteString].indexOf(CPJSONPCallbackReplacementString) < 0)
[CPException raise:CPInvalidArgumentException reason:@"JSONP source specified without callback parameter or CPJSONPCallbackReplacementString in URL."];
if (shouldStartImmediately)
[self start];
if (shouldStartImmediately)
[self start];
}
return self;
}