-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Argument is read-only with in default argument expressions.
jsx#327 (cherry picked from commit bbaabac) Failed to compile when `bin/jsx --minify t/run/400.constant-param- within-default-argument-expressions.jsx`. The minifier count reference to the original `ArgumentDeclaration`, and not clone but I think need replace `LocalVariable` within `LocalExpression` like `MemberFunctionDefinition#clone`.
- Loading branch information
uchida_t
committed
May 21, 2014
1 parent
0173307
commit a75ffd9
Showing
5 changed files
with
48 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
t/compile_error/219.constant-param-within-default-argument-expressions.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class C { | ||
|
||
function fn(a : number, b : number = ++a) : void { | ||
} | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
t/run/400.constant-param-within-default-argument-expressions.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/*EXPECTED | ||
1 | ||
1 | ||
*/ | ||
class _Main { | ||
|
||
static function fn(a : number, b : () => number = () => a) : void { | ||
log b(); | ||
a = 10; | ||
log b(); | ||
} | ||
|
||
static function main(args : string[]) : void { | ||
_Main.fn(1); | ||
} | ||
} |