From ab5674aa4e2b42e89d1867fb4988d22bfd6d69eb Mon Sep 17 00:00:00 2001 From: Martin Carlberg Date: Mon, 14 Apr 2014 16:38:34 +0200 Subject: [PATCH] Fixed: Send message test cases now work. Also added a test case for send message with 'self' as receiver --- .../Preprocessor/OutputTests/Messages/colon-selector.js | 2 +- .../OutputTests/Messages/keyword-in-selector.js | 2 +- .../OutputTests/Messages/multiple-parameters.js | 2 +- .../Preprocessor/OutputTests/Messages/no-parameters.js | 2 +- .../Preprocessor/OutputTests/Messages/one-parameter.js | 2 +- .../OutputTests/Messages/ternary-operator-argument.js | 6 +++--- .../Preprocessor/OutputTests/Misc/parenthesis-return.js | 5 ++--- Tests/Objective-J/Preprocessor/OutputTests/OutputTest.j | 1 + 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Tests/Objective-J/Preprocessor/OutputTests/Messages/colon-selector.js b/Tests/Objective-J/Preprocessor/OutputTests/Messages/colon-selector.js index 07ce0e2ee..1104fd603 100644 --- a/Tests/Objective-J/Preprocessor/OutputTests/Messages/colon-selector.js +++ b/Tests/Objective-J/Preprocessor/OutputTests/Messages/colon-selector.js @@ -1,2 +1,2 @@ -((___r1=object),___r1==null?null:___r1.isa.objj_msgSend1(___r1,":",argument)); +(object==null?null:object.isa.objj_msgSend1(object,":",argument)); \ No newline at end of file diff --git a/Tests/Objective-J/Preprocessor/OutputTests/Messages/keyword-in-selector.js b/Tests/Objective-J/Preprocessor/OutputTests/Messages/keyword-in-selector.js index 35a123ac4..8e4bc3bda 100644 --- a/Tests/Objective-J/Preprocessor/OutputTests/Messages/keyword-in-selector.js +++ b/Tests/Objective-J/Preprocessor/OutputTests/Messages/keyword-in-selector.js @@ -1 +1 @@ -((___r1=object),___r1==null?null:___r1.isa.objj_msgSend3(___r1,"for:in:nil:",a,b,nil)); \ No newline at end of file +(object==null?null:object.isa.objj_msgSend3(object,"for:in:nil:",a,b,nil)); \ No newline at end of file diff --git a/Tests/Objective-J/Preprocessor/OutputTests/Messages/multiple-parameters.js b/Tests/Objective-J/Preprocessor/OutputTests/Messages/multiple-parameters.js index bd35709fe..4c55b7aef 100644 --- a/Tests/Objective-J/Preprocessor/OutputTests/Messages/multiple-parameters.js +++ b/Tests/Objective-J/Preprocessor/OutputTests/Messages/multiple-parameters.js @@ -1,2 +1,2 @@ -((___r1=object),___r1==null?null:___r1.isa.objj_msgSend(___r1,"label:label2:label3:label4:",argument,argument2,argument3,argument4)); +(object==null?null:object.isa.objj_msgSend(object,"label:label2:label3:label4:",argument,argument2,argument3,argument4)); diff --git a/Tests/Objective-J/Preprocessor/OutputTests/Messages/no-parameters.js b/Tests/Objective-J/Preprocessor/OutputTests/Messages/no-parameters.js index b96b0c15d..58a5cae2a 100644 --- a/Tests/Objective-J/Preprocessor/OutputTests/Messages/no-parameters.js +++ b/Tests/Objective-J/Preprocessor/OutputTests/Messages/no-parameters.js @@ -1,2 +1,2 @@ -((___r1=object),___r1==null?null:___r1.isa.objj_msgSend0(___r1,"message")); +(object==null?null:object.isa.objj_msgSend0(object,"message")); diff --git a/Tests/Objective-J/Preprocessor/OutputTests/Messages/one-parameter.js b/Tests/Objective-J/Preprocessor/OutputTests/Messages/one-parameter.js index a69f22f5e..99a3c5f0f 100644 --- a/Tests/Objective-J/Preprocessor/OutputTests/Messages/one-parameter.js +++ b/Tests/Objective-J/Preprocessor/OutputTests/Messages/one-parameter.js @@ -1,2 +1,2 @@ -((___r1=object),___r1==null?null:___r1.isa.objj_msgSend1(___r1,"label:",argument)); +(object==null?null:object.isa.objj_msgSend1(object,"label:",argument)); diff --git a/Tests/Objective-J/Preprocessor/OutputTests/Messages/ternary-operator-argument.js b/Tests/Objective-J/Preprocessor/OutputTests/Messages/ternary-operator-argument.js index f5d8ca3e7..f879e332c 100644 --- a/Tests/Objective-J/Preprocessor/OutputTests/Messages/ternary-operator-argument.js +++ b/Tests/Objective-J/Preprocessor/OutputTests/Messages/ternary-operator-argument.js @@ -1,4 +1,4 @@ -((___r1=object),___r1==null?null:___r1.isa.objj_msgSend1(___r1,"label:",condition?true:false)); -((___r1=object),___r1==null?null:___r1.isa.objj_msgSend1(___r1,"label:",condition?true:false)); -((___r1=object),___r1==null?null:___r1.isa.objj_msgSend1(___r1,"label:",condition?true:false)); +(object==null?null:object.isa.objj_msgSend1(object,"label:",condition?true:false)); +(object==null?null:object.isa.objj_msgSend1(object,"label:",condition?true:false)); +(object==null?null:object.isa.objj_msgSend1(object,"label:",condition?true:false)); diff --git a/Tests/Objective-J/Preprocessor/OutputTests/Misc/parenthesis-return.js b/Tests/Objective-J/Preprocessor/OutputTests/Misc/parenthesis-return.js index d09cbb0de..4b3da9ec7 100644 --- a/Tests/Objective-J/Preprocessor/OutputTests/Misc/parenthesis-return.js +++ b/Tests/Objective-J/Preprocessor/OutputTests/Misc/parenthesis-return.js @@ -1,4 +1,3 @@ x=function(){ -return ((_1=someIval),_1==null?null:_1.isa.objj_msgSend0(_1,"someMethod")); -var _1; -}; \ No newline at end of file +return (someIval==null?null:someIval.isa.objj_msgSend0(someIval,"someMethod")); +}; diff --git a/Tests/Objective-J/Preprocessor/OutputTests/OutputTest.j b/Tests/Objective-J/Preprocessor/OutputTests/OutputTest.j index 302ce7823..776b75d09 100644 --- a/Tests/Objective-J/Preprocessor/OutputTests/OutputTest.j +++ b/Tests/Objective-J/Preprocessor/OutputTests/OutputTest.j @@ -13,6 +13,7 @@ var FILENAMES = [ "Messages/ternary-operator-argument", "Messages/keyword-in-selector", "Messages/colon-selector", + "Messages/self-as-receiver", "Misc/parenthesis-return", "Misc/preprocess-if-directives",