diff --git a/Foundation/CPAttributedString.j b/Foundation/CPAttributedString.j index 3b8fff5f8..82e7f93a7 100644 --- a/Foundation/CPAttributedString.j +++ b/Foundation/CPAttributedString.j @@ -750,8 +750,8 @@ } //Private methods -- (void)_indexOfRangeEntryForIndex:(unsigned)characterIndex splitOnMaxIndex:(BOOL)split -{ +- (Number)_indexOfRangeEntryForIndex:(unsigned)characterIndex splitOnMaxIndex:(BOOL)split +{ var index = [self _indexOfEntryWithIndex:characterIndex]; if (index < 0) diff --git a/Foundation/CPURL.j b/Foundation/CPURL.j index bfc2ab507..fc7a52405 100644 --- a/Foundation/CPURL.j +++ b/Foundation/CPURL.j @@ -132,7 +132,7 @@ CPURLCustomIconKey = @"CPURLCustomIconKey"; return URI_RE.test(str) ? (parse(str).domain || nil) : nil; } -- (CPString)port +- (Number)port { var str = [self absoluteString]; if (URI_RE.test(str)) { diff --git a/Objective-J/Includes.js b/Objective-J/Includes.js index fd7d1920b..d2aa45ee1 100644 --- a/Objective-J/Includes.js +++ b/Objective-J/Includes.js @@ -41,7 +41,7 @@ #include "FileExecutable.js" #include "FileExecutableSearch.js" #include "Runtime.js" -#if DEBUG +#if defined(DEBUG) || defined(COMMONJS) #include "Debug.js" #endif #include "Bootstrap.js" diff --git a/Tests/Foundation/CPAttributedStringTest.j b/Tests/Foundation/CPAttributedStringTest.j index bbc2a607d..c5b0e09b3 100644 --- a/Tests/Foundation/CPAttributedStringTest.j +++ b/Tests/Foundation/CPAttributedStringTest.j @@ -31,14 +31,14 @@ var sharedObject = [CPObject new]; return string; } -- (id)testInitWithString +- (void)testInitWithString { var string = [[CPAttributedString alloc] initWithString:@"hi there"]; [self assertTrue:([string string] === @"hi there") message:"testInitWithString: expected:" + @"hi there" + " actual:" + [string string]]; } -- (id)testInitWithAttributedString +- (void)testInitWithAttributedString { var string = [[CPAttributedString alloc] initWithString:@"hi there"], attributedString = [[CPAttributedString alloc] initWithAttributedString:string]; @@ -53,7 +53,7 @@ var sharedObject = [CPObject new]; message:"testInitWithAttributedString: expected:" + [self stringForTesting] + " actual:" + string]; } -- (id)testIinitWithString_attributes +- (void)testIinitWithString_attributes { var string = [[CPAttributedString alloc] initWithString:@"hi there" attributes:[CPDictionary dictionary]]; @@ -70,7 +70,7 @@ var sharedObject = [CPObject new]; } //Retrieving Character Information -- (CPString)testString +- (void)testString { var string = [[CPAttributedString alloc] initWithString:@"hi there"]; @@ -78,7 +78,7 @@ var sharedObject = [CPObject new]; message:"testString: expected:" + @"hi there" + " actual:" + [string string]]; } -- (unsigned)testLength +- (void)testLength { var string = [[CPAttributedString alloc] initWithString:@"hi there"]; @@ -89,7 +89,7 @@ var sharedObject = [CPObject new]; message:"testLength: expected:" + 45 + " actual:" + [[self stringForTesting] length]]; } -- (unsigned)test_indexOfEntryWithIndex +- (void)test_indexOfEntryWithIndex { var string = [self stringForTesting]; @@ -104,7 +104,7 @@ var sharedObject = [CPObject new]; } //Retrieving Attribute Information -- (CPDictionary)testAttributesAtIndexEffectiveRange +- (void)testAttributesAtIndexEffectiveRange { var string = [self stringForTesting], expectedValues = {a:1, b:"bar", c:sharedObject, d:20}; @@ -117,7 +117,7 @@ var sharedObject = [CPObject new]; } //- (CPDictionary)attributesAtIndex:(unsigned)anIndex longestEffectiveRange:(CPRangePointer)aRange inRange:(CPRange)rangeLimit -- (CPDictionary)testAttributesAtIndexLongestEffectiveRangeInRange +- (void)testAttributesAtIndexLongestEffectiveRangeInRange { var string = [self stringForTesting]; @@ -136,7 +136,7 @@ var sharedObject = [CPObject new]; } //- (id)attribute:(CPString)attribute atIndex:(unsigned)index effectiveRange:(CPRangePointer)aRange -- (id)testAttributeAtIndexEffectiveRange +- (void)testAttributeAtIndexEffectiveRange { var string = [self stringForTesting]; @@ -145,7 +145,7 @@ var sharedObject = [CPObject new]; } //- (id)attribute:(CPString)attribute atIndex:(unsigned)index longestEffectiveRange:(CPRangePointer)aRange inRange:(CPRange)rangeLimit -- (id)testAttributeAtIndexLongestEffectiveRangeInRange +- (void)testAttributeAtIndexLongestEffectiveRangeInRange { var string = [self stringForTesting]; @@ -159,14 +159,14 @@ var sharedObject = [CPObject new]; } //Comparing Attributed Strings -- (BOOL)testIsEqualToAttributedString +- (void)testIsEqualToAttributedString { [self assertTrue:[[self stringForTesting] isEqualToAttributedString:[self stringForTesting]] message:"expected stringForTesting to equal itself, but it didn't"]; [self assertFalse:[[self stringForTesting] isEqualToAttributedString:[[CPAttributedString alloc] initWithString:@"HELLO!"]] message:"Expected stringForTesting to not equal 'HELLO!', but it did"]; } -- (BOOL)testIsEqual +- (void)testIsEqual { [self assertTrue:[[self stringForTesting] isEqual:[self stringForTesting]] message:"expected stringForTesting to equal itself, but it didn't"]; @@ -181,7 +181,7 @@ var sharedObject = [CPObject new]; //Extracting a Substring //- (CPAttributedString)attributedSubstringFromRange:(CPRange)aRange -- (CPAttributedString)testAttributedSubstringFromRange +- (void)testAttributedSubstringFromRange { var a = [[self stringForTesting] attributedSubstringFromRange:CPMakeRange(0, 9)], expectedValues = {a:1, b:"bar", c:sharedObject, d:20};