Commit Graph

290 Commits

Author SHA1 Message Date
regis@google.com 61297238fb Support redirecting factory constructors in the VM (issue 3969).
Add test (negative tests still missing).
Some more work is needed regarding when to throw a dynamic error and when to
report a compile-time error. Some questions are not answered by the spec.
Review URL: https://codereview.chromium.org//10964058

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12791 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-24 17:28:37 +00:00
ager@google.com b065e9cb29 Fix implicit super constructor calls for sub-classes of native field wrappers.
The current code does not add implicit super calls for any sub-classes
of native field wrappers. It should only omit them from the actual
native field wrappers.

I encountered this issue when looking into dartbug.com/5301.

The test in the parser is not pretty. However, since the native field
wrappers can be generated through the API a better solution was not
immediate. I wanted to check if the class was from the
dart:nativewrappers library, but through the API you can create
native wrappers in any other library as well.

R=hausner@google.com,asiva@google.com
BUG=

Review URL: https://codereview.chromium.org//10963009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12679 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-21 05:40:33 +00:00
asiva@google.com 4140ed9d5b Fix for issue 5223 : Import 'dart:core' implicitly only if it has not been
already explicitly imported in the script.
Review URL: https://codereview.chromium.org//10949028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12673 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-21 00:43:08 +00:00
asiva@google.com 72f3a9c2ba Issue a more meaningful error message when we see duplicate definitions (ambiguous reference)
Review URL: https://codereview.chromium.org//10969002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12657 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-20 21:04:14 +00:00
iposva@google.com b9327e0236 - Make the VM understand the --checked flag to be aligned with dart2js.
- Adjust some of the checked mode tests to pass --checked and --enable-checked-mode.
Review URL: https://codereview.chromium.org//10962013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12651 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-20 18:19:06 +00:00
vegorov@google.com cd578d9de7 Ensure that parser throws an error when parsing x is! T with malformed type T.
Otherwise VM crashes in the flow graph builder

R=regis@google.com
BUG=

Review URL: https://codereview.chromium.org//10944041

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12608 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-19 21:48:50 +00:00
regis@google.com 99818005d8 Control static type propagation with a flag in optimizing compiler.
Minor cleanup.
Review URL: https://codereview.chromium.org//10952009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12601 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-19 20:59:01 +00:00
hausner@google.com 19c8f19f5e Stop making classes implicitly abstract
Allocating an implicitly abstract class is no longer a runtime error.
Review URL: https://codereview.chromium.org//10910284

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12408 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-14 22:46:54 +00:00
hausner@google.com 731f692895 Get rid of #resource directive in VM
Review URL: https://codereview.chromium.org//10918226

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12358 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-13 22:25:09 +00:00
turnidge@google.com a28d475ff3 Implement more of the mirrors library, primarily stuff to do with types.
Highlights:

- Implement FunctionClassMirror, used to reflect on the class of
  function objects.

- Implement TypeVariableMirror, used to reflect on type variables.

- Implement TypedefMirror, used to reflect on typedefs.

- Implement returnType for MethodMirror

- Implement type for VariableMirror/ParameterMirror

- Added supporting functions to the dart embedding api:
  - Dart_ClassIsTypedef
  - Dart_ClassGetTypedefReferent
  - Dart_ClassIsFunctionClass
  - Dart_ClassGetFunctionClassSignature
  - Dart_FunctionReturnType
  - Dart_FunctionParameterType
  - Dart_VariableType
  - Dart_GetTypeVariableNames
  - Dart_LookupTypeVariable
  - Dart_IsTypeVariable
  - Dart_TypeVariableOwner
  - Dart_TypeVariableUpperBound

Other stuff:

- Fixed bug in Function::NumberOfImplicitParameters for signature
  functions.

- Chnaged the default upper bound for type variables to Object from
  Dynamic.  Discussed this with Gilad and Regis.

- Fixed some smaller problems in mirrors_impl.dart.
Review URL: https://chromiumcodereview.appspot.com//10916252

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12342 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-13 17:47:25 +00:00
kasperl@google.com d1da3ed908 Re-land r12289.
Looks like Johnni has fixed the dartdoc issues.

R=iposva@google.com,hausner@google.com
BUG=

Review URL: https://codereview.chromium.org//10919263

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12321 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-13 12:37:00 +00:00
lrn@google.com 292da5cc48 Make int an abstract class.
This looks deceptively simple (the only real change is in init, which
just copies the code for double, and the rest are just renaming for
consistency). It seems to work.

