mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-28 06:27:02 +00:00
Merge branch 'loader' of git@github.com:280north/cappuccino into loader
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
|
||||
makeExportsGlobal();
|
||||
|
||||
var rootNode = new StaticResourceNode("", null, StaticResourceNode.DirectoryType, YES),
|
||||
var rootNode = new StaticResourceNode("", NULL, StaticResourceNode.DirectoryType, YES),
|
||||
cwd = FILE.cwd();
|
||||
#ifndef COMMONJS
|
||||
rootNode.nodeAtSubPath(FILE.dirname(cwd), YES);
|
||||
@@ -32,7 +32,7 @@ function afterDocumentLoad(/*Function*/ aFunction)
|
||||
return aFunction();
|
||||
|
||||
if (window.addEventListener)
|
||||
window.addEventListener("load", aFunction, false);
|
||||
window.addEventListener("load", aFunction, NO);
|
||||
|
||||
else if (window.attachEvent)
|
||||
window.attachEvent("onload", aFunction);
|
||||
|
||||
@@ -176,7 +176,7 @@ function base64_decode_to_string(input, strip)
|
||||
function bytes_to_string(bytes)
|
||||
{
|
||||
// This is relatively efficient, I think:
|
||||
return String.fromCharCode.apply(null, bytes);
|
||||
return String.fromCharCode.apply(NULL, bytes);
|
||||
}
|
||||
|
||||
exports.bytes_to_string = bytes_to_string;
|
||||
|
||||
@@ -37,7 +37,7 @@ CFPropertyList.sniffedFormatOfString = function(/*String*/ aString)
|
||||
if (aString.substr(0, CFPropertyList.Format280NorthMagicNumber.length) === CFPropertyList.Format280NorthMagicNumber)
|
||||
return CFPropertyList.Format280North_v1_0;
|
||||
|
||||
return null;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Serialization
|
||||
@@ -75,7 +75,7 @@ function serializePropertyList(/*CFPropertyList*/ aPropertyList, /*Object*/ seri
|
||||
aPropertyList = valueOf;
|
||||
}
|
||||
|
||||
if (aPropertyList === true || aPropertyList === false)
|
||||
if (aPropertyList === YES || aPropertyList === NO)
|
||||
type = "boolean";
|
||||
|
||||
else if (type === "number")
|
||||
@@ -273,7 +273,7 @@ var XML_XML = "xml",
|
||||
#define IS_DOCUMENTTYPE(anXMLNode) (NODE_TYPE(anXMLNode) === 10)
|
||||
|
||||
#define PLIST_NEXT_SIBLING(anXMLNode) while ((anXMLNode = NEXT_SIBLING(anXMLNode)) && IS_WHITESPACE(anXMLNode)) ;
|
||||
#define PLIST_FIRST_CHILD(anXMLNode) anXMLNode = FIRST_CHILD(anXMLNode); if (anXMLNode !== null && IS_WHITESPACE(anXMLNode)) PLIST_NEXT_SIBLING(anXMLNode)
|
||||
#define PLIST_FIRST_CHILD(anXMLNode) anXMLNode = FIRST_CHILD(anXMLNode); if (anXMLNode !== NULL && IS_WHITESPACE(anXMLNode)) PLIST_NEXT_SIBLING(anXMLNode)
|
||||
|
||||
// FIXME: no first child?
|
||||
#define CHILD_VALUE(anXMLNode) (NODE_VALUE(FIRST_CHILD(anXMLNode)))
|
||||
@@ -297,7 +297,7 @@ var _plist_traverseNextNode = function(anXMLNode, stayWithin, stack)
|
||||
else
|
||||
{
|
||||
if (node === stayWithin)
|
||||
return null;
|
||||
return NULL;
|
||||
|
||||
node = anXMLNode;
|
||||
|
||||
@@ -326,13 +326,13 @@ var _plist_traverseNextNode = function(anXMLNode, stayWithin, stack)
|
||||
|
||||
// If we are being asked to move up, and our parent is the stay within, then just
|
||||
if (stayWithin && node === stayWithin)
|
||||
return null;
|
||||
return NULL;
|
||||
|
||||
// Pop the stack if we have officially "moved up"
|
||||
stack.pop();
|
||||
}
|
||||
|
||||
return null;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CFPropertyList.propertyListFromData = function(/*Data*/ aData)
|
||||
@@ -351,7 +351,7 @@ CFPropertyList.propertyListFromString = function(/*String*/ aString, /*Format*/
|
||||
if (aFormat === CFPropertyList.Format280North_v1_0)
|
||||
return propertyListFrom280NorthString(aString);
|
||||
|
||||
return null;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// 280 North Plist Format
|
||||
@@ -415,9 +415,9 @@ function propertyListFrom280NorthString(/*String*/ aString)
|
||||
case STRING_MARKER: object = stream.getString();
|
||||
break;
|
||||
|
||||
case TRUE_MARKER: object = true;
|
||||
case TRUE_MARKER: object = YES;
|
||||
break;
|
||||
case FALSE_MARKER: object = false;
|
||||
case FALSE_MARKER: object = NO;
|
||||
break;
|
||||
|
||||
default: throw new Error("*** " + marker + " marker not recognized in Plist.");
|
||||
@@ -486,16 +486,16 @@ CFPropertyList.propertyListFromXML = function(/*String | XMLNode*/ aStringOrXMLN
|
||||
|
||||
// If this is not a PLIST, bail.
|
||||
if (!IS_PLIST(XMLNode))
|
||||
return null;
|
||||
return NULL;
|
||||
|
||||
var key = "",
|
||||
object = null,
|
||||
plistObject = null,
|
||||
object = NULL,
|
||||
plistObject = NULL,
|
||||
|
||||
plistNode = XMLNode,
|
||||
|
||||
containers = [],
|
||||
currentContainer = null;
|
||||
currentContainer = NULL;
|
||||
|
||||
while (XMLNode = _plist_traverseNextNode(XMLNode, plistNode, containers))
|
||||
{
|
||||
@@ -527,13 +527,13 @@ CFPropertyList.propertyListFromXML = function(/*String | XMLNode*/ aStringOrXMLN
|
||||
case PLIST_STRING: object = decodeHTMLComponent(FIRST_CHILD(XMLNode) ? CHILD_VALUE(XMLNode) : "");
|
||||
break;
|
||||
|
||||
case PLIST_BOOLEAN_TRUE: object = true;
|
||||
case PLIST_BOOLEAN_TRUE: object = YES;
|
||||
break;
|
||||
case PLIST_BOOLEAN_FALSE: object = false;
|
||||
case PLIST_BOOLEAN_FALSE: object = NO;
|
||||
break;
|
||||
|
||||
case PLIST_DATA: object = new CFMutableData();
|
||||
object.bytes = FIRST_CHILD(XMLNode) ? base64_decode_to_array(CHILD_VALUE(XMLNode), true) : [];
|
||||
object.bytes = FIRST_CHILD(XMLNode) ? base64_decode_to_array(CHILD_VALUE(XMLNode), YES) : [];
|
||||
break;
|
||||
|
||||
default: throw new Error("*** " + NODE_NAME(XMLNode) + " tag not recognized in Plist.");
|
||||
|
||||
@@ -39,7 +39,7 @@ function objj_msgSend_decorate()
|
||||
function objj_msgSend_set_decorators()
|
||||
{
|
||||
objj_msgSend_reset();
|
||||
objj_msgSend_decorate.apply(null, arguments);
|
||||
objj_msgSend_decorate.apply(NULL, arguments);
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ function objj_backtrace_decorator(msgSend)
|
||||
objj_backtrace.push({ receiver: aReceiver, selector : aSelector });
|
||||
try
|
||||
{
|
||||
return msgSend.apply(null, arguments);
|
||||
return msgSend.apply(NULL, arguments);
|
||||
}
|
||||
catch (anException)
|
||||
{
|
||||
@@ -81,7 +81,7 @@ function objj_backtrace_decorator(msgSend)
|
||||
// type checking decorator
|
||||
|
||||
var objj_typechecks_reported = {},
|
||||
objj_typecheck_prints_backtrace = false;
|
||||
objj_typecheck_prints_backtrace = NO;
|
||||
|
||||
function objj_typecheck_decorator(msgSend)
|
||||
{
|
||||
@@ -90,7 +90,7 @@ function objj_typecheck_decorator(msgSend)
|
||||
var aReceiver = aReceiverOrSuper && (aReceiverOrSuper.receiver || aReceiverOrSuper);
|
||||
|
||||
if (!aReceiver)
|
||||
return msgSend.apply(null, arguments);
|
||||
return msgSend.apply(NULL, arguments);
|
||||
|
||||
var types = aReceiver.isa.method_dtable[aSelector].types;
|
||||
for (var i = 2; i < arguments.length; i++)
|
||||
@@ -103,7 +103,7 @@ function objj_typecheck_decorator(msgSend)
|
||||
{
|
||||
var key = [GETMETA(aReceiver).name, aSelector, i, e].join(";");
|
||||
if (!objj_typechecks_reported[key]) {
|
||||
objj_typechecks_reported[key] = true;
|
||||
objj_typechecks_reported[key] = YES;
|
||||
objj_fprintf(warning_stream, "Type check failed on argument " + (i-2) + " of " + objj_debug_message_format(aReceiver, aSelector) + ": " + e);
|
||||
if (objj_typecheck_prints_backtrace)
|
||||
objj_backtrace_print(warning_stream);
|
||||
@@ -111,7 +111,7 @@ function objj_typecheck_decorator(msgSend)
|
||||
}
|
||||
}
|
||||
|
||||
var result = msgSend.apply(null, arguments);
|
||||
var result = msgSend.apply(NULL, arguments);
|
||||
|
||||
try
|
||||
{
|
||||
@@ -121,7 +121,7 @@ function objj_typecheck_decorator(msgSend)
|
||||
{
|
||||
var key = [GETMETA(aReceiver).name, aSelector, "ret", e].join(";");
|
||||
if (!objj_typechecks_reported[key]) {
|
||||
objj_typechecks_reported[key] = true;
|
||||
objj_typechecks_reported[key] = YES;
|
||||
objj_fprintf(warning_stream, "Type check failed on return val of " + objj_debug_message_format(aReceiver, aSelector) + ": " + e);
|
||||
if (objj_typecheck_prints_backtrace)
|
||||
objj_backtrace_print(warning_stream);
|
||||
@@ -171,7 +171,7 @@ function objj_debug_typecheck(expectedType, object)
|
||||
}
|
||||
|
||||
var actualType;
|
||||
if (object === null)
|
||||
if (object === NULL)
|
||||
actualType = "null";
|
||||
else if (object === undefined)
|
||||
actualType = "void";
|
||||
|
||||
@@ -4,13 +4,6 @@ function Event(/*String*/ aType)
|
||||
this.type = aType;
|
||||
}
|
||||
|
||||
function ErrorEvent(/*String*/ aType, /*String*/ anErrorMessage)
|
||||
{
|
||||
Event.apply(this, aType);
|
||||
|
||||
this.error = new Error(anErrorMessage);
|
||||
}
|
||||
|
||||
function EventDispatcher(/*Object*/ anOwner)
|
||||
{
|
||||
this._eventListenersForEventNames = { };
|
||||
|
||||
@@ -47,14 +47,14 @@ function Executable(/*String*/ aCode, /*Array*/ fileDependencies, /*String*/ aSc
|
||||
code = "function(" + this.functionParameters().join(" , ") + "){" + code + "/**/\n}";
|
||||
|
||||
if (typeof system !== "undefined" && system.engine === "rhino")
|
||||
this._function = Packages.org.mozilla.javascript.Context.getCurrentContext().compileFunction(window, code, this._scope, 0, null);
|
||||
this._function = Packages.org.mozilla.javascript.Context.getCurrentContext().compileFunction(window, code, this._scope, 0, NULL);
|
||||
else
|
||||
this._function = eval("(" + code + ")");
|
||||
#else
|
||||
// "//@ sourceURL=" at the end lets us name our eval'd files for debuggers, etc.
|
||||
// * WebKit: http://pmuellr.blogspot.com/2009/06/debugger-friendly.html
|
||||
// * Firebug: http://blog.getfirebug.com/2009/08/11/give-your-eval-a-name-with-sourceurl/
|
||||
//if (true) {
|
||||
//if (YES) {
|
||||
code += "/**/\n//@ sourceURL=" + this._scope;
|
||||
this._function = new Function(this.functionParameters(), code);
|
||||
//} else {
|
||||
|
||||
@@ -23,23 +23,6 @@
|
||||
var OBJJ_PREPROCESSOR_DEBUG_SYMBOLS = 1 << 0,
|
||||
OBJJ_PREPROCESSOR_TYPE_SIGNATURES = 1 << 1;
|
||||
|
||||
function objj_preprocess(/*String*/ aString, /*objj_bundle*/ aBundle, /*objj_file*/ aSourceFile, /*unsigned*/ flags)
|
||||
{
|
||||
try
|
||||
{
|
||||
return new objj_preprocessor(aString.replace(/^#[^\n]+\n/, "\n"), aSourceFile, aBundle, flags);
|
||||
}
|
||||
catch (anException)
|
||||
{
|
||||
objj_exception_report(anException, aSourceFile);
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
var OBJJParseException = "OBJJParseException",
|
||||
OBJJClassNotFoundException = "OBJJClassNotFoundException";
|
||||
|
||||
var TOKEN_ACCESSORS = "accessors",
|
||||
TOKEN_CLASS = "class",
|
||||
TOKEN_END = "end",
|
||||
|
||||
Reference in New Issue
Block a user