mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-12 11:37:07 +00:00
Fixed: When selector is only a ':' in a send message statement the new compiler crashed.
The program below crashed on the last line with a 'null is not an object' error message. Also added a test case.
@implementation MyObject {
- (int):(int)a {
return a;
}
@end
var a = [[MyObject alloc] init];
var b = [a:3];
This commit is contained in:
1 parent
8f17f904f2
commit
595736b8c6
4 files changed
+7
-1
No files matched your search
@@ -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++)
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
[object:argument];
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
objj_msgSend(object, ":", argument);
|
||||
@@ -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",
|
||||
|
||||
Reference in new issue
Block a user