Commit Graph

981 Commits

Author SHA1 Message Date
johnniwinther@google.com 1274e083f5 Error produced for missing var, final, const or type on field declarations.
BUG=2997
TEST=tests/language/field_decl_missing_var_type_test

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9585 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-12 09:22:53 +00:00
johnniwinther@google.com fdbabb995e Dartdoc and Apidoc updated to use dart2js through the mirror system.
BUG=3414

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9584 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-12 08:52:19 +00:00
smok@google.com b79fd16adb dart2dart introduce "emitter" that that generates source code.
Review URL: https://chromiumcodereview.appspot.com//10694151

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9581 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-12 07:46:26 +00:00
sra@google.com 0e37190b18 Refresh dart:html
Review URL: https://chromiumcodereview.appspot.com//10701153

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9579 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-12 02:15:48 +00:00
gram@google.com e75fb92bcb Added ability to disable logging in mocks, to avoid the memory overhead if you don't need behavior verification of the mock itself.
Changed exceptions to end with periods - seems more Darty.
Review URL: https://chromiumcodereview.appspot.com//10694146

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9575 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 23:32:23 +00:00
gram@google.com b0e10499c3 CallMatchers can now be null, or take null for a method name. This might be
useful if we want to do things like find all method calls that returned a 
certain value.
Review URL: https://chromiumcodereview.appspot.com//10689148

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9570 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 19:57:52 +00:00
floitsch@google.com de90cce3e2 Inline compareTo for numbers into min and max.
Review URL: https://chromiumcodereview.appspot.com//10690086

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9564 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 19:00:40 +00:00
antonm@google.com f7eb436167 Provide proper Dartium support for _getNewIsolateId().
R=vsm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9555 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 17:33:32 +00:00
antonm@google.com dd491625ca Simplify ReceivePortSync.receive implementation.
R=vsm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9553 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 16:55:44 +00:00
antonm@google.com 4f0699c0b1 Reuse _dispatchEvent for sync message sending.
R=vsm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9552 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 16:14:15 +00:00
smok@google.com 8b8c0d1b5b Fix getters/setters unparsing, they appeared as ordinary methods without get/set keywords.
Review URL: https://chromiumcodereview.appspot.com//10698154

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9551 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 16:10:28 +00:00
smok@google.com 3fa18d1a27 Fix unparsing of variable definitions.
Example affecting method with method args:
foo(f(arg)){}

would unparse to:
foo(var f(arg)){}

Also correctly unparse variable definition modifiers.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9550 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 14:00:34 +00:00
floitsch@google.com 14b781bcd1 Refactor SsaBranchBuilder.
Review URL: https://chromiumcodereview.appspot.com//10693143

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9549 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 12:34:53 +00:00
ager@google.com 0ef33295a7 Bring back most of the performance lost when fixing union on types.
We lost the basic propagation of known field types from constructors.

R=floitsch@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9548 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 12:32:57 +00:00
floitsch@google.com c8cd641308 Fix usage of UNKNOWN/CONFLICTING types for union.
Fixes issue 4033.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9547 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 10:34:58 +00:00
lrn@google.com 42f353fad1 Patch methods in classes.
Add math library in corelib/unified. Location subject to change.
Made _Random's implementation external and patched it to use JS random.
Made "external" marking acually work.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9544 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 08:47:24 +00:00
smok@google.com b929ce15cc dart2dart fix synthesized constructor appearing in unparser. Don't output it.
For example, if we have:
class A {
}
main() {
  new A();
}

that would result in:
class A{class}...

that "class" is the unparse result of synthesized constructor.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9541 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 04:31:36 +00:00
vsm@google.com 9323a6d742 Add registerPort / lookupPort to generated interfaces with documentation
Note, the implementations are already there in Dartium and Dart2JS.
This will make the APIs show up in the Editor and dartdoc.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9537 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-10 23:54:37 +00:00
antonm@google.com b462d8dbd4 Support timers in DOM isolates.
R=podivilov@chromium.org
BUG=4013

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9511 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-10 15:06:13 +00:00
smok@google.com a7bc3e38de Fix broken unparser test in checked mode.
Review URL: https://chromiumcodereview.appspot.com//10701117

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9509 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-10 13:56:33 +00:00
ager@google.com ef3aeff677 Make sure to use the type-restricted selector when registering
what can be called in loops.

I don't expect a big impact, but it could reduce code size by
avoiding type-guard insertions for methods that cannot be hit
by a given call.

R=floitsch@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9507 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-10 13:28:08 +00:00
smok@google.com 0842017adc dart2dart support for instantiatin simple top-level class:
class A {
}

main() {
  new A();
}

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9506 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-10 12:41:29 +00:00
podivilov@google.com 80d8de3dda Replace 'NativeTraits' typedef with 'isNode', 'isActive', and 'isEventTarget' static boolean fields.
'isEventTarget' field is needed to implement proper GC semantics for non-node event target listeners.
'isNode'+'isActive' is a direct replacement of 'NativeTraits' typedef.

