I don't think ? works with null in Dart the way it does in JS.


On Wed, Jan 29, 2014 at 8:57 AM, Dominic Hamon <notifications@github.com>wrote:

> In example/demos/demo.dart:
>
> > @@ -67,20 +70,12 @@ abstract class Demo {
> >    /** HTML element used to display the world step time */
> >    Element worldStepTime;
> >
> > -  // TODO(dominich): Make this library-private once optional positional
> > -  // parameters are introduced.
> > -  double viewportScale;
> > -
> > -  // For timing the world.step call. It is kept running but reset and polled
> > -  // every frame to minimize overhead.
> > -  Stopwatch _stopwatch;
> > -
> > -  Demo(String name, [Vector2 gravity, this.viewportScale = _VIEWPORT_SCALE]) {
> > -    _stopwatch = new Stopwatch()..start();
> > +  Demo(String name, [Vector2 gravity, this._viewportScale = _VIEWPORT_SCALE])
> > +      : this.world = new World((gravity == null) ? new Vector2(0.0, GRAVITY) :
>
> you know, can we do:
>
> Demo(String name, [Vector2 gravity, this.*viewportScale = _VIEWPORT*
> SCALE])
> : this.world = new World(gravity ? gravity : new Vector2(0.0, GRAVITY),
> true, new DefaultWorldPool()),
> ....
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/dart-lang/dart-box2d/pull/35/files#r9274037>
> .
>