diff --git a/Objective-J/ObjJAcornCompiler.js b/Objective-J/ObjJAcornCompiler.js index d8851579b..9bdad14a3 100644 --- a/Objective-J/ObjJAcornCompiler.js +++ b/Objective-J/ObjJAcornCompiler.js @@ -1577,7 +1577,8 @@ MessageSendExpression: function(node, st, c) { var selectors = node.selectors, arguments = node.arguments, - selector = selectors[0].name; // There is always at least one selector + firstSelector = selectors[0], + selector = firstSelector ? firstSelector.name : ""; // There is always at least one selector // Put together the selector. Maybe this should be done in the parser... for (var i = 0; i < arguments.length; i++) diff --git a/Tests/Objective-J/Preprocessor/OutputTests/Messages/colon-selector.j b/Tests/Objective-J/Preprocessor/OutputTests/Messages/colon-selector.j new file mode 100644 index 000000000..f995cbbbd --- /dev/null +++ b/Tests/Objective-J/Preprocessor/OutputTests/Messages/colon-selector.j @@ -0,0 +1,2 @@ + +[object:argument]; diff --git a/Tests/Objective-J/Preprocessor/OutputTests/Messages/colon-selector.js b/Tests/Objective-J/Preprocessor/OutputTests/Messages/colon-selector.js new file mode 100644 index 000000000..aff484c53 --- /dev/null +++ b/Tests/Objective-J/Preprocessor/OutputTests/Messages/colon-selector.js @@ -0,0 +1,2 @@ + +objj_msgSend(object, ":", argument); diff --git a/Tests/Objective-J/Preprocessor/OutputTests/OutputTest.j b/Tests/Objective-J/Preprocessor/OutputTests/OutputTest.j index d457565e7..3083447d2 100644 --- a/Tests/Objective-J/Preprocessor/OutputTests/OutputTest.j +++ b/Tests/Objective-J/Preprocessor/OutputTests/OutputTest.j @@ -12,6 +12,7 @@ var FILENAMES = [ "Messages/multiple-parameters", "Messages/ternary-operator-argument", "Messages/keyword-in-selector", + "Messages/colon-selector", "Misc/parenthesis-return", "Misc/preprocess-if-directives",