A few additions for pretty printing things and getting better error messages

This commit is contained in:
Ross Boucher
2009-12-11 10:58:07 -08:00
parent d14e077511
commit a98de54db4
3 changed files with 23 additions and 3 deletions
+17 -1
View File
@@ -33,6 +33,10 @@
@implementation CPBundle : CPObject
{
//properties set up in file.js
//this.path = NULL;
//this.info = NULL;
//this._URIMap = { };
}
+ (id)alloc
@@ -185,13 +189,25 @@
- (void)connection:(CPURLConnection)aConnection didFailWithError:(CPError)anError
{
alert("Couldnot find bundle:" + anError)
if ([_delegate respondsToSelector:@selector(bundle:didFailWithError:)])
[_delegate bundle:self didFailWithError:anError];
CPLog.error("Could not find bundle: " + self);
}
- (void)connectionDidFinishLoading:(CPURLConnection)aConnection
{
}
- (CPString)description
{
return [super description] + "(" + path + ")";
}
@end
objj_bundle.prototype.isa = CPBundle;
objj_bundle.prototype.toString = function()
{
return [this description];
}
+4
View File
@@ -609,3 +609,7 @@
@end
objj_dictionary.prototype.isa = CPDictionary;
objj_bundle.prototype.toString = function()
{
return [this description];
}
+2 -2
View File
@@ -607,10 +607,10 @@ function objj_decompile(aString, bundle)
var stream = new objj_markedStream(aString);
if (stream.magicNumber() != STATIC_MAGIC_NUMBER)
objj_exception_throw(new objj_exception(OBJJUnrecognizedFormatException, "*** Could not recognize executable code format."));
objj_exception_throw(new objj_exception(OBJJUnrecognizedFormatException, "*** Could not recognize executable code format in bundle: "+bundle));
if (stream.version() != 1.0)
objj_exception_throw(new objj_exception(OBJJUnrecognizedFormatException, "*** Could not recognize executable code format."));
objj_exception_throw(new objj_exception(OBJJUnrecognizedFormatException, "*** Could not recognize executable code format in bundle: "+bundle));
var file = NULL,
files = [],