diff --git a/Foundation/CPData.j b/Foundation/CPData.j index b5fe53c5f..1412e034a 100644 --- a/Foundation/CPData.j +++ b/Foundation/CPData.j @@ -69,7 +69,7 @@ { var data = [[self alloc] init]; data.setBytes(bytesArray); - + return data; } @@ -77,7 +77,7 @@ { var data = [[self alloc] init]; data.setBase64String(aString); - + return data; } diff --git a/Objective-J/CFData.js b/Objective-J/CFData.js index afbfe20d7..f4b08f86b 100644 --- a/Objective-J/CFData.js +++ b/Objective-J/CFData.js @@ -31,7 +31,7 @@ GLOBAL(CFData) = function() this._bytes = NULL; this._base64 = NULL; -} +}; CFData.prototype.propertyList = function() { @@ -39,7 +39,7 @@ CFData.prototype.propertyList = function() this._propertyList = CFPropertyList.propertyListFromString(this.rawString()); return this._propertyList; -} +}; CFData.prototype.JSONObject = function() { @@ -55,7 +55,7 @@ CFData.prototype.JSONObject = function() } return this._JSONObject; -} +}; CFData.prototype.rawString = function() { @@ -78,7 +78,7 @@ CFData.prototype.rawString = function() } return this._rawString; -} +}; CFData.prototype.bytes = function() { @@ -87,9 +87,9 @@ CFData.prototype.bytes = function() var bytes = CFData.stringToBytes(this.rawString()); this.setBytes(bytes); } - + return this._bytes; -} +}; CFData.prototype.base64 = function() { @@ -100,17 +100,17 @@ CFData.prototype.base64 = function() base64 = CFData.encodeBase64Array(this._bytes); else base64 = CFData.encodeBase64String(this.rawString()); - + this.setBase64String(base64); } - + return this._base64; -} +}; GLOBAL(CFMutableData) = function() { CFData.call(this); -} +}; CFMutableData.prototype = new CFData(); @@ -133,35 +133,35 @@ CFMutableData.prototype.setPropertyList = function(/*PropertyList*/ aPropertyLis this._propertyList = aPropertyList; this._propertyListFormat = aFormat; -} +}; CFMutableData.prototype.setJSONObject = function(/*Object*/ anObject) { clearMutableData(this); - this._JSONObject = anObject -} + this._JSONObject = anObject; +}; CFMutableData.prototype.setRawString = function(/*String*/ aString) { clearMutableData(this); this._rawString = aString; -} +}; CFMutableData.prototype.setBytes = function(/*Array*/ bytes) { clearMutableData(this); this._bytes = bytes; -} +}; CFMutableData.prototype.setBase64String = function(/*String*/ aBase64String) { clearMutableData(this); this._base64 = aBase64String; -} +}; // Base64 encoding and decoding @@ -201,7 +201,7 @@ CFData.decodeBase64ToArray = function(input, strip) return output.slice(0, -1 * pad); return output; -} +}; CFData.encodeBase64Array = function(input) { @@ -239,23 +239,23 @@ CFData.encodeBase64Array = function(input) } return output.join(""); -} +}; CFData.decodeBase64ToString = function(input, strip) { return CFData.bytesToString(CFData.decodeBase64ToArray(input, strip)); -} +}; CFData.decodeBase64ToUtf16String = function(input, strip) { return CFData.bytesToUtf16String(CFData.decodeBase64ToArray(input, strip)); -} +}; CFData.bytesToString = function(bytes) { // This is relatively efficient, I think: return String.fromCharCode.apply(NULL, bytes); -} +}; CFData.stringToBytes = function(input) { @@ -264,7 +264,7 @@ CFData.stringToBytes = function(input) temp.push(input.charCodeAt(i)); return temp; -} +}; CFData.encodeBase64String = function(input) { @@ -273,7 +273,7 @@ CFData.encodeBase64String = function(input) temp.push(input.charCodeAt(i)); return CFData.encodeBase64Array(temp); -} +}; CFData.bytesToUtf16String = function(bytes) { @@ -283,7 +283,7 @@ CFData.bytesToUtf16String = function(bytes) temp.push(bytes[i+1] << 8 | bytes[i]); // This is relatively efficient, I think: return String.fromCharCode.apply(NULL, temp); -} +}; CFData.encodeBase64Utf16String = function(input) @@ -298,4 +298,4 @@ CFData.encodeBase64Utf16String = function(input) } return CFData.encodeBase64Array(temp); -} +}; diff --git a/Tools/nib2cib/Converter.j b/Tools/nib2cib/Converter.j index 654c5dd0a..76ec766c3 100644 --- a/Tools/nib2cib/Converter.j +++ b/Tools/nib2cib/Converter.j @@ -129,7 +129,7 @@ ConverterConversionException = @"ConverterConversionException"; if (!FILE.isReadable(temporaryPlistFilePath)) [CPException raise:ConverterConversionException reason:@"Unable to convert nib file."]; - var plistContents = FILE.read(temporaryPlistFilePath, { charset:"UTF-8" }); + var plistContents = FILE.read(temporaryPlistFilePath, { charset: "UTF-8" }); // Minor NS keyed archive to CP keyed archive conversion. // Use Java directly because rhino's string.replace is *so slow*. 4 seconds vs. 1 millisecond. @@ -142,7 +142,7 @@ ConverterConversionException = @"ConverterConversionException"; plistContents = plistContents.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F]<\/string>/g, function(c) { CPLog.warn("Warning: converting character 0x" + c.charCodeAt(8).toString(16) + " to base64 representation"); - return ""+CFData.encodeBase64String(c.charAt(8))+""; + return "" + CFData.encodeBase64String(c.charAt(8)) + ""; }); } finally