mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-04 16:12:58 +00:00
Fixed warning messages in compiler
This commit is contained in:
1 parent
458fa9d02e
commit
6fbab322cf
2 files changed
+1
-4
No files matched your search
@@ -745,7 +745,7 @@ Identifier: function(node, st, c) {
|
||||
if (!reservedIdentifiers(identifier) && !st.getLvar(identifier) && typeof global[identifier] === "undefined" && !st.compiler.getClassDef(identifier)) {
|
||||
var message;
|
||||
if (st.assignment) {
|
||||
message = createMessage("Creating global variable inside function or method'" + identifier + "'", node, st.compiler.source);
|
||||
message = createMessage("Creating global variable inside function or method '" + identifier + "'", node, st.compiler.source);
|
||||
st.vars[identifier] = {type: "global", node: node};
|
||||
} else
|
||||
message = createMessage("Using unknown class or uninitialized global variable '" + identifier + "'", node, st.compiler.source);
|
||||
@@ -801,7 +801,6 @@ GlobalStatement: function(node, st, c) {
|
||||
CONCAT(st.compiler.jsBuffer, st.compiler.source.substring(st.compiler.lastPos, node.start));
|
||||
st.compiler.lastPos = node.start;
|
||||
CONCAT(st.compiler.jsBuffer, "//");
|
||||
print("GlobalStatement: " + node.id.name);
|
||||
st.rootScope().vars[node.id.name] = {type: "global", node: node.id};
|
||||
}
|
||||
});
|
||||
@@ -1449,14 +1449,12 @@ if (!exports.acorn) {
|
||||
case _class:
|
||||
next();
|
||||
node.id = parseIdent(false);
|
||||
print("Class: " + node.id.name);
|
||||
return finishNode(node, "ClassStatement");
|
||||
|
||||
// This is a Objective-J statement
|
||||
case _global:
|
||||
next();
|
||||
node.id = parseIdent(false);
|
||||
print("Global: " + node.id.name);
|
||||
return finishNode(node, "GlobalStatement");
|
||||
|
||||
// If the statement does not start with a statement keyword or a
|
||||
|
||||
Reference in new issue
Block a user