Review URL: https://chromiumcodereview.appspot.com//10933039

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12304 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-13 07:17:27 +00:00
hausner@google.com 08893af550 Revert change 12289
Will resubmit tomorrow. Dartc and Editor need to cleanup static finals.
Review URL: https://codereview.chromium.org//10928169

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12291 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-13 00:22:12 +00:00
hausner@google.com b740a3266f Stop treating finals as const
Toplevel final variables and static final fields are no longer
considered compile-time constants.
Review URL: https://codereview.chromium.org//10918203

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12289 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-13 00:03:16 +00:00
regis@google.com e860f819a0 Limit the maximum number of formal parameters (32K fixed and 32K optional)
in order to save space in function objects.
Naming cleanup.
Review URL: https://codereview.chromium.org//10928160

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12288 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-12 23:35:05 +00:00
iposva@google.com 609f39c69e - Fixed patching of named factory constructors. Bug 4727.
- Added test to check for error free patching of native factories.

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12280 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-12 20:13:25 +00:00
kasperl@google.com 55140fd125 Remove support for operator negate and replace occurrences with unary
operator -.

In the VM, I have disabled the operator negate support in the parser but I
have not removed the keyword because the token is used in quite a few other
places.

R=ahe@google.com,iposva@google.com,hausner@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10911206

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12233 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-12 05:29:03 +00:00
hausner@google.com a32a698c6f Support new library/import syntax
This change simply adds new syntax support for the functionality we
currently have in the VM.

- Support for library and import, import-as.
- Still to do: show/hide combinators, export, library parts.
Review URL: https://chromiumcodereview.appspot.com//10928121

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12216 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-11 20:10:56 +00:00
iposva@google.com a8a8f1e7de - Do not limit the compiler message buffer, by allocating the message
into a String object.
Review URL: https://chromiumcodereview.appspot.com//10933021

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12202 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-11 15:03:40 +00:00
vegorov@google.com a528a1a3ea Refactor building of StoreStaticField and StoreLocal to manually preserve value.
This is first step towards eliminating manual value preservation in the write barrier's fast-path.

R=fschneider@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10905182

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12124 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-10 16:02:40 +00:00
hausner@google.com 5aff33a57f Add missing dot in comment
Review URL: https://chromiumcodereview.appspot.com//10908152

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12079 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-07 23:10:43 +00:00
hausner@google.com 22fdbae05b VM can parse and ignore metadata
Support parsing of metadata in all legal locations except library
and import directives. The metadata is simply ignored. It is not
evaluated or validated for correctness.
 
Review URL: https://chromiumcodereview.appspot.com//10913138

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12078 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-07 23:06:48 +00:00
regis@google.com 7cc84c2892 Implement new optional parameters syntax in the vm (issue 4290).
Provide --reject_named_argument_as_positional flag to ease transition to new
syntax (default is false).
Add tests.
Review URL: https://chromiumcodereview.appspot.com//10910119

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12004 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-07 01:13:27 +00:00
hausner@google.com e0ed54ea8e Add named constructor name checking
Named constructors may not clash with any other class members.
Add a check but enable it only when --construcotr_name_check
runtime flag is passed to the VM.

Eliminate one named constructor in Process class in core library,
as well as a couple of cases in dart2js.

The dart2js team may want to rename the constructors I changed.