R=antonm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9501 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-10 10:51:46 +00:00
smok@google.com ae080111b6 support unparsing of "new Object()":
main() {
  new Object();
}

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9496 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-10 03:13:34 +00:00
turnidge@google.com 22fb45f640 Implement method and variable reflection in dart:mirrors.
Review URL: https://chromiumcodereview.appspot.com//10687004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9493 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 23:57:08 +00:00
sra@google.com d3a67e8016 Revert "Revert "Allow === and == to generate inputs at the use site when compiling to a single comparison.""
Fixed bug where subexpressions were visited twice.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9492 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 23:51:26 +00:00
gram@google.com 2c125a4cd2 Mocking library improvements:
- Timestamped logs
- Using enum pattern
- Improved verifiers

This is basically the same as the last reverted change but has a few bug fixes 
and now uses the enum pattern.
Review URL: https://chromiumcodereview.appspot.com//10752007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9489 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 22:41:17 +00:00
nweiz@google.com cefb44c63e Have Pub make use of the arg parser.
Also allow non-negatable flags in the arg parser.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9488 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 22:13:24 +00:00
nweiz@google.com 4957d72677 Allow asynchronous tests to explicitly register exceptions along with stack traces.
Review URL: https://chromiumcodereview.appspot.com//10766005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9487 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 22:10:13 +00:00
sra@google.com 0777cd8cb7 Revert "Allow === and == to generate inputs at the use site when compiling to a single comparison."
Review URL: https://chromiumcodereview.appspot.com//10757009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9486 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 21:19:01 +00:00
nweiz@google.com 852a684feb Print the stack traces for Future expectations that raise exceptions.
Review URL: https://chromiumcodereview.appspot.com//10766006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9485 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 21:05:36 +00:00
sra@google.com 30b48d9fac Allow === and == to generate inputs at the use site when compiling to a single comparison.
We only need temps in the general case
x === y -->  (x == null ? y == null : x === y)

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9481 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 20:18:02 +00:00
vsm@google.com 8231039baa Roll IDL to multivm@683
TBR=sra

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9479 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 19:42:19 +00:00
vsm@google.com 49c78a2d9c Revert "Make sure we do not try to run main() before the document has been fully loaded."
This reverts commit r9434.

It appears the r9434 is breaking samples in the editor: https://groups.google.com/a/dartlang.org/forum/?fromgroups#!topic/misc/Fvr73o2E_5o

Devon has verified that undoing this fixes the problem.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9474 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 18:13:25 +00:00
floitsch@google.com 596f69cae0 Use better names for closures and static variables.
This increases the code size, but goes away with a minifier.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9468 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 14:40:13 +00:00
ager@google.com 1aae5dca28 Insert type guards for loads from arrays in nested loops.
To limit code size implications, only do it in methods that already
have type guards.

R=floitsch@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9466 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 12:49:10 +00:00
smok@google.com 2f89b3723f dart2dart: fix top level field declarations.
Unparse:
final String x = "asd";
main() {
  x;
}

used to unparse to:
x="asd"main(){x;}

Now:
final String x="asd";main(){x;}

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9465 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 12:36:52 +00:00
floitsch@google.com 84fcfdce84 Don't box variables for closures that are assigned only once.
Fixes issue 4001.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9461 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 09:10:16 +00:00
lrn@google.com 87bce39efe Fix type errors.
Will now run my tests with --host-checked too.

TBR=floitsch

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9458 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 06:59:53 +00:00
lrn@google.com aa8f2cf676 Recognize "patch" identifier in .dartp files.
Added more infrastructure to detect errors in the patch.
Still no ability to add an element from the patch to the original library.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9457 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 06:39:57 +00:00
lrn@google.com 9010ea745c Add "external" prefix to methods and constructors.
This is expected to be added to the language specification, for allowing the specification of methods with externally bound implementations.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9456 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 06:37:51 +00:00
podivilov@google.com 25f88de46d _html_library_custom members are only custom in frog.
R=antonm@google.com,sra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9444 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-06 16:18:44 +00:00
antonm@google.com 8bb6f341f9 Support parsing of constructs like T[]?.
R=podivilov@chromium.org

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9442 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-06 16:04:10 +00:00
floitsch@google.com d356ee6c96 Fix very subtle bug in HNode.changeUse.
Review URL: https://chromiumcodereview.appspot.com//10696120

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9441 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-06 15:22:00 +00:00
smok@google.com 7b3401dd48 Fix const unparse. Example:
foo([var a = const[]]) {}
used to unparse to:
foo([var a = []]) {}

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9439 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-06 12:57:27 +00:00
smok@google.com 4c9d8416cf Some enhancements of PrettyPrinter for NodeList, LiteralList.
Review URL: https://chromiumcodereview.appspot.com//10701090

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9437 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-06 11:51:44 +00:00
podivilov@google.com fb4ba0921a Cleanup attributes generation in dart:html.
R=antonm@google.com,sra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9436 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-06 11:41:20 +00:00
kasperl@google.com f0d2788ce3 Make sure we do not try to run main() before the document has been fully loaded.
The problem was that document.readyState is either loading, interactive,
or complete, so before this change we would sometimes run main() when the
document has been parsed but not fully loaded.

R=efortuna@google.com,vsm@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9434 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-06 10:51:38 +00:00
sgjesse@google.com c89a6deab4 Fix spelling mistake
TBR=floitsch@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9433 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-06 10:20:42 +00:00
vsm@google.com 9c4f5eda7f Added Dartium support for JS to Dart PortSync calls
I addressed your test comments from the last cl - sorry for missing the last time.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9431 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-06 09:33:34 +00:00