Fixed warning messages in compiler

This commit is contained in:
Martin Carlberg committed 2013-01-18 14:25:05 +01:00
1 parent 458fa9d02e
commit 6fbab322cf
2 files changed
+1 -4

No files matched your search

+1 -2
View File
@@ -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};
}
});
-2
View File
@@ -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