mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-24 11:20:42 +00:00
Updating CPDictionary and CPString to both actually subclass.. not just create a new object without inherited properties.
This commit is contained in:
@@ -84,8 +84,9 @@
|
||||
*/
|
||||
+ (id)alloc
|
||||
{
|
||||
if ([self class] !== CPDictionary && [self class] !== CPMutableDictionary) return [super alloc];
|
||||
return new CFMutableDictionary();
|
||||
var result = new CFMutableDictionary();
|
||||
if ([self class] !== CPDictionary && [self class] !== CPMutableDictionary) result.isa = [self class];
|
||||
return result;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
+12
-1
@@ -135,7 +135,7 @@ var CPStringRegexSpecialCharacters = [
|
||||
*/
|
||||
- (id)initWithString:(CPString)aString
|
||||
{
|
||||
return String(aString);
|
||||
return CreateSubclassableString(aString, [self class]);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -796,6 +796,17 @@ var CPStringRegexSpecialCharacters = [
|
||||
|
||||
@end
|
||||
|
||||
var CreateSubclassableString = function(aString, aClass)
|
||||
{
|
||||
if (aClass === CPString) return String(aString);
|
||||
|
||||
var result = new String(aString);
|
||||
|
||||
result.isa = aClass;
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
var diacritics = [[192,198],[224,230],[231,231],[232,235],[236,239],[242,246],[249,252]]; // Basic Latin ; Latin-1 Supplement.
|
||||
var normalized = [65,97,99,101,105,111,117];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user