Skip to content

Commit

Permalink
Added missing "var"s to various parts of Objective-J
Browse files Browse the repository at this point in the history
  • Loading branch information
tlrobinson committed Apr 28, 2009
1 parent dadabd8 commit aa14661
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 27 deletions.
8 changes: 3 additions & 5 deletions Objective-J/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,10 @@ function objj_printf(string)
}

#if RHINO

warning_stream = function (aString) { Packages.java.lang.System.out.println(aString) };

var warning_stream = function (aString) { Packages.java.lang.System.out.println(aString) };
#else
if (window.console && window.console.warn)
warning_stream = function(aString) { window.console.warn(aString); }
var warning_stream = function(aString) { window.console.warn(aString); }
else
warning_stream = function(){};
var warning_stream = function(){};
#endif
1 change: 1 addition & 0 deletions Objective-J/evaluate.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ function fragment_evaluate_code(aFragment)
try
{
#if RHINO
//compiled = eval("function(){"+GET_CODE(aFragment)+"}");
compiled = Packages.org.mozilla.javascript.Context.getCurrentContext().compileFunction(window, "function(){"+GET_CODE(aFragment)+"}", GET_FILE(aFragment).path, 0, null);
#else
compiled = new Function(GET_CODE(aFragment));
Expand Down
21 changes: 11 additions & 10 deletions Objective-J/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
// Look inside bundleResponseCallback.


OBJJ_PLATFORMS = PLATFORMS
var OBJJ_PLATFORMS = PLATFORMS;
#define DIRECTORY(aPath) (aPath).substr(0, (aPath).lastIndexOf('/') + 1)

OBJJFileNotFoundException = "OBJJFileNotFoundException";
OBJJExecutableNotFoundException = "OBJJExecutableNotFoundException";
var OBJJFileNotFoundException = "OBJJFileNotFoundException",
OBJJExecutableNotFoundException = "OBJJExecutableNotFoundException";

var objj_files = { },
objj_bundles = { },
Expand Down Expand Up @@ -169,7 +169,7 @@ objj_search.prototype.attemptNextSearchPath = function()

// Before we kick off our ajax requests, see whether this directory already has
// a bundle associated with it.
var infoPath = objj_standardize_path(DIRECTORY(searchPath) + "Info.plist")
var infoPath = objj_standardize_path(DIRECTORY(searchPath) + "Info.plist"),
bundle = objj_bundles[infoPath];

// If there is, then simply look for the file in question.
Expand Down Expand Up @@ -502,7 +502,7 @@ function objj_standardize_path(aPath)

IF (ACTIVE_X)

objj_standardize_xml = function(aRequest)
var objj_standardize_xml = function(aRequest)
{
var XMLData = new ActiveXObject("Microsoft.XMLDOM");
XMLData.loadXML(aRequest.responseText.substr(aRequest.responseText.indexOf(".dtd\">") + 6));
Expand All @@ -512,7 +512,7 @@ objj_standardize_xml = function(aRequest)

ELSE

objj_standardize_xml = function(aRequest)
var objj_standardize_xml = function(aRequest)
{
return aRequest.responseXML;
}
Expand All @@ -534,7 +534,7 @@ function objj_response_xmlhttp()

IF (NATIVE_XMLHTTPREQUEST)

objj_request_xmlhttp = function()
var objj_request_xmlhttp = function()
{
return new XMLHttpRequest();
}
Expand Down Expand Up @@ -563,15 +563,15 @@ var MSXML_XMLHTTP = MSXML_XMLHTTP_OBJECTS[index];
delete index;
delete MSXML_XMLHTTP_OBJECTS;

objj_request_xmlhttp = function()
var objj_request_xmlhttp = function()
{
return new ActiveXObject(MSXML_XMLHTTP);
}

ENDIF


OBJJUnrecognizedFormatException = "OBJJUnrecognizedFormatException";
var OBJJUnrecognizedFormatException = "OBJJUnrecognizedFormatException";

var STATIC_MAGIC_NUMBER = "@STATIC",
MARKER_PATH = "p",
Expand All @@ -594,7 +594,8 @@ function objj_decompile(aString, bundle)
objj_exception_throw(new objj_exception(OBJJUnrecognizedFormatException, "*** Could not recognize executable code format."));

var file = NULL,
files = [];
files = [],
marker;

while (marker = stream.getMarker())
{
Expand Down
14 changes: 7 additions & 7 deletions Objective-J/plist.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

kCFPropertyListOpenStepFormat = 1;
kCFPropertyListXMLFormat_v1_0 = 100;
kCFPropertyListBinaryFormat_v1_0 = 200;
kCFPropertyList280NorthFormat_v1_0 = -1000;
var kCFPropertyListOpenStepFormat = 1,
kCFPropertyListXMLFormat_v1_0 = 100,
kCFPropertyListBinaryFormat_v1_0 = 200,
kCFPropertyList280NorthFormat_v1_0 = -1000;

OBJJPlistParseException = "OBJJPlistParseException";
OBJJPlistSerializeException = "OBJJPlistSerializeException";
var OBJJPlistParseException = "OBJJPlistParseException",
OBJJPlistSerializeException = "OBJJPlistSerializeException";

var kCFPropertyList280NorthMagicNumber = "280NPLIST";

Expand Down Expand Up @@ -191,7 +191,7 @@ var XML_XML = "xml",
PLIST_BOOLEAN_TRUE = "true",
PLIST_BOOLEAN_FALSE = "false",
PLIST_NUMBER_REAL = "real",
PLIST_NUMBER_INTEGER = "integer";
PLIST_NUMBER_INTEGER = "integer",
PLIST_DATA = "data";


Expand Down
8 changes: 4 additions & 4 deletions Objective-J/preprocess.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

OBJJ_PREPROCESSOR_DEBUG_SYMBOLS = 1 << 0;
var OBJJ_PREPROCESSOR_DEBUG_SYMBOLS = 1 << 0;

function objj_preprocess(/*String*/ aString, /*objj_bundle*/ aBundle, /*objj_file*/ aSourceFile, /*unsigned*/ flags)
{
try
{
return new objj_preprocessor(aString, aSourceFile, aBundle, flags).fragments();
return new objj_preprocessor(aString.replace(/^#[^\n]+\n/, "\n"), aSourceFile, aBundle, flags).fragments();
}
catch (anException)
{
Expand All @@ -36,8 +36,8 @@ function objj_preprocess(/*String*/ aString, /*objj_bundle*/ aBundle, /*objj_fil
return [];
}

OBJJParseException = "OBJJParseException";
OBJJClassNotFoundException = "OBJJClassNotFoundException";
var OBJJParseException = "OBJJParseException",
OBJJClassNotFoundException = "OBJJClassNotFoundException";

var TOKEN_ACCESSORS = "accessors",
TOKEN_CLASS = "class",
Expand Down
2 changes: 1 addition & 1 deletion Objective-J/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ function class_getMethodImplementation(/*Class*/ aClass, /*SEL*/ aSelector)

// Adding Classes

var GLOBAL_NAMESPACE = this,
var GLOBAL_NAMESPACE = window,
REGISTERED_CLASSES = {};

function objj_allocateClassPair(/*Class*/ superclass, /*String*/ aName)
Expand Down

0 comments on commit aa14661

Please sign in to comment.