Issue 3990  (http://code.google.com/p/dart/issues/detail?id=3990)
 
Review URL: https://chromiumcodereview.appspot.com//10905109

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11972 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-06 18:02:41 +00:00
cshapiro@google.com da14bf70a7 Add attributions so printf like functions can have their arguments checked.
This change also corrects some misuses of format strings and format
arguments that discovered by the compiler checks.

Review URL: https://chromiumcodereview.appspot.com//10869063

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11912 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-06 00:58:25 +00:00
tball@google.com 90bd62f488 Fixed parsing of parameterized type test assert statement in production mode.
BUG=3741
TEST=Verified with bug's test, plus all VM tests.
Review URL: https://chromiumcodereview.appspot.com//10911042

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11843 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-04 21:42:20 +00:00
hausner@google.com dce2c6a275 Catch illegally declared constructors
Constructors cannot be abstract or static.
Review URL: https://chromiumcodereview.appspot.com//10910079

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11842 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-04 21:28:48 +00:00
regis@google.com 2ea2249b48 Fix argument definition test (issue 4888).
Review URL: https://chromiumcodereview.appspot.com//10907064

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11835 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-04 18:59:01 +00:00
kasperl@google.com 7a535d3226 Disable all support for legacy try-catch in the VM.
R=ngeoffray@google.com,hausner@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10910060

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11754 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-03 10:15:47 +00:00
hausner@google.com 35d7793891 Throw AbstractClassInstantiationError if an abstract class is instantiated
This is the second try to my previous attempt to implement the
new abstract class handling. Instead of a compile-time error,
the VM now throws an AbstractClassInstantiationError at runtime
if an abstract class is instantiated. Added the new error class
to the core library.

For now I'm still using the rule that a class is abstract if it is explicitly
marked as abstract, or if it defines a new abstract method.
Review URL: https://chromiumcodereview.appspot.com//10916039

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11708 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-31 18:06:42 +00:00
asiva@google.com 9ed2e66130 Get rid of support for string interpolation in #import strings.
Review URL: https://chromiumcodereview.appspot.com//10911025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11698 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-31 16:55:03 +00:00
regis@google.com 9e00bd8ccb Implement argument definition test in the vm.
Add tests.
Various cleanups.
Review URL: https://chromiumcodereview.appspot.com//10915022

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11664 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 22:46:44 +00:00
cshapiro@google.com 72c02b48c4 Format pointer type declarations more consistently.
Review URL: https://chromiumcodereview.appspot.com//10896054

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11645 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 19:26:28 +00:00
hausner@google.com 5692051e4e Convert double interface into abstract class
In a future change, we can implement double in the core
library, eliminating class Double (using the patch class
feature).
Review URL: https://chromiumcodereview.appspot.com//10876100

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11631 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 17:29:49 +00:00
hausner@google.com b3a2c41d02 Revert change 11558
I learnt that instantiating an abstract class is a runtime error, not a compile time error.

TBR=regis
Review URL: https://chromiumcodereview.appspot.com//10894048

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11567 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-29 22:49:52 +00:00
hausner@google.com 28d88d4b2d Add compiler error when instantiating abstract class
Also, make abstract keyword on methods optional.
Review URL: https://chromiumcodereview.appspot.com//10899039

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11558 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-29 22:13:06 +00:00
iposva@google.com 327ff5d70e - Change "static final" to "static const" in the runtime/ directory.
- Fixed parsing of top-level static const.
Review URL: https://chromiumcodereview.appspot.com//10883071

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11425 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-27 23:51:37 +00:00
hausner@google.com c7f5bcd0ca Eliminate interface bool
Replace with concrete class bool instead, and getting rid of class Bool in core_impl library.
Review URL: https://chromiumcodereview.appspot.com//10874071

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11418 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-27 21:09:23 +00:00
regis@google.com d0539c0335 Propagate type of list literal from parser to ast, graph, and optimizer.
Review URL: https://chromiumcodereview.appspot.com//10878042

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11329 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-24 18:17:11 +00:00
srdjan@google.com b77b6f913d Type of PhasePramater is Smi.
Review URL: https://chromiumcodereview.appspot.com//10868057

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11276 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-23 23:50:23 +00:00
hausner@google.com 0300d88b1b Gentle start with removing explicit interfaces
Review URL: https://chromiumcodereview.appspot.com//10832401

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11248 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-23 18:32:10 +00:00
regis@google.com 9efad2644b Re-enable checking of native resolvers.
Review URL: https://chromiumcodereview.appspot.com//10882007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11206 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-23 03:26:20 +00:00
regis@google.com 55c106f812 Make ClassFinalizer indifferent on whether we are generating a snapshot or not.
Add flag --error_on_malformed_type.
Remove obsolete flag --verify_implements.
Support snapshotting of LanguageError (for malformed types) and ApiError.
Review URL: https://chromiumcodereview.appspot.com//10871005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11198 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-23 00:27:49 +00:00
hausner@google.com 9dc7ab8e1e Implement import scope
Implement the new scope rule for imports.

- Imported identifiers are in a scope that is shadowed
  by the importing library's top-level scope.
- Conflicting names imported from different libraries
  are not an error unless the name is referenced.
- Conflicting type names are only an error in checked mode.

In a follow-on change, I'll remove the "imported_into" pointers in libraries. They are no longer needed.


Issue 2945
Review URL: https://chromiumcodereview.appspot.com//10823396

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10923 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-17 21:06:16 +00:00
regis@google.com d9b0276a4c Require two type arguments for map literals (issue 4522).
Spec has been changed back.
VM temporarily accepts a single type argument and emits a warning.
Update tests, dart2js source, dartdoc, etc...
Disable failing co19 tests (issue 175 filed).
Review URL: https://chromiumcodereview.appspot.com//10854191

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10861 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-16 20:44:32 +00:00
hausner@google.com d116929aa9 New getter syntax for top-level getters
Fix 4538
Review URL: https://chromiumcodereview.appspot.com//10837288

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10846 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-16 17:30:56 +00:00
iposva@google.com e5851a16c5 - Merge function lists when patching classes (no more duplicates).
- Report errors when applying a patch with duplicate fields or mismatched parameters.
- Fix bug 4526: Wrong error message when defining an already defined class.
Review URL: https://chromiumcodereview.appspot.com//10854176

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10784 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-16 00:00:04 +00:00
iposva@google.com 5a443ddcc9 - Split functionality of adding implicit constructors and checking
for cycles into two functions.
- Fix handling of closures in patch classes.
Review URL: https://chromiumcodereview.appspot.com//10829332

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10703 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-15 07:33:19 +00:00
hausner@google.com b69319b6ce Allow non-const field initializers
Revision 0.11 of the spec allows arbitrary initializer expressions
for instance fields.

Issue 3848
Review URL: https://chromiumcodereview.appspot.com//10832283

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10672 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-14 19:52:00 +00:00
iposva@google.com 99d563982c - Support for patching of class methods and fields.
Review URL: https://chromiumcodereview.appspot.com//10827288

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10616 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-14 00:38:01 +00:00