sgjesse@google.com
36a67fa046
Implement fromEnvironment on bool, int and String
...
This implements const constructor fromEnvironment on bool, int and
String.
The VM have the added -Dname=value option to define the value for the
properties. All values are provided by using the -D - nothing is read
from the environment.
If the resulting value is null or - in the case of int.fromEnvironment
- not a number an ArgumentError is thrown.
This CL does not have any implementation for dart2js.
This is a continuation of the change
https://chromiumcodereview.appspot.com/24975002 by iposva@
BUG=
R=iposva@google.com
Review URL: https://codereview.chromium.org//50983002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29642 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-31 05:46:57 +00:00
regis@google.com
3fa7a61efc
Implement latest spec changes regarding malformed types (see issue 14006):
...
- a malformed type used in a is, as, or catch type test results in a dynamic
type error being thrown.
- a malformed type is not mapped to dynamic anymore.
For now, this applies to type tests in checked mode as well, but discussion is
still on-going.
R=hausner@google.com
Review URL: https://codereview.chromium.org//53583003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29608 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-30 23:30:32 +00:00
regis@google.com
65379851a8
Implement stricter rule about self referencing typedefs (fix issue 13675).
...
R=rmacnak@google.com
Review URL: https://codereview.chromium.org//49853004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29460 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-29 17:04:21 +00:00
hausner@google.com
e02652a123
Throw CyclicInitializationError instead of string
...
For some reason, I had to regenerate the snapshot for test standalone/issue14236_source.dart. The checked-in snapshot crashed with my change. We don't know yet why. Siva is looking at this separately.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//38563005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29397 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-28 21:38:57 +00:00
regis@google.com
e9b01ccf7b
Disallow explicit parameter default values in redirecting factory (issue 13662).
...
Add language test.
Fix usage in core lib.
R=hausner@google.com
Review URL: https://codereview.chromium.org//45833002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29298 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-25 23:02:48 +00:00
regis@google.com
20badfb06e
Register synthesized mixin application classes in the library and reuse them
...
when possible (fix issue 14318).
R=asiva@google.com , hausner@google.com , rmacnak@google.com
Review URL: https://codereview.chromium.org//42723003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29276 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-25 19:46:32 +00:00
hausner@google.com
07c06be8e7
It's a compile-time error if a const constructor call fails
...
Making it a compile-time error if a const constructor call
fails. Also improve error message when invoking dart code during
compilation fails.
Fixes issue 14302
R=srdjan@google.com
Review URL: https://codereview.chromium.org//40683002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29212 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-24 21:42:39 +00:00
hausner@google.com
cf4da8d1d9
Properly report error for certain expressions that must be const
...
Issue error message instead of hitting assertion for an expression that
contains an assignment but is expected to be const.
Fixes security issue 13941
R=regis@google.com
Review URL: https://codereview.chromium.org//41113002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29194 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-24 18:54:52 +00:00
hausner@google.com
ddd9907e23
Implement type checks for switch expression
...
If the switch expression is not compatible with the case clause
constants, we must report a runtime error. Implement this by annotating
the temporary variable holding the switch expression with the correct
type.
Issue 7274
R=regis@google.com
Review URL: https://codereview.chromium.org//34413007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29126 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-23 21:15:25 +00:00
iposva@google.com
d369b7a0c9
- Ensure that the token stream from generated source matches the
...
original token stream in the presence of combinations of
multiline string and string interpolation. If not this will
cause mismatches when accessing code snippets, e.g when
reporting parser errors or assertions.
- Ensure that ScanAll and ScanTo are in sync when adding or
counting tokens.
- Added unit test for multiline strings and interpolation.
- Expanded GenerateSource unit test to iterate through all
loaded libraries.
- Do not report columns for compilation errors in snapshotted
code.
- Do not report columns from exceptions and errors when dealing
with snapshotted code.
- Remove length field from TokenDescriptor. It was unused.
- Remove TokenStream::ComputeTokenPosition. It was unused.
R=fschneider@google.com , hausner@google.com
Review URL: https://codereview.chromium.org//36323003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29110 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-23 19:08:36 +00:00
fschneider@google.com
77669aac3e
Fix VM issue 1372: super constructor invocation with redirection.
...
A redirecting super constructor simply passes the phase parameter
on to the target which executes the corresponding phase.
BUG=https://code.google.com/p/dart/issues/detail?id=1372
R=hausner@google.com
Review URL: https://codereview.chromium.org//35693010
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29097 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-23 16:18:20 +00:00
fschneider@google.com
a61e701da3
VM: Fix evaluation order when throwing an AbstractClassInstantiationError.
...
BUG=https://code.google.com/p/dart/issues/detail?id=13420
TEST=Language/12_Expressions/12_Instance_Creation/1_New_A06_t12
R=zra@google.com
Review URL: https://codereview.chromium.org//37193002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29088 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-23 15:29:02 +00:00
regis@google.com
3e8c130227
Fix language tests for redirecting factories (issue 14297).
...
Use target constructor name in redirecting factory errors.
R=hausner@google.com
Review URL: https://codereview.chromium.org//34903006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29045 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-22 22:36:42 +00:00
regis@google.com
9ec07853c5
Report correct error message in case of super invocation (fix issue 8208).
...
R=hausner@google.com
Review URL: https://codereview.chromium.org//30533004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29042 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-22 22:12:07 +00:00
hausner@google.com
e7255e091a
Do not generate a compile-time error if there is more than one catch-all clause
...
This includes catch clauses with malformed types, which are essentially
catch-all clauses.
The spec does not mandate such a compile-time error. (It probably did a long
time ago.)
Fixes issue 8601, 12159, 13019
R=iposva@google.com
Review URL: https://codereview.chromium.org//33813003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28999 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-22 15:44:28 +00:00
hausner@google.com
dbe0e4c9b4
Allow string literal concatenation in import clauses
...
Added benefit: if there is no interpolation in any of the adjacent
string literals, the compiler concatenates the strings without
invoking Dart code.
Fixes issues 12521, 6877
R=regis@google.com
Review URL: https://codereview.chromium.org//32513007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28964 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-21 22:13:42 +00:00
hausner@google.com
0e099ff048
Check that class member names do not conflict with type parameters
...
Implement check that member names do not conflict with type
parameters. Simplify name checks in class namespace.
Mark typevariable_mirror_metadata_test as failing now that we
report the proper compile time errors. (The test expects no errors.)
Some co19 tests expect a name conflict between a setter X= and type
parameter X. This is still in flux from a language perspective. This
change list does not introduce an compile error for this case.
Fix for issue 13701.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//27619002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28808 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-17 17:39:08 +00:00
srdjan@google.com
b83bda9e0e
Add new style of string interpolation optimization: new nodes, working constant folding.
...
TODO: partial constant fold of incoming arguments.
R=kmillikin@google.com
Review URL: https://codereview.chromium.org//27192005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28741 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-16 18:12:08 +00:00
fschneider@google.com
ed801a1b2f
VM: Fix bug with evaluation order of static setter invocation.
...
This fixes the case for an assignment of the form
v=e
where v is unknown. The right-hand side of the assignment
has to be evaluated before throwing a NoSuchMethodError.
I moved the generation of the NoSuchMethodError out of
the parser to the flow-graph builder, where the right-hand side
argument is evaluated before throwing.
BUG=https://code.google.com/p/dart/issues/detail?id=13494
TEST=co19/Language/12_Expressions/18_Assignment_A01_t07
R=hausner@google.com
Review URL: https://codereview.chromium.org//25842003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28723 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-16 13:07:58 +00:00
regis@google.com
2d59eb0cb1
Throw a dynamic type error instead of a CastError in a type cast with a
...
malbounded type (fix issue 14123).
Regression test is not checked in yet (see https://codereview.chromium.org/27378002/ )
R=rmacnak@google.com
Review URL: https://codereview.chromium.org//27420002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28698 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-16 00:38:55 +00:00
hausner@google.com
c646aed258
Implement new mixin application syntax
...
Implment the class X = S with M syntax, add warning on deprecated
typedef syntax. Also convert a handful of tests. More tests to
be converted subsequently.
R=regis@google.com
Review URL: https://codereview.chromium.org//27223005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28652 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-15 16:13:02 +00:00
srdjan@google.com
2f0a906dbf
Cleanups, refactoring in anticipation of new string interpolation nodes. Removed unnecessary code.
...
R=hausner@google.com
Review URL: https://codereview.chromium.org//27006003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28619 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-14 23:21:52 +00:00
fschneider@google.com
d69461ba62
VM: Fix performance regression introduced by r28408.
...
Change the AST for static consts so that they don't
end up translated as calls, and so that we don't rely
on the inliner to fold them away).
Instead I generate a LoadStatic AST node that will be
constant folded in the flow graph builder.
BUG=https://code.google.com/p/dart/issues/detail?id=13954
R=kmillikin@google.com
Review URL: https://codereview.chromium.org//27020002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28521 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-11 15:44:36 +00:00
regis@google.com
15bc5b9a0a
Disallow extending a malformed type (issue 13940).
...
Add language test and update dart2js status (issue 13994 filed).
R=rmacnak@google.com
Review URL: https://codereview.chromium.org//26888005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28488 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-10 23:30:42 +00:00
regis@google.com
42ceee4cba
Allow malbounded literal types (fix issue 13952).
...
R=rmacnak@google.com
Review URL: https://codereview.chromium.org//26866005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28474 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-10 20:45:09 +00:00
hausner@google.com
5a5850d9d9
Optimize away empty string sections in string interpolation
...
R=srdjan@google.com
Review URL: https://codereview.chromium.org//26726004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28423 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-09 22:05:27 +00:00
rmacnak@google.com
6ed9f2c17f
Implement constructor kinds in the VM mirrors.
...
BUG=http://dartbug.com/13798
R=asiva@google.com , hausner@google.com
Review URL: https://codereview.chromium.org//26436004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28416 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-09 20:40:11 +00:00
hausner@google.com
b87ef6ab7f
Final variables induce a setter that throws NSME
...
Clean up handling of const and final variables. They induce a
setter that throws a NSME, rather than a compile-time error.
Delay the AST conversion of loading a const field into loading
the literal value. The conversion is now done when we know
that the load in on the right hand side of an expression.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//26703002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28408 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-09 17:33:10 +00:00
rmacnak@google.com
41f0d0e0f1
Correctly report the type of initializing formals declared without an explicit type to be the type of the corresponding field.
...
BUG=http://dartbug.com/11281
R=gbracha@google.com , hausner@google.com
Review URL: https://codereview.chromium.org//26346002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28349 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-08 01:08:59 +00:00
regis@google.com
5e817c182b
It is not an error anymore to leave an instance final field uninitialized.
...
Fix issues 11054 and 12157.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//26023005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28289 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-04 22:56:53 +00:00
iposva@google.com
3423572926
- Harden coverage generation, by not attempting to compile
...
un-compilable functions.
- Only register closure functions in the class when they
have been properly setup.
- Make sure to compile closure functions when calling CompileAll.
R=hausner@google.com
Review URL: https://codereview.chromium.org//25954003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28282 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-04 20:50:16 +00:00
hausner@google.com
8fa41d5d55
Compile error on const instance variables
...
Another little step towards full spec compliance.
Issue 11051
R=srdjan@google.com
Review URL: https://codereview.chromium.org//25873005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28234 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-03 18:17:16 +00:00
hausner@google.com
3f238a01a5
Add type check to const conditional expression evaluation
...
issue 13746
R=srdjan@google.com
Review URL: https://codereview.chromium.org//25456005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28182 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-02 21:08:24 +00:00
hausner@google.com
1ea4547a96
Disallow double in case clauses and const map literal keys
...
Implements the latest Spec decisions and clarifications.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//25561002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28104 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-01 17:22:39 +00:00
fschneider@google.com
a329b0e6bc
Dart VM: Simplify code generation for equality operators.
...
By inserting the necessary checks for null inside the callee
at the AST level, the code generation of == operations can be
greatly simplified.
This is a performance-neutral change and a step for allowing
generic inlining of arbitrary == methods. So far we could only
inline them for a common set of types in the flow graph
optimizer.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//24203004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28084 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-01 10:10:50 +00:00
hausner@google.com
fcb84c8dc9
Fix expression evaluation in library context
...
- Use correct source for patch functions when class
finalizer reports error
- Reinstate support for class in Dart_EvaluateExpr
R=regis@google.com
Review URL: https://codereview.chromium.org//25284003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28064 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-30 18:49:32 +00:00
hausner@google.com
b7dbaaa46c
Slight optimization of case clause type checks
...
Address review comment.
Review URL: https://codereview.chromium.org//24915002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28015 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-27 16:40:33 +00:00
regis@google.com
6531272706
Support forwarding constructors for mixin typedefs (issue 11888).
...
R=hausner@google.com
Review URL: https://codereview.chromium.org//24896002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27979 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-27 00:26:22 +00:00
hausner@google.com
b0780d316b
Check types of case expressions
...
Implement checks to make sure all case expressions are of the same type and other restrictions.
This change assumes that it's ok to use double values in switch expressions. Will verify with those who are in the know.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//24768004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27968 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-26 18:54:15 +00:00
hausner@google.com
1c5c3d55c4
Eliminate legacy support for throw without expression.
...
Issue 13533.
R=mlippautz@google.com
Review URL: https://codereview.chromium.org//23910003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27856 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-24 22:16:19 +00:00
hausner@google.com
3c360399ee
Improve NoSuchMethodError error messages
...
- Don't say there is no constructor with name X if there is one
that has incompatible parameter list.
- Better error message when mismatched optional parameters are passed.
(Prviously only the number of parameters was considered, but not
names of named parameters for example.)
Fixes issue 6189.
R=regis@google.com
Review URL: https://codereview.chromium.org//24395007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27826 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-24 16:14:28 +00:00
regis@google.com
3b5628fd1b
Support mixin application typedef as mixin in the VM (issues 9383, 12773).
...
Disallow Object as mixin (issue 10952).
Detect illegal cycles in mixins.
R=hausner@google.com
Review URL: https://codereview.chromium.org//24397002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27791 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-24 00:25:01 +00:00
hausner@google.com
257535165e
Properly parse symbol literals in top-level expression
...
R=iposva@google.com
Review URL: https://codereview.chromium.org//23531075
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27682 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-20 00:12:55 +00:00
hausner@google.com
aeb3386956
Fix function type parameter parsing
...
Corner case of final variables was wrong. In most cases, this went undetected because of the permissive type system of dart.
Fixes issue 13367.
R=regis@google.com
Review URL: https://codereview.chromium.org//24269010
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27678 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-19 22:02:45 +00:00
mlippautz@google.com
4fa46b7148
Introduce newline tokens into the token stream.
...
CL only introduces the tokens into the compressed token stream. We do not
use the newline tokens (yet).
Overhead:
snapshot: 6.4% (860k/808k)
compressed token stream (gen_snapshot): 21% (314312/259907)
BUG=
R=asiva@google.com , hausner@google.com
Review URL: https://codereview.chromium.org//23452043
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27677 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-19 21:46:50 +00:00
hausner@google.com
f3baeeb6a5
Implement symbol literals in the VM compiler
...
Issue 12171
R=iposva@google.com
Review URL: https://codereview.chromium.org//24240010
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27668 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-19 17:39:16 +00:00
hausner@google.com
cda093e7e0
Fix redirecting constructors
...
Field initializer expressions must not be executed in redirecting
constructors.
Fixes issue 13347
R=regis@google.com
Review URL: https://codereview.chromium.org//23542051
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27628 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-18 16:02:30 +00:00
fschneider@google.com
67057623e5
Fix assertion in the parser about operator precedence.
...
R=kmillikin@google.com
Review URL: https://codereview.chromium.org//24078019
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27625 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-18 15:17:00 +00:00
mlippautz@google.com
b09bbf706b
Add metadata to type parameters. Reflective access is provided by TypeVariableMirror.
...
Addresses issue 10906.
BUG=https://code.google.com/p/dart/issues/detail?id=10906
R=asiva@google.com , rmacnak@google.com
Review URL: https://codereview.chromium.org//23872010
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27523 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-16 16:53:24 +00:00
hausner@google.com
f3ed73c8da
Make hidden initializing formal parameters invisible to the debugger
...
Fixes issue 13143.
R=regis@google.com
Review URL: https://codereview.chromium.org//23460040
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27505 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-13 21:37:16 +00:00