|
|
Support const modifier in fields, variables
Issue 3551
This change adds const as a valid keyword to declare fields and
variables. The mandatory initializer has to be a compile time
const expression.
Static final variables still have to be initialized with
compile time constant expressions. I will add non-const static
finals (issue 3558) in another change.
Other small changes:
- allow null in some compile time constant expressions.
- allow only numbers, booleans, strings and null in compile time
constant string interpolation.
Committed: https://code.google.com/p/dart/source/detail?r=9992
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+129 lines, -97 lines) |
Patch |
 |
M |
runtime/vm/ast.cc
|
View
|
|
2 chunks |
+6 lines, -3 lines |
0 comments
|
Download
|
 |
M |
runtime/vm/object.h
|
View
|
|
3 chunks |
+5 lines, -3 lines |
0 comments
|
Download
|
 |
M |
runtime/vm/object.cc
|
View
|
|
3 chunks |
+6 lines, -3 lines |
0 comments
|
Download
|
 |
M |
runtime/vm/object_test.cc
|
View
|
|
2 chunks |
+4 lines, -2 lines |
0 comments
|
Download
|
 |
M |
runtime/vm/parser.h
|
View
|
|
1 chunk |
+4 lines, -2 lines |
0 comments
|
Download
|
 |
M |
runtime/vm/parser.cc
|
View
|
1
|
19 chunks |
+97 lines, -44 lines |
0 comments
|
Download
|
 |
M |
runtime/vm/raw_object.h
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
runtime/vm/raw_object_snapshot.cc
|
View
|
|
2 chunks |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
M |
tests/co19/co19-runtime.status
|
View
|
|
4 chunks |
+4 lines, -19 lines |
0 comments
|
Download
|
 |
D |
tests/language/const_syntax_test.dart
|
View
|
|
1 chunk |
+0 lines, -18 lines |
0 comments
|
Download
|
 |
M |
tests/language/language.status
|
View
|
|
1 chunk |
+0 lines, -3 lines |
0 comments
|
Download
|
Total messages: 2 (0 generated)
|