Skip to main content

Posts

New site for Dart news and articles

For the latest Dart news, visit our new blog at  https://medium.com/dartlang .

Breaking Change: Disabling Support for Old Getter Syntax

Matthias Hausner  writes : On Wed Nov 28, we will disable support for the old getter definition syntax. The empty formal parameter list in the getter definition will be a compile error. To convert your sources from old to new syntax, simply remove the empty parameter list after the getter name, for example: old:  int get Length() => a.length; new:  int get Length => a.length; As always, we invite you to join our  Dart mailing list , ask questions on  Stack Overflow , or file feature requests on  dartbug.com .

Let's Get Ready to Benchmark!

Today the Dart team released the official Dart benchmark harness . This harness is an absolute requirement if you’re benchmarking Dart. Conveniently, the benchmark harness is available as a pub package. The harness includes a template benchmark that you can copy and paste into your own project. Also included are two benchmarks that the Dart team uses internally to measure Dart’s performance: DeltaBlue and Richards. These are Dart variants of the same benchmarks in the JavaScript benchmark suite, Octane . To use the benchmark harness in your own code, simply add the following dependency to your Dart application, by updating your pubspec.yaml file: dependencies: benchmark_harness: ">=1.0.0 <2.0.0" For more details on benchmarking Dart, check out the in-depth article . As always, we encourage you to join our mailing list and let us know what you think! (image courtesy of http://www.flickr.com/photos/thatguyfromcchs08/2300190277/ )

Breaking Change: Element.elements is now Element.children

Pete Blois  sends us a FYI: :          We'll be renaming Element.elements to Element.children. We'll keep both methods around for a bit and I'll give a heads up once Element.children is checked in and ready to use.   As always, we invite you to join our  Dart mailing list , ask questions on  Stack Overflow , or file feature requests on  dartbug.com .

Breaking Change! NullPointerException Removed

If you have the NullPointerException in your code, its time get rid of it. Lasse Nielsen  writes : The ugly duckling of exceptions, the NullPointerException, has been removed. It had numerous problems. The two most immediate ones were that there wasn't a pointer, and it wasn't an exception.   And it was causing confusion, most visibly by its being used inconsistently: It should, by the spec, be a subclass of NoSuchMethodError (and hence be an error), and be thrown by Null.noSuchMethod. It should also be thrown if you tried to throw the null object - which matched badly with being a NoSuchMethodError. And it was being thrown by methods that couldn't handle a null argument value. This was Java style, because it allowed you to skip a test in Java and just use the object and still get the same exception.  Without NullPointerException, those three cases now need to be handled independently: Accessing a missing member on null will throw a NoSuchMeth...

Breaking Change! Exception no Longer has a Const Constructor

Lasse Nielsen  writes : Exceptions, unlike Errors, are intended to be caught and pass useful and accessible information to the catcher.  That makes "new Exception('here be dragons')" pretty useless. We considered removing the constructor completely, but decided to hang on to it for now for its one redeeming usage: As a stand-in for a more specific Exception while developing. So, consider the Exception constructor deprecated in finished code, and a sign of a partially implemented system (just as UnimplementedError). We have our share of them in samples, packages and libraries, but hopefully we'll find something better to throw. The only visible change is that Exception is no longer const - it's now as primitive as it can get, and that's the way we want it :) Change landed in r15077. As always, we invite you to join our  Dart mailing list , ask questions on  Stack Overflow , or file feature requests on  dartbug.com .

New Dart Editor build 0.2.4.1_r15042

Eric Clayberg  fills us in on the details on the new Dart Editor build : A new Dart Editor build is available at  www.dartlang.org/editor . Changes include: Added a new sample to the welcome page - Solar 3D! This demonstrates the use of WebGL. You can view it at Tools > Welcome Page. Removed support for obsolete style annotations @deprecated and @override in comments. Opening the samples from the Welcome page now creates the sample contents in user.home/dart directory. Fixed an issue on Windows where we couldn’t launch applications with spaces in the path name.. Breaking Change List: The asynchronous Element.rect API has been removed, in its place are the standard DOM methods (clientWidth, offsetHeight, etc).  Remove support for old style pub package layouts. And as always, view the  changelog  for the full list of changes, and to get started with the Editor see our  tutorial . As always, we invite you to join...