Fixed #1936 AS3 - Parentheses around function definition call

This commit is contained in:
Jindra Petřík
2023-01-13 23:34:43 +01:00
parent 376888af0d
commit c5d1790c25
10 changed files with 80 additions and 6 deletions

View File

@@ -72,6 +72,7 @@ package
TestInc2;
TestIncDec;
TestInlineFunctions;
TestInlineFunctions2;
TestInnerFunctions;
TestInnerFunctionScope;
TestInnerIf;

View File

@@ -5,7 +5,7 @@ package tests
{
public function run():*
{
trace("hello");
trace("hello");
}
}
}

View File

@@ -0,0 +1,25 @@
package tests
{
public class TestInlineFunctions2
{
public function run():*
{
function f(a:int):int {
return a + 1;
}
var g:Function = function(a:int):int {
return a + 1;
};
var h:Function = function h2(a:int):int {
return a + 1;
};
(function(a:int):int {
return a + 1;
})(1);
}
}
}

View File

@@ -4,7 +4,7 @@ package tests
{
public function run() : *
{
var test:* = new function testFunc(param1:*, param2:int, param3:Array):Boolean
var test:* = function testFunc(param1:*, param2:int, param3:Array):Boolean
{
return (param1 as TestClass2).attrib1 == 5;
};