srdjan@google.com
d07087ce77
Ongoing renaming of type classes:
...
TypeArguments -> AbstractTypeArguments
TypeArray -> TypeArguments
Review URL: http://codereview.chromium.org//8776020
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2002 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-01 23:19:59 +00:00
srdjan@google.com
2ff4d8a207
Address Regis' comments, replace AbstractType with Type where possible.
...
Review URL: http://codereview.chromium.org//8772009
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1992 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-01 21:14:48 +00:00
srdjan@google.com
17552e9a3c
Renaming type classes as discussed:
...
Type -> AbstractType
ParameterizedType -> Type
TODO:
TypeArguments -> AbstractTypeArguments
TypeArray -> TypeArguments
Review URL: http://codereview.chromium.org//8761011
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1987 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-01 16:54:52 +00:00
srdjan@google.com
0063555050
Use ParametrizedType instead of Type where appropriate. Expand ToCString of type related classes. Do not instantiate abtract classes Type and TypeArguments (e.g., through Type::null());
...
Review URL: http://codereview.chromium.org//8742028
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1941 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-30 21:14:22 +00:00
hausner@google.com
51bb1d4e4c
Properly detect name collisions at library level
...
Fixing issue 592
Review URL: http://codereview.chromium.org//8724015
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1934 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-30 18:55:37 +00:00
regis@google.com
5382e56f05
Optimize type checks of list and map literals.
...
Introduce an ast node for explicit 'assignable to' type checks.
Remove Instance::Is() helper.
Review URL: http://codereview.chromium.org//8678031
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1827 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-24 00:26:18 +00:00
hausner@google.com
ac4b099912
Fix even more builds
...
My code is apparently breaking everywhere except on the Mac...
Review URL: http://codereview.chromium.org//8680031
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1822 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-23 22:39:22 +00:00
hausner@google.com
0b3cc43b89
Fix Windows build
...
Write once, fix everywhere...
Review URL: http://codereview.chromium.org//8680029
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1820 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-23 22:34:14 +00:00
hausner@google.com
0ef3609ec0
Allow optional initializing formals again
...
After removing optional initializing formal parameters from the VM
yesterday, the language team decided that they should be allowed
and made usable.
- The name of an optional initializing formal is the name of
the field it initializes.
- The parameter is only visible at the call site of the constructor,
to name the parameter.
- The parameter is NOT visible in the constructor's initializer list
and body.
class A {
A([this.x = 10]);
A.bad([this.x = 10]) : y = x; // Error: parameter x not in scope
A.ok([this.x = 10]) { print(x); } // Refers to field x, not parameter x.
var x, y;
}
o = new A(x: 50); // o.x == 50.
o = new A(); // o.x == 10.
Review URL: http://codereview.chromium.org//8682025
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1819 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-23 22:31:09 +00:00
regis@google.com
6191ea8088
Fix build breakage.
...
Check type of list and map literals in checked mode only, and with an
"assignable to" test rather than a "instance of" test.
Review URL: http://codereview.chromium.org//8677019
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1814 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-23 20:14:27 +00:00
srdjan@google.com
4c267997cd
Fix bug 557: Disallow user side allocation of ImmutableArray. Also added "instantiation-checks" for some other VM-internal classes.
...
Review URL: http://codereview.chromium.org//8648003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1811 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-23 19:48:25 +00:00
regis@google.com
9f230a34c6
Implement type checking of list literals (issue 220).
...
Remove expose_core_impl flag.
Add tests.
Fix tests.
Cleanup type checking of map literals.
Review URL: http://codereview.chromium.org//8676001
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1809 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-23 19:34:23 +00:00
regis@google.com
a2bb53c7af
Implement type checking of map literals (issue 221).
...
Support proper syntax for map literals (at most one type argument is allowed)
and give a warning when legacy syntax is used.
Add tests.
Fix tests.
Review URL: http://codereview.chromium.org//8637018
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1764 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-22 21:42:07 +00:00
hausner@google.com
b9cf297c15
Initializing formals can't be optional parameters
...
Add new error message to VM compiler.
Remove all optional initializing formals from library
and tests.
Review URL: http://codereview.chromium.org//8619008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1755 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-22 19:09:54 +00:00
asiva@google.com
ce606eda7b
Library prefix should be an identifier
...
(we don't yet check that it is not a reserved keyword, that can be done only
after we are able to store the keyword table as a singleton in the vm isolate)
Review URL: http://codereview.chromium.org//8500006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1720 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-21 22:17:41 +00:00
regis@google.com
314a89e16c
Update comments in core lib showing proper factory syntax.
...
Improve error messages reported from class finalizer.
Fix parser error reporting to be thread safe.
Reformat type error and failed assertion messages to be consistent.
Add one more new factory syntax test.
Review URL: http://codereview.chromium.org//8549033
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1708 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-21 17:06:52 +00:00
srdjan@google.com
8b6dbe1b76
Do not allow allocation of FallThroughError and AssertionError by the user.
...
Review URL: http://codereview.chromium.org//8569013
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1671 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-18 20:36:42 +00:00
regis@google.com
a5dc8b60d1
Fix code generation issue with new factory syntax.
...
Convert VM core library to new factory syntax.
Review URL: http://codereview.chromium.org//8602004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1662 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-18 17:47:12 +00:00
regis@google.com
80d89cc93b
Fix parsing of factory calls (issue 500).
...
Add test.
Fix test.
Adjust co19 status file.
Review URL: http://codereview.chromium.org//8591025
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1633 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-17 21:42:55 +00:00
asiva@google.com
9f49e2bf74
Implement automatic loading of dart:core_native_fields library
...
with predefined classes having native fields.
Classes that need native fields in them can import this library and
extend these predefined classes.
Review URL: http://codereview.chromium.org//8537023
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1629 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-17 21:04:43 +00:00
regis@google.com
3c64ffe9a3
Support correct factory syntax in the VM as decribed in the spec.
...
Change the default value of --silent_warnings from true to false, so that
warnings are visible when legacy factory syntax is used.
In order to facilitate transition of libraries and user programs, legacy factory
syntax is still supported by 2 workarounds, but warnings are printed.
The first workaround allows the factory clause to omit the type
parameter list, which otherwise has to match exactly with the list of
type parameters in the factory class declaration.
The second workaround allows a factory method to omit the type
parameter list. In that case, the type parameter list of the enclosing
class is used instead.
Workarounds will be removed to enforce correct factory syntax at a later time.
Review URL: http://codereview.chromium.org//8585004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1595 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-16 23:49:04 +00:00
srdjan@google.com
1ea6e2e0de
Stop building blind: report errors with factories and parametrized types.
...
Enable test. This CL expects the frog/leg changes to be submitted first.
Review URL: http://codereview.chromium.org//8511070
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1479 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-11 22:23:45 +00:00
regis@google.com
8b9ebb3528
Second attempt at finalizing all classes in the VM (fix issue 364).
...
Review URL: http://codereview.chromium.org//8491055
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1475 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-11 21:38:49 +00:00
turnidge@google.com
8c64adf13e
Deal with unhandled exceptions the same way in all Dart api functions.
...
--
Terminology change: invalid handles are now called error handles.
Unhandled exceptions used to be a kind of valid handle. Now they are
a kind of error handle.
For the Dart_Invoke* functions, this means that the standard
error-checking blob drops from two tests to one test and is
harder to mess up.
Many other Dart api functions (Dart_ToString, for example) previously
dealt with unhandled exceptions by turning them into terse error
messages. Now these functions preserve information about the
exceptions and generate better error messages.
Changed Dart_HandleMessage to return success/failure. It seemed to fit.
--
Details:
Dart_IsValid becomes Dart_IsError (negated sense).
Dart_GetError now knows how to print a stack trace semi-nicely.
Dart_ExceptionOccurred -> Dart_IsUnhandledException.
Renamed ApiFailure class to ApiError to fit better.
ApiError now has a "data" pointer that points to either an error
message string or to an unhandled exception object.
Documentation changes aplenty.
Review URL: http://codereview.chromium.org//8501034
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1470 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-11 19:31:04 +00:00
srdjan@google.com
81be68ae18
Giving up on the change to report errors with factories and generic types.
...
This means that you will continue to have crashes in Debug mode, but you will be able to "run" in Release mode. Best solution is to get rid of generic types in Link until factories and generic types have been fully implemented. Until then we do not know what can happen when running in release mode.
Still trying to figure out how to test frog and leg correctly.
Review URL: http://codereview.chromium.org//8540013
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1469 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-11 18:52:53 +00:00
srdjan@google.com
6ff41ed334
Require legacy form of type parameters in factories and report errors if a factory class does not have a required parametrized type (fixes crashes in VM). Fix frog code, however, there are frogs problem with --compileall:
...
leg/util/link_implementation.dart:38:12: error: wrong number of arguments, expected 0 but found 2
return new Link<T>(element, this);
^^^^^^^^^^^^^^^^^^^^^^^^^^
Review URL: http://codereview.chromium.org//8515024
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1464 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-11 17:04:00 +00:00
srdjan@google.com
da9092146b
Implement %= and assign a couple of tests.
...
Review URL: http://codereview.chromium.org//8509032
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1411 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-10 18:04:42 +00:00
regis@google.com
a6282231eb
Revert r1380 that is breaking frog.
...
Review URL: http://codereview.chromium.org//8509031
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1382 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-10 01:39:06 +00:00
regis@google.com
8dd26ba9f6
Finalize all classes (fix issue 364).
...
Review URL: http://codereview.chromium.org//8506001
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1380 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-09 23:33:48 +00:00
hausner@google.com
f59e679860
Capturing for loop variables correctly
...
Re-introduce a "fresh copy" of the for loop variable(s) in each iteration. Adding a minimal test to check that closures capture the value of the particular loop iteration.
Review URL: http://codereview.chromium.org//8490019
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1273 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-07 22:36:28 +00:00
hausner@google.com
b121e837d4
Address Regis' review feedback
...
TBR
Review URL: http://codereview.chromium.org//8475005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1208 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-04 17:04:40 +00:00
hausner@google.com
504eea10ff
Experimental version without native constructor support
...
The semantics of native constructors are not really clear. Instead of a native constructor, write a regular Dart constructor that calls a native function in the constructor body instead.
Review URL: http://codereview.chromium.org//8450016
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1201 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-04 15:58:55 +00:00
hausner@google.com
35cc976b4b
Separating constructor parsing from function parsing
...
Make parsing functions and constructors more readable by separating
the two into disjoint functions.
Review URL: http://codereview.chromium.org//8417056
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1172 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-03 22:29:57 +00:00
hausner@google.com
a6b3f4f19c
No returns allowed in constructors
...
Add compiler error message when a constructor explicitly returns a
value. Fixes bug/issue 224.
Review URL: http://codereview.chromium.org//8450009
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1161 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-03 20:07:35 +00:00
hausner@google.com
f401476d02
Fix problem with named arguments in constructors
...
When generating the implicit super call to the body, the argument
names have to be duplicated from the implicit initializer call.
Review URL: http://codereview.chromium.org//8386065
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1130 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-03 00:36:27 +00:00
hausner@google.com
7651034e9e
Two-phase constructors
...
This CL fixes the initializer evaluation order and brings the VM fully up to spec.
Constructors are executed in two phases: the initializer phase and the constructor body phase. An additional implicit parameter tells the constructor code whether to execute the initializer list or the body (or both).
If the super initializer call is not at the end of the initializer list, the super constructor has to be called twice. The arguments to the super initializer have to be evaluated and stored in temporary local variables. At the beginning of the constructor block, a second implicit super call is inserted.
If the super initializer call happens to be at the end of the list, none of this madness has to happen, except for the extra implicit parameter to the constructor.
Review URL: http://codereview.chromium.org//8440014
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1102 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-02 17:19:15 +00:00
regis@google.com
3125475ef8
Canonicalize types.
...
Review URL: http://codereview.chromium.org//8372041
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1045 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-01 22:00:06 +00:00
regis@google.com
a8478d5312
Fix parsing of named parameters (issue 243).
...
Add corresponding test.
Review URL: http://codereview.chromium.org//8387046
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@973 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-31 21:16:15 +00:00
asiva@google.com
b245c234f0
Report NullPointerException when we try to construct a regular expression
...
using a NULL pointer.
Report NullPointerException instead of ObjectNotClosureException when the
closure object is Null.
Review URL: http://codereview.chromium.org//8363034
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@901 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-28 17:32:29 +00:00
regis@google.com
1df8ca858e
Rename the VM internal 'var' type to 'Dynamic' type.
...
This change does not implement support for the built-in identifier 'Dynamic'.
Review URL: http://codereview.chromium.org//8403003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@779 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-26 20:58:34 +00:00
turnidge@google.com
e756497a78
Refactor the dart api a bit:
...
- Dart_Result is gone. Dart_Handle mostly replaces it.
- Name/signature changes
- IsValidResult -> IsValid
- GetErrorCString -> GetError
- many more...
- Make details of persistent handle freelist private.
- Add persistent "True" handle to api state.
Things I am not doing in this changelist:
- Documentation updates
Review URL: http://codereview.chromium.org//8380020
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@778 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-26 20:38:41 +00:00
regis@google.com
0b98430a58
Cleanups.
...
Review URL: http://codereview.chromium.org//8390021
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@726 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-25 23:16:16 +00:00
hausner@google.com
48304ec6d7
Implicitly move super constructor call
...
Implicitly move super constructor call to the end of the initializer
list. Some code failed after r412.
Review URL: http://codereview.chromium.org//8380023
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@663 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-24 23:06:01 +00:00
regis@google.com
d2e9c47e77
Fix wrong detection of duplicate definition of function types (issue 187).
...
Duplicate import of a function type alias must be detected, but duplicate
import of a compiler generated canonical function type is necessary for proper
class resolution and is permitted.
Add tests.
Review URL: http://codereview.chromium.org//8375033
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@658 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-24 22:31:30 +00:00
srdjan@google.com
584a6f81b4
Some performance improvements to make raytracer faster (e.g, support intensified operation in mixed double/smi, constant folding).
...
Review URL: http://codereview.chromium.org//8355041
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@596 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-21 07:03:17 +00:00
regis@google.com
ee3fdf27e4
Replace calls to Class::IsParameterized() by either
...
Class::NumTypeParameters() > 0
or by
Class::NumTypeArguments() > 0.
Review URL: http://codereview.chromium.org//8329005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@503 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-18 00:59:54 +00:00
hausner@google.com
ab37c41e1d
Interpolated strings are never considered compile time const
...
Review URL: http://codereview.chromium.org//8318031
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@500 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-17 23:51:28 +00:00
regis@google.com
7c2f02849c
Merge the 3 different closure nodes into a single node.
...
Review URL: http://codereview.chromium.org//8294013
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@485 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-17 20:22:42 +00:00
regis@google.com
4d24678892
Set type argument vector at compile time in type of closure parameters; this
...
require the introduction of a signature type cached in signature functions.
Support printing of the name of an instantiated signature type, e.g. print
'(int) => int' instead of '<T>(T) => T<int>'.
Avoid cycles when printing the name of illegal types during error reporting by
checking that the type is not being finalized.
Review URL: http://codereview.chromium.org//8289027
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@479 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-17 19:03:32 +00:00
regis@google.com
dc895f3138
Rename class AssertError to AssertionError in the VM (fix issue 119).
...
Move VM specific tests to the correct tests directory.
Enable asserts in the VM when type checks are enabled.
Review URL: http://codereview.chromium.org//8294005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@460 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-14 22:02:50 +00:00