diff --git a/AUTHORS b/AUTHORS index 74025465a..b3fcda667 100644 --- a/AUTHORS +++ b/AUTHORS @@ -5,4 +5,5 @@ Google Inc. -Matthew Butler \ No newline at end of file +Matthew Butler +Chris Buckett \ No newline at end of file diff --git a/src/site/_includes/language-tour/classes/index.markdown b/src/site/_includes/language-tour/classes/index.markdown index 20b3a30a3..fd03206d4 100644 --- a/src/site/_includes/language-tour/classes/index.markdown +++ b/src/site/_includes/language-tour/classes/index.markdown @@ -366,12 +366,14 @@ The distanceTo() method in the following sample is an example of an instance method. {% highlight dart %} +#import('dart:math'); + class Point { num x, y; Point(this.x, this.y); num distanceTo(Point other) { - return Math.sqrt(((x-other.x)*(x-other.x)) + ((y-other.y)*(y-other.y))); + return sqrt(((x-other.x)*(x-other.x)) + ((y-other.y)*(y-other.y))); } } {% endhighlight %} @@ -569,12 +571,14 @@ Static methods (class methods) do not operate on an instance, and thus do not have access to `this`. {% highlight dart %} +#import('dart:math'); + class Point { num x, y; Point(this.x, this.y); static num distanceBetween(Point a, Point b) { - return Math.sqrt(((a.x-b.x)*(a.x-b.x)) + ((a.y-b.y)*(a.y-b.y))); + return sqrt(((a.x-b.x)*(a.x-b.x)) + ((a.y-b.y)*(a.y-b.y))); } } diff --git a/src/site/articles/idiomatic-dart/index.html b/src/site/articles/idiomatic-dart/index.html index d5205b02e..a5e7c5f60 100644 --- a/src/site/articles/idiomatic-dart/index.html +++ b/src/site/articles/idiomatic-dart/index.html @@ -66,13 +66,15 @@

Named constructors

Like most dynamically-typed languages, Dart doesn't support overloading. With methods, this isn't much of a limitation because you can always use a different name, but constructors aren't so lucky. To alleviate that, Dart lets you define named constructors:

{% highlight dart %} +#import('dart:math'); + class Point { num x, y; Point(this.x, this.y); Point.zero() : x = 0, y = 0; Point.polar(num theta, num radius) { - x = Math.cos(theta) * radius; - y = Math.sin(theta) * radius; + x = cos(theta) * radius; + y = sin(theta) * radius; } } {% endhighlight dart 0 %} @@ -80,9 +82,13 @@

Named constructors

Here our Point class has three constructors, a normal one and two named ones. You can use them like so:

{% highlight dart %} -var a = new Point(1, 2); -var b = new Point.zero(); -var c = new Point.polar(Math.PI, 4.0); +#import('dart:math'); + +main() { + var a = new Point(1, 2); + var b = new Point.zero(); + var c = new Point.polar(PI, 4.0); +} {% endhighlight dart 0 %}

Note that we're still using new here when we invoke the named constructor. It isn't just a static method.

@@ -255,9 +261,11 @@

Top-level definitions

Dart is a "pure" object-oriented language in that everything you can place in a variable is a real object (no mutant "primitives") and every object is an instance of some class. It's not a dogmatic OOP language though. You aren't required to place everything you define inside some class. Instead, you are free to define functions, variables, and even getters and setters at the top level if you want.

{% highlight dart %} +#import('dart:math'); + num abs(num value) => value < 0 ? -value : value; -final TWO_PI = Math.PI * 2.0; +final TWO_PI = PI * 2.0; int get today() { final date = new Date.now(); @@ -267,7 +275,7 @@

Top-level definitions

Even in languages that don't require you to place everything inside a class or object, like JavaScript, it's still common to do so as a form of namespacing: top-level definitions with the same name could inadvertently collide. To address that, Dart has a library system that allows you to import definitions from other libraries with a prefix applied to disambiguate it. That means you shouldn't need to defensively squirrel your definitions inside classes.

-

We're still exploring what this actually means for how we define libraries. Most of our code does place definitions inside classes, like Math. It's hard to tell if this is just an ingrained habit we have from other languages or a practice that's also good for Dart. This is an area we want feedback on.

+

We're still exploring what this actually means for how we define libraries. For example, the project used to have a Math class, but we moved all functionality from that class to top-level methods inside the dart:math library.

We do have some examples where we use top-level definitions. The first you'll run into is main() which is expected to be defined at the top level. If you work with the DOM, the familiar document and window "variables" are actually top-level getters in Dart.

@@ -304,8 +312,11 @@

Strings and interpolation

placing them inside curly braces:

{% highlight dart %} -var r = 2; -print('The area of a circle with radius $r is ${Math.PI * r * r}'); +#import('dart:math'); +main() { + var r = 2; + print('The area of a circle with radius $r is ${PI * r * r}'); +} {% endhighlight dart 0 %}

Operators

diff --git a/src/site/articles/mocking-with-dart/index.markdown b/src/site/articles/mocking-with-dart/index.markdown index cfa762ed8..4a6ec9b9f 100644 --- a/src/site/articles/mocking-with-dart/index.markdown +++ b/src/site/articles/mocking-with-dart/index.markdown @@ -393,7 +393,7 @@ themselves can be `expect()`-style `Matcher`s, for example: {% highlight dart %} m.when(callsTo('sqrt', isNegative)). alwaysThrow('No imaginary number support'); -m.when(callsTo('sqrt', isNonNegative)).alwaysCall((x) => Math.sqrt(x)); +m.when(callsTo('sqrt', isNonNegative)).alwaysCall((x) => sqrt(x)); {% endhighlight %} You don't need to provide argument matchers in `callsTo()` for all arguments of a method, but you do need diff --git a/src/site/articles/puzzlers/chapter-2.markdown b/src/site/articles/puzzlers/chapter-2.markdown index 140b371a7..ef5a7cd19 100644 --- a/src/site/articles/puzzlers/chapter-2.markdown +++ b/src/site/articles/puzzlers/chapter-2.markdown @@ -677,9 +677,12 @@ So the mysterious behavior is explained. What happens when we do a naive translation to Dart? {% highlight dart %} +#import('dart:math'); + main() { StringBuffer word = null; - switch ((Math.random() * 2).toInt()) { + var random = new Random(); + switch ((random.nextDouble() * 2).toInt()) { case 1: word = new StringBuffer('P'); case 2: word = new StringBuffer('G'); default: word = new StringBuffer('M'); diff --git a/src/site/articles/style-guide/index.markdown b/src/site/articles/style-guide/index.markdown index ab63019fd..971eb598a 100644 --- a/src/site/articles/style-guide/index.markdown +++ b/src/site/articles/style-guide/index.markdown @@ -612,8 +612,10 @@ together.
{% highlight dart good %} +#import('dart:math'); +// ... /* Rolls both [Dice] and returns the highest rolled value. */ -num greatestRoll(Dice a, Dice b) => Math.max(a.roll(), b.roll()); +num greatestRoll(Dice a, Dice b) => max(a.roll(), b.roll()); {% endhighlight %}
diff --git a/src/site/docs/editor/index.html b/src/site/docs/editor/index.html index 14eaa96b5..3c2a5c1dc 100644 --- a/src/site/docs/editor/index.html +++ b/src/site/docs/editor/index.html @@ -337,7 +337,7 @@

Using autocomplete

Type a class, interface, or variable name, and then type a period.
- For example, type document. or Math. + For example, type document. and pause a moment. Once the suggestions appear, continue typing to pare down the list. @@ -348,9 +348,9 @@

Using autocomplete

Type Ctl+Space.
- For example, type Mat, then Ctl+Space + For example, type Str, then Ctl+Space to see a list of classes and interfaces - that start with "Mat". + that start with "Str".

@@ -410,9 +410,9 @@

Finding where an API is declared

The editor displays the file that declares the item. - For example, if you Command-click Math, + For example, if you Command-click String, the file that declares the - Math type appears. + String type appears.

diff --git a/src/site/docs/library-tour/index.markdown b/src/site/docs/library-tour/index.markdown index eefd07a7f..f7fb6dc8e 100644 --- a/src/site/docs/library-tour/index.markdown +++ b/src/site/docs/library-tour/index.markdown @@ -35,10 +35,10 @@ for the full details about a class or interface. 1. [Maps (aka dictionaries or hashes)](#maps-aka-dictionaries-or-hashes) 1. [Dates and times](#dates-and-times) 1. [Utility interfaces](#utility-interfaces) - 1. [Math and numbers](#math-and-numbers) 1. [Strings and regular expressions](#strings-and-regular-expressions) 1. [Asynchronous programming](#asynchronous-programming) 1. [Exceptions](#exceptions) +1. [dart:math - Math](#dartmath---math) 1. [dart:html - Using HTML5 APIs](#html) 1. [Manipulating the DOM](#html-dom) 1. [WebSockets](#html-websockets) @@ -624,128 +624,6 @@ for a full list of methods. [Back to contents.](#toc) {:.up-to-toc} -### Math and numbers - -The [Math](http://api.dartlang.org/dart_core/Math.html) class -provides common functionality such as sine and cosine, -maximum and minimum, -string-to-number conversion, -and constants such as _pi_ and _e_. - -#### Converting strings to numbers - -You can convert a string into either an integer or double with the Math class. - -{% highlight dart %} -assert(Math.parseInt('42') == 42); -assert(Math.parseDouble("0.50") == 0.5); -{% endhighlight %} - -#### Converting numbers to strings - -Use the toString() method (defined by -[Object](http://api.dartlang.org/dart_core/Object.html)) -to convert an int or double to a string. - -To specify the number of digits to the right of the decimal, -use toStringAsFixed() -(defined by [num](http://api.dartlang.org/dart_core/num.html)). -To specify the number of significant digits in the string, -use toStringAsPrecision(). - -{% highlight dart %} -// Convert an int to a string. -assert(42.toString() == '42'); - -// Convert a double to a string. -assert(123.456.toString() == '123.456'); - -// Specify the number of digits after the decimal. -assert(123.456.toStringAsFixed(2) == '123.46'); - -// Specify the number of significant figures. -assert(123.456.toStringAsPrecision(2) == '1.2e+2'); -assert(Math.parseDouble('1.2e+2') == 120.0); -{% endhighlight %} - -#### Trigonometry - -Use the Math class for the basic trigonometric functions. - - - -{% highlight dart %} -// Cosine -assert(Math.cos(Math.PI) == -1.0); - -// Sine -var degrees = 30; -var radians = degrees * (Math.PI / 180); -// radians is now 0.52359. -var sinOf30degrees = Math.sin(radians); - -// Truncate the decimal places to 2. -assert(Math.parseDouble(sinOf30degrees.toStringAsPrecision(2)) == 0.5); -{% endhighlight %} - -#### Maximum and mininum - -Math provides optimized max and min methods. - -{% highlight dart %} -assert(Math.max(1, 1000) == 1000); -assert(Math.min(1, -1000) == -1000); -{% endhighlight %} - -#### Math constants - -Find your favorite constants—_pi_, _e_, and more—in Math. - -{% highlight dart %} -// See the Math class for additional constants. - -print(Math.E); // 2.718281828459045 -print(Math.PI); // 3.141592653589793 -print(Math.SQRT2); // 1.4142135623730951 -{% endhighlight %} - -#### Random numbers - -Generate random numbers between 0.0 and 1.0 with the Math class. - -{% highlight dart %} -var rand = Math.random(); -{% endhighlight %} - - - -#### More information - -Refer to the full -[Math API docs](http://api.dartlang.org/dart_core/Math.html) -for a full list of methods. -Also see the API docs for -[num](http://api.dartlang.org/dart_core/num.html), -[int](http://api.dartlang.org/dart_core/int.html), -and -[double](http://api.dartlang.org/dart_core/double.html). - -[Back to contents.](#toc) -{:.up-to-toc} - ### Strings and regular expressions A [String](http://api.dartlang.org/dart_core/String.html) is @@ -1048,6 +926,165 @@ See the [Back to contents.](#toc) {:.up-to-toc} +## dart:math - Math + +The [Math](http://api.dartlang.org/dart_math/index.html) library +provides common functionality such as sine and cosine, +maximum and minimum, +string-to-number conversion, +and constants such as _pi_ and _e_. + +### Importing the Math library + +Math functionality is in the `dart:math` library. + +{% highlight dart %} +#import('dart:math'); + +main() { + // Do fun math stuff. +} +{% endhighlight %} + +### Converting strings to numbers + +You can convert a string into either an integer or double with the Math class. + +{% highlight dart %} +#import('dart:math'); + +main() { + assert(parseInt('42') == 42); + assert(parseDouble("0.50") == 0.5); +} +{% endhighlight %} + +### Converting numbers to strings + +Use the toString() method (defined by +[Object](http://api.dartlang.org/dart_core/Object.html)) +to convert an int or double to a string. + +To specify the number of digits to the right of the decimal, +use toStringAsFixed() +(defined by [num](http://api.dartlang.org/dart_core/num.html)). +To specify the number of significant digits in the string, +use toStringAsPrecision(). + +{% highlight dart %} +// Convert an int to a string. +assert(42.toString() == '42'); + +// Convert a double to a string. +assert(123.456.toString() == '123.456'); + +// Specify the number of digits after the decimal. +assert(123.456.toStringAsFixed(2) == '123.46'); + +// Specify the number of significant figures. +assert(123.456.toStringAsPrecision(2) == '1.2e+2'); +{% endhighlight %} + +### Trigonometry + +Use the Math library for the basic trigonometric functions. + + + +{% highlight dart %} +#import('dart:math'); + +main() { + // Cosine + assert(cos(PI) == -1.0); + + // Sine + var degrees = 30; + var radians = degrees * (PI / 180); + // radians is now 0.52359. + var sinOf30degrees = sin(radians); + + // Truncate the decimal places to 2. + assert(parseDouble(sinOf30degrees.toStringAsPrecision(2)) == 0.5); +} +{% endhighlight %} + +### Maximum and mininum + +The Math library provides optimized max and min methods. + +{% highlight dart %} +#import('dart:math'); + +main() { + assert(max(1, 1000) == 1000); + assert(min(1, -1000) == -1000); +} +{% endhighlight %} + +### Math constants + +Find your favorite constants—_pi_, _e_, and more—in +the Math library. + +{% highlight dart %} +// See the Math class for additional constants. + +#import('dart:math'); + +main() { + print(E); // 2.718281828459045 + print(PI); // 3.141592653589793 + print(SQRT2); // 1.4142135623730951 +} +{% endhighlight %} + +### Random numbers + +Generate random numbers with the Random class. +You can optionally provide a seed to the Random +constructor. + +{% highlight dart %} +#import('dart:math'); + +main() { + var random = new Random(); + random.nextDouble(); // Between 0.0 and 0.1. + random.nextInt(10); // Between 0 and 9. +} +{% endhighlight %} + +You can even generate random booleans. + +{% highlight dart %} +#import('dart:math'); + +main() { + var random = new Random(); + random.nextBoolean(); // true or false +} +{% endhighlight %} + +### More information + +Refer to the full +[Math API docs](http://api.dartlang.org/dart_math/index.html) +for a full list of methods. +Also see the API docs for +[num](http://api.dartlang.org/dart_core/num.html), +[int](http://api.dartlang.org/dart_core/int.html), +and +[double](http://api.dartlang.org/dart_core/double.html). + +[Back to contents.](#toc) +{:.up-to-toc} + ## dart:html - Using HTML5 APIs {#html} {% render library-tour/html.markdown %} diff --git a/src/site/docs/technical-overview/index.html b/src/site/docs/technical-overview/index.html index 258e1bcf8..325b454fd 100644 --- a/src/site/docs/technical-overview/index.html +++ b/src/site/docs/technical-overview/index.html @@ -217,11 +217,13 @@

Optional types

{% highlight dart %} +#import('dart:math'); + class Point { var x, y; Point(this.x, this.y); scale(factor) => new Point(x*factor, y*factor); - distance() => Math.sqrt(x*x + y*y); + distance() => sqrt(x*x + y*y); } main() { @@ -240,11 +242,13 @@

Optional types

{% highlight dart %} +#import('dart:math'); + class Point { num x, y; Point(num this.x, num this.y); Point scale(num factor) => new Point(x*factor, y*factor); - num distance() => Math.sqrt(x*x + y*y); + num distance() => sqrt(x*x + y*y); } void main() { diff --git a/src/site/index.html b/src/site/index.html index 9973b25d8..fc5385212 100644 --- a/src/site/index.html +++ b/src/site/index.html @@ -198,6 +198,8 @@

A structured language that's flexible and familiar

{% highlight dart %} +#import('dart:math'); + class Point { final num x, y; @@ -208,7 +210,7 @@

A structured language that's flexible and familiar

num distanceTo(Point other) { var dx = x - other.x; var dy = y - other.y; - return Math.sqrt(dx * dx + dy * dy); + return sqrt(dx * dx + dy * dy); } } {% endhighlight %} @@ -297,6 +299,8 @@

Libraries

{% highlight dart %} +#import('dart:math'); + class Point { final num x, y; Point(this.x, this.y); @@ -308,7 +312,7 @@

Libraries

// untyped dynamic variable var dx = x - other.x; var dy = y - other.y; - return Math.sqrt(dx * dx + dy * dy); + return sqrt(dx * dx + dy * dy); } } {% endhighlight %} diff --git a/src/site/samples/spirodraw/app/Spirodraw.dart b/src/site/samples/spirodraw/app/Spirodraw.dart index 7461da88c..387cb2a13 100644 --- a/src/site/samples/spirodraw/app/Spirodraw.dart +++ b/src/site/samples/spirodraw/app/Spirodraw.dart @@ -5,6 +5,7 @@ #library('spirodraw'); #import('dart:html'); +#import('dart:math', prefix: 'Math'); #source("ColorPicker.dart"); @@ -206,10 +207,11 @@ class Spirodraw { * things too much. */ void lucky() { - wheelRadiusSlider.valueAsNumber = Math.random() * 9; - penRadiusSlider.valueAsNumber = Math.random() * 9; - penWidthSlider.valueAsNumber = 1 + Math.random() * 9; - colorPicker.selectedColor = colorPicker.getHexString(Math.random() * 215); + var rand = new Math.Random(); + wheelRadiusSlider.valueAsNumber = rand.nextDouble() * 9; + penRadiusSlider.valueAsNumber = rand.nextDouble() * 9; + penWidthSlider.valueAsNumber = 1 + rand.nextDouble() * 9; + colorPicker.selectedColor = colorPicker.getHexString(rand.nextDouble() * 215); start(); } diff --git a/src/site/samples/spirodraw/app/Spirodraw.dart.js b/src/site/samples/spirodraw/app/Spirodraw.dart.js index 51cc5f348..cc3c85a36 100644 --- a/src/site/samples/spirodraw/app/Spirodraw.dart.js +++ b/src/site/samples/spirodraw/app/Spirodraw.dart.js @@ -9,7 +9,112 @@ $$.ExceptionImplementation = {"": toString$0: function() { var t1 = this._msg; return t1 == null ? 'Exception' : 'Exception: ' + $.S(t1); - } +}, + is$Exception: true +}; + +$$.FutureImpl = {"": + ["_completionListeners", "_exceptionHandlers", "_successListeners", "_exceptionHandled", "_stackTrace", "_exception", "_lib0_value", "_isComplete"], + super: "Object", + _setException$2: function(exception, stackTrace) { + if (exception == null) + throw $.captureStackTrace($.IllegalArgumentException$(null)); + if (this._isComplete === true) + throw $.captureStackTrace($.FutureAlreadyCompleteException$()); + this._exception = exception; + this._stackTrace = stackTrace; + this._complete$0(); +}, + _setValue$1: function(value) { + if (this._isComplete === true) + throw $.captureStackTrace($.FutureAlreadyCompleteException$()); + this._lib0_value = value; + this._complete$0(); +}, + _complete$0: function() { + this._isComplete = true; + try { + if (!(this._exception == null)) + for (var t1 = $.iterator(this._exceptionHandlers); t1.hasNext$0() === true;) { + var handler = t1.next$0(); + if ($.eqB(handler.call$1(this._exception), true)) { + this._exceptionHandled = true; + break; + } + } + if (this.get$hasValue() === true) + for (t1 = $.iterator(this._successListeners); t1.hasNext$0() === true;) { + var listener = t1.next$0(); + listener.call$1(this.get$value()); + } + else if (this._exceptionHandled !== true && $.gtB($.get$length(this._successListeners), 0)) + throw $.captureStackTrace(this._exception); + } finally { + for (t1 = $.iterator(this._completionListeners); t1.hasNext$0() === true;) { + var listener0 = t1.next$0(); + try { + listener0.call$1(this); + } catch (exception) { + $.unwrapException(exception); + } + + } + } +}, + handleException$1: function(onException) { + if (this._exceptionHandled === true) + return; + if (this._isComplete === true) { + var t1 = this._exception; + if (!(t1 == null)) + this._exceptionHandled = onException.call$1(t1); + } else + $.add$1(this._exceptionHandlers, onException); +}, + then$1: function(onSuccess) { + if (this.get$hasValue() === true) + onSuccess.call$1(this.get$value()); + else if (this.get$isComplete() !== true) + $.add$1(this._successListeners, onSuccess); + else if (this._exceptionHandled !== true) + throw $.captureStackTrace(this._exception); +}, + get$hasValue: function() { + return this.get$isComplete() === true && this._exception == null; +}, + get$isComplete: function() { + return this._isComplete; +}, + get$stackTrace: function() { + if (this.get$isComplete() !== true) + throw $.captureStackTrace($.FutureNotCompleteException$()); + return this._stackTrace; +}, + get$value: function() { + if (this.get$isComplete() !== true) + throw $.captureStackTrace($.FutureNotCompleteException$()); + var t1 = this._exception; + if (!(t1 == null)) + throw $.captureStackTrace(t1); + return this._lib0_value; +} +}; + +$$.CompleterImpl = {"": + ["_futureImpl"], + super: "Object", + completeException$2: function(exception, stackTrace) { + this._futureImpl._setException$2(exception, stackTrace); +}, + completeException$1: function(exception) { + return this.completeException$2(exception,null) +}, + complete$1: function(value) { + this._futureImpl._setValue$1(value); +}, + get$future: function() { + return this._futureImpl; +} }; $$.HashMapImplementation = {"": @@ -17,100 +122,226 @@ $$.HashMapImplementation = {"": super: "Object", toString$0: function() { return $.Maps_mapToString(this); - }, +}, containsKey$1: function(key) { return !$.eqB(this._probeForLookup$1(key), -1); - }, +}, getValues$0: function() { - var t1 = ({}); + var t1 = {}; var list = $.ListFactory_List($.get$length(this)); - $.setRuntimeTypeInfo(list, ({E: 'V'})); + $.setRuntimeTypeInfo(list, {E: 'V'}); t1.i_1 = 0; this.forEach$1(new $.HashMapImplementation_getValues__(list, t1)); return list; - }, +}, getKeys$0: function() { - var t1 = ({}); + var t1 = {}; var list = $.ListFactory_List($.get$length(this)); - $.setRuntimeTypeInfo(list, ({E: 'K'})); + $.setRuntimeTypeInfo(list, {E: 'K'}); t1.i_1 = 0; this.forEach$1(new $.HashMapImplementation_getKeys__(list, t1)); return list; - }, +}, forEach$1: function(f) { var length$ = $.get$length(this._keys); - if (typeof length$ !== 'number') return this.forEach$1$bailout(1, f, length$); + if (typeof length$ !== 'number') + return this.forEach$1$bailout(1, f, length$); for (var i = 0; i < length$; ++i) { var key = $.index(this._keys, i); - !(key == null) && !(key === $.CTC5) && f.$call$2(key, $.index(this._values, i)); + if (!(key == null) && !(key === $.CTC6)) + f.call$2(key, $.index(this._values, i)); } - }, +}, forEach$1$bailout: function(state, f, length$) { for (var i = 0; $.ltB(i, length$); ++i) { var key = $.index(this._keys, i); - !(key == null) && !(key === $.CTC5) && f.$call$2(key, $.index(this._values, i)); + if (!(key == null) && !(key === $.CTC6)) + f.call$2(key, $.index(this._values, i)); } - }, +}, get$length: function() { return this._numberOfEntries; - }, +}, isEmpty$0: function() { return $.eq(this._numberOfEntries, 0); - }, +}, + remove$1: function(key) { + var index = this._probeForLookup$1(key); + if ($.geB(index, 0)) { + this._numberOfEntries = $.sub(this._numberOfEntries, 1); + var value = $.index(this._values, index); + $.indexSet(this._values, index, null); + $.indexSet(this._keys, index, $.CTC6); + this._numberOfDeleted = $.add(this._numberOfDeleted, 1); + return value; + } + return; +}, operator$index$1: function(key) { var index = this._probeForLookup$1(key); - if ($.ltB(index, 0)) return; + if ($.ltB(index, 0)) + return; return $.index(this._values, index); - }, +}, operator$indexSet$2: function(key, value) { this._ensureCapacity$0(); var index = this._probeForAdding$1(key); - if ($.index(this._keys, index) == null || $.index(this._keys, index) === $.CTC5) this._numberOfEntries = $.add(this._numberOfEntries, 1); - $.indexSet(this._keys, index, key); - $.indexSet(this._values, index, value); - }, + var t1 = this._keys; + if (typeof t1 !== 'string' && (typeof t1 !== 'object' || t1 === null || t1.constructor !== Array && !t1.is$JavaScriptIndexingBehavior())) + return this.operator$indexSet$2$bailout(1, key, value, index, t1); + if (index !== (index | 0)) + throw $.iae(index); + var t3 = t1.length; + if (index < 0 || index >= t3) + throw $.ioore(index); + if (!(t1[index] == null)) { + var t2 = t1.length; + if (index < 0 || index >= t2) + throw $.ioore(index); + t3 = t1[index] === $.CTC6; + t1 = t3; + } else + t1 = true; + if (t1) { + t1 = this._numberOfEntries; + if (typeof t1 !== 'number') + return this.operator$indexSet$2$bailout(3, key, value, t1, index); + this._numberOfEntries = t1 + 1; + } + t1 = this._keys; + if (typeof t1 !== 'object' || t1 === null || (t1.constructor !== Array || !!t1.immutable$list) && !t1.is$JavaScriptIndexingBehavior()) + return this.operator$indexSet$2$bailout(4, key, value, t1, index); + t3 = t1.length; + if (index < 0 || index >= t3) + throw $.ioore(index); + t1[index] = key; + t1 = this._values; + if (typeof t1 !== 'object' || t1 === null || (t1.constructor !== Array || !!t1.immutable$list) && !t1.is$JavaScriptIndexingBehavior()) + return this.operator$indexSet$2$bailout(5, value, t1, index, 0); + var t5 = t1.length; + if (index < 0 || index >= t5) + throw $.ioore(index); + t1[index] = value; +}, + operator$indexSet$2$bailout: function(state, env0, env1, env2, env3) { + switch (state) { + case 1: + var key = env0; + var value = env1; + index = env2; + t1 = env3; + break; + case 2: + key = env0; + value = env1; + index = env2; + t1 = env3; + break; + case 3: + key = env0; + value = env1; + t1 = env2; + index = env3; + break; + case 4: + key = env0; + value = env1; + t1 = env2; + index = env3; + break; + case 5: + value = env0; + t1 = env1; + index = env2; + break; + } + switch (state) { + case 0: + this._ensureCapacity$0(); + var index = this._probeForAdding$1(key); + var t1 = this._keys; + case 1: + state = 0; + case 2: + if (state === 2 || state === 0 && !($.index(t1, index) == null)) + switch (state) { + case 0: + t1 = this._keys; + case 2: + state = 0; + var t3 = $.index(t1, index) === $.CTC6; + t1 = t3; + } + else + t1 = true; + case 3: + if (state === 3 || state === 0 && t1) + switch (state) { + case 0: + t1 = this._numberOfEntries; + case 3: + state = 0; + this._numberOfEntries = $.add(t1, 1); + } + t1 = this._keys; + case 4: + state = 0; + $.indexSet(t1, index, key); + t1 = this._values; + case 5: + state = 0; + $.indexSet(t1, index, value); + } +}, clear$0: function() { this._numberOfEntries = 0; this._numberOfDeleted = 0; var length$ = $.get$length(this._keys); - if (typeof length$ !== 'number') return this.clear$0$bailout(1, length$); + if (typeof length$ !== 'number') + return this.clear$0$bailout(1, length$); for (var i = 0; i < length$; ++i) { $.indexSet(this._keys, i, null); $.indexSet(this._values, i, null); } - }, +}, clear$0$bailout: function(state, length$) { for (var i = 0; $.ltB(i, length$); ++i) { $.indexSet(this._keys, i, null); $.indexSet(this._values, i, null); } - }, +}, _grow$1: function(newCapacity) { var capacity = $.get$length(this._keys); - if (typeof capacity !== 'number') return this._grow$1$bailout(1, newCapacity, capacity, 0, 0); + if (typeof capacity !== 'number') + return this._grow$1$bailout(1, newCapacity, capacity, 0, 0); this._loadLimit = $.HashMapImplementation__computeLoadLimit(newCapacity); var oldKeys = this._keys; - if (typeof oldKeys !== 'string' && (typeof oldKeys !== 'object' || oldKeys === null || (oldKeys.constructor !== Array && !oldKeys.is$JavaScriptIndexingBehavior()))) return this._grow$1$bailout(2, newCapacity, oldKeys, capacity, 0); + if (typeof oldKeys !== 'string' && (typeof oldKeys !== 'object' || oldKeys === null || oldKeys.constructor !== Array && !oldKeys.is$JavaScriptIndexingBehavior())) + return this._grow$1$bailout(2, newCapacity, oldKeys, capacity, 0); var oldValues = this._values; - if (typeof oldValues !== 'string' && (typeof oldValues !== 'object' || oldValues === null || (oldValues.constructor !== Array && !oldValues.is$JavaScriptIndexingBehavior()))) return this._grow$1$bailout(3, newCapacity, oldKeys, oldValues, capacity); + if (typeof oldValues !== 'string' && (typeof oldValues !== 'object' || oldValues === null || oldValues.constructor !== Array && !oldValues.is$JavaScriptIndexingBehavior())) + return this._grow$1$bailout(3, newCapacity, oldKeys, oldValues, capacity); this._keys = $.ListFactory_List(newCapacity); var t4 = $.ListFactory_List(newCapacity); - $.setRuntimeTypeInfo(t4, ({E: 'V'})); + $.setRuntimeTypeInfo(t4, {E: 'V'}); this._values = t4; for (var i = 0; i < capacity; ++i) { var t1 = oldKeys.length; - if (i < 0 || i >= t1) throw $.ioore(i); + if (i < 0 || i >= t1) + throw $.ioore(i); var key = oldKeys[i]; - if (key == null || key === $.CTC5) continue; + if (key == null || key === $.CTC6) + continue; t1 = oldValues.length; - if (i < 0 || i >= t1) throw $.ioore(i); + if (i < 0 || i >= t1) + throw $.ioore(i); var value = oldValues[i]; var newIndex = this._probeForAdding$1(key); $.indexSet(this._keys, newIndex, key); $.indexSet(this._values, newIndex, value); } this._numberOfDeleted = 0; - }, +}, _grow$1$bailout: function(state, env0, env1, env2, env3) { switch (state) { case 1: @@ -143,11 +374,12 @@ $$.HashMapImplementation = {"": state = 0; this._keys = $.ListFactory_List(newCapacity); var t4 = $.ListFactory_List(newCapacity); - $.setRuntimeTypeInfo(t4, ({E: 'V'})); + $.setRuntimeTypeInfo(t4, {E: 'V'}); this._values = t4; for (var i = 0; $.ltB(i, capacity); ++i) { var key = $.index(oldKeys, i); - if (key == null || key === $.CTC5) continue; + if (key == null || key === $.CTC6) + continue; var value = $.index(oldValues, i); var newIndex = this._probeForAdding$1(key); $.indexSet(this._keys, newIndex, key); @@ -155,7 +387,7 @@ $$.HashMapImplementation = {"": } this._numberOfDeleted = 0; } - }, +}, _ensureCapacity$0: function() { var newNumberOfEntries = $.add(this._numberOfEntries, 1); if ($.geB(newNumberOfEntries, this._loadLimit)) { @@ -163,40 +395,49 @@ $$.HashMapImplementation = {"": return; } var numberOfFree = $.sub($.sub($.get$length(this._keys), newNumberOfEntries), this._numberOfDeleted); - $.gtB(this._numberOfDeleted, numberOfFree) && this._grow$1($.get$length(this._keys)); - }, + if ($.gtB(this._numberOfDeleted, numberOfFree)) + this._grow$1($.get$length(this._keys)); +}, _probeForLookup$1: function(key) { var hash = $.HashMapImplementation__firstProbe($.hashCode(key), $.get$length(this._keys)); - for (var numberOfProbes = 1; true; ) { + for (var numberOfProbes = 1; true;) { var existingKey = $.index(this._keys, hash); - if (existingKey == null) return -1; - if ($.eqB(existingKey, key)) return hash; + if (existingKey == null) + return -1; + if ($.eqB(existingKey, key)) + return hash; var numberOfProbes0 = numberOfProbes + 1; hash = $.HashMapImplementation__nextProbe(hash, numberOfProbes, $.get$length(this._keys)); numberOfProbes = numberOfProbes0; } - }, +}, _probeForAdding$1: function(key) { var hash = $.HashMapImplementation__firstProbe($.hashCode(key), $.get$length(this._keys)); - if (hash !== (hash | 0)) return this._probeForAdding$1$bailout(1, key, hash, 0, 0, 0); - for (var numberOfProbes = 1, insertionIndex = -1; true; ) { + if (hash !== (hash | 0)) + return this._probeForAdding$1$bailout(1, key, hash, 0, 0, 0); + for (var numberOfProbes = 1, insertionIndex = -1; true;) { var t1 = this._keys; - if (typeof t1 !== 'string' && (typeof t1 !== 'object' || t1 === null || (t1.constructor !== Array && !t1.is$JavaScriptIndexingBehavior()))) return this._probeForAdding$1$bailout(2, numberOfProbes, hash, key, insertionIndex, t1); + if (typeof t1 !== 'string' && (typeof t1 !== 'object' || t1 === null || t1.constructor !== Array && !t1.is$JavaScriptIndexingBehavior())) + return this._probeForAdding$1$bailout(2, numberOfProbes, hash, key, insertionIndex, t1); var t3 = t1.length; - if (hash < 0 || hash >= t3) throw $.ioore(hash); + if (hash < 0 || hash >= t3) + throw $.ioore(hash); var existingKey = t1[hash]; if (existingKey == null) { - if (insertionIndex < 0) return hash; + if (insertionIndex < 0) + return hash; return insertionIndex; - } - if ($.eqB(existingKey, key)) return hash; - if (insertionIndex < 0 && $.CTC5 === existingKey) insertionIndex = hash; + } else if ($.eqB(existingKey, key)) + return hash; + else if (insertionIndex < 0 && $.CTC6 === existingKey) + insertionIndex = hash; var numberOfProbes0 = numberOfProbes + 1; hash = $.HashMapImplementation__nextProbe(hash, numberOfProbes, $.get$length(this._keys)); - if (hash !== (hash | 0)) return this._probeForAdding$1$bailout(3, key, numberOfProbes0, insertionIndex, hash, 0); + if (hash !== (hash | 0)) + return this._probeForAdding$1$bailout(3, key, numberOfProbes0, insertionIndex, hash, 0); numberOfProbes = numberOfProbes0; } - }, +}, _probeForAdding$1$bailout: function(state, env0, env1, env2, env3, env4) { switch (state) { case 1: @@ -225,38 +466,41 @@ $$.HashMapImplementation = {"": var numberOfProbes = 1; var insertionIndex = -1; default: - L0: while (true) { - switch (state) { - case 0: - if (!true) break L0; - var t1 = this._keys; - case 2: - state = 0; - var existingKey = $.index(t1, hash); - if (existingKey == null) { - if ($.ltB(insertionIndex, 0)) return hash; - return insertionIndex; - } - if ($.eqB(existingKey, key)) return hash; - if ($.ltB(insertionIndex, 0) && $.CTC5 === existingKey) insertionIndex = hash; - var numberOfProbes0 = numberOfProbes + 1; - hash = $.HashMapImplementation__nextProbe(hash, numberOfProbes, $.get$length(this._keys)); - case 3: - state = 0; - numberOfProbes = numberOfProbes0; - } - } + L0: + while (true) + switch (state) { + case 0: + if (!true) + break L0; + var t1 = this._keys; + case 2: + state = 0; + var existingKey = $.index(t1, hash); + if (existingKey == null) { + if ($.ltB(insertionIndex, 0)) + return hash; + return insertionIndex; + } else if ($.eqB(existingKey, key)) + return hash; + else if ($.ltB(insertionIndex, 0) && $.CTC6 === existingKey) + insertionIndex = hash; + var numberOfProbes0 = numberOfProbes + 1; + hash = $.HashMapImplementation__nextProbe(hash, numberOfProbes, $.get$length(this._keys)); + case 3: + state = 0; + numberOfProbes = numberOfProbes0; + } } - }, +}, HashMapImplementation$0: function() { this._numberOfEntries = 0; this._numberOfDeleted = 0; this._loadLimit = $.HashMapImplementation__computeLoadLimit(8); this._keys = $.ListFactory_List(8); var t1 = $.ListFactory_List(8); - $.setRuntimeTypeInfo(t1, ({E: 'V'})); + $.setRuntimeTypeInfo(t1, {E: 'V'}); this._values = t1; - }, +}, is$Map: function() { return true; } }; @@ -265,41 +509,51 @@ $$.HashSetImplementation = {"": super: "Object", toString$0: function() { return $.Collections_collectionToString(this); - }, +}, iterator$0: function() { var t1 = $.HashSetIterator$(this); - $.setRuntimeTypeInfo(t1, ({E: 'E'})); + $.setRuntimeTypeInfo(t1, {E: 'E'}); return t1; - }, +}, get$length: function() { return $.get$length(this._backingMap); - }, +}, isEmpty$0: function() { return $.isEmpty(this._backingMap); - }, +}, forEach$1: function(f) { $.forEach(this._backingMap, new $.HashSetImplementation_forEach__(f)); - }, +}, + remove$1: function(value) { + var t1 = this._backingMap; + if (t1.containsKey$1(value) !== true) + return false; + t1.remove$1(value); + return true; +}, contains$1: function(value) { return this._backingMap.containsKey$1(value); - }, +}, add$1: function(value) { var t1 = this._backingMap; - if (typeof t1 !== 'object' || t1 === null || ((t1.constructor !== Array || !!t1.immutable$list) && !t1.is$JavaScriptIndexingBehavior())) return this.add$1$bailout(1, t1, value); - if (value !== (value | 0)) throw $.iae(value); + if (typeof t1 !== 'object' || t1 === null || (t1.constructor !== Array || !!t1.immutable$list) && !t1.is$JavaScriptIndexingBehavior()) + return this.add$1$bailout(1, t1, value); + if (value !== (value | 0)) + throw $.iae(value); var t3 = t1.length; - if (value < 0 || value >= t3) throw $.ioore(value); + if (value < 0 || value >= t3) + throw $.ioore(value); t1[value] = value; - }, +}, add$1$bailout: function(state, t1, value) { $.indexSet(t1, value, value); - }, +}, clear$0: function() { $.clear(this._backingMap); - }, +}, HashSetImplementation$0: function() { this._backingMap = $.HashMapImplementation$(); - }, +}, is$Collection: function() { return true; } }; @@ -308,66 +562,82 @@ $$.HashSetIterator = {"": super: "Object", _advance$0: function() { var t1 = this._entries; - if (typeof t1 !== 'string' && (typeof t1 !== 'object' || t1 === null || (t1.constructor !== Array && !t1.is$JavaScriptIndexingBehavior()))) return this._advance$0$bailout(1, t1); + if (typeof t1 !== 'string' && (typeof t1 !== 'object' || t1 === null || t1.constructor !== Array && !t1.is$JavaScriptIndexingBehavior())) + return this._advance$0$bailout(1, t1); var length$ = t1.length; var entry = null; do { var t2 = this._nextValidIndex + 1; this._nextValidIndex = t2; - if (t2 >= length$) break; + if (t2 >= length$) + break; t2 = this._nextValidIndex; - if (t2 !== (t2 | 0)) throw $.iae(t2); + if (t2 !== (t2 | 0)) + throw $.iae(t2); var t3 = t1.length; - if (t2 < 0 || t2 >= t3) throw $.ioore(t2); + if (t2 < 0 || t2 >= t3) + throw $.ioore(t2); entry = t1[t2]; - } while ((entry == null || entry === $.CTC5)); - }, + } while (entry == null || entry === $.CTC6); +}, _advance$0$bailout: function(state, t1) { var length$ = $.get$length(t1); var entry = null; do { var t2 = this._nextValidIndex + 1; this._nextValidIndex = t2; - if ($.geB(t2, length$)) break; + if ($.geB(t2, length$)) + break; entry = $.index(t1, this._nextValidIndex); - } while ((entry == null || entry === $.CTC5)); - }, + } while (entry == null || entry === $.CTC6); +}, next$0: function() { - if (this.hasNext$0() !== true) throw $.captureStackTrace($.CTC1); + if (this.hasNext$0() !== true) + throw $.captureStackTrace($.CTC1); var t1 = this._entries; - if (typeof t1 !== 'string' && (typeof t1 !== 'object' || t1 === null || (t1.constructor !== Array && !t1.is$JavaScriptIndexingBehavior()))) return this.next$0$bailout(1, t1); + if (typeof t1 !== 'string' && (typeof t1 !== 'object' || t1 === null || t1.constructor !== Array && !t1.is$JavaScriptIndexingBehavior())) + return this.next$0$bailout(1, t1); var t3 = this._nextValidIndex; - if (t3 !== (t3 | 0)) throw $.iae(t3); + if (t3 !== (t3 | 0)) + throw $.iae(t3); var t4 = t1.length; - if (t3 < 0 || t3 >= t4) throw $.ioore(t3); + if (t3 < 0 || t3 >= t4) + throw $.ioore(t3); var res = t1[t3]; this._advance$0(); return res; - }, +}, next$0$bailout: function(state, t1) { var res = $.index(t1, this._nextValidIndex); this._advance$0(); return res; - }, +}, hasNext$0: function() { var t1 = this._nextValidIndex; var t2 = this._entries; - if (typeof t2 !== 'string' && (typeof t2 !== 'object' || t2 === null || (t2.constructor !== Array && !t2.is$JavaScriptIndexingBehavior()))) return this.hasNext$0$bailout(1, t1, t2); + if (typeof t2 !== 'string' && (typeof t2 !== 'object' || t2 === null || t2.constructor !== Array && !t2.is$JavaScriptIndexingBehavior())) + return this.hasNext$0$bailout(1, t1, t2); var t4 = t2.length; - if (t1 >= t4) return false; - if (t1 !== (t1 | 0)) throw $.iae(t1); - if (t1 < 0 || t1 >= t4) throw $.ioore(t1); - t2[t1] === $.CTC5 && this._advance$0(); + if (t1 >= t4) + return false; + if (t1 !== (t1 | 0)) + throw $.iae(t1); + if (t1 < 0 || t1 >= t4) + throw $.ioore(t1); + if (t2[t1] === $.CTC6) + this._advance$0(); return this._nextValidIndex < t2.length; - }, +}, hasNext$0$bailout: function(state, t1, t2) { - if ($.geB(t1, $.get$length(t2))) return false; - $.index(t2, this._nextValidIndex) === $.CTC5 && this._advance$0(); + if ($.geB(t1, $.get$length(t2))) + return false; + if ($.index(t2, this._nextValidIndex) === $.CTC6) + this._advance$0(); return $.lt(this._nextValidIndex, $.get$length(t2)); - }, +}, HashSetIterator$1: function(set_) { this._advance$0(); - } +} }; $$._DeletedKeySentinel = {"": @@ -385,76 +655,90 @@ $$.LinkedHashMapImplementation = {"": super: "Object", toString$0: function() { return $.Maps_mapToString(this); - }, +}, clear$0: function() { $.clear(this._map); $.clear(this._list); - }, +}, isEmpty$0: function() { return $.eq($.get$length(this), 0); - }, +}, get$length: function() { return $.get$length(this._map); - }, +}, containsKey$1: function(key) { return this._map.containsKey$1(key); - }, +}, forEach$1: function(f) { $.forEach(this._list, new $.LinkedHashMapImplementation_forEach__(f)); - }, +}, getValues$0: function() { - var t1 = ({}); + var t1 = {}; var list = $.ListFactory_List($.get$length(this)); - $.setRuntimeTypeInfo(list, ({E: 'V'})); + $.setRuntimeTypeInfo(list, {E: 'V'}); t1.index_1 = 0; $.forEach(this._list, new $.LinkedHashMapImplementation_getValues__(list, t1)); return list; - }, +}, getKeys$0: function() { - var t1 = ({}); + var t1 = {}; var list = $.ListFactory_List($.get$length(this)); - $.setRuntimeTypeInfo(list, ({E: 'K'})); + $.setRuntimeTypeInfo(list, {E: 'K'}); t1.index_1 = 0; $.forEach(this._list, new $.LinkedHashMapImplementation_getKeys__(list, t1)); return list; - }, +}, + remove$1: function(key) { + var entry = this._map.remove$1(key); + if (entry == null) + return; + entry.remove$0(); + return entry.get$element().get$value(); +}, operator$index$1: function(key) { var entry = $.index(this._map, key); - if (entry == null) return; + if (entry == null) + return; return entry.get$element().get$value(); - }, +}, operator$indexSet$2: function(key, value) { var t1 = this._map; - if (typeof t1 !== 'object' || t1 === null || ((t1.constructor !== Array || !!t1.immutable$list) && !t1.is$JavaScriptIndexingBehavior())) return this.operator$indexSet$2$bailout(1, key, value, t1); + if (typeof t1 !== 'object' || t1 === null || (t1.constructor !== Array || !!t1.immutable$list) && !t1.is$JavaScriptIndexingBehavior()) + return this.operator$indexSet$2$bailout(1, key, value, t1); if (t1.containsKey$1(key) === true) { - if (key !== (key | 0)) throw $.iae(key); + if (key !== (key | 0)) + throw $.iae(key); var t2 = t1.length; - if (key < 0 || key >= t2) throw $.ioore(key); + if (key < 0 || key >= t2) + throw $.ioore(key); t1[key].get$element().set$value(value); } else { t2 = this._list; $.addLast(t2, $.KeyValuePair$(key, value)); t2 = t2.lastEntry$0(); - if (key !== (key | 0)) throw $.iae(key); + if (key !== (key | 0)) + throw $.iae(key); var t3 = t1.length; - if (key < 0 || key >= t3) throw $.ioore(key); + if (key < 0 || key >= t3) + throw $.ioore(key); t1[key] = t2; } - }, +}, operator$indexSet$2$bailout: function(state, key, value, t1) { - if (t1.containsKey$1(key) === true) $.index(t1, key).get$element().set$value(value); + if (t1.containsKey$1(key) === true) + $.index(t1, key).get$element().set$value(value); else { var t2 = this._list; $.addLast(t2, $.KeyValuePair$(key, value)); $.indexSet(t1, key, t2.lastEntry$0()); } - }, +}, LinkedHashMapImplementation$0: function() { this._map = $.HashMapImplementation$(); var t1 = $.DoubleLinkedQueue$(); - $.setRuntimeTypeInfo(t1, ({E: 'KeyValuePair'})); + $.setRuntimeTypeInfo(t1, {E: 'KeyValuePair'}); this._list = t1; - }, +}, is$Map: function() { return true; } }; @@ -463,13 +747,13 @@ $$.DoubleLinkedQueueEntry = {"": super: "Object", get$element: function() { return this._element; - }, +}, previousEntry$0: function() { return this._previous._asNonSentinelEntry$0(); - }, +}, _asNonSentinelEntry$0: function() { return this; - }, +}, remove$0: function() { var t1 = this._next; this._previous.set$_next(t1); @@ -478,38 +762,38 @@ $$.DoubleLinkedQueueEntry = {"": this._next = null; this._previous = null; return this._element; - }, +}, prepend$1: function(e) { var t1 = $.DoubleLinkedQueueEntry$(e); - $.setRuntimeTypeInfo(t1, ({E: 'E'})); + $.setRuntimeTypeInfo(t1, {E: 'E'}); t1._link$2(this._previous, this); - }, +}, _link$2: function(p, n) { this._next = n; this._previous = p; - p._next = this; - n._previous = this; - }, + p.set$_next(this); + n.set$_previous(this); +}, DoubleLinkedQueueEntry$1: function(e) { this._element = e; - } +} }; $$._DoubleLinkedQueueEntrySentinel = {"": ["_element", "_next", "_previous"], super: "DoubleLinkedQueueEntry", get$element: function() { - throw $.captureStackTrace($.CTC7); - }, + throw $.captureStackTrace($.CTC8); +}, _asNonSentinelEntry$0: function() { return; - }, +}, remove$0: function() { - throw $.captureStackTrace($.CTC7); - }, + throw $.captureStackTrace($.CTC8); +}, _DoubleLinkedQueueEntrySentinel$0: function() { this._link$2(this, this); - } +} }; $$.DoubleLinkedQueue = {"": @@ -517,57 +801,57 @@ $$.DoubleLinkedQueue = {"": super: "Object", toString$0: function() { return $.Collections_collectionToString(this); - }, +}, iterator$0: function() { var t1 = $._DoubleLinkedQueueIterator$(this._sentinel); - $.setRuntimeTypeInfo(t1, ({E: 'E'})); + $.setRuntimeTypeInfo(t1, {E: 'E'}); return t1; - }, +}, forEach$1: function(f) { var t1 = this._sentinel; var entry = t1.get$_next(); - for (; !(entry == null ? t1 == null : entry === t1); ) { + for (; !(entry == null ? t1 == null : entry === t1);) { var nextEntry = entry.get$_next(); - f.$call$1(entry.get$_element()); + f.call$1(entry.get$_element()); entry = nextEntry; } - }, +}, clear$0: function() { var t1 = this._sentinel; t1.set$_next(t1); t1.set$_previous(t1); - }, +}, isEmpty$0: function() { var t1 = this._sentinel; var t2 = t1.get$_next(); return t2 == null ? t1 == null : t2 === t1; - }, +}, get$length: function() { - var t1 = ({}); + var t1 = {}; t1.counter_1 = 0; this.forEach$1(new $.DoubleLinkedQueue_length__(t1)); return t1.counter_1; - }, +}, lastEntry$0: function() { return this._sentinel.previousEntry$0(); - }, +}, removeFirst$0: function() { return this._sentinel.get$_next().remove$0(); - }, +}, removeLast$0: function() { return this._sentinel.get$_previous().remove$0(); - }, +}, add$1: function(value) { this.addLast$1(value); - }, +}, addLast$1: function(value) { this._sentinel.prepend$1(value); - }, +}, DoubleLinkedQueue$0: function() { var t1 = $._DoubleLinkedQueueEntrySentinel$(); - $.setRuntimeTypeInfo(t1, ({E: 'E'})); + $.setRuntimeTypeInfo(t1, {E: 'E'}); this._sentinel = t1; - }, +}, is$Collection: function() { return true; } }; @@ -575,49 +859,55 @@ $$._DoubleLinkedQueueIterator = {"": ["_currentEntry", "_sentinel"], super: "Object", next$0: function() { - if (this.hasNext$0() !== true) throw $.captureStackTrace($.CTC1); + if (this.hasNext$0() !== true) + throw $.captureStackTrace($.CTC1); this._currentEntry = this._currentEntry.get$_next(); return this._currentEntry.get$element(); - }, +}, hasNext$0: function() { var t1 = this._currentEntry.get$_next(); var t2 = this._sentinel; return !(t1 == null ? t2 == null : t1 === t2); - }, +}, _DoubleLinkedQueueIterator$1: function(_sentinel) { this._currentEntry = this._sentinel; - } +} }; $$.StringBufferImpl = {"": ["_length", "_buffer"], super: "Object", toString$0: function() { - if ($.get$length(this._buffer) === 0) return ''; - if ($.get$length(this._buffer) === 1) return $.index(this._buffer, 0); + if ($.get$length(this._buffer) === 0) + return ''; + if ($.get$length(this._buffer) === 1) + return $.index(this._buffer, 0); var result = $.StringBase_concatAll(this._buffer); $.clear(this._buffer); $.add$1(this._buffer, result); return result; - }, +}, clear$0: function() { var t1 = $.ListFactory_List(null); - $.setRuntimeTypeInfo(t1, ({E: 'String'})); + $.setRuntimeTypeInfo(t1, {E: 'String'}); this._buffer = t1; this._length = 0; return this; - }, +}, add$1: function(obj) { var str = $.toString(obj); - if (str == null || $.isEmpty(str) === true) return this; + if (str == null || $.isEmpty(str) === true) + return this; $.add$1(this._buffer, str); var t1 = this._length; - if (typeof t1 !== 'number') return this.add$1$bailout(1, str, t1); + if (typeof t1 !== 'number') + return this.add$1$bailout(1, str, t1); var t3 = $.get$length(str); - if (typeof t3 !== 'number') return this.add$1$bailout(2, t1, t3); + if (typeof t3 !== 'number') + return this.add$1$bailout(2, t1, t3); this._length = t1 + t3; return this; - }, +}, add$1$bailout: function(state, env0, env1) { switch (state) { case 1: @@ -632,7 +922,8 @@ $$.StringBufferImpl = {"": switch (state) { case 0: var str = $.toString(obj); - if (str == null || $.isEmpty(str) === true) return this; + if (str == null || $.isEmpty(str) === true) + return this; $.add$1(this._buffer, str); var t1 = this._length; case 1: @@ -643,17 +934,17 @@ $$.StringBufferImpl = {"": this._length = $.add(t1, t3); return this; } - }, +}, isEmpty$0: function() { return this._length === 0; - }, +}, get$length: function() { return this._length; - }, +}, StringBufferImpl$1: function(content$) { this.clear$0(); this.add$1(content$); - } +} }; $$.JSSyntaxRegExp = {"": @@ -662,20 +953,24 @@ $$.JSSyntaxRegExp = {"": allMatches$1: function(str) { $.checkString(str); return $._AllMatchesIterable$(this, str); - }, +}, hasMatch$1: function(str) { return $.regExpTest(this, $.checkString(str)); - }, +}, firstMatch$1: function(str) { var m = $.regExpExec(this, $.checkString(str)); - if (m == null) return; + if (m == null) + return; var matchStart = $.regExpMatchStart(m); - var matchEnd = $.add(matchStart, $.get$length($.index(m, 0))); + var t1 = $.get$length($.index(m, 0)); + if (typeof t1 !== 'number') + throw $.iae(t1); + var matchEnd = matchStart + t1; return $.MatchImplementation$(this.pattern, str, matchStart, matchEnd, m); - }, +}, JSSyntaxRegExp$_globalVersionOf$1: function(other) { $.regExpAttachGlobalNative(this); - }, +}, is$JSSyntaxRegExp: true }; @@ -684,13 +979,13 @@ $$.MatchImplementation = {"": super: "Object", operator$index$1: function(index) { return this.group$1(index); - }, +}, group$1: function(index) { return $.index(this._groups, index); - }, +}, start$0: function() { return this._lib0_start; - } +} }; $$._AllMatchesIterable = {"": @@ -698,90 +993,31 @@ $$._AllMatchesIterable = {"": super: "Object", iterator$0: function() { return $._AllMatchesIterator$(this._re, this._str); - } +} }; $$._AllMatchesIterator = {"": ["_done", "_next=", "_str", "_re"], super: "Object", hasNext$0: function() { - if (this._done === true) return false; - if (!(this._next == null)) return true; + if (this._done === true) + return false; + else if (!(this._next == null)) + return true; this._next = this._re.firstMatch$1(this._str); if (this._next == null) { this._done = true; return false; - } - return true; - }, + } else + return true; +}, next$0: function() { - if (this.hasNext$0() !== true) throw $.captureStackTrace($.CTC1); + if (this.hasNext$0() !== true) + throw $.captureStackTrace($.CTC1); var next = this._next; this._next = null; return next; - } -}; - -$$.ListIterator = {"": - ["list", "i"], - super: "Object", - next$0: function() { - if (this.hasNext$0() !== true) throw $.captureStackTrace($.NoMoreElementsException$()); - var value = (this.list[this.i]); - var t1 = this.i; - if (typeof t1 !== 'number') return this.next$0$bailout(1, t1, value); - this.i = t1 + 1; - return value; - }, - next$0$bailout: function(state, t1, value) { - this.i = $.add(t1, 1); - return value; - }, - hasNext$0: function() { - var t1 = this.i; - if (typeof t1 !== 'number') return this.hasNext$0$bailout(1, t1); - return t1 < (this.list.length); - }, - hasNext$0$bailout: function(state, t1) { - return $.lt(t1, (this.list.length)); - } -}; - -$$.StackTrace = {"": - ["stack"], - super: "Object", - toString$0: function() { - var t1 = this.stack; - return !(t1 == null) ? t1 : ''; - } -}; - -$$.Closure = {"": - [], - super: "Object", - toString$0: function() { - return 'Closure'; - } -}; - -$$.MetaInfo = {"": - ["set?", "tags", "tag?"], - super: "Object" -}; - -$$.StringMatch = {"": - ["pattern?", "str", "_start"], - super: "Object", - group$1: function(group_) { - if (!$.eqB(group_, 0)) throw $.captureStackTrace($.IndexOutOfRangeException$(group_)); - return this.pattern; - }, - operator$index$1: function(g) { - return this.group$1(g); - }, - start$0: function() { - return this._start; - } +} }; $$.Object = {"": @@ -789,7 +1025,7 @@ $$.Object = {"": super: "", toString$0: function() { return $.Primitives_objectToString(this); - } +} }; $$.IndexOutOfRangeException = {"": @@ -797,7 +1033,8 @@ $$.IndexOutOfRangeException = {"": super: "Object", toString$0: function() { return 'IndexOutOfRangeException: ' + $.S(this._value); - } +}, + is$Exception: true }; $$.NoSuchMethodException = {"": @@ -806,38 +1043,44 @@ $$.NoSuchMethodException = {"": toString$0: function() { var sb = $.StringBufferImpl$(''); var t1 = this._arguments; - if (typeof t1 !== 'string' && (typeof t1 !== 'object' || t1 === null || (t1.constructor !== Array && !t1.is$JavaScriptIndexingBehavior()))) return this.toString$0$bailout(1, sb, t1); + if (typeof t1 !== 'string' && (typeof t1 !== 'object' || t1 === null || t1.constructor !== Array && !t1.is$JavaScriptIndexingBehavior())) + return this.toString$0$bailout(1, t1, sb); var i = 0; for (; i < t1.length; ++i) { - i > 0 && sb.add$1(', '); + if (i > 0) + sb.add$1(', '); var t2 = t1.length; - if (i < 0 || i >= t2) throw $.ioore(i); + if (i < 0 || i >= t2) + throw $.ioore(i); sb.add$1(t1[i]); } t1 = this._existingArgumentNames; - if (typeof t1 !== 'string' && (typeof t1 !== 'object' || t1 === null || (t1.constructor !== Array && !t1.is$JavaScriptIndexingBehavior()))) return this.toString$0$bailout(2, t1, sb); + if (typeof t1 !== 'string' && (typeof t1 !== 'object' || t1 === null || t1.constructor !== Array && !t1.is$JavaScriptIndexingBehavior())) + return this.toString$0$bailout(2, sb, t1); var actualParameters = sb.toString$0(); sb = $.StringBufferImpl$(''); for (i = 0; i < t1.length; ++i) { - i > 0 && sb.add$1(', '); + if (i > 0) + sb.add$1(', '); t2 = t1.length; - if (i < 0 || i >= t2) throw $.ioore(i); + if (i < 0 || i >= t2) + throw $.ioore(i); sb.add$1(t1[i]); } var formalParameters = sb.toString$0(); t1 = this._functionName; return 'NoSuchMethodException: incorrect number of arguments passed to method named \'' + $.S(t1) + '\'\nReceiver: ' + $.S(this._receiver) + '\n' + 'Tried calling: ' + $.S(t1) + '(' + $.S(actualParameters) + ')\n' + 'Found: ' + $.S(t1) + '(' + $.S(formalParameters) + ')'; - }, +}, toString$0$bailout: function(state, env0, env1) { switch (state) { case 1: - sb = env0; - t1 = env1; - break; - case 2: t1 = env0; sb = env1; break; + case 2: + sb = env0; + t1 = env1; + break; } switch (state) { case 0: @@ -847,24 +1090,30 @@ $$.NoSuchMethodException = {"": state = 0; var i = 0; for (; $.ltB(i, $.get$length(t1)); ++i) { - i > 0 && sb.add$1(', '); + if (i > 0) + sb.add$1(', '); sb.add$1($.index(t1, i)); } t1 = this._existingArgumentNames; case 2: state = 0; - if (t1 == null) return 'NoSuchMethodException : method not found: \'' + $.S(this._functionName) + '\'\n' + 'Receiver: ' + $.S(this._receiver) + '\n' + 'Arguments: [' + $.S(sb) + ']'; - var actualParameters = sb.toString$0(); - sb = $.StringBufferImpl$(''); - for (i = 0; $.ltB(i, $.get$length(t1)); ++i) { - i > 0 && sb.add$1(', '); - sb.add$1($.index(t1, i)); + if (t1 == null) + return 'NoSuchMethodException : method not found: \'' + $.S(this._functionName) + '\'\n' + 'Receiver: ' + $.S(this._receiver) + '\n' + 'Arguments: [' + $.S(sb) + ']'; + else { + var actualParameters = sb.toString$0(); + sb = $.StringBufferImpl$(''); + for (i = 0; $.ltB(i, $.get$length(t1)); ++i) { + if (i > 0) + sb.add$1(', '); + sb.add$1($.index(t1, i)); + } + var formalParameters = sb.toString$0(); + t1 = this._functionName; + return 'NoSuchMethodException: incorrect number of arguments passed to method named \'' + $.S(t1) + '\'\nReceiver: ' + $.S(this._receiver) + '\n' + 'Tried calling: ' + $.S(t1) + '(' + $.S(actualParameters) + ')\n' + 'Found: ' + $.S(t1) + '(' + $.S(formalParameters) + ')'; } - var formalParameters = sb.toString$0(); - t1 = this._functionName; - return 'NoSuchMethodException: incorrect number of arguments passed to method named \'' + $.S(t1) + '\'\nReceiver: ' + $.S(this._receiver) + '\n' + 'Tried calling: ' + $.S(t1) + '(' + $.S(actualParameters) + ')\n' + 'Found: ' + $.S(t1) + '(' + $.S(formalParameters) + ')'; } - } +}, + is$Exception: true }; $$.ObjectNotClosureException = {"": @@ -872,7 +1121,8 @@ $$.ObjectNotClosureException = {"": super: "Object", toString$0: function() { return 'Object is not closure'; - } +}, + is$Exception: true }; $$.IllegalArgumentException = {"": @@ -880,7 +1130,8 @@ $$.IllegalArgumentException = {"": super: "Object", toString$0: function() { return 'Illegal argument(s): ' + $.S(this._arg); - } +}, + is$Exception: true }; $$.StackOverflowException = {"": @@ -888,7 +1139,8 @@ $$.StackOverflowException = {"": super: "Object", toString$0: function() { return 'Stack Overflow'; - } +}, + is$Exception: true }; $$.FormatException = {"": @@ -896,7 +1148,8 @@ $$.FormatException = {"": super: "Object", toString$0: function() { return 'FormatException: ' + $.S(this.message); - } +}, + is$Exception: true }; $$.NullPointerException = {"": @@ -904,12 +1157,15 @@ $$.NullPointerException = {"": super: "Object", get$exceptionName: function() { return 'NullPointerException'; - }, +}, toString$0: function() { var t1 = this.functionName; - if (t1 == null) return this.get$exceptionName(); - return $.S(this.get$exceptionName()) + ' : method: \'' + $.S(t1) + '\'\n' + 'Receiver: null\n' + 'Arguments: ' + $.S(this.arguments); - } + if (t1 == null) + return this.get$exceptionName(); + else + return $.S(this.get$exceptionName()) + ' : method: \'' + $.S(t1) + '\'\n' + 'Receiver: null\n' + 'Arguments: ' + $.S(this.arguments); +}, + is$Exception: true }; $$.NoMoreElementsException = {"": @@ -917,7 +1173,8 @@ $$.NoMoreElementsException = {"": super: "Object", toString$0: function() { return 'NoMoreElementsException'; - } +}, + is$Exception: true }; $$.EmptyQueueException = {"": @@ -925,7 +1182,8 @@ $$.EmptyQueueException = {"": super: "Object", toString$0: function() { return 'EmptyQueueException'; - } +}, + is$Exception: true }; $$.UnsupportedOperationException = {"": @@ -933,7 +1191,8 @@ $$.UnsupportedOperationException = {"": super: "Object", toString$0: function() { return 'UnsupportedOperationException: ' + $.S(this._message); - } +}, + is$Exception: true }; $$.IllegalJSRegExpException = {"": @@ -941,7 +1200,100 @@ $$.IllegalJSRegExpException = {"": super: "Object", toString$0: function() { return 'IllegalJSRegExpException: \'' + $.S(this._pattern) + '\' \'' + $.S(this._errmsg) + '\''; - } +}, + is$Exception: true +}; + +$$.FutureNotCompleteException = {"": + [], + super: "Object", + toString$0: function() { + return 'Exception: future has not been completed'; +}, + is$Exception: true +}; + +$$.FutureAlreadyCompleteException = {"": + [], + super: "Object", + toString$0: function() { + return 'Exception: future already completed'; +}, + is$Exception: true +}; + +$$._Random = {"": + [], + super: "Object", + nextDouble$0: function() { + return Math.random(); +} +}; + +$$.ListIterator = {"": + ["list", "i"], + super: "Object", + next$0: function() { + if (this.hasNext$0() !== true) + throw $.captureStackTrace($.NoMoreElementsException$()); + var value = this.list[this.i]; + var t1 = this.i; + if (typeof t1 !== 'number') + return this.next$0$bailout(1, t1, value); + this.i = t1 + 1; + return value; +}, + next$0$bailout: function(state, t1, value) { + this.i = $.add(t1, 1); + return value; +}, + hasNext$0: function() { + var t1 = this.i; + if (typeof t1 !== 'number') + return this.hasNext$0$bailout(1, t1); + return t1 < this.list.length; +}, + hasNext$0$bailout: function(state, t1) { + return $.lt(t1, this.list.length); +} +}; + +$$.StackTrace = {"": + ["stack"], + super: "Object", + toString$0: function() { + var t1 = this.stack; + return !(t1 == null) ? t1 : ''; +} +}; + +$$.Closure = {"": + [], + super: "Object", + toString$0: function() { + return 'Closure'; +} +}; + +$$.MetaInfo = {"": + ["set?", "tags", "tag?"], + super: "Object" +}; + +$$.StringMatch = {"": + ["pattern?", "str", "_start"], + super: "Object", + group$1: function(group_) { + if (!$.eqB(group_, 0)) + throw $.captureStackTrace($.IndexOutOfRangeException$(group_)); + return this.pattern; +}, + operator$index$1: function(g) { + return this.group$1(g); +}, + start$0: function() { + return this._start; +} }; $$.Spirodraw = {"": @@ -960,11 +1312,11 @@ $$.Spirodraw = {"": } this.lastX = tx; this.lastY = ty; - }, +}, drawTip$3: function(wx, wy, theta) { var rot = $.eqB(this.r, 0) ? theta : $.div($.mul(theta, $.add(this.R, this.r)), this.r); - var tx = $.add(wx, $.mul(this.d, $.Math_cos(rot))); - var ty = $.sub(wy, $.mul(this.d, $.Math_sin(rot))); + var tx = $.add(wx, $.mul(this.d, $.cos(rot))); + var ty = $.sub(wy, $.mul(this.d, $.sin(rot))); if (this.animationEnabled === true) { var t1 = this.front; t1.beginPath$0(); @@ -978,11 +1330,11 @@ $$.Spirodraw = {"": t1.stroke$0(); } this.drawSegmentTo$2(tx, ty); - }, +}, drawWheel$1: function(theta) { - var wx = $.add(this.xc, $.mul($.add(this.R, this.r), $.Math_cos(theta))); - var wy = $.sub(this.yc, $.mul($.add(this.R, this.r), $.Math_sin(theta))); - if (this.animationEnabled === true) { + var wx = $.add(this.xc, $.mul($.add(this.R, this.r), $.cos(theta))); + var wy = $.sub(this.yc, $.mul($.add(this.R, this.r), $.sin(theta))); + if (this.animationEnabled === true) if ($.gtB(this.rUnits, 0)) { var t1 = this.front; t1.beginPath$0(); @@ -997,9 +1349,8 @@ $$.Spirodraw = {"": t1.closePath$0(); t1.stroke$0(); } - } this.drawTip$3(wx, wy, theta); - }, +}, drawFixed$0: function() { if (this.animationEnabled === true) { var t1 = this.front; @@ -1010,82 +1361,94 @@ $$.Spirodraw = {"": t1.closePath$0(); t1.stroke$0(); } - }, +}, lucky$0: function() { - var t1 = $.mul($.Math_random(), 9); + var rand = $.Random_Random(null); + var t1 = $.mul(rand.nextDouble$0(), 9); this.wheelRadiusSlider.set$valueAsNumber(t1); - t1 = $.mul($.Math_random(), 9); + t1 = $.mul(rand.nextDouble$0(), 9); this.penRadiusSlider.set$valueAsNumber(t1); - t1 = $.mul($.Math_random(), 9); - if (typeof t1 !== 'number') throw $.iae(t1); - ++t1; + t1 = $.mul(rand.nextDouble$0(), 9); + if (typeof t1 !== 'number') + throw $.iae(t1); + t1 = 1 + t1; this.penWidthSlider.set$valueAsNumber(t1); - t1 = this.colorPicker.getHexString$1($.mul($.Math_random(), 215)); + t1 = this.colorPicker.getHexString$1($.mul(rand.nextDouble$0(), 215)); this.colorPicker.set$selectedColor(t1); this.start$0(); - }, +}, clear$0: function() { this.stop$0(); this.back.clearRect$4(0, 0, this.width, this.height); this.refresh$0(); - }, +}, stop$0: function() { this.run = false; var t1 = this.front; t1.clearRect$4(0, 0, this.width, this.height); t1.drawImage$3(this.backCanvas, 0, 0); this.rad = 0.0; - }, +}, calcTurns$0: function() { - if ($.eqB(this.dUnits, 0) || $.eqB(this.rUnits, 0)) return 1; + if ($.eqB(this.dUnits, 0) || $.eqB(this.rUnits, 0)) + return 1; var ru = $.abs(this.rUnits); return $.toInt($.tdiv(ru, $.gcf($.add(this.RUnits, this.rUnits), ru))); - }, +}, start$0: function() { this.refresh$0(); this.rad = 0.0; this.run = true; $.window().webkitRequestAnimationFrame$1(this.get$animate()); - }, +}, animate$1: function(time) { if (this.run === true) { var t1 = this.rad; - if (typeof t1 !== 'number') return this.animate$1$bailout(1, t1, 0, 0); + if (typeof t1 !== 'number') + return this.animate$1$bailout(1, t1, 0, 0); var t3 = this.maxTurns; - if (typeof t3 !== 'number') return this.animate$1$bailout(2, t1, t3, 0); + if (typeof t3 !== 'number') + return this.animate$1$bailout(2, t3, t1, 0); var t5 = $.Spirodraw_PI2; - if (typeof t5 !== 'number') return this.animate$1$bailout(3, t1, t3, t5); + if (typeof t5 !== 'number') + return this.animate$1$bailout(3, t3, t5, t1); t1 = t1 <= t3 * t5; - } else t1 = false; + } else + t1 = false; if (t1) { t1 = this.rad; - if (typeof t1 !== 'number') return this.animate$1$bailout(4, t1, 0, 0); + if (typeof t1 !== 'number') + return this.animate$1$bailout(4, t1, 0, 0); t3 = this.stepSize; - if (typeof t3 !== 'number') return this.animate$1$bailout(5, t1, t3, 0); + if (typeof t3 !== 'number') + return this.animate$1$bailout(5, t1, t3, 0); this.rad = t1 + t3; this.drawFrame$1(this.rad); t5 = this.rad; - if (typeof t5 !== 'number') return this.animate$1$bailout(6, t5, 0, 0); + if (typeof t5 !== 'number') + return this.animate$1$bailout(6, t5, 0, 0); var t7 = $.Spirodraw_PI2; - if (typeof t7 !== 'number') return this.animate$1$bailout(7, t7, t5, 0); + if (typeof t7 !== 'number') + return this.animate$1$bailout(7, t7, t5, 0); var t9 = $.S($.toInt(t5 / t7)) + '/' + $.S(this.maxTurns); this.numTurns.set$text(t9); $.window().webkitRequestAnimationFrame$1(this.get$animate()); - } else this.stop$0(); - }, + } else + this.stop$0(); +}, animate$1$bailout: function(state, env0, env1, env2) { switch (state) { case 1: t1 = env0; break; case 2: - t1 = env0; - t3 = env1; + t3 = env0; + t1 = env1; break; case 3: - t1 = env0; - t3 = env1; - t5 = env2; + t3 = env0; + t5 = env1; + t1 = env2; break; case 4: t1 = env0; @@ -1105,7 +1468,7 @@ $$.Spirodraw = {"": switch (state) { case 0: default: - if (state == 1 || state == 2 || state == 3 || (state == 0 && this.run === true)) { + if (state === 3 || state === 2 || state === 1 || state === 0 && this.run === true) switch (state) { case 0: var t1 = this.rad; @@ -1119,14 +1482,13 @@ $$.Spirodraw = {"": state = 0; t1 = $.leB(t1, $.mul(t3, t5)); } - } else { + else t1 = false; - } case 4: case 5: case 6: case 7: - if (state == 4 || state == 5 || state == 6 || state == 7 || (state == 0 && t1)) { + if (state === 7 || state === 6 || state === 5 || state === 4 || state === 0 && t1) switch (state) { case 0: t1 = this.rad; @@ -1147,11 +1509,10 @@ $$.Spirodraw = {"": this.numTurns.set$text(t9); $.window().webkitRequestAnimationFrame$1(this.get$animate()); } - } else { + else this.stop$0(); - } } - }, +}, get$animate: function() { return new $.BoundClosure(this, 'animate$1'); }, drawFrame$1: function(theta) { if (this.animationEnabled === true) { @@ -1161,28 +1522,32 @@ $$.Spirodraw = {"": this.drawFixed$0(); } this.drawWheel$1(theta); - }, +}, calcStepSize$0: function() { return $.div($.mul($.div(this.speed, 100), this.maxTurns), this.numPoints); - }, +}, calcNumPoints$0: function() { - if ($.eqB(this.dUnits, 0) || $.eqB(this.rUnits, 0)) return 2; + if ($.eqB(this.dUnits, 0) || $.eqB(this.rUnits, 0)) + return 2; var gcf_ = $.gcf(this.RUnits, this.rUnits); var n = $.tdiv(this.RUnits, gcf_); var d_ = $.tdiv(this.rUnits, gcf_); - if ($.eqB($.mod(n, 2), 1)) return n; - if ($.eqB($.mod(d_, 2), 1)) return n; - return $.tdiv(n, 2); - }, + if ($.eqB($.mod(n, 2), 1)) + return n; + else if ($.eqB($.mod(d_, 2), 1)) + return n; + else + return $.tdiv(n, 2); +}, refresh$0: function() { this.stop$0(); this.lastY = 0; this.lastX = 0; - var pixelsPerUnit = $.div($.Math_min(this.height, this.width), 40); + var pixelsPerUnit = $.min(this.height, this.width) / 40; this.RUnits = $.toInt(this.fixedRadiusSlider.get$valueAsNumber()); this.R = $.mul(this.RUnits, pixelsPerUnit); this.rUnits = $.toInt(this.wheelRadiusSlider.get$valueAsNumber()); - this.r = $.mul($.div($.mul(this.rUnits, this.R), this.RUnits), $.Math_parseInt(this.inOrOut.get$value())); + this.r = $.mul($.div($.mul(this.rUnits, this.R), this.RUnits), $.parseInt(this.inOrOut.get$value())); this.dUnits = $.toInt(this.penRadiusSlider.get$valueAsNumber()); this.d = $.div($.mul(this.dUnits, this.R), this.RUnits); this.numPoints = this.calcNumPoints$0(); @@ -1192,19 +1557,19 @@ $$.Spirodraw = {"": this.numTurns.set$text(t1); this.penWidth = $.toInt(this.penWidthSlider.get$valueAsNumber()); this.drawFrame$1(0.0); - }, +}, onPenWidthChange$0: function() { this.penWidth = $.toInt(this.penWidthSlider.get$valueAsNumber()); this.drawFrame$1(this.rad); - }, +}, onSpeedChange$0: function() { this.speed = this.speedSlider.get$valueAsNumber(); this.stepSize = this.calcStepSize$0(); - }, +}, onColorChange$1: function(color) { this.penColor = color; this.drawFrame$1(this.rad); - }, +}, initControlPanel$0: function() { this.inOrOut.get$on().get$change().add$2(new $.Spirodraw_initControlPanel_anon(this), true); this.fixedRadiusSlider.get$on().get$change().add$2(new $.Spirodraw_initControlPanel_anon0(this), true); @@ -1219,7 +1584,7 @@ $$.Spirodraw = {"": t1.query$1('#stop').get$on().get$click().add$2(new $.Spirodraw_initControlPanel_anon7(this), true); t1.query$1('#clear').get$on().get$click().add$2(new $.Spirodraw_initControlPanel_anon8(this), true); t1.query$1('#lucky').get$on().get$click().add$2(new $.Spirodraw_initControlPanel_anon9(this), true); - }, +}, onResize$0: function() { this.height = $.window().get$innerHeight(); this.width = $.sub($.window().get$innerWidth(), 270); @@ -1234,11 +1599,11 @@ $$.Spirodraw = {"": t1.set$height(t2); t1.set$width(this.width); this.clear$0(); - }, +}, go$0: function() { this.onResize$0(); - }, - run$0: function() { return this.run.$call$0(); }, +}, + run$0: function() { return this.run.call$0(); }, Spirodraw$0: function() { this.doc = $.window().get$document(); var t1 = this.doc; @@ -1257,7 +1622,7 @@ $$.Spirodraw = {"": this.paletteElement = t1.query$1('#palette'); $.window().get$on().get$resize().add$2(new $.anon(this), true); this.initControlPanel$0(); - } +} }; $$.ColorPicker = {"": @@ -1268,16 +1633,22 @@ $$.ColorPicker = {"": var r = $.mod($.tdiv(i, 36), 6); var g = $.tdiv($.mod(i, 36), 6); var b = $.mod(i, 6); - if (r !== (r | 0)) throw $.iae(r); - if (r < 0 || r >= 6) throw $.ioore(r); + if (r !== (r | 0)) + throw $.iae(r); + if (r < 0 || r >= 6) + throw $.ioore(r); var t1 = '#' + $.S($.CTC2[r]); - if (g !== (g | 0)) throw $.iae(g); - if (g < 0 || g >= 6) throw $.ioore(g); + if (g !== (g | 0)) + throw $.iae(g); + if (g < 0 || g >= 6) + throw $.ioore(g); var t2 = t1 + $.S($.CTC2[g]); - if (b !== (b | 0)) throw $.iae(b); - if (b < 0 || b >= 6) throw $.ioore(b); + if (b !== (b | 0)) + throw $.iae(b); + if (b < 0 || b >= 6) + throw $.ioore(b); return t2 + $.S($.CTC2[b]); - }, +}, showSelected$0: function() { var t1 = this._selectedColor; var t2 = this.ctx; @@ -1286,18 +1657,17 @@ $$.ColorPicker = {"": t2.fillRect$4($.div(t1, 2), 0, $.div(t1, 2), 30); t2.set$fillStyle('white'); t2.fillRect$4(0, 0, $.div(t1, 2), 30); - }, +}, getColorIndex$2: function(x, y) { return $.add($.mul($.tdiv(y, 10), 18), $.tdiv(x, 10)); - }, +}, fireSelected$0: function() { - for (var t1 = $.iterator(this._listeners); t1.hasNext$0() === true; ) { - t1.next$0().$call$1(this._selectedColor); - } - }, + for (var t1 = $.iterator(this._listeners); t1.hasNext$0() === true;) + t1.next$0().call$1(this._selectedColor); +}, drawPalette$0: function() { - for (var t1 = this.ctx, r = 0, i = 0; r < 256; r += 51) { - for (var g = 0; g < 256; g += 51) { + for (var t1 = this.ctx, r = 0, i = 0; r < 256; r += 51) + for (var g = 0; g < 256; g += 51) for (var b = 0; b < 256; b += 51) { t1.set$fillStyle(this.getHexString$1(i)); var x = 10 * $.mod(i, 18); @@ -1305,45 +1675,45 @@ $$.ColorPicker = {"": t1.fillRect$4(x + 1, y + 1, 8, 8); ++i; } - } - } - }, +}, addHandlers$0: function() { var t1 = this.canvasElement; t1.get$on().get$mouseMove().add$2(new $.ColorPicker_addHandlers_anon(this), true); t1.get$on().get$mouseDown().add$2(new $.ColorPicker_addHandlers_anon0(this), true); - }, +}, addListener$1: function(listener) { $.add$1(this._listeners, listener); - }, +}, onMouseDown$1: function(event$) { event$.get$target(); event$.set$cancelBubble(true); var x = event$.get$offsetX(); var y = $.sub(event$.get$offsetY(), 40); - if ($.ltB(y, 0) || $.geB(x, this.width)) return; + if ($.ltB(y, 0) || $.geB(x, this.width)) + return; this.set$selectedColor(this.getHexString$1(this.getColorIndex$2(x, y))); - }, +}, onMouseMove$1: function(event$) { var x = event$.get$offsetX(); var y = $.sub(event$.get$offsetY(), 40); - if ($.ltB(y, 0) || $.geB(x, this.width)) return; + if ($.ltB(y, 0) || $.geB(x, this.width)) + return; var t1 = this.getHexString$1(this.getColorIndex$2(x, y)); var t2 = this.ctx; t2.set$fillStyle(t1); t2.fillRect$4(0, 0, $.div(this.width, 2), 30); - }, +}, set$selectedColor: function(color) { this._selectedColor = color; this.showSelected$0(); this.fireSelected$0(); - }, +}, ColorPicker$1: function(canvasElement) { this.ctx = this.canvasElement.get$context2d(); this.drawPalette$0(); this.addHandlers$0(); this.showSelected$0(); - } +} }; $$._AbstractWorkerEventsImpl = {"": @@ -1353,7 +1723,11 @@ $$._AbstractWorkerEventsImpl = {"": $$._AudioContextEventsImpl = {"": ["_ptr"], - super: "_EventsImpl" + super: "_EventsImpl", + get$complete: function() { + return this.operator$index$1('complete'); +}, + complete$1: function(arg0) { return this.get$complete().call$1(arg0); } }; $$._BatteryManagerEventsImpl = {"": @@ -1366,7 +1740,7 @@ $$._BodyElementEventsImpl = {"": super: "_ElementEventsImpl", get$resize: function() { return this.operator$index$1('resize'); - } +} }; $$._DOMApplicationCacheEventsImpl = {"": @@ -1384,20 +1758,20 @@ $$._DocumentEventsImpl = {"": super: "_ElementEventsImpl", get$reset: function() { return this.operator$index$1('reset'); - }, - reset$0: function() { return this.get$reset().$call$0(); }, +}, + reset$0: function() { return this.get$reset().call$0(); }, get$mouseMove: function() { return this.operator$index$1('mousemove'); - }, +}, get$mouseDown: function() { return this.operator$index$1('mousedown'); - }, +}, get$click: function() { return this.operator$index$1('click'); - }, +}, get$change: function() { return this.operator$index$1('change'); - } +} }; $$._ElementEventsImpl = {"": @@ -1405,20 +1779,20 @@ $$._ElementEventsImpl = {"": super: "_EventsImpl", get$reset: function() { return this.operator$index$1('reset'); - }, - reset$0: function() { return this.get$reset().$call$0(); }, +}, + reset$0: function() { return this.get$reset().call$0(); }, get$mouseMove: function() { return this.operator$index$1('mousemove'); - }, +}, get$mouseDown: function() { return this.operator$index$1('mousedown'); - }, +}, get$click: function() { return this.operator$index$1('click'); - }, +}, get$change: function() { return this.operator$index$1('change'); - } +} }; $$._EventSourceEventsImpl = {"": @@ -1431,19 +1805,29 @@ $$._EventsImpl = {"": super: "Object", operator$index$1: function(type) { return $._EventListenerListImpl$(this._ptr, type); - } +} }; $$._EventListenerListImpl = {"": ["_type", "_ptr"], super: "Object", + _remove$2: function(listener, useCapture) { + this._ptr.$dom_removeEventListener$3(this._type, listener, useCapture); +}, _add$2: function(listener, useCapture) { this._ptr.$dom_addEventListener$3(this._type, listener, useCapture); - }, +}, + remove$2: function(listener, useCapture) { + this._remove$2(listener, useCapture); + return this; +}, + remove$1: function(listener) { + return this.remove$2(listener,false) +}, add$2: function(listener, useCapture) { this._add$2(listener, useCapture); return this; - }, +}, add$1: function(listener) { return this.add$2(listener,false) } @@ -1464,7 +1848,17 @@ $$._FrameSetElementEventsImpl = {"": super: "_ElementEventsImpl", get$resize: function() { return this.operator$index$1('resize'); - } +} +}; + +$$._HttpRequestEventsImpl = {"": + ["_ptr"], + super: "_EventsImpl" +}; + +$$._HttpRequestUploadEventsImpl = {"": + ["_ptr"], + super: "_EventsImpl" }; $$._IDBDatabaseEventsImpl = {"": @@ -1472,6 +1866,11 @@ $$._IDBDatabaseEventsImpl = {"": super: "_EventsImpl" }; +$$._IDBOpenDBRequestEventsImpl = {"": + ["_ptr"], + super: "_IDBRequestEventsImpl" +}; + $$._IDBRequestEventsImpl = {"": ["_ptr"], super: "_EventsImpl" @@ -1479,7 +1878,11 @@ $$._IDBRequestEventsImpl = {"": $$._IDBTransactionEventsImpl = {"": ["_ptr"], - super: "_EventsImpl" + super: "_EventsImpl", + get$complete: function() { + return this.operator$index$1('complete'); +}, + complete$1: function(arg0) { return this.get$complete().call$1(arg0); } }; $$._IDBVersionChangeRequestEventsImpl = {"": @@ -1525,9 +1928,13 @@ $$._MessagePortEventsImpl = {"": $$._NotificationEventsImpl = {"": ["_ptr"], super: "_EventsImpl", + get$close: function() { + return this.operator$index$1('close'); +}, + close$0: function() { return this.get$close().call$0(); }, get$click: function() { return this.operator$index$1('click'); - } +} }; $$._PeerConnection00EventsImpl = {"": @@ -1540,23 +1947,23 @@ $$._SVGElementInstanceEventsImpl = {"": super: "_EventsImpl", get$resize: function() { return this.operator$index$1('resize'); - }, +}, get$reset: function() { return this.operator$index$1('reset'); - }, - reset$0: function() { return this.get$reset().$call$0(); }, +}, + reset$0: function() { return this.get$reset().call$0(); }, get$mouseMove: function() { return this.operator$index$1('mousemove'); - }, +}, get$mouseDown: function() { return this.operator$index$1('mousedown'); - }, +}, get$click: function() { return this.operator$index$1('click'); - }, +}, get$change: function() { return this.operator$index$1('change'); - } +} }; $$._SharedWorkerContextEventsImpl = {"": @@ -1569,8 +1976,8 @@ $$._SpeechRecognitionEventsImpl = {"": super: "_EventsImpl", get$start: function() { return this.operator$index$1('start'); - }, - start$0: function() { return this.get$start().$call$0(); } +}, + start$0: function() { return this.get$start().call$0(); } }; $$._TextTrackEventsImpl = {"": @@ -1590,7 +1997,11 @@ $$._TextTrackListEventsImpl = {"": $$._WebSocketEventsImpl = {"": ["_ptr"], - super: "_EventsImpl" + super: "_EventsImpl", + get$close: function() { + return this.operator$index$1('close'); +}, + close$0: function() { return this.get$close().call$0(); } }; $$._WindowEventsImpl = {"": @@ -1598,23 +2009,23 @@ $$._WindowEventsImpl = {"": super: "_EventsImpl", get$resize: function() { return this.operator$index$1('resize'); - }, +}, get$reset: function() { return this.operator$index$1('reset'); - }, - reset$0: function() { return this.get$reset().$call$0(); }, +}, + reset$0: function() { return this.get$reset().call$0(); }, get$mouseMove: function() { return this.operator$index$1('mousemove'); - }, +}, get$mouseDown: function() { return this.operator$index$1('mousedown'); - }, +}, get$click: function() { return this.operator$index$1('click'); - }, +}, get$change: function() { return this.operator$index$1('change'); - } +} }; $$._WorkerEventsImpl = {"": @@ -1627,31 +2038,18 @@ $$._WorkerContextEventsImpl = {"": super: "_EventsImpl" }; -$$._XMLHttpRequestEventsImpl = {"": - ["_ptr"], - super: "_EventsImpl" -}; - -$$._XMLHttpRequestUploadEventsImpl = {"": - ["_ptr"], - super: "_EventsImpl" -}; - -$$._IDBOpenDBRequestEventsImpl = {"": - ["_ptr"], - super: "_IDBRequestEventsImpl" -}; - $$._FixedSizeListIterator = {"": ["_lib_length", "_pos", "_array"], super: "_VariableSizeListIterator", hasNext$0: function() { var t1 = this._lib_length; - if (typeof t1 !== 'number') return this.hasNext$0$bailout(1, t1, 0); + if (typeof t1 !== 'number') + return this.hasNext$0$bailout(1, t1, 0); var t3 = this._pos; - if (typeof t3 !== 'number') return this.hasNext$0$bailout(2, t1, t3); + if (typeof t3 !== 'number') + return this.hasNext$0$bailout(2, t1, t3); return t1 > t3; - }, +}, hasNext$0$bailout: function(state, env0, env1) { switch (state) { case 1: @@ -1672,24 +2070,29 @@ $$._FixedSizeListIterator = {"": state = 0; return $.gt(t1, t3); } - } +} }; $$._VariableSizeListIterator = {"": [], super: "Object", next$0: function() { - if (this.hasNext$0() !== true) throw $.captureStackTrace($.CTC1); + if (this.hasNext$0() !== true) + throw $.captureStackTrace($.CTC1); var t1 = this._array; - if (typeof t1 !== 'string' && (typeof t1 !== 'object' || t1 === null || (t1.constructor !== Array && !t1.is$JavaScriptIndexingBehavior()))) return this.next$0$bailout(1, t1, 0); + if (typeof t1 !== 'string' && (typeof t1 !== 'object' || t1 === null || t1.constructor !== Array && !t1.is$JavaScriptIndexingBehavior())) + return this.next$0$bailout(1, t1, 0); var t3 = this._pos; - if (typeof t3 !== 'number') return this.next$0$bailout(2, t1, t3); + if (typeof t3 !== 'number') + return this.next$0$bailout(2, t1, t3); this._pos = t3 + 1; - if (t3 !== (t3 | 0)) throw $.iae(t3); + if (t3 !== (t3 | 0)) + throw $.iae(t3); var t5 = t1.length; - if (t3 < 0 || t3 >= t5) throw $.ioore(t3); + if (t3 < 0 || t3 >= t5) + throw $.ioore(t3); return t1[t3]; - }, +}, next$0$bailout: function(state, env0, env1) { switch (state) { case 1: @@ -1702,7 +2105,8 @@ $$._VariableSizeListIterator = {"": } switch (state) { case 0: - if (this.hasNext$0() !== true) throw $.captureStackTrace($.CTC1); + if (this.hasNext$0() !== true) + throw $.captureStackTrace($.CTC1); var t1 = this._array; case 1: state = 0; @@ -1712,14 +2116,16 @@ $$._VariableSizeListIterator = {"": this._pos = $.add(t3, 1); return $.index(t1, t3); } - }, +}, hasNext$0: function() { var t1 = $.get$length(this._array); - if (typeof t1 !== 'number') return this.hasNext$0$bailout(1, t1, 0); + if (typeof t1 !== 'number') + return this.hasNext$0$bailout(1, t1, 0); var t3 = this._pos; - if (typeof t3 !== 'number') return this.hasNext$0$bailout(2, t3, t1); + if (typeof t3 !== 'number') + return this.hasNext$0$bailout(2, t3, t1); return t1 > t3; - }, +}, hasNext$0$bailout: function(state, env0, env1) { switch (state) { case 1: @@ -1740,211 +2146,87 @@ $$._VariableSizeListIterator = {"": state = 0; return $.gt(t1, t3); } - } +} }; -$$._MessageTraverserVisitedMap = {"": - [], +$$._Manager = {"": + ["managers?", "mainManager?", "isolates?", "supportsWorkers", "isWorker?", "fromCommandLine?", "topEventLoop?", "rootContext=", "currentContext=", "nextManagerId", "currentManagerId?", "nextIsolateId="], super: "Object", - cleanup$0: function() { - }, - reset$0: function() { - }, - operator$indexSet$2: function(object, info) { - }, - operator$index$1: function(object) { - return; - } + maybeCloseWorker$0: function() { + if ($.isEmpty(this.isolates) === true) + this.mainManager.postMessage$1($._serializeMessage($.makeLiteralMap(['command', 'close']))); +}, + _nativeInitWorkerMessageHandler$0: function() { + $globalThis.onmessage = function (e) { + _IsolateNatives._processWorkerMessage(this.mainManager, e); + } + +}, + _nativeDetectEnvironment$0: function() { + this.isWorker = $isWorker; + this.supportsWorkers = $supportsWorkers; + this.fromCommandLine = typeof(window) == 'undefined'; + +}, + get$needSerialization: function() { + return this.get$useWorkers(); +}, + get$useWorkers: function() { + return this.supportsWorkers; +}, + _Manager$0: function() { + this._nativeDetectEnvironment$0(); + this.topEventLoop = $._EventLoop$(); + this.isolates = $.HashMapImplementation$(); + this.managers = $.HashMapImplementation$(); + if (this.isWorker === true) { + this.mainManager = $._MainManagerStub$(); + this._nativeInitWorkerMessageHandler$0(); + } +} }; -$$._MessageTraverser = {"": - [], - super: "Object", - _dispatch$1: function(x) { - if ($._MessageTraverser_isPrimitive(x) === true) return this.visitPrimitive$1(x); - if (typeof x === 'object' && x !== null && (x.constructor === Array || x.is$List())) return this.visitList$1(x); - if (typeof x === 'object' && x !== null && x.is$Map()) return this.visitMap$1(x); - if (typeof x === 'object' && x !== null && !!x.is$SendPort) return this.visitSendPort$1(x); - if (typeof x === 'object' && x !== null && !!x.is$SendPortSync) return this.visitSendPortSync$1(x); - throw $.captureStackTrace('Message serialization: Illegal value ' + $.S(x) + ' passed'); - }, - traverse$1: function(x) { - if ($._MessageTraverser_isPrimitive(x) === true) return this.visitPrimitive$1(x); - var t1 = this._visited; - t1.reset$0(); - var result = null; - try { - result = this._dispatch$1(x); - } finally { - t1.cleanup$0(); - } - return result; - } -}; - -$$._Copier = {"": - [], - super: "_MessageTraverser", - visitMap$1: function(map) { - var t1 = ({}); - var t2 = this._visited; - t1.copy_1 = $.index(t2, map); - var t3 = t1.copy_1; - if (!(t3 == null)) return t3; - t1.copy_1 = $.HashMapImplementation$(); - $.indexSet(t2, map, t1.copy_1); - $.forEach(map, new $._Copier_visitMap_anon(this, t1)); - return t1.copy_1; - }, - visitList$1: function(list) { - if (typeof list !== 'string' && (typeof list !== 'object' || list === null || (list.constructor !== Array && !list.is$JavaScriptIndexingBehavior()))) return this.visitList$1$bailout(1, list); - var t1 = this._visited; - var copy = t1.operator$index$1(list); - if (!(copy == null)) return copy; - var len = list.length; - copy = $.ListFactory_List(len); - t1.operator$indexSet$2(list, copy); - for (var i = 0; i < len; ++i) { - t1 = list.length; - if (i < 0 || i >= t1) throw $.ioore(i); - var t2 = this._dispatch$1(list[i]); - var t3 = copy.length; - if (i < 0 || i >= t3) throw $.ioore(i); - copy[i] = t2; - } - return copy; - }, - visitList$1$bailout: function(state, list) { - var t1 = this._visited; - var copy = $.index(t1, list); - if (!(copy == null)) return copy; - var len = $.get$length(list); - copy = $.ListFactory_List(len); - $.indexSet(t1, list, copy); - for (var i = 0; $.ltB(i, len); ++i) { - t1 = this._dispatch$1($.index(list, i)); - var t2 = copy.length; - if (i < 0 || i >= t2) throw $.ioore(i); - copy[i] = t1; - } - return copy; - }, - visitPrimitive$1: function(x) { - return x; - } -}; - -$$._Serializer = {"": - [], - super: "_MessageTraverser", - _serializeList$1: function(list) { - if (typeof list !== 'string' && (typeof list !== 'object' || list === null || (list.constructor !== Array && !list.is$JavaScriptIndexingBehavior()))) return this._serializeList$1$bailout(1, list); - var len = list.length; - var result = $.ListFactory_List(len); - for (var i = 0; i < len; ++i) { - var t1 = list.length; - if (i < 0 || i >= t1) throw $.ioore(i); - var t2 = this._dispatch$1(list[i]); - var t3 = result.length; - if (i < 0 || i >= t3) throw $.ioore(i); - result[i] = t2; - } - return result; - }, - _serializeList$1$bailout: function(state, list) { - var len = $.get$length(list); - var result = $.ListFactory_List(len); - for (var i = 0; $.ltB(i, len); ++i) { - var t1 = this._dispatch$1($.index(list, i)); - var t2 = result.length; - if (i < 0 || i >= t2) throw $.ioore(i); - result[i] = t1; - } - return result; - }, - visitMap$1: function(map) { - var t1 = this._visited; - var copyId = $.index(t1, map); - if (!(copyId == null)) return ['ref', copyId]; - var id = this._nextFreeRefId; - this._nextFreeRefId = id + 1; - $.indexSet(t1, map, id); - return ['map', id, this._serializeList$1(map.getKeys$0()), this._serializeList$1(map.getValues$0())]; - }, - visitList$1: function(list) { - var t1 = this._visited; - var copyId = $.index(t1, list); - if (!(copyId == null)) return ['ref', copyId]; - var id = this._nextFreeRefId; - this._nextFreeRefId = id + 1; - $.indexSet(t1, list, id); - return ['list', id, this._serializeList$1(list)]; - }, - visitPrimitive$1: function(x) { - return x; - } -}; - -$$._Manager = {"": - ["managers", "mainManager?", "isolates?", "supportsWorkers", "isWorker?", "fromCommandLine?", "topEventLoop?", "rootContext=", "currentContext=", "nextManagerId", "currentManagerId?", "nextIsolateId="], - super: "Object", - maybeCloseWorker$0: function() { - $.isEmpty(this.isolates) === true && this.mainManager.postMessage$1($._serializeMessage($.makeLiteralMap(['command', 'close']))); - }, - _nativeInitWorkerMessageHandler$0: function() { - $globalThis.onmessage = function (e) { - _IsolateNatives._processWorkerMessage(this.mainManager, e); - } - ; - }, - _nativeDetectEnvironment$0: function() { - this.isWorker = $isWorker; - this.supportsWorkers = $supportsWorkers; - this.fromCommandLine = typeof(window) == 'undefined'; - ; - }, - get$needSerialization: function() { - return this.get$useWorkers(); - }, - get$useWorkers: function() { - return this.supportsWorkers; - }, - _Manager$0: function() { - this._nativeDetectEnvironment$0(); - this.topEventLoop = $._EventLoop$(); - this.isolates = $.HashMapImplementation$(); - this.managers = $.HashMapImplementation$(); - if (this.isWorker === true) { - this.mainManager = $._MainManagerStub$(); - this._nativeInitWorkerMessageHandler$0(); - } - } -}; - -$$._IsolateContext = {"": - ["isolateStatics", "ports?", "id?"], +$$._IsolateContext = {"": + ["isolateStatics", "ports?", "id?"], super: "Object", + unregister$1: function(portId) { + var t1 = this.ports; + t1.remove$1(portId); + if ($.isEmpty(t1) === true) + $._globalState().get$isolates().remove$1(this.id); +}, + register$2: function(portId, port) { + var t1 = this.ports; + if (t1.containsKey$1(portId) === true) + throw $.captureStackTrace($.ExceptionImplementation$('Registry: ports must be registered only once.')); + $.indexSet(t1, portId, port); + $.indexSet($._globalState().get$isolates(), this.id, this); +}, + lookup$1: function(portId) { + return $.index(this.ports, portId); +}, _setGlobals$0: function() { - $setGlobals(this);; - }, +$setGlobals(this); +}, eval$1: function(code) { var old = $._globalState().get$currentContext(); $._globalState().set$currentContext(this); this._setGlobals$0(); var result = null; try { - result = code.$call$0(); + result = code.call$0(); } finally { var t1 = old; $._globalState().set$currentContext(t1); t1 = old; - !(t1 == null) && t1._setGlobals$0(); + if (!(t1 == null)) + t1._setGlobals$0(); } return result; - }, +}, initGlobals$0: function() { - $initGlobals(this);; - }, +$initGlobals(this); +}, _IsolateContext$0: function() { var t1 = $._globalState(); var t2 = t1.get$nextIsolateId(); @@ -1952,15 +2234,16 @@ $$._IsolateContext = {"": this.id = t2; this.ports = $.HashMapImplementation$(); this.initGlobals$0(); - } +} }; $$._EventLoop = {"": ["events"], super: "Object", run$0: function() { - if ($._globalState().get$isWorker() !== true) this._runHelper$0(); - else { + if ($._globalState().get$isWorker() !== true) + this._runHelper$0(); + else try { this._runHelper$0(); } catch (exception) { @@ -1969,48 +2252,71 @@ $$._EventLoop = {"": var trace = $.getTraceFromException(exception); $._globalState().get$mainManager().postMessage$1($._serializeMessage($.makeLiteralMap(['command', 'error', 'msg', $.S(e) + '\n' + $.S(trace)]))); } - } - }, + +}, _runHelper$0: function() { - if (!($._window() == null)) new $._EventLoop__runHelper_next(this).$call$0(); - else { - for (; this.runIteration$0() === true; ) { - } - } - }, + if (!($._window() == null)) + new $._EventLoop__runHelper_next(this).call$0(); + else + for (; this.runIteration$0() === true;) + ; +}, runIteration$0: function() { var event$ = this.dequeue$0(); if (event$ == null) { - if ($._globalState().get$isWorker() === true) $._globalState().maybeCloseWorker$0(); - else { - if (!($._globalState().get$rootContext() == null) && ($._globalState().get$isolates().containsKey$1($._globalState().get$rootContext().get$id()) === true && ($._globalState().get$fromCommandLine() === true && $.isEmpty($._globalState().get$rootContext().get$ports()) === true))) throw $.captureStackTrace($.ExceptionImplementation$('Program exited with open ReceivePorts.')); - } + if ($._globalState().get$isWorker() === true) + $._globalState().maybeCloseWorker$0(); + else if (!($._globalState().get$rootContext() == null) && $._globalState().get$isolates().containsKey$1($._globalState().get$rootContext().get$id()) === true && $._globalState().get$fromCommandLine() === true && $.isEmpty($._globalState().get$rootContext().get$ports()) === true) + throw $.captureStackTrace($.ExceptionImplementation$('Program exited with open ReceivePorts.')); return false; } event$.process$0(); return true; - }, +}, dequeue$0: function() { var t1 = this.events; - if ($.isEmpty(t1) === true) return; + if ($.isEmpty(t1) === true) + return; return t1.removeFirst$0(); - } +}, + enqueue$3: function(isolate, fn, msg) { + $.addLast(this.events, $._IsolateEvent$(isolate, fn, msg)); +} +}; + +$$._IsolateEvent = {"": + ["message", "fn", "isolate"], + super: "Object", + process$0: function() { + this.isolate.eval$1(this.fn); +} }; $$._MainManagerStub = {"": [], super: "Object", postMessage$1: function(msg) { - $globalThis.postMessage(msg);; - }, +$globalThis.postMessage(msg); +}, get$id: function() { return 0; - } +} }; $$._BaseSendPort = {"": ["_isolateId?"], super: "Object", + call$1: function(message) { + var completer = $.CompleterImpl$(); + var port = $._ReceivePortImpl$(); + this.send$2(message, port.toSendPort$0()); + port.receive$1(new $._BaseSendPort_call_anon(port, completer)); + return completer.get$future(); +}, + _checkReplyTo$1: function(replyTo) { + if (!(replyTo == null) && !(typeof replyTo === 'object' && replyTo !== null && !!replyTo.is$_NativeJsSendPort) && !(typeof replyTo === 'object' && replyTo !== null && !!replyTo.is$_WorkerSendPort) && !(typeof replyTo === 'object' && replyTo !== null && !!replyTo.is$_BufferingSendPort)) + throw $.captureStackTrace($.ExceptionImplementation$('SendPort.send: Illegal replyTo port type')); +}, is$SendPort: true }; @@ -2019,370 +2325,879 @@ $$._NativeJsSendPort = {"": super: "_BaseSendPort", hashCode$0: function() { return this._receivePort.get$_id(); - }, +}, operator$eq$1: function(other) { return typeof other === 'object' && other !== null && !!other.is$_NativeJsSendPort && $.eqB(this._receivePort, other._receivePort); - }, +}, + send$2: function(message, replyTo) { + $._waitForPendingPorts([message, replyTo], new $._NativeJsSendPort_send_anon(message, this, replyTo)); +}, is$_NativeJsSendPort: true, is$SendPort: true }; $$._WorkerSendPort = {"": - ["_receivePortId?", "_workerId?", "_isolateId"], + ["_receivePortId", "_workerId?", "_isolateId"], super: "_BaseSendPort", hashCode$0: function() { return $.xor($.xor($.shl(this._workerId, 16), $.shl(this._isolateId, 8)), this._receivePortId); - }, +}, operator$eq$1: function(other) { - if (typeof other === 'object' && other !== null && !!other.is$_WorkerSendPort) { - var t1 = $.eqB(this._workerId, other._workerId) && ($.eqB(this._isolateId, other._isolateId) && $.eqB(this._receivePortId, other._receivePortId)); - } else t1 = false; + if (typeof other === 'object' && other !== null && !!other.is$_WorkerSendPort) + var t1 = $.eqB(this._workerId, other._workerId) && $.eqB(this._isolateId, other._isolateId) && $.eqB(this._receivePortId, other._receivePortId); + else + t1 = false; return t1; - }, +}, + send$2: function(message, replyTo) { + $._waitForPendingPorts([message, replyTo], new $._WorkerSendPort_send_anon(message, this, replyTo)); +}, is$_WorkerSendPort: true, is$SendPort: true }; +$$._ReceivePortImpl = {"": + ["_callback?", "_id?"], + super: "Object", + toSendPort$0: function() { + return $._NativeJsSendPort$(this, $._globalState().get$currentContext().get$id()); +}, + close$0: function() { + this._callback = null; + $._globalState().get$currentContext().unregister$1(this._id); +}, + receive$1: function(onMessage) { + this._callback = onMessage; +}, + _callback$2: function(arg0, arg1) { return this._callback.call$2(arg0, arg1); }, + _ReceivePortImpl$0: function() { + $._globalState().get$currentContext().register$2(this._id, this); +} +}; + +$$._PendingSendPortFinder = {"": + ["ports?", "_visited"], + super: "_MessageTraverser", + visitSendPort$1: function(port) { + if (!!port.is$_BufferingSendPort && port._port == null) + $.add$1(this.ports, port.get$_futurePort()); +}, + visitMap$1: function(map) { + var t1 = this._visited; + if (!($.index(t1, map) == null)) + return; + $.indexSet(t1, map, true); + $.forEach(map.getValues$0(), new $._PendingSendPortFinder_visitMap_anon(this)); +}, + visitList$1: function(list) { + var t1 = this._visited; + if (!($.index(t1, list) == null)) + return; + $.indexSet(t1, list, true); + $.forEach(list, new $._PendingSendPortFinder_visitList_anon(this)); +}, + visitPrimitive$1: function(x) { +}, + _PendingSendPortFinder$0: function() { + this._visited = $._JsVisitedMap$(); +} +}; + $$._JsSerializer = {"": ["_nextFreeRefId", "_visited"], super: "_Serializer", visitBufferingSendPort$1: function(port) { - if (!(port.get$_port() == null)) return this.visitSendPort$1(port.get$_port()); - throw $.captureStackTrace('internal error: must call _waitForPendingPorts to ensure all ports are resolved at this point.'); - }, + var t1 = port._port; + if (!(t1 == null)) + return this.visitSendPort$1(t1); + else + throw $.captureStackTrace('internal error: must call _waitForPendingPorts to ensure all ports are resolved at this point.'); +}, visitWorkerSendPort$1: function(port) { - return ['sendport', port.get$_workerId(), port.get$_isolateId(), port.get$_receivePortId()]; - }, + return ['sendport', port._workerId, port._isolateId, port._receivePortId]; +}, visitNativeJsSendPort$1: function(port) { - return ['sendport', $._globalState().get$currentManagerId(), port.get$_isolateId(), port.get$_receivePort().get$_id()]; - }, + return ['sendport', $._globalState().get$currentManagerId(), port._isolateId, port._receivePort.get$_id()]; +}, visitSendPort$1: function(x) { - if (typeof x === 'object' && x !== null && !!x.is$_NativeJsSendPort) return this.visitNativeJsSendPort$1(x); - if (typeof x === 'object' && x !== null && !!x.is$_WorkerSendPort) return this.visitWorkerSendPort$1(x); - if (typeof x === 'object' && x !== null && !!x.is$_BufferingSendPort) return this.visitBufferingSendPort$1(x); + if (!!x.is$_NativeJsSendPort) + return this.visitNativeJsSendPort$1(x); + if (!!x.is$_WorkerSendPort) + return this.visitWorkerSendPort$1(x); + if (!!x.is$_BufferingSendPort) + return this.visitBufferingSendPort$1(x); throw $.captureStackTrace('Illegal underlying port ' + $.S(x)); - }, +}, _JsSerializer$0: function() { this._visited = $._JsVisitedMap$(); - } +} }; $$._JsCopier = {"": ["_visited"], super: "_Copier", visitBufferingSendPort$1: function(port) { - if (!(port.get$_port() == null)) return this.visitSendPort$1(port.get$_port()); - throw $.captureStackTrace('internal error: must call _waitForPendingPorts to ensure all ports are resolved at this point.'); - }, + var t1 = port._port; + if (!(t1 == null)) + return this.visitSendPort$1(t1); + else + throw $.captureStackTrace('internal error: must call _waitForPendingPorts to ensure all ports are resolved at this point.'); +}, visitWorkerSendPort$1: function(port) { - return $._WorkerSendPort$(port.get$_workerId(), port.get$_isolateId(), port.get$_receivePortId()); - }, + return $._WorkerSendPort$(port._workerId, port._isolateId, port._receivePortId); +}, visitNativeJsSendPort$1: function(port) { - return $._NativeJsSendPort$(port.get$_receivePort(), port.get$_isolateId()); - }, + return $._NativeJsSendPort$(port._receivePort, port._isolateId); +}, visitSendPort$1: function(x) { - if (typeof x === 'object' && x !== null && !!x.is$_NativeJsSendPort) return this.visitNativeJsSendPort$1(x); - if (typeof x === 'object' && x !== null && !!x.is$_WorkerSendPort) return this.visitWorkerSendPort$1(x); - if (typeof x === 'object' && x !== null && !!x.is$_BufferingSendPort) return this.visitBufferingSendPort$1(x); + if (!!x.is$_NativeJsSendPort) + return this.visitNativeJsSendPort$1(x); + if (!!x.is$_WorkerSendPort) + return this.visitWorkerSendPort$1(x); + if (!!x.is$_BufferingSendPort) + return this.visitBufferingSendPort$1(x); throw $.captureStackTrace('Illegal underlying port ' + $.S(this.get$p())); - }, +}, _JsCopier$0: function() { this._visited = $._JsVisitedMap$(); - } +} +}; + +$$._JsDeserializer = {"": + ["_deserialized"], + super: "_Deserializer", + deserializeSendPort$1: function(x) { + var managerId = $.index(x, 1); + var isolateId = $.index(x, 2); + var receivePortId = $.index(x, 3); + if ($.eqB(managerId, $._globalState().get$currentManagerId())) { + var isolate = $.index($._globalState().get$isolates(), isolateId); + if (isolate == null) + return; + return $._NativeJsSendPort$(isolate.lookup$1(receivePortId), isolateId); + } else + return $._WorkerSendPort$(managerId, isolateId, receivePortId); +} }; $$._JsVisitedMap = {"": ["tagged"], super: "Object", _getAttachedInfo$1: function(o) { - return o['__MessageTraverser__attached_info__'];; - }, +return o['__MessageTraverser__attached_info__']; +}, _setAttachedInfo$2: function(o, info) { - o['__MessageTraverser__attached_info__'] = info;; - }, +o['__MessageTraverser__attached_info__'] = info; +}, _clearAttachedInfo$1: function(o) { - o['__MessageTraverser__attached_info__'] = (void 0);; - }, +o['__MessageTraverser__attached_info__'] = (void 0); +}, cleanup$0: function() { var length$ = $.get$length(this.tagged); - if (typeof length$ !== 'number') return this.cleanup$0$bailout(1, length$); + if (typeof length$ !== 'number') + return this.cleanup$0$bailout(1, length$); var i = 0; - for (; i < length$; ++i) { + for (; i < length$; ++i) this._clearAttachedInfo$1($.index(this.tagged, i)); - } this.tagged = null; - }, +}, cleanup$0$bailout: function(state, length$) { var i = 0; - for (; $.ltB(i, length$); ++i) { + for (; $.ltB(i, length$); ++i) this._clearAttachedInfo$1($.index(this.tagged, i)); - } this.tagged = null; - }, +}, reset$0: function() { this.tagged = $.ListFactory_List(null); - }, +}, operator$indexSet$2: function(object, info) { $.add$1(this.tagged, object); this._setAttachedInfo$2(object, info); - }, +}, operator$index$1: function(object) { return this._getAttachedInfo$1(object); - } +} +}; + +$$._MessageTraverserVisitedMap = {"": + [], + super: "Object", + cleanup$0: function() { +}, + reset$0: function() { +}, + operator$indexSet$2: function(object, info) { +}, + operator$index$1: function(object) { + return; +} +}; + +$$._MessageTraverser = {"": + [], + super: "Object", + visitObject$1: function(x) { + throw $.captureStackTrace('Message serialization: Illegal value ' + $.S(x) + ' passed'); +}, + _dispatch$1: function(x) { + if ($._MessageTraverser_isPrimitive(x)) + return this.visitPrimitive$1(x); + if (typeof x === 'object' && x !== null && (x.constructor === Array || x.is$List())) + return this.visitList$1(x); + if (typeof x === 'object' && x !== null && x.is$Map()) + return this.visitMap$1(x); + if (typeof x === 'object' && x !== null && !!x.is$SendPort) + return this.visitSendPort$1(x); + if (typeof x === 'object' && x !== null && !!x.is$SendPortSync) + return this.visitSendPortSync$1(x); + return this.visitObject$1(x); +}, + traverse$1: function(x) { + if ($._MessageTraverser_isPrimitive(x)) + return this.visitPrimitive$1(x); + var t1 = this._visited; + t1.reset$0(); + var result = null; + try { + result = this._dispatch$1(x); + } finally { + t1.cleanup$0(); + } + return result; +} +}; + +$$._Copier = {"": + [], + super: "_MessageTraverser", + visitMap$1: function(map) { + var t1 = {}; + var t2 = this._visited; + t1.copy_1 = $.index(t2, map); + var t3 = t1.copy_1; + if (!(t3 == null)) + return t3; + t1.copy_1 = $.HashMapImplementation$(); + $.indexSet(t2, map, t1.copy_1); + map.forEach$1(new $._Copier_visitMap_anon(this, t1)); + return t1.copy_1; +}, + visitList$1: function(list) { + if (typeof list !== 'object' || list === null || list.constructor !== Array && !list.is$JavaScriptIndexingBehavior()) + return this.visitList$1$bailout(1, list); + var t1 = this._visited; + var copy = t1.operator$index$1(list); + if (!(copy == null)) + return copy; + var len = list.length; + copy = $.ListFactory_List(len); + t1.operator$indexSet$2(list, copy); + for (var i = 0; i < len; ++i) { + t1 = list.length; + if (i < 0 || i >= t1) + throw $.ioore(i); + var t2 = this._dispatch$1(list[i]); + var t3 = copy.length; + if (i < 0 || i >= t3) + throw $.ioore(i); + copy[i] = t2; + } + return copy; +}, + visitList$1$bailout: function(state, list) { + var t1 = this._visited; + var copy = $.index(t1, list); + if (!(copy == null)) + return copy; + var len = $.get$length(list); + copy = $.ListFactory_List(len); + $.indexSet(t1, list, copy); + for (var i = 0; $.ltB(i, len); ++i) { + t1 = this._dispatch$1($.index(list, i)); + var t2 = copy.length; + if (i < 0 || i >= t2) + throw $.ioore(i); + copy[i] = t1; + } + return copy; +}, + visitPrimitive$1: function(x) { + return x; +} +}; + +$$._Serializer = {"": + [], + super: "_MessageTraverser", + _serializeList$1: function(list) { + if (typeof list !== 'string' && (typeof list !== 'object' || list === null || list.constructor !== Array && !list.is$JavaScriptIndexingBehavior())) + return this._serializeList$1$bailout(1, list); + var len = list.length; + var result = $.ListFactory_List(len); + for (var i = 0; i < len; ++i) { + var t1 = list.length; + if (i < 0 || i >= t1) + throw $.ioore(i); + var t2 = this._dispatch$1(list[i]); + var t3 = result.length; + if (i < 0 || i >= t3) + throw $.ioore(i); + result[i] = t2; + } + return result; +}, + _serializeList$1$bailout: function(state, list) { + var len = $.get$length(list); + var result = $.ListFactory_List(len); + for (var i = 0; $.ltB(i, len); ++i) { + var t1 = this._dispatch$1($.index(list, i)); + var t2 = result.length; + if (i < 0 || i >= t2) + throw $.ioore(i); + result[i] = t1; + } + return result; +}, + visitMap$1: function(map) { + var t1 = this._visited; + var copyId = $.index(t1, map); + if (!(copyId == null)) + return ['ref', copyId]; + var id = this._nextFreeRefId; + this._nextFreeRefId = id + 1; + $.indexSet(t1, map, id); + return ['map', id, this._serializeList$1(map.getKeys$0()), this._serializeList$1(map.getValues$0())]; +}, + visitList$1: function(list) { + var t1 = this._visited; + var copyId = $.index(t1, list); + if (!(copyId == null)) + return ['ref', copyId]; + var id = this._nextFreeRefId; + this._nextFreeRefId = id + 1; + $.indexSet(t1, list, id); + return ['list', id, this._serializeList$1(list)]; +}, + visitPrimitive$1: function(x) { + return x; +} +}; + +$$._Deserializer = {"": + [], + super: "Object", + deserializeObject$1: function(x) { + throw $.captureStackTrace('Unexpected serialized object'); +}, + _deserializeMap$1: function(x) { + var result = $.HashMapImplementation$(); + var id = $.index(x, 1); + $.indexSet(this._deserialized, id, result); + var keys = $.index(x, 2); + if (typeof keys !== 'string' && (typeof keys !== 'object' || keys === null || keys.constructor !== Array && !keys.is$JavaScriptIndexingBehavior())) + return this._deserializeMap$1$bailout(1, x, result, keys); + var values = $.index(x, 3); + if (typeof values !== 'string' && (typeof values !== 'object' || values === null || values.constructor !== Array && !values.is$JavaScriptIndexingBehavior())) + return this._deserializeMap$1$bailout(2, values, result, keys); + var len = keys.length; + for (var i = 0; i < len; ++i) { + var t1 = keys.length; + if (i < 0 || i >= t1) + throw $.ioore(i); + var key = this._deserializeHelper$1(keys[i]); + var t2 = values.length; + if (i < 0 || i >= t2) + throw $.ioore(i); + result.operator$indexSet$2(key, this._deserializeHelper$1(values[i])); + } + return result; +}, + _deserializeMap$1$bailout: function(state, env0, env1, env2) { + switch (state) { + case 1: + var x = env0; + result = env1; + keys = env2; + break; + case 2: + values = env0; + result = env1; + keys = env2; + break; + } + switch (state) { + case 0: + var result = $.HashMapImplementation$(); + var id = $.index(x, 1); + $.indexSet(this._deserialized, id, result); + var keys = $.index(x, 2); + case 1: + state = 0; + var values = $.index(x, 3); + case 2: + state = 0; + var len = $.get$length(keys); + for (var i = 0; $.ltB(i, len); ++i) + result.operator$indexSet$2(this._deserializeHelper$1($.index(keys, i)), this._deserializeHelper$1($.index(values, i))); + return result; + } +}, + _deserializeList$1: function(x) { + var id = $.index(x, 1); + var dartList = $.index(x, 2); + if (typeof dartList !== 'object' || dartList === null || (dartList.constructor !== Array || !!dartList.immutable$list) && !dartList.is$JavaScriptIndexingBehavior()) + return this._deserializeList$1$bailout(1, dartList, id); + $.indexSet(this._deserialized, id, dartList); + var len = dartList.length; + for (var i = 0; i < len; ++i) { + var t1 = dartList.length; + if (i < 0 || i >= t1) + throw $.ioore(i); + var t2 = this._deserializeHelper$1(dartList[i]); + var t3 = dartList.length; + if (i < 0 || i >= t3) + throw $.ioore(i); + dartList[i] = t2; + } + return dartList; +}, + _deserializeList$1$bailout: function(state, dartList, id) { + $.indexSet(this._deserialized, id, dartList); + var len = $.get$length(dartList); + for (var i = 0; $.ltB(i, len); ++i) + $.indexSet(dartList, i, this._deserializeHelper$1($.index(dartList, i))); + return dartList; +}, + _deserializeRef$1: function(x) { + var id = $.index(x, 1); + return $.index(this._deserialized, id); +}, + _deserializeHelper$1: function(x) { + if ($._Deserializer_isPrimitive(x)) + return x; + switch ($.index(x, 0)) { + case 'ref': + return this._deserializeRef$1(x); + case 'list': + return this._deserializeList$1(x); + case 'map': + return this._deserializeMap$1(x); + case 'sendport': + return this.deserializeSendPort$1(x); + default: + return this.deserializeObject$1(x); + } +}, + deserialize$1: function(x) { + if ($._Deserializer_isPrimitive(x)) + return x; + this._deserialized = $.HashMapImplementation$(); + return this._deserializeHelper$1(x); +} +}; + +$$._Timer = {"": + ["_handle", "_once"], + super: "Object", + _Timer$repeating$2: function(milliSeconds, callback) { + this._handle = $._window().setInterval$2(new $.anon1(this, callback), milliSeconds); +}, + _Timer$2: function(milliSeconds, callback) { + this._handle = $._window().setTimeout$2(new $.anon0(this, callback), milliSeconds); +} }; $$.Maps__emitMap_anon = {"": ["result_3", "box_0", "visiting_2"], super: "Closure", - $call$2: function(k, v) { - this.box_0.first_1 !== true && $.add$1(this.result_3, ', '); + call$2: function(k, v) { + if (this.box_0.first_1 !== true) + $.add$1(this.result_3, ', '); this.box_0.first_1 = false; $.Collections__emitObject(k, this.result_3, this.visiting_2); $.add$1(this.result_3, ': '); $.Collections__emitObject(v, this.result_3, this.visiting_2); - } +} }; $$.invokeClosure_anon = {"": ["closure_0"], super: "Closure", - $call$0: function() { - return this.closure_0.$call$0(); - } + call$0: function() { + return this.closure_0.call$0(); +} }; $$.invokeClosure_anon0 = {"": ["closure_2", "arg1_1"], super: "Closure", - $call$0: function() { - return this.closure_2.$call$1(this.arg1_1); - } + call$0: function() { + return this.closure_2.call$1(this.arg1_1); +} }; $$.invokeClosure_anon1 = {"": ["closure_5", "arg1_4", "arg2_3"], super: "Closure", - $call$0: function() { - return this.closure_5.$call$2(this.arg1_4, this.arg2_3); - } + call$0: function() { + return this.closure_5.call$2(this.arg1_4, this.arg2_3); +} }; $$.anon = {"": ["this_0"], super: "Closure", - $call$1: function(event$) { + call$1: function(event$) { return this.this_0.onResize$0(); - } +} }; $$.Spirodraw_initControlPanel_anon = {"": ["this_0"], super: "Closure", - $call$1: function(event$) { + call$1: function(event$) { return this.this_0.refresh$0(); - } +} }; $$.Spirodraw_initControlPanel_anon0 = {"": ["this_1"], super: "Closure", - $call$1: function(event$) { + call$1: function(event$) { return this.this_1.refresh$0(); - } +} }; $$.Spirodraw_initControlPanel_anon1 = {"": ["this_2"], super: "Closure", - $call$1: function(event$) { + call$1: function(event$) { return this.this_2.refresh$0(); - } +} }; $$.Spirodraw_initControlPanel_anon2 = {"": ["this_3"], super: "Closure", - $call$1: function(event$) { + call$1: function(event$) { return this.this_3.onSpeedChange$0(); - } +} }; $$.Spirodraw_initControlPanel_anon3 = {"": ["this_4"], super: "Closure", - $call$1: function(event$) { + call$1: function(event$) { return this.this_4.refresh$0(); - } +} }; $$.Spirodraw_initControlPanel_anon4 = {"": ["this_5"], super: "Closure", - $call$1: function(event$) { + call$1: function(event$) { return this.this_5.onPenWidthChange$0(); - } +} }; $$.Spirodraw_initControlPanel_anon5 = {"": ["this_6"], super: "Closure", - $call$1: function(color) { + call$1: function(color) { return this.this_6.onColorChange$1(color); - } +} }; $$.Spirodraw_initControlPanel_anon6 = {"": ["this_7"], super: "Closure", - $call$1: function(event$) { + call$1: function(event$) { return this.this_7.start$0(); - } +} }; $$.Spirodraw_initControlPanel_anon7 = {"": ["this_8"], super: "Closure", - $call$1: function(event$) { + call$1: function(event$) { return this.this_8.stop$0(); - } +} }; $$.Spirodraw_initControlPanel_anon8 = {"": ["this_9"], super: "Closure", - $call$1: function(event$) { + call$1: function(event$) { return this.this_9.clear$0(); - } +} }; $$.Spirodraw_initControlPanel_anon9 = {"": ["this_10"], super: "Closure", - $call$1: function(event$) { + call$1: function(event$) { return this.this_10.lucky$0(); - } +} }; $$.ColorPicker_addHandlers_anon = {"": ["this_0"], super: "Closure", - $call$1: function(e) { + call$1: function(e) { return this.this_0.onMouseMove$1(e); - } +} }; $$.ColorPicker_addHandlers_anon0 = {"": ["this_1"], super: "Closure", - $call$1: function(e) { + call$1: function(e) { return this.this_1.onMouseDown$1(e); - } +} }; $$.HashSetImplementation_forEach__ = {"": ["f_0"], super: "Closure", - $call$2: function(key, value) { - this.f_0.$call$1(key); - } + call$2: function(key, value) { + this.f_0.call$1(key); +} +}; + +$$.startRootIsolate_anon = {"": + [], + super: "Closure", + call$0: function() { + return $._setTimerFactoryClosure($._timerFactory); +} }; $$.DoubleLinkedQueue_length__ = {"": ["box_0"], super: "Closure", - $call$1: function(element) { + call$1: function(element) { var counter = $.add(this.box_0.counter_1, 1); this.box_0.counter_1 = counter; - } +} }; $$.LinkedHashMapImplementation_forEach__ = {"": ["f_0"], super: "Closure", - $call$1: function(entry) { - this.f_0.$call$2(entry.get$key(), entry.get$value()); - } + call$1: function(entry) { + this.f_0.call$2(entry.get$key(), entry.get$value()); +} +}; + +$$._BaseSendPort_call_anon = {"": + ["port_1", "completer_0"], + super: "Closure", + call$2: function(value, ignoreReplyTo) { + this.port_1.close$0(); + var t1 = typeof value === 'object' && value !== null && !!value.is$Exception; + var t2 = this.completer_0; + if (t1) + t2.completeException$1(value); + else + t2.complete$1(value); +} +}; + +$$._WorkerSendPort_send_anon = {"": + ["message_2", "this_1", "replyTo_0"], + super: "Closure", + call$0: function() { + this.this_1._checkReplyTo$1(this.replyTo_0); + var workerMessage = $._serializeMessage($.makeLiteralMap(['command', 'message', 'port', this.this_1, 'msg', this.message_2, 'replyTo', this.replyTo_0])); + if ($._globalState().get$isWorker() === true) + $._globalState().get$mainManager().postMessage$1(workerMessage); + else + $.index($._globalState().get$managers(), this.this_1.get$_workerId()).postMessage$1(workerMessage); +} +}; + +$$._waitForPendingPorts_anon = {"": + ["callback_0"], + super: "Closure", + call$1: function(_) { + return this.callback_0.call$0(); +} +}; + +$$.Futures_wait_anon = {"": + ["result_5", "pos_4", "completer_3", "box_0", "values_2"], + super: "Closure", + call$1: function(value) { + $.indexSet(this.values_2, this.pos_4, value); + var remaining = $.sub(this.box_0.remaining_1, 1); + this.box_0.remaining_1 = remaining; + if ($.eqB(remaining, 0) && this.result_5.get$isComplete() !== true) + this.completer_3.complete$1(this.values_2); +} +}; + +$$.Futures_wait_anon0 = {"": + ["result_8", "completer_7", "future_6"], + super: "Closure", + call$1: function(exception) { + if (this.result_8.get$isComplete() !== true) + this.completer_7.completeException$2(exception, this.future_6.get$stackTrace()); + return true; +} +}; + +$$._PendingSendPortFinder_visitList_anon = {"": + ["this_0"], + super: "Closure", + call$1: function(e) { + return this.this_0._dispatch$1(e); +} +}; + +$$._PendingSendPortFinder_visitMap_anon = {"": + ["this_0"], + super: "Closure", + call$1: function(e) { + return this.this_0._dispatch$1(e); +} }; $$._StorageImpl_getValues_anon = {"": ["values_0"], super: "Closure", - $call$2: function(k, v) { + call$2: function(k, v) { return $.add$1(this.values_0, v); - } +} }; $$.HashMapImplementation_getValues__ = {"": ["list_2", "box_0"], super: "Closure", - $call$2: function(key, value) { + call$2: function(key, value) { var t1 = this.list_2; var t2 = this.box_0.i_1; var i = $.add(t2, 1); this.box_0.i_1 = i; $.indexSet(t1, t2, value); - } +} }; $$.LinkedHashMapImplementation_getValues__ = {"": ["list_2", "box_0"], super: "Closure", - $call$1: function(entry) { + call$1: function(entry) { var t1 = this.list_2; var t2 = this.box_0.index_1; var index = $.add(t2, 1); this.box_0.index_1 = index; $.indexSet(t1, t2, entry.get$value()); - } +} +}; + +$$._NativeJsSendPort_send_anon = {"": + ["message_5", "this_4", "replyTo_3"], + super: "Closure", + call$0: function() { + var t1 = {}; + this.this_4._checkReplyTo$1(this.replyTo_3); + var isolate = $.index($._globalState().get$isolates(), this.this_4.get$_isolateId()); + if (isolate == null) + return; + if (this.this_4.get$_receivePort().get$_callback() == null) + return; + var shouldSerialize = !($._globalState().get$currentContext() == null) && !$.eqB($._globalState().get$currentContext().get$id(), this.this_4.get$_isolateId()); + t1.msg_1 = this.message_5; + t1.reply_2 = this.replyTo_3; + if (shouldSerialize) { + t1.msg_1 = $._serializeMessage(t1.msg_1); + t1.reply_2 = $._serializeMessage(t1.reply_2); + } + $._globalState().get$topEventLoop().enqueue$3(isolate, new $._NativeJsSendPort_send_anon0(this.this_4, t1, shouldSerialize), 'receive ' + $.S(this.message_5)); +} +}; + +$$._NativeJsSendPort_send_anon0 = {"": + ["this_7", "box_0", "shouldSerialize_6"], + super: "Closure", + call$0: function() { + if (!(this.this_7.get$_receivePort().get$_callback() == null)) { + if (this.shouldSerialize_6 === true) { + var msg = $._deserializeMessage(this.box_0.msg_1); + this.box_0.msg_1 = msg; + var reply = $._deserializeMessage(this.box_0.reply_2); + this.box_0.reply_2 = reply; + } + var t1 = this.this_7.get$_receivePort(); + var t2 = this.box_0; + t1._callback$2(t2.msg_1, t2.reply_2); + } +} }; $$._StorageImpl_getKeys_anon = {"": ["keys_0"], super: "Closure", - $call$2: function(k, v) { + call$2: function(k, v) { return $.add$1(this.keys_0, k); - } +} }; $$.HashMapImplementation_getKeys__ = {"": ["list_2", "box_0"], super: "Closure", - $call$2: function(key, value) { + call$2: function(key, value) { var t1 = this.list_2; var t2 = this.box_0.i_1; var i = $.add(t2, 1); this.box_0.i_1 = i; $.indexSet(t1, t2, key); - } +} }; $$.LinkedHashMapImplementation_getKeys__ = {"": ["list_2", "box_0"], super: "Closure", - $call$1: function(entry) { + call$1: function(entry) { var t1 = this.list_2; var t2 = this.box_0.index_1; var index = $.add(t2, 1); this.box_0.index_1 = index; $.indexSet(t1, t2, entry.get$key()); - } +} }; $$._Copier_visitMap_anon = {"": ["this_2", "box_0"], super: "Closure", - $call$2: function(key, val) { + call$2: function(key, val) { $.indexSet(this.box_0.copy_1, this.this_2._dispatch$1(key), this.this_2._dispatch$1(val)); - } +} }; $$._EventLoop__runHelper_next = {"": ["this_0"], super: "Closure", - $call$0: function() { - if (this.this_0.runIteration$0() !== true) return; + call$0: function() { + if (this.this_0.runIteration$0() !== true) + return; $._window().setTimeout$2(this, 0); - } +} +}; + +$$.anon0 = {"": + ["this_1", "callback_0"], + super: "Closure", + call$0: function() { + return this.callback_0.call$1(this.this_1); +} +}; + +$$.anon1 = {"": + ["this_1", "callback_0"], + super: "Closure", + call$0: function() { + return this.callback_0.call$1(this.this_1); +} }; $$.Closure = {"": @@ -2390,38 +3205,42 @@ $$.Closure = {"": super: "Object", toString$0: function() { return 'Closure'; - } +} }; $$.BoundClosure = {'': ['self', 'target'], 'super': 'Closure', -$call$1: function(p0) { return this.self[this.target](p0); } +call$1: function(p0) { return this.self[this.target](p0); } }; $$.BoundClosure0 = {'': ['self', 'target'], 'super': 'Closure', -$call$0: function() { return this.self[this.target](); } +call$0: function() { return this.self[this.target](); } }; $.mul$slow = function(a, b) { - if ($.checkNumbers(a, b) === true) return a * b; + if ($.checkNumbers(a, b)) + return a * b; return a.operator$mul$1(b); }; $.startRootIsolate = function(entry) { var t1 = $._Manager$(); $._globalState0(t1); - if ($._globalState().get$isWorker() === true) return; + if ($._globalState().get$isWorker() === true) + return; var rootContext = $._IsolateContext$(); $._globalState().set$rootContext(rootContext); $._fillStatics(rootContext); $._globalState().set$currentContext(rootContext); + if (!($._window() == null)) + rootContext.eval$1(new $.startRootIsolate_anon()); rootContext.eval$1(entry); $._globalState().get$topEventLoop().run$0(); }; $._window = function() { - return typeof window != 'undefined' ? window : (void 0);; + return typeof window != "undefined" ? window : null; }; $._AudioContextEventsImpl$ = function(_ptr) { @@ -2429,35 +3248,41 @@ $._AudioContextEventsImpl$ = function(_ptr) { }; $.floor = function(receiver) { - if (!(typeof receiver === 'number')) return receiver.floor$0(); + if (!(typeof receiver === 'number')) + return receiver.floor$0(); return Math.floor(receiver); }; $.eqB = function(a, b) { - if (a == null) return b == null; - if (b == null) return false; - if (typeof a === "object") { - if (!!a.operator$eq$1) return a.operator$eq$1(b) === true; - } + if (a == null) + return b == null; + if (b == null) + return false; + if (typeof a === "object") + if (!!a.operator$eq$1) + return a.operator$eq$1(b) === true; return a === b; }; $.Collections__containsRef = function(c, ref) { - for (var t1 = $.iterator(c); t1.hasNext$0() === true; ) { + for (var t1 = $.iterator(c); t1.hasNext$0() === true;) { var t2 = t1.next$0(); - if (t2 == null ? ref == null : t2 === ref) return true; + if (t2 == null ? ref == null : t2 === ref) + return true; } return false; }; $.isJsArray = function(value) { - return !(value == null) && (value.constructor === Array); + return !(value == null) && value.constructor === Array; }; $.indexSet$slow = function(a, index, value) { - if ($.isJsArray(a) === true) { - if (!((typeof index === 'number') && (index === (index | 0)))) throw $.captureStackTrace($.IllegalArgumentException$(index)); - if (index < 0 || $.geB(index, $.get$length(a))) throw $.captureStackTrace($.IndexOutOfRangeException$(index)); + if ($.isJsArray(a)) { + if (!(typeof index === 'number' && index === (index | 0))) + throw $.captureStackTrace($.IllegalArgumentException$(index)); + if (index < 0 || $.geB(index, $.get$length(a))) + throw $.captureStackTrace($.IndexOutOfRangeException$(index)); $.checkMutable(a, 'indexed set'); a[index] = value; return; @@ -2470,7 +3295,8 @@ $.HashMapImplementation__nextProbe = function(currentProbe, numberOfProbes, leng }; $.allMatches = function(receiver, str) { - if (!(typeof receiver === 'string')) return receiver.allMatches$1(str); + if (!(typeof receiver === 'string')) + return receiver.allMatches$1(str); $.checkString(str); return $.allMatchesInStringUnchecked(receiver, str); }; @@ -2480,12 +3306,15 @@ $.substringUnchecked = function(receiver, startIndex, endIndex) { }; $.get$length = function(receiver) { - if (typeof receiver === 'string' || $.isJsArray(receiver) === true) return receiver.length; - return receiver.get$length(); + if (typeof receiver === 'string' || $.isJsArray(receiver)) + return receiver.length; + else + return receiver.get$length(); }; $.ge$slow = function(a, b) { - if ($.checkNumbers(a, b) === true) return a >= b; + if ($.checkNumbers(a, b)) + return a >= b; return a.operator$ge$1(b); }; @@ -2493,25 +3322,41 @@ $.IllegalJSRegExpException$ = function(_pattern, _errmsg) { return new $.IllegalJSRegExpException(_errmsg, _pattern); }; +$.FutureImpl_FutureImpl$immediate = function(value) { + var res = $.FutureImpl$(); + res._setValue$1(value); + return res; +}; + $._IDBOpenDBRequestEventsImpl$ = function(_ptr) { return new $._IDBOpenDBRequestEventsImpl(_ptr); }; $.typeNameInIE = function(obj) { var name$ = $.constructorNameFallback(obj); - if ($.eqB(name$, 'Window')) return 'DOMWindow'; + if ($.eqB(name$, 'Window')) + return 'DOMWindow'; if ($.eqB(name$, 'Document')) { - if (!!obj.xmlVersion) return 'Document'; + if (!!obj.xmlVersion) + return 'Document'; return 'HTMLDocument'; } - if ($.eqB(name$, 'CanvasPixelArray')) return 'Uint8ClampedArray'; - if ($.eqB(name$, 'HTMLDDElement')) return 'HTMLElement'; - if ($.eqB(name$, 'HTMLDTElement')) return 'HTMLElement'; - if ($.eqB(name$, 'HTMLTableDataCellElement')) return 'HTMLTableCellElement'; - if ($.eqB(name$, 'HTMLTableHeaderCellElement')) return 'HTMLTableCellElement'; - if ($.eqB(name$, 'HTMLPhraseElement')) return 'HTMLElement'; - if ($.eqB(name$, 'MSStyleCSSProperties')) return 'CSSStyleDeclaration'; - if ($.eqB(name$, 'MouseWheelEvent')) return 'WheelEvent'; + if ($.eqB(name$, 'CanvasPixelArray')) + return 'Uint8ClampedArray'; + if ($.eqB(name$, 'HTMLDDElement')) + return 'HTMLElement'; + if ($.eqB(name$, 'HTMLDTElement')) + return 'HTMLElement'; + if ($.eqB(name$, 'HTMLTableDataCellElement')) + return 'HTMLTableCellElement'; + if ($.eqB(name$, 'HTMLTableHeaderCellElement')) + return 'HTMLTableCellElement'; + if ($.eqB(name$, 'HTMLPhraseElement')) + return 'HTMLElement'; + if ($.eqB(name$, 'MSStyleCSSProperties')) + return 'CSSStyleDeclaration'; + if ($.eqB(name$, 'MouseWheelEvent')) + return 'WheelEvent'; return name$; }; @@ -2522,12 +3367,13 @@ $.DoubleLinkedQueueEntry$ = function(e) { }; $.constructorNameFallback = function(obj) { - var constructor$ = (obj.constructor); - if ((typeof(constructor$)) === 'function') { - var name$ = (constructor$.name); - if ((typeof(name$)) === 'string' && ($.isEmpty(name$) !== true && (!(name$ === 'Object') && !(name$ === 'Function.prototype')))) return name$; + var constructor$ = obj.constructor; + if (typeof(constructor$) === 'function') { + var name$ = constructor$.name; + if (typeof(name$) === 'string' && $.isEmpty(name$) !== true && !(name$ === 'Object') && !(name$ === 'Function.prototype')) + return name$; } - var string = (Object.prototype.toString.call(obj)); + var string = Object.prototype.toString.call(obj); return $.substring$2(string, 8, string.length - 1); }; @@ -2540,23 +3386,29 @@ $.NullPointerException$ = function(functionName, arguments$) { }; $._serializeMessage = function(message) { - if ($._globalState().get$needSerialization() === true) return $._JsSerializer$().traverse$1(message); - return $._JsCopier$().traverse$1(message); + if ($._globalState().get$needSerialization() === true) + return $._JsSerializer$().traverse$1(message); + else + return $._JsCopier$().traverse$1(message); }; -$.Math_max = function(a, b) { +$.max = function(a, b) { if (typeof a === 'number') { if (typeof b === 'number') { - if (a > b) return a; - if (a < b) return b; + if (a > b) + return a; + if (a < b) + return b; if (typeof b === 'number') { - if (typeof a === 'number') { - if (a === 0.0) return a + b; - } - if ($.isNaN(b) === true) return b; + if (typeof a === 'number') + if (a === 0.0) + return a + b; + if ($.isNaN(b) === true) + return b; return a; } - if (b === 0 && $.isNegative(a) === true) return b; + if (b === 0 && $.isNegative(a) === true) + return b; return a; } throw $.captureStackTrace($.IllegalArgumentException$(b)); @@ -2565,7 +3417,8 @@ $.Math_max = function(a, b) { }; $.tdiv = function(a, b) { - if ($.checkNumbers(a, b) === true) return $.truncate((a) / (b)); + if ($.checkNumbers(a, b)) + return $.truncate(a / b); return a.operator$tdiv$1(b); }; @@ -2577,55 +3430,73 @@ $.JSSyntaxRegExp$_globalVersionOf = function(other) { return t1; }; -$.clear = function(receiver) { - if ($.isJsArray(receiver) !== true) return receiver.clear$0(); - $.set$length(receiver, 0); -}; - $.typeNameInChrome = function(obj) { - var name$ = (obj.constructor.name); - if (name$ === 'Window') return 'DOMWindow'; - if (name$ === 'CanvasPixelArray') return 'Uint8ClampedArray'; - if (name$ === 'WebKitMutationObserver') return 'MutationObserver'; + var name$ = obj.constructor.name; + if (name$ === 'Window') + return 'DOMWindow'; + if (name$ === 'CanvasPixelArray') + return 'Uint8ClampedArray'; + if (name$ === 'WebKitMutationObserver') + return 'MutationObserver'; return name$; }; +$._deserializeMessage = function(message) { + if ($._globalState().get$needSerialization() === true) + return $._JsDeserializer$().deserialize$1(message); + else + return message; +}; + +$.clear = function(receiver) { + if (!$.isJsArray(receiver)) + return receiver.clear$0(); + $.set$length(receiver, 0); +}; + $.shr = function(a, b) { - if ($.checkNumbers(a, b) === true) { - a = (a); - b = (b); - if (b < 0) throw $.captureStackTrace($.IllegalArgumentException$(b)); + if ($.checkNumbers(a, b)) { + a = a; + b = b; + if (b < 0) + throw $.captureStackTrace($.IllegalArgumentException$(b)); if (a > 0) { - if (b > 31) return 0; + if (b > 31) + return 0; return a >>> b; } - if (b > 31) b = 31; + if (b > 31) + b = 31; return (a >> b) >>> 0; } return a.operator$shr$1(b); }; $.and = function(a, b) { - if ($.checkNumbers(a, b) === true) return (a & b) >>> 0; + if ($.checkNumbers(a, b)) + return (a & b) >>> 0; return a.operator$and$1(b); }; $.substring$2 = function(receiver, startIndex, endIndex) { - if (!(typeof receiver === 'string')) return receiver.substring$2(startIndex, endIndex); $.checkNum(startIndex); var length$ = receiver.length; - if (endIndex == null) endIndex = length$; + if (endIndex == null) + endIndex = length$; $.checkNum(endIndex); - if ($.ltB(startIndex, 0)) throw $.captureStackTrace($.IndexOutOfRangeException$(startIndex)); - if ($.gtB(startIndex, endIndex)) throw $.captureStackTrace($.IndexOutOfRangeException$(startIndex)); - if ($.gtB(endIndex, length$)) throw $.captureStackTrace($.IndexOutOfRangeException$(endIndex)); + if (startIndex < 0) + throw $.captureStackTrace($.IndexOutOfRangeException$(startIndex)); + if ($.gtB(startIndex, endIndex)) + throw $.captureStackTrace($.IndexOutOfRangeException$(startIndex)); + if ($.gtB(endIndex, length$)) + throw $.captureStackTrace($.IndexOutOfRangeException$(endIndex)); return $.substringUnchecked(receiver, startIndex, endIndex); }; $.indexSet = function(a, index, value) { if (a.constructor === Array && !a.immutable$list) { - var key = (index >>> 0); - if (key === index && key < (a.length)) { + var key = index >>> 0; + if (key === index && key < a.length) { a[key] = value; return; } @@ -2646,10 +3517,14 @@ $._DOMApplicationCacheEventsImpl$ = function(_ptr) { }; $.invokeClosure = function(closure, isolate, numberOfArguments, arg1, arg2) { - if ($.eqB(numberOfArguments, 0)) return $._callInIsolate(isolate, new $.invokeClosure_anon(closure)); - if ($.eqB(numberOfArguments, 1)) return $._callInIsolate(isolate, new $.invokeClosure_anon0(closure, arg1)); - if ($.eqB(numberOfArguments, 2)) return $._callInIsolate(isolate, new $.invokeClosure_anon1(closure, arg1, arg2)); - throw $.captureStackTrace($.ExceptionImplementation$('Unsupported number of arguments for wrapped closure')); + if ($.eqB(numberOfArguments, 0)) + return $._callInIsolate(isolate, new $.invokeClosure_anon(closure)); + else if ($.eqB(numberOfArguments, 1)) + return $._callInIsolate(isolate, new $.invokeClosure_anon0(closure, arg1)); + else if ($.eqB(numberOfArguments, 2)) + return $._callInIsolate(isolate, new $.invokeClosure_anon1(closure, arg1, arg2)); + else + throw $.captureStackTrace($.ExceptionImplementation$('Unsupported number of arguments for wrapped closure')); }; $.stringJoinUnchecked = function(array, separator) { @@ -2657,24 +3532,29 @@ $.stringJoinUnchecked = function(array, separator) { }; $.gt = function(a, b) { - return typeof a === 'number' && typeof b === 'number' ? (a > b) : $.gt$slow(a, b); + return typeof a === 'number' && typeof b === 'number' ? a > b : $.gt$slow(a, b); }; $.buildDynamicMetadata = function(inputTable) { - if (typeof inputTable !== 'string' && (typeof inputTable !== 'object' || inputTable === null || (inputTable.constructor !== Array && !inputTable.is$JavaScriptIndexingBehavior()))) return $.buildDynamicMetadata$bailout(1, inputTable, 0, 0, 0, 0, 0, 0); + if (typeof inputTable !== 'string' && (typeof inputTable !== 'object' || inputTable === null || inputTable.constructor !== Array && !inputTable.is$JavaScriptIndexingBehavior())) + return $.buildDynamicMetadata$bailout(1, inputTable, 0, 0, 0, 0, 0, 0); var result = []; for (var i = 0; t1 = inputTable.length, i < t1; ++i) { - if (i < 0 || i >= t1) throw $.ioore(i); + if (i < 0 || i >= t1) + throw $.ioore(i); var tag = $.index(inputTable[i], 0); var t2 = inputTable.length; - if (i < 0 || i >= t2) throw $.ioore(i); + if (i < 0 || i >= t2) + throw $.ioore(i); var tags = $.index(inputTable[i], 1); var set = $.HashSetImplementation$(); - $.setRuntimeTypeInfo(set, ({E: 'String'})); + $.setRuntimeTypeInfo(set, {E: 'String'}); var tagNames = $.split(tags, '|'); - if (typeof tagNames !== 'string' && (typeof tagNames !== 'object' || tagNames === null || (tagNames.constructor !== Array && !tagNames.is$JavaScriptIndexingBehavior()))) return $.buildDynamicMetadata$bailout(2, inputTable, result, tagNames, tag, i, tags, set); + if (typeof tagNames !== 'string' && (typeof tagNames !== 'object' || tagNames === null || tagNames.constructor !== Array && !tagNames.is$JavaScriptIndexingBehavior())) + return $.buildDynamicMetadata$bailout(2, inputTable, result, tagNames, tag, i, tags, set); for (var j = 0; t1 = tagNames.length, j < t1; ++j) { - if (j < 0 || j >= t1) throw $.ioore(j); + if (j < 0 || j >= t1) + throw $.ioore(j); set.add$1(tagNames[j]); } $.add$1(result, $.MetaInfo$(tag, tags, set)); @@ -2684,7 +3564,8 @@ $.buildDynamicMetadata = function(inputTable) { }; $.contains$1 = function(receiver, other) { - if (!(typeof receiver === 'string')) return receiver.contains$1(other); + if (!(typeof receiver === 'string')) + return receiver.contains$1(other); return $.contains$2(receiver, other, 0); }; @@ -2693,28 +3574,29 @@ $._EventSourceEventsImpl$ = function(_ptr) { }; $.mul = function(a, b) { - return typeof a === 'number' && typeof b === 'number' ? (a * b) : $.mul$slow(a, b); -}; - -$.Math_parseInt = function(str) { - return $.MathNatives_parseInt(str); + return typeof a === 'number' && typeof b === 'number' ? a * b : $.mul$slow(a, b); }; -$.MathNatives_parseInt = function(str) { +$.parseInt = function(str) { $.checkString(str); - if (!(/^\s*[+-]?(?:0[xX][abcdefABCDEF0-9]+|\d+)\s*$/.test(str))) throw $.captureStackTrace($.FormatException$(str)); + if (!/^\s*[+-]?(?:0[xX][abcdefABCDEF0-9]+|\d+)\s*$/.test(str)) + throw $.captureStackTrace($.FormatException$(str)); var trimmed = $.trim(str); - if ($.gtB($.get$length(trimmed), 2)) { + if ($.gtB($.get$length(trimmed), 2)) var t1 = $.eqB($.index(trimmed, 1), 'x') || $.eqB($.index(trimmed, 1), 'X'); - } else t1 = false; - if (!t1) { - if ($.gtB($.get$length(trimmed), 3)) { + else + t1 = false; + if (!t1) + if ($.gtB($.get$length(trimmed), 3)) t1 = $.eqB($.index(trimmed, 2), 'x') || $.eqB($.index(trimmed, 2), 'X'); - } else t1 = false; - } else t1 = true; + else + t1 = false; + else + t1 = true; var base = t1 ? 16 : 10; - var ret = (parseInt(trimmed, base)); - if ($.isNaN(ret) === true) throw $.captureStackTrace($.FormatException$(str)); + var ret = parseInt(trimmed, base); + if ($.isNaN(ret) === true) + throw $.captureStackTrace($.FormatException$(str)); return ret; }; @@ -2722,17 +3604,22 @@ $._NotificationEventsImpl$ = function(_ptr) { return new $._NotificationEventsImpl(_ptr); }; +$._Deserializer_isPrimitive = function(x) { + return x == null || typeof x === 'string' || typeof x === 'number' || typeof x === 'boolean'; +}; + $._MessageTraverser_isPrimitive = function(x) { - return x == null || (typeof x === 'string' || (typeof x === 'number' || typeof x === 'boolean')); + return x == null || typeof x === 'string' || typeof x === 'number' || typeof x === 'boolean'; }; $.Collections__emitCollection = function(c, result, visiting) { $.add$1(visiting, c); var isList = typeof c === 'object' && c !== null && (c.constructor === Array || c.is$List()); $.add$1(result, isList ? '[' : '{'); - for (var t1 = $.iterator(c), first = true; t1.hasNext$0() === true; ) { + for (var t1 = $.iterator(c), first = true; t1.hasNext$0() === true;) { var t2 = t1.next$0(); - !first && $.add$1(result, ', '); + if (!first) + $.add$1(result, ', '); $.Collections__emitObject(t2, result, visiting); first = false; } @@ -2741,16 +3628,18 @@ $.Collections__emitCollection = function(c, result, visiting) { }; $.checkMutable = function(list, reason) { - if (!!(list.immutable$list)) throw $.captureStackTrace($.UnsupportedOperationException$(reason)); + if (!!(list.immutable$list)) + throw $.captureStackTrace($.UnsupportedOperationException$(reason)); }; $.sub$slow = function(a, b) { - if ($.checkNumbers(a, b) === true) return a - b; + if ($.checkNumbers(a, b)) + return a - b; return a.operator$sub$1(b); }; $.toStringWrapper = function() { - return $.toString((this.dartException)); + return $.toString(this.dartException); }; $._PeerConnection00EventsImpl$ = function(_ptr) { @@ -2761,13 +3650,18 @@ $._WorkerContextEventsImpl$ = function(_ptr) { return new $._WorkerContextEventsImpl(_ptr); }; +$._setTimerFactoryClosure = function(closure) { + $._TimerFactory__factory = closure; +}; + $._DocumentEventsImpl$ = function(_ptr) { return new $._DocumentEventsImpl(_ptr); }; $.typeNameInOpera = function(obj) { var name$ = $.constructorNameFallback(obj); - if ($.eqB(name$, 'Window')) return 'DOMWindow'; + if ($.eqB(name$, 'Window')) + return 'DOMWindow'; return name$; }; @@ -2790,13 +3684,12 @@ $._IDBRequestEventsImpl$ = function(_ptr) { }; $.stringSplitUnchecked = function(receiver, pattern) { - if (typeof pattern === 'string') return receiver.split(pattern); - if (typeof pattern === 'object' && pattern !== null && !!pattern.is$JSSyntaxRegExp) return receiver.split($.regExpGetNative(pattern)); - throw $.captureStackTrace('StringImplementation.split(Pattern) UNIMPLEMENTED'); + return receiver.split(pattern); }; $.checkGrowable = function(list, reason) { - if (!!(list.fixed$length)) throw $.captureStackTrace($.UnsupportedOperationException$(reason)); + if (!!(list.fixed$length)) + throw $.captureStackTrace($.UnsupportedOperationException$(reason)); }; $._SpeechRecognitionEventsImpl$ = function(_ptr) { @@ -2807,17 +3700,41 @@ $._MediaStreamTrackEventsImpl$ = function(_ptr) { return new $._MediaStreamTrackEventsImpl(_ptr); }; +$._timerFactory = function(millis, callback, repeating) { + return repeating === true ? $._Timer$repeating(millis, callback) : $._Timer$(millis, callback); +}; + $._SVGElementInstanceEventsImpl$ = function(_ptr) { return new $._SVGElementInstanceEventsImpl(_ptr); }; -$.isEmpty = function(receiver) { - if (typeof receiver === 'string' || $.isJsArray(receiver) === true) return receiver.length === 0; - return receiver.isEmpty$0(); +$.Futures_wait = function(futures) { + var t1 = {}; + if (typeof futures !== 'string' && (typeof futures !== 'object' || futures === null || futures.constructor !== Array && !futures.is$JavaScriptIndexingBehavior())) + return $.Futures_wait$bailout(1, futures, t1); + if ($.isEmpty(futures) === true) { + t1 = $.FutureImpl_FutureImpl$immediate($.CTC); + $.setRuntimeTypeInfo(t1, {T: 'List'}); + return t1; + } + var completer = $.CompleterImpl$(); + $.setRuntimeTypeInfo(completer, {T: 'List'}); + var result = completer.get$future(); + t1.remaining_1 = futures.length; + var values = $.ListFactory_List(futures.length); + for (var i = 0; t2 = futures.length, i < t2; ++i) { + if (i < 0 || i >= t2) + throw $.ioore(i); + var future = futures[i]; + future.then$1(new $.Futures_wait_anon(result, i, completer, t1, values)); + future.handleException$1(new $.Futures_wait_anon0(result, completer, future)); + } + return result; + var t2; }; $.add$1 = function(receiver, value) { - if ($.isJsArray(receiver) === true) { + if ($.isJsArray(receiver)) { $.checkGrowable(receiver, 'add'); receiver.push(value); return; @@ -2826,115 +3743,141 @@ $.add$1 = function(receiver, value) { }; $.regExpExec = function(regExp, str) { - var result = ($.regExpGetNative(regExp).exec(str)); - if (result === null) return; + var result = $.regExpGetNative(regExp).exec(str); + if (result === null) + return; return result; }; -$.add = function(a, b) { - return typeof a === 'number' && typeof b === 'number' ? (a + b) : $.add$slow(a, b); -}; - $.geB = function(a, b) { - return typeof a === 'number' && typeof b === 'number' ? (a >= b) : $.ge$slow(a, b) === true; + return typeof a === 'number' && typeof b === 'number' ? a >= b : $.ge$slow(a, b) === true; }; $.stringContainsUnchecked = function(receiver, other, startIndex) { - if (typeof other === 'string') return !($.indexOf$2(receiver, other, startIndex) === -1); - if (typeof other === 'object' && other !== null && !!other.is$JSSyntaxRegExp) return other.hasMatch$1($.substring$1(receiver, startIndex)); - return $.iterator($.allMatches(other, $.substring$1(receiver, startIndex))).hasNext$0(); + if (typeof other === 'string') + return !($.indexOf$2(receiver, other, startIndex) === -1); + else if (typeof other === 'object' && other !== null && !!other.is$JSSyntaxRegExp) + return other.hasMatch$1($.substring$1(receiver, startIndex)); + else + return $.iterator($.allMatches(other, $.substring$1(receiver, startIndex))).hasNext$0(); +}; + +$._Timer$repeating = function(milliSeconds, callback) { + var t1 = new $._Timer(null, false); + t1._Timer$repeating$2(milliSeconds, callback); + return t1; }; $.ObjectNotClosureException$ = function() { return new $.ObjectNotClosureException(); }; +$.iterator = function(receiver) { + if ($.isJsArray(receiver)) + return $.ListIterator$(receiver); + return receiver.iterator$0(); +}; + $.window = function() { - return window;; +return window; }; $.abs = function(receiver) { - if (!(typeof receiver === 'number')) return receiver.abs$0(); + if (!(typeof receiver === 'number')) + return receiver.abs$0(); return Math.abs(receiver); }; $.typeNameInSafari = function(obj) { var name$ = $.constructorNameFallback(obj); - if ($.eqB(name$, 'Window')) return 'DOMWindow'; - if ($.eqB(name$, 'CanvasPixelArray')) return 'Uint8ClampedArray'; - if ($.eqB(name$, 'WebKitMutationObserver')) return 'MutationObserver'; + if ($.eqB(name$, 'Window')) + return 'DOMWindow'; + if ($.eqB(name$, 'CanvasPixelArray')) + return 'Uint8ClampedArray'; + if ($.eqB(name$, 'WebKitMutationObserver')) + return 'MutationObserver'; return name$; }; $.gcf = function(n, d) { - if (typeof n !== 'number') return $.gcf$bailout(1, n, d, 0); - if (typeof d !== 'number') return $.gcf$bailout(1, n, d, 0); - if (n === d) return n; - var i = $.tdiv($.Math_max(n, d), 2); - if (typeof i !== 'number') return $.gcf$bailout(2, n, d, i); - for (; i > 1; --i) { - if ($.mod(n, i) === 0 && $.mod(d, i) === 0) return i; - } + if (typeof n !== 'number') + return $.gcf$bailout(1, n, d); + if (typeof d !== 'number') + return $.gcf$bailout(1, n, d); + if (n === d) + return n; + for (var i = $.tdiv($.max(n, d), 2); i > 1; --i) + if ($.mod(n, i) === 0 && $.mod(d, i) === 0) + return i; return 1; }; $.Primitives_objectTypeName = function(object) { var name$ = $.constructorNameFallback(object); if ($.eqB(name$, 'Object')) { - var decompiled = (String(object.constructor).match(/^\s*function\s*(\S*)\s*\(/)[1]); - if (typeof decompiled === 'string') name$ = decompiled; + var decompiled = String(object.constructor).match(/^\s*function\s*(\S*)\s*\(/)[1]; + if (typeof decompiled === 'string') + name$ = decompiled; } return $.charCodeAt(name$, 0) === 36 ? $.substring$1(name$, 1) : name$; }; -$.regExpAttachGlobalNative = function(regExp) { - regExp._re = $.regExpMakeNative(regExp, true); +$.add = function(a, b) { + return typeof a === 'number' && typeof b === 'number' ? a + b : $.add$slow(a, b); }; -$.iterator = function(receiver) { - if ($.isJsArray(receiver) === true) return $.ListIterator$(receiver); - return receiver.iterator$0(); +$.regExpAttachGlobalNative = function(regExp) { + regExp._re = $.regExpMakeNative(regExp, true); }; $.leB = function(a, b) { - return typeof a === 'number' && typeof b === 'number' ? (a <= b) : $.le$slow(a, b) === true; + return typeof a === 'number' && typeof b === 'number' ? a <= b : $.le$slow(a, b) === true; }; $.isNegative = function(receiver) { - if (typeof receiver === 'number') { - return receiver === 0 ? 1 / receiver < 0 : receiver < 0; - } - return receiver.isNegative$0(); + return receiver === 0 ? 1 / receiver < 0 : receiver < 0; }; $.mod = function(a, b) { - if ($.checkNumbers(a, b) === true) { - var result = (a % b); - if (result === 0) return 0; - if (result > 0) return result; - b = (b); - if (b < 0) return result - b; - return result + b; + if ($.checkNumbers(a, b)) { + var result = a % b; + if (result === 0) + return 0; + if (result > 0) + return result; + b = b; + if (b < 0) + return result - b; + else + return result + b; } return a.operator$mod$1(b); }; $.regExpMakeNative = function(regExp, global) { - var pattern = regExp.get$pattern(); - var multiLine = regExp.get$multiLine(); - var ignoreCase = regExp.get$ignoreCase(); + var pattern = regExp.pattern; + var multiLine = regExp.multiLine; + var ignoreCase = regExp.ignoreCase; $.checkString(pattern); var sb = $.StringBufferImpl$(''); - multiLine === true && $.add$1(sb, 'm'); - ignoreCase === true && $.add$1(sb, 'i'); - global === true && $.add$1(sb, 'g'); + if (multiLine === true) + $.add$1(sb, 'm'); + if (ignoreCase === true) + $.add$1(sb, 'i'); + if (global) + $.add$1(sb, 'g'); try { return new RegExp(pattern, $.toString(sb)); } catch (exception) { var t1 = $.unwrapException(exception); var e = t1; - throw $.captureStackTrace($.IllegalJSRegExpException$(pattern, (String(e)))); + throw $.captureStackTrace($.IllegalJSRegExpException$(pattern, String(e))); } + +}; + +$._JsDeserializer$ = function() { + return new $._JsDeserializer(null); }; $.Maps_mapToString = function(m) { @@ -2943,8 +3886,10 @@ $.Maps_mapToString = function(m) { return result.toString$0(); }; -$._XMLHttpRequestEventsImpl$ = function(_ptr) { - return new $._XMLHttpRequestEventsImpl(_ptr); +$.isEmpty = function(receiver) { + if (typeof receiver === 'string' || $.isJsArray(receiver)) + return receiver.length === 0; + return receiver.isEmpty$0(); }; $._JavaScriptAudioNodeEventsImpl$ = function(_ptr) { @@ -2952,22 +3897,26 @@ $._JavaScriptAudioNodeEventsImpl$ = function(_ptr) { }; $.Collections__emitObject = function(o, result, visiting) { - if (typeof o === 'object' && o !== null && (o.constructor === Array || o.is$Collection())) { - if ($.Collections__containsRef(visiting, o) === true) { + if (typeof o === 'object' && o !== null && (o.constructor === Array || o.is$Collection())) + if ($.Collections__containsRef(visiting, o)) $.add$1(result, typeof o === 'object' && o !== null && (o.constructor === Array || o.is$List()) ? '[...]' : '{...}'); - } else $.Collections__emitCollection(o, result, visiting); - } else { - if (typeof o === 'object' && o !== null && o.is$Map()) { - if ($.Collections__containsRef(visiting, o) === true) $.add$1(result, '{...}'); - else $.Maps__emitMap(o, result, visiting); - } else { - $.add$1(result, o == null ? 'null' : o); - } - } + else + $.Collections__emitCollection(o, result, visiting); + else if (typeof o === 'object' && o !== null && o.is$Map()) + if ($.Collections__containsRef(visiting, o)) + $.add$1(result, '{...}'); + else + $.Maps__emitMap(o, result, visiting); + else + $.add$1(result, o == null ? 'null' : o); +}; + +$._IsolateEvent$ = function(isolate, fn, message) { + return new $._IsolateEvent(message, fn, isolate); }; $.Maps__emitMap = function(m, result, visiting) { - var t1 = ({}); + var t1 = {}; $.add$1(visiting, m); $.add$1(result, '{'); t1.first_1 = true; @@ -2993,15 +3942,16 @@ $.UnsupportedOperationException$ = function(_message) { }; $.indexOf$2 = function(receiver, element, start) { - if ($.isJsArray(receiver) === true) { - if (!((typeof start === 'number') && (start === (start | 0)))) throw $.captureStackTrace($.IllegalArgumentException$(start)); - return $.Arrays_indexOf(receiver, element, start, (receiver.length)); - } - if (typeof receiver === 'string') { + if ($.isJsArray(receiver)) { + if (!(typeof start === 'number' && start === (start | 0))) + throw $.captureStackTrace($.IllegalArgumentException$(start)); + return $.Arrays_indexOf(receiver, element, start, receiver.length); + } else if (typeof receiver === 'string') { $.checkNull(element); - if (!((typeof start === 'number') && (start === (start | 0)))) throw $.captureStackTrace($.IllegalArgumentException$(start)); - if (!(typeof element === 'string')) throw $.captureStackTrace($.IllegalArgumentException$(element)); - if (start < 0) return -1; + if (!(typeof start === 'number' && start === (start | 0))) + throw $.captureStackTrace($.IllegalArgumentException$(start)); + if (start < 0) + return -1; return receiver.indexOf(element, start); } return receiver.indexOf$2(element, start); @@ -3015,6 +3965,12 @@ $._FileReaderEventsImpl$ = function(_ptr) { return new $._FileReaderEventsImpl(_ptr); }; +$._Timer$ = function(milliSeconds, callback) { + var t1 = new $._Timer(null, true); + t1._Timer$2(milliSeconds, callback); + return t1; +}; + $._JsCopier$ = function() { var t1 = new $._JsCopier($._MessageTraverserVisitedMap$()); t1._JsCopier$0(); @@ -3032,7 +3988,7 @@ $._Manager$ = function() { }; $._ElementFactoryProvider_Element$tag = function(tag) { - return document.createElement(tag); +return document.createElement(tag) }; $._FrameSetElementEventsImpl$ = function(_ptr) { @@ -3040,7 +3996,8 @@ $._FrameSetElementEventsImpl$ = function(_ptr) { }; $.add$slow = function(a, b) { - if ($.checkNumbers(a, b) === true) return a + b; + if ($.checkNumbers(a, b)) + return a + b; return a.operator$add$1(b); }; @@ -3049,9 +4006,11 @@ $._WorkerSendPort$ = function(_workerId, isolateId, _receivePortId) { }; $.Primitives_newList = function(length$) { - if (length$ == null) return new Array(); - if (!((typeof length$ === 'number') && (length$ === (length$ | 0))) || length$ < 0) throw $.captureStackTrace($.IllegalArgumentException$(length$)); - var result = (new Array(length$)); + if (length$ == null) + return new Array(); + if (!(typeof length$ === 'number' && length$ === (length$ | 0)) || length$ < 0) + throw $.captureStackTrace($.IllegalArgumentException$(length$)); + var result = new Array(length$); result.fixed$length = true; return result; }; @@ -3082,12 +4041,6 @@ $._MediaElementEventsImpl$ = function(_ptr) { return new $._MediaElementEventsImpl(_ptr); }; -$.addLast = function(receiver, value) { - if ($.isJsArray(receiver) !== true) return receiver.addLast$1(value); - $.checkGrowable(receiver, 'addLast'); - receiver.push(value); -}; - $._IDBTransactionEventsImpl$ = function(_ptr) { return new $._IDBTransactionEventsImpl(_ptr); }; @@ -3096,10 +4049,23 @@ $._AllMatchesIterator$ = function(re, _str) { return new $._AllMatchesIterator(false, null, _str, $.JSSyntaxRegExp$_globalVersionOf(re)); }; +$.addLast = function(receiver, value) { + if (!$.isJsArray(receiver)) + return receiver.addLast$1(value); + $.checkGrowable(receiver, 'addLast'); + receiver.push(value); +}; + $._BodyElementEventsImpl$ = function(_ptr) { return new $._BodyElementEventsImpl(_ptr); }; +$.FutureImpl$ = function() { + var t1 = []; + var t2 = []; + return new $.FutureImpl([], t2, t1, false, null, null, null, false); +}; + $.iae = function(argument) { throw $.captureStackTrace($.IllegalArgumentException$(argument)); }; @@ -3117,41 +4083,39 @@ $.Spirodraw$ = function() { }; $.truncate = function(receiver) { - if (!(typeof receiver === 'number')) return receiver.truncate$0(); return receiver < 0 ? $.ceil(receiver) : $.floor(receiver); }; $.isNaN = function(receiver) { - if (typeof receiver === 'number') return isNaN(receiver); - return receiver.isNaN$0(); + return isNaN(receiver); }; $.isInfinite = function(receiver) { - if (!(typeof receiver === 'number')) return receiver.isInfinite$0(); - return (receiver == Infinity) || (receiver == -Infinity); + return receiver == Infinity || receiver == -Infinity; }; $.allMatchesInStringUnchecked = function(needle, haystack) { var result = $.ListFactory_List(null); - $.setRuntimeTypeInfo(result, ({E: 'Match'})); + $.setRuntimeTypeInfo(result, {E: 'Match'}); var length$ = $.get$length(haystack); - var patternLength = $.get$length(needle); - if (patternLength !== (patternLength | 0)) return $.allMatchesInStringUnchecked$bailout(1, needle, haystack, length$, patternLength, result); - for (var startIndex = 0; true; ) { + var patternLength = needle.length; + for (var startIndex = 0; true;) { var position = $.indexOf$2(haystack, needle, startIndex); - if ($.eqB(position, -1)) break; + if ($.eqB(position, -1)) + break; result.push($.StringMatch$(position, haystack, needle)); var endIndex = $.add(position, patternLength); - if ($.eqB(endIndex, length$)) break; - else { + if ($.eqB(endIndex, length$)) + break; + else startIndex = $.eqB(position, endIndex) ? $.add(startIndex, 1) : endIndex; - } } return result; }; $.le$slow = function(a, b) { - if ($.checkNumbers(a, b) === true) return a <= b; + if ($.checkNumbers(a, b)) + return a <= b; return a.operator$le$1(b); }; @@ -3165,13 +4129,12 @@ $.dynamicSetMetadata = function(inputTable) { }; $.endsWith = function(receiver, other) { - if (!(typeof receiver === 'string')) return receiver.endsWith$1(other); $.checkString(other); var receiverLength = receiver.length; - var otherLength = $.get$length(other); - if ($.gtB(otherLength, receiverLength)) return false; - if (typeof otherLength !== 'number') throw $.iae(otherLength); - return $.eq(other, $.substring$1(receiver, receiverLength - otherLength)); + var otherLength = other.length; + if (otherLength > receiverLength) + return false; + return other === $.substring$1(receiver, receiverLength - otherLength); }; $.ListIterator$ = function(list) { @@ -3186,12 +4149,16 @@ $.checkNum = function(value) { return value; }; +$.FutureAlreadyCompleteException$ = function() { + return new $.FutureAlreadyCompleteException(); +}; + $._WorkerEventsImpl$ = function(_ptr) { return new $._WorkerEventsImpl(_ptr); }; $.ltB = function(a, b) { - return typeof a === 'number' && typeof b === 'number' ? (a < b) : $.lt$slow(a, b) === true; + return typeof a === 'number' && typeof b === 'number' ? a < b : $.lt$slow(a, b) === true; }; $._currentIsolate = function() { @@ -3199,12 +4166,14 @@ $._currentIsolate = function() { }; $.convertDartClosureToJS = function(closure, arity) { - if (closure == null) return; - var function$ = (closure.$identity); - if (!!function$) return function$; - function$ = (function() { - return $.invokeClosure.$call$5(closure, $._currentIsolate(), arity, arguments[0], arguments[1]); - }); + if (closure == null) + return; + var function$ = closure.$identity; + if (!!function$) + return function$; + function$ = function() { + return $.invokeClosure.call$5(closure, $._currentIsolate(), arity, arguments[0], arguments[1]); + }; closure.$identity = function$; return function$; }; @@ -3220,7 +4189,8 @@ $._FixedSizeListIterator$ = function(array) { }; $.split = function(receiver, pattern) { - if (!(typeof receiver === 'string')) return receiver.split$1(pattern); + if (!(typeof receiver === 'string')) + return receiver.split$1(pattern); $.checkNull(pattern); return $.stringSplitUnchecked(receiver, pattern); }; @@ -3241,35 +4211,47 @@ $._DoubleLinkedQueueIterator$ = function(_sentinel) { $.S = function(value) { var res = $.toString(value); - if (!(typeof res === 'string')) throw $.captureStackTrace($.IllegalArgumentException$(value)); + if (!(typeof res === 'string')) + throw $.captureStackTrace($.IllegalArgumentException$(value)); return res; }; -$._TextTrackListEventsImpl$ = function(_ptr) { - return new $._TextTrackListEventsImpl(_ptr); -}; - $._dynamicMetadata = function(table) { $dynamicMetadata = table; }; +$._TextTrackListEventsImpl$ = function(_ptr) { + return new $._TextTrackListEventsImpl(_ptr); +}; + $._dynamicMetadata0 = function() { - if ((typeof($dynamicMetadata)) === 'undefined') { + if (typeof($dynamicMetadata) === 'undefined') { var t1 = []; $._dynamicMetadata(t1); } return $dynamicMetadata; }; +$.Random_Random = function(seed) { + return $.CTC3; +}; + $.LinkedHashMapImplementation$ = function() { var t1 = new $.LinkedHashMapImplementation(null, null); t1.LinkedHashMapImplementation$0(); return t1; }; +$._PendingSendPortFinder$ = function() { + var t1 = $._MessageTraverserVisitedMap$(); + t1 = new $._PendingSendPortFinder([], t1); + t1._PendingSendPortFinder$0(); + return t1; +}; + $.regExpGetNative = function(regExp) { - var r = (regExp._re); - return r == null ? (regExp._re = $.regExpMakeNative(regExp, false)) : r; + var r = regExp._re; + return r == null ? regExp._re = $.regExpMakeNative(regExp, false) : r; }; $.throwNoSuchMethod = function(obj, name$, arguments$) { @@ -3277,10 +4259,15 @@ $.throwNoSuchMethod = function(obj, name$, arguments$) { }; $.checkNull = function(object) { - if (object == null) throw $.captureStackTrace($.NullPointerException$(null, $.CTC)); + if (object == null) + throw $.captureStackTrace($.NullPointerException$(null, $.CTC)); return object; }; +$.CompleterImpl$ = function() { + return new $.CompleterImpl($.FutureImpl$()); +}; + $.StackTrace$ = function(stack) { return new $.StackTrace(stack); }; @@ -3290,9 +4277,9 @@ $._EventListenerListImpl$ = function(_ptr, _type) { }; $._fillStatics = function(context) { - $globals = context.isolateStatics; + $globals = context.isolateStatics; $static_init(); -; + }; $._WindowEventsImpl$ = function(_ptr) { @@ -3306,22 +4293,16 @@ $.DoubleLinkedQueue$ = function() { }; $.checkNumbers = function(a, b) { - if (typeof a === 'number') { - if (typeof b === 'number') return true; - $.checkNull(b); - throw $.captureStackTrace($.IllegalArgumentException$(b)); - } + if (typeof a === 'number') + if (typeof b === 'number') + return true; + else { + $.checkNull(b); + throw $.captureStackTrace($.IllegalArgumentException$(b)); + } return false; }; -$.Math_random = function() { - return $.MathNatives_random(); -}; - -$.MathNatives_random = function() { - return Math.random(); -}; - $._DoubleLinkedQueueEntrySentinel$ = function() { var t1 = new $._DoubleLinkedQueueEntrySentinel(null, null, null); t1.DoubleLinkedQueueEntry$1(null); @@ -3330,28 +4311,32 @@ $._DoubleLinkedQueueEntrySentinel$ = function() { }; $.lt$slow = function(a, b) { - if ($.checkNumbers(a, b) === true) return a < b; + if ($.checkNumbers(a, b)) + return a < b; return a.operator$lt$1(b); }; $.index$slow = function(a, index) { - if (typeof a === 'string' || $.isJsArray(a) === true) { - if (!((typeof index === 'number') && (index === (index | 0)))) { - if (!(typeof index === 'number')) throw $.captureStackTrace($.IllegalArgumentException$(index)); - if (!($.truncate(index) === index)) throw $.captureStackTrace($.IllegalArgumentException$(index)); + if (typeof a === 'string' || $.isJsArray(a)) { + if (!(typeof index === 'number' && index === (index | 0))) { + if (!(typeof index === 'number')) + throw $.captureStackTrace($.IllegalArgumentException$(index)); + if (!($.truncate(index) === index)) + throw $.captureStackTrace($.IllegalArgumentException$(index)); } - if ($.ltB(index, 0) || $.geB(index, $.get$length(a))) throw $.captureStackTrace($.IndexOutOfRangeException$(index)); + if ($.ltB(index, 0) || $.geB(index, $.get$length(a))) + throw $.captureStackTrace($.IndexOutOfRangeException$(index)); return a[index]; } return a.operator$index$1(index); }; $._globalState = function() { - return $globalState;; +return $globalState; }; $._globalState0 = function(val) { - $globalState = val;; +$globalState = val; }; $.ColorPicker$ = function(canvasElement) { @@ -3360,8 +4345,15 @@ $.ColorPicker$ = function(canvasElement) { return t1; }; +$._ReceivePortImpl$ = function() { + var t1 = $._ReceivePortImpl__nextFreeId; + $._ReceivePortImpl__nextFreeId = $.add(t1, 1); + t1 = new $._ReceivePortImpl(null, t1); + t1._ReceivePortImpl$0(); + return t1; +}; + $.contains$2 = function(receiver, other, startIndex) { - if (!(typeof receiver === 'string')) return receiver.contains$2(other, startIndex); $.checkNull(other); return $.stringContainsUnchecked(receiver, other, startIndex); }; @@ -3370,29 +4362,39 @@ $._MainManagerStub$ = function() { return new $._MainManagerStub(); }; +$._HttpRequestEventsImpl$ = function(_ptr) { + return new $._HttpRequestEventsImpl(_ptr); +}; + $.StringBase__toJsStringArray = function(strings) { - if (typeof strings !== 'object' || strings === null || ((strings.constructor !== Array || !!strings.immutable$list) && !strings.is$JavaScriptIndexingBehavior())) return $.StringBase__toJsStringArray$bailout(1, strings); + if (typeof strings !== 'object' || strings === null || (strings.constructor !== Array || !!strings.immutable$list) && !strings.is$JavaScriptIndexingBehavior()) + return $.StringBase__toJsStringArray$bailout(1, strings); $.checkNull(strings); var length$ = strings.length; - if ($.isJsArray(strings) === true) { + if ($.isJsArray(strings)) { for (var i = 0; i < length$; ++i) { var t1 = strings.length; - if (i < 0 || i >= t1) throw $.ioore(i); + if (i < 0 || i >= t1) + throw $.ioore(i); var string = strings[i]; $.checkNull(string); - if (!(typeof string === 'string')) throw $.captureStackTrace($.IllegalArgumentException$(string)); + if (!(typeof string === 'string')) + throw $.captureStackTrace($.IllegalArgumentException$(string)); } var array = strings; } else { array = $.ListFactory_List(length$); for (i = 0; i < length$; ++i) { t1 = strings.length; - if (i < 0 || i >= t1) throw $.ioore(i); + if (i < 0 || i >= t1) + throw $.ioore(i); string = strings[i]; $.checkNull(string); - if (!(typeof string === 'string')) throw $.captureStackTrace($.IllegalArgumentException$(string)); + if (!(typeof string === 'string')) + throw $.captureStackTrace($.IllegalArgumentException$(string)); t1 = array.length; - if (i < 0 || i >= t1) throw $.ioore(i); + if (i < 0 || i >= t1) + throw $.ioore(i); array[i] = string; } } @@ -3408,32 +4410,22 @@ $._MessageTraverserVisitedMap$ = function() { }; $.getTraceFromException = function(exception) { - return $.StackTrace$((exception.stack)); + return $.StackTrace$(exception.stack); }; $._TextTrackEventsImpl$ = function(_ptr) { return new $._TextTrackEventsImpl(_ptr); }; -$.toString = function(value) { - if (typeof value == "object" && value !== null) { - if ($.isJsArray(value) === true) return $.Collections_collectionToString(value); - return value.toString$0(); - } - if (value === 0 && (1 / value) < 0) return '-0.0'; - if (value == null) return 'null'; - if (typeof value == "function") return 'Closure'; - return String(value); -}; - $.charCodeAt = function(receiver, index) { if (typeof receiver === 'string') { - if (!(typeof index === 'number')) throw $.captureStackTrace($.IllegalArgumentException$(index)); - if (index < 0) throw $.captureStackTrace($.IndexOutOfRangeException$(index)); - if (index >= receiver.length) throw $.captureStackTrace($.IndexOutOfRangeException$(index)); + if (index < 0) + throw $.captureStackTrace($.IndexOutOfRangeException$(index)); + if (index >= receiver.length) + throw $.captureStackTrace($.IndexOutOfRangeException$(index)); return receiver.charCodeAt(index); - } - return receiver.charCodeAt$1(index); + } else + return receiver.charCodeAt$1(index); }; $._BatteryManagerEventsImpl$ = function(_ptr) { @@ -3445,16 +4437,19 @@ $._MediaStreamTrackListEventsImpl$ = function(_ptr) { }; $.toInt = function(receiver) { - if (!(typeof receiver === 'number')) return receiver.toInt$0(); - if ($.isNaN(receiver) === true) throw $.captureStackTrace($.FormatException$('NaN')); - if ($.isInfinite(receiver) === true) throw $.captureStackTrace($.FormatException$('Infinity')); + if (!(typeof receiver === 'number')) + return receiver.toInt$0(); + if ($.isNaN(receiver) === true) + throw $.captureStackTrace($.FormatException$('NaN')); + if ($.isInfinite(receiver) === true) + throw $.captureStackTrace($.FormatException$('Infinity')); var truncated = $.truncate(receiver); - return (truncated == -0.0) ? 0 : truncated; + return truncated == -0.0 ? 0 : truncated; }; $._EventLoop$ = function() { var t1 = $.DoubleLinkedQueue$(); - $.setRuntimeTypeInfo(t1, ({E: '_IsolateEvent'})); + $.setRuntimeTypeInfo(t1, {E: '_IsolateEvent'}); return new $._EventLoop(t1); }; @@ -3462,10 +4457,6 @@ $._WebSocketEventsImpl$ = function(_ptr) { return new $._WebSocketEventsImpl(_ptr); }; -$.KeyValuePair$ = function(key, value) { - return new $.KeyValuePair(value, key); -}; - $.Collections_collectionToString = function(c) { var result = $.StringBufferImpl$(''); $.Collections__emitCollection(c, result, $.ListFactory_List(null)); @@ -3476,6 +4467,10 @@ $.MetaInfo$ = function(tag, tags, set) { return new $.MetaInfo(set, tags, tag); }; +$.KeyValuePair$ = function(key, value) { + return new $.KeyValuePair(value, key); +}; + $._MediaStreamEventsImpl$ = function(_ptr) { return new $._MediaStreamEventsImpl(_ptr); }; @@ -3490,14 +4485,16 @@ $.defineProperty = function(obj, property, value) { }; $.dynamicFunction = function(name$) { - var f = (Object.prototype[name$]); - if (!(f == null) && (!!f.methods)) return f.methods; - var methods = ({}); - var dartMethod = (Object.getPrototypeOf($.CTC6)[name$]); - !(dartMethod == null) && (methods['Object'] = dartMethod); - var bind = (function() {return $.dynamicBind.$call$4(this, name$, methods, Array.prototype.slice.call(arguments));}); + var f = Object.prototype[name$]; + if (!(f == null) && !!f.methods) + return f.methods; + var methods = {}; + var dartMethod = Object.getPrototypeOf($.CTC7)[name$]; + if (!(dartMethod == null)) + methods['Object'] = dartMethod; + var bind = function() {return $.dynamicBind.call$4(this, name$, methods, Array.prototype.slice.call(arguments));}; bind.methods = methods; - $.defineProperty((Object.prototype), name$, bind); + $.defineProperty(Object.prototype, name$, bind); return methods; }; @@ -3510,7 +4507,7 @@ $.checkString = function(value) { }; $.div = function(a, b) { - return typeof a === 'number' && typeof b === 'number' ? (a / b) : $.div$slow(a, b); + return typeof a === 'number' && typeof b === 'number' ? a / b : $.div$slow(a, b); }; $._callInIsolate = function(isolate, function$) { @@ -3522,32 +4519,21 @@ $.Primitives_objectToString = function(object) { return 'Instance of \'' + $.S($.Primitives_objectTypeName(object)) + '\''; }; -$.Arrays_indexOf = function(a, element, startIndex, endIndex) { - if (typeof a !== 'string' && (typeof a !== 'object' || a === null || (a.constructor !== Array && !a.is$JavaScriptIndexingBehavior()))) return $.Arrays_indexOf$bailout(1, a, element, startIndex, endIndex); - if (typeof endIndex !== 'number') return $.Arrays_indexOf$bailout(1, a, element, startIndex, endIndex); - if ($.geB(startIndex, a.length)) return -1; - if ($.ltB(startIndex, 0)) startIndex = 0; - if (typeof startIndex !== 'number') return $.Arrays_indexOf$bailout(2, a, element, startIndex, endIndex); - for (var i = startIndex; i < endIndex; ++i) { - if (i !== (i | 0)) throw $.iae(i); - var t1 = a.length; - if (i < 0 || i >= t1) throw $.ioore(i); - if ($.eqB(a[i], element)) return i; - } - return -1; -}; - $._Lists_indexOf = function(a, element, startIndex, endIndex) { - if (typeof a !== 'string' && (typeof a !== 'object' || a === null || (a.constructor !== Array && !a.is$JavaScriptIndexingBehavior()))) return $._Lists_indexOf$bailout(1, a, element, startIndex, endIndex); - if (typeof endIndex !== 'number') return $._Lists_indexOf$bailout(1, a, element, startIndex, endIndex); - if ($.geB(startIndex, a.length)) return -1; - if ($.ltB(startIndex, 0)) startIndex = 0; - if (typeof startIndex !== 'number') return $._Lists_indexOf$bailout(2, a, element, startIndex, endIndex); + if (typeof a !== 'string' && (typeof a !== 'object' || a === null || a.constructor !== Array && !a.is$JavaScriptIndexingBehavior())) + return $._Lists_indexOf$bailout(1, a, element, startIndex, endIndex); + if (typeof endIndex !== 'number') + return $._Lists_indexOf$bailout(1, a, element, startIndex, endIndex); + if (startIndex >= a.length) + return -1; + if (startIndex < 0) + startIndex = 0; for (var i = startIndex; i < endIndex; ++i) { - if (i !== (i | 0)) throw $.iae(i); var t1 = a.length; - if (i < 0 || i >= t1) throw $.ioore(i); - if ($.eqB(a[i], element)) return i; + if (i < 0 || i >= t1) + throw $.ioore(i); + if ($.eqB(a[i], element)) + return i; } return -1; }; @@ -3556,59 +4542,78 @@ $.HashMapImplementation__firstProbe = function(hashCode, length$) { return $.and(hashCode, $.sub(length$, 1)); }; +$.forEach = function(receiver, f) { + if (!$.isJsArray(receiver)) + return receiver.forEach$1(f); + else + return $.Collections_forEach(receiver, f); +}; + +$.Collections_forEach = function(iterable, f) { + for (var t1 = $.iterator(iterable); t1.hasNext$0() === true;) + f.call$1(t1.next$0()); +}; + $.set$length = function(receiver, newLength) { - if ($.isJsArray(receiver) === true) { + if ($.isJsArray(receiver)) { $.checkNull(newLength); - if (!((typeof newLength === 'number') && (newLength === (newLength | 0)))) throw $.captureStackTrace($.IllegalArgumentException$(newLength)); - if (newLength < 0) throw $.captureStackTrace($.IndexOutOfRangeException$(newLength)); + if (newLength < 0) + throw $.captureStackTrace($.IndexOutOfRangeException$(newLength)); $.checkGrowable(receiver, 'set length'); receiver.length = newLength; - } else receiver.set$length(newLength); + } else + receiver.set$length(newLength); return newLength; }; +$.ioore = function(index) { + throw $.captureStackTrace($.IndexOutOfRangeException$(index)); +}; + $.typeNameInFirefox = function(obj) { var name$ = $.constructorNameFallback(obj); - if ($.eqB(name$, 'Window')) return 'DOMWindow'; - if ($.eqB(name$, 'Document')) return 'HTMLDocument'; - if ($.eqB(name$, 'XMLDocument')) return 'Document'; - if ($.eqB(name$, 'WorkerMessageEvent')) return 'MessageEvent'; + if ($.eqB(name$, 'Window')) + return 'DOMWindow'; + if ($.eqB(name$, 'Document')) + return 'HTMLDocument'; + if ($.eqB(name$, 'XMLDocument')) + return 'Document'; + if ($.eqB(name$, 'WorkerMessageEvent')) + return 'MessageEvent'; return name$; }; -$.ioore = function(index) { - throw $.captureStackTrace($.IndexOutOfRangeException$(index)); -}; - $.gt$slow = function(a, b) { - if ($.checkNumbers(a, b) === true) return a > b; + if ($.checkNumbers(a, b)) + return a > b; return a.operator$gt$1(b); }; -$.forEach = function(receiver, f) { - if ($.isJsArray(receiver) !== true) return receiver.forEach$1(f); - return $.Collections_forEach(receiver, f); -}; - -$.Collections_forEach = function(iterable, f) { - for (var t1 = $.iterator(iterable); t1.hasNext$0() === true; ) { - f.$call$1(t1.next$0()); - } -}; - $.hashCode = function(receiver) { - if (typeof receiver === 'number') return receiver & 0x1FFFFFFF; - if (!(typeof receiver === 'string')) return receiver.hashCode$0(); - var length$ = (receiver.length); + if (typeof receiver === 'number') + return receiver & 0x1FFFFFFF; + if (!(typeof receiver === 'string')) + return receiver.hashCode$0(); + var length$ = receiver.length; for (var hash = 0, i = 0; i < length$; ++i) { - var hash0 = 536870911 & hash + (receiver.charCodeAt(i)); - var hash1 = 536870911 & hash0 + (524287 & hash0 << 10); + var hash0 = 536870911 & hash + receiver.charCodeAt(i); + var hash1 = 536870911 & hash0 + 524287 & hash0 << 10; hash1 = (hash1 ^ $.shr(hash1, 6)) >>> 0; hash = hash1; } - hash0 = 536870911 & hash + (67108863 & hash << 3); + hash0 = 536870911 & hash + 67108863 & hash << 3; hash0 = (hash0 ^ $.shr(hash0, 11)) >>> 0; - return 536870911 & hash0 + (16383 & hash0 << 15); + return 536870911 & hash0 + 16383 & hash0 << 15; +}; + +$.removeLast = function(receiver) { + if ($.isJsArray(receiver)) { + $.checkGrowable(receiver, 'removeLast'); + if ($.get$length(receiver) === 0) + throw $.captureStackTrace($.IndexOutOfRangeException$(-1)); + return receiver.pop(); + } + return receiver.removeLast$0(); }; $._JsVisitedMap$ = function() { @@ -3618,22 +4623,24 @@ $._JsVisitedMap$ = function() { $.makeLiteralMap = function(keyValuePairs) { var iterator = $.iterator(keyValuePairs); var result = $.LinkedHashMapImplementation$(); - for (; iterator.hasNext$0() === true; ) { + for (; iterator.hasNext$0() === true;) result.operator$indexSet$2(iterator.next$0(), iterator.next$0()); - } return result; }; -$.Math_min = function(a, b) { +$.min = function(a, b) { if (typeof a === 'number') { if (typeof b === 'number') { - if (a > b) return b; - if (a < b) return a; + if (a > b) + return b; + if (a < b) + return a; if (typeof b === 'number') { - if (typeof a === 'number') { - if (a === 0.0) return (a + b) * a * b; - } - if (a === 0 && $.isNegative(b) === true || $.isNaN(b) === true) return b; + if (typeof a === 'number') + if (a === 0.0) + return (a + b) * a * b; + if (a === 0 && $.isNegative(b) === true || $.isNaN(b) === true) + return b; return a; } return a; @@ -3644,10 +4651,10 @@ $.Math_min = function(a, b) { }; $.startsWith = function(receiver, other) { - if (!(typeof receiver === 'string')) return receiver.startsWith$1(other); $.checkString(other); - var length$ = $.get$length(other); - if ($.gtB(length$, receiver.length)) return false; + var length$ = other.length; + if (length$ > receiver.length) + return false; return other == receiver.substring(0, length$); }; @@ -3655,42 +4662,31 @@ $.toStringForNativeObject = function(obj) { return 'Instance of ' + $.S($.getTypeNameOf(obj)); }; -$._Collections_forEach = function(iterable, f) { - for (var t1 = $.iterator(iterable); t1.hasNext$0() === true; ) { - f.$call$1(t1.next$0()); - } -}; - $.trim = function(receiver) { - if (!(typeof receiver === 'string')) return receiver.trim$0(); + if (!(typeof receiver === 'string')) + return receiver.trim$0(); return receiver.trim(); }; -$.removeLast = function(receiver) { - if ($.isJsArray(receiver) === true) { - $.checkGrowable(receiver, 'removeLast'); - if ($.get$length(receiver) === 0) throw $.captureStackTrace($.IndexOutOfRangeException$(-1)); - return receiver.pop(); - } - return receiver.removeLast$0(); -}; - $.dynamicBind = function(obj, name$, methods, arguments$) { var tag = $.getTypeNameOf(obj); - var method = (methods[tag]); - if (method == null && !($._dynamicMetadata0() == null)) { + var method = methods[tag]; + if (method == null && !($._dynamicMetadata0() == null)) for (var i = 0; $.ltB(i, $.get$length($._dynamicMetadata0())); ++i) { var entry = $.index($._dynamicMetadata0(), i); if ($.contains$1(entry.get$set(), tag) === true) { - method = (methods[entry.get$tag()]); - if (!(method == null)) break; + method = methods[entry.get$tag()]; + if (!(method == null)) + break; } } - } - if (method == null) method = (methods['Object']); - var proto = (Object.getPrototypeOf(obj)); - if (method == null) method = (function () {if (Object.getPrototypeOf(this) === proto) {$.throwNoSuchMethod.$call$3(this, name$, Array.prototype.slice.call(arguments));} else {return Object.prototype[name$].apply(this, arguments);}}); - (!proto.hasOwnProperty(name$)) && $.defineProperty(proto, name$, method); + if (method == null) + method = methods['Object']; + var proto = Object.getPrototypeOf(obj); + if (method == null) + method = function () {if (Object.getPrototypeOf(this) === proto) {$.throwNoSuchMethod.call$3(this, name$, Array.prototype.slice.call(arguments));} else {return Object.prototype[name$].apply(this, arguments);}}; + if (!proto.hasOwnProperty(name$)) + $.defineProperty(proto, name$, method); return method.apply(obj, arguments$); }; @@ -3698,27 +4694,42 @@ $._MessagePortEventsImpl$ = function(_ptr) { return new $._MessagePortEventsImpl(_ptr); }; +$._waitForPendingPorts = function(message, callback) { + var finder = $._PendingSendPortFinder$(); + finder.traverse$1(message); + $.Futures_wait(finder.ports).then$1(new $._waitForPendingPorts_anon(callback)); +}; + $.getFunctionForTypeNameOf = function() { - if (!((typeof(navigator)) === 'object')) return $.typeNameInChrome; - var userAgent = (navigator.userAgent); - if ($.contains$1(userAgent, $.CTC4) === true) return $.typeNameInChrome; - if ($.contains$1(userAgent, 'Firefox') === true) return $.typeNameInFirefox; - if ($.contains$1(userAgent, 'MSIE') === true) return $.typeNameInIE; - if ($.contains$1(userAgent, 'Opera') === true) return $.typeNameInOpera; - if ($.contains$1(userAgent, 'Safari') === true) return $.typeNameInSafari; - return $.constructorNameFallback; + if (!(typeof(navigator) === 'object')) + return $.typeNameInChrome; + var userAgent = navigator.userAgent; + if ($.contains$1(userAgent, $.CTC5) === true) + return $.typeNameInChrome; + else if ($.contains$1(userAgent, 'Firefox') === true) + return $.typeNameInFirefox; + else if ($.contains$1(userAgent, 'MSIE') === true) + return $.typeNameInIE; + else if ($.contains$1(userAgent, 'Opera') === true) + return $.typeNameInOpera; + else if ($.contains$1(userAgent, 'Safari') === true) + return $.typeNameInSafari; + else + return $.constructorNameFallback; }; $.index = function(a, index) { if (typeof a == "string" || a.constructor === Array) { - var key = (index >>> 0); - if (key === index && key < (a.length)) return a[key]; + var key = index >>> 0; + if (key === index && key < a.length) + return a[key]; } return $.index$slow(a, index); }; $.xor = function(a, b) { - if ($.checkNumbers(a, b) === true) return (a ^ b) >>> 0; + if ($.checkNumbers(a, b)) + return (a ^ b) >>> 0; return a.operator$xor$1(b); }; @@ -3726,11 +4737,7 @@ $._ElementEventsImpl$ = function(_ptr) { return new $._ElementEventsImpl(_ptr); }; -$.Math_sin = function(x) { - return $.MathNatives_sin(x); -}; - -$.MathNatives_sin = function(value) { +$.sin = function(value) { return Math.sin($.checkNum(value)); }; @@ -3738,29 +4745,60 @@ $.ListFactory_List = function(length$) { return $.Primitives_newList(length$); }; -$._XMLHttpRequestUploadEventsImpl$ = function(_ptr) { - return new $._XMLHttpRequestUploadEventsImpl(_ptr); +$.toString = function(value) { + if (typeof value == "object" && value !== null) + if ($.isJsArray(value)) + return $.Collections_collectionToString(value); + else + return value.toString$0(); + if (value === 0 && (1 / value) < 0) + return '-0.0'; + if (value == null) + return 'null'; + if (typeof value == "function") + return 'Closure'; + return String(value); }; $.captureStackTrace = function(ex) { - if (ex == null) ex = $.CTC0; - var jsError = (new Error()); + if (ex == null) + ex = $.CTC0; + var jsError = new Error(); jsError.dartException = ex; - jsError.toString = $.toStringWrapper.$call$0; + jsError.toString = $.toStringWrapper.call$0; return jsError; }; +$._Collections_forEach = function(iterable, f) { + for (var t1 = $.iterator(iterable); t1.hasNext$0() === true;) + f.call$1(t1.next$0()); +}; + $.StackOverflowException$ = function() { return new $.StackOverflowException(); }; -$.eq = function(a, b) { - if (a == null) return b == null; - if (b == null) return false; - if (typeof a === "object") { - if (!!a.operator$eq$1) return a.operator$eq$1(b); +$.StringBufferImpl$ = function(content$) { + var t1 = new $.StringBufferImpl(null, null); + t1.StringBufferImpl$1(content$); + return t1; +}; + +$.Arrays_indexOf = function(a, element, startIndex, endIndex) { + if (typeof a !== 'string' && (typeof a !== 'object' || a === null || a.constructor !== Array && !a.is$JavaScriptIndexingBehavior())) + return $.Arrays_indexOf$bailout(1, a, element, startIndex, endIndex); + if (startIndex >= a.length) + return -1; + if (startIndex < 0) + startIndex = 0; + for (var i = startIndex; i < endIndex; ++i) { + var t1 = a.length; + if (i < 0 || i >= t1) + throw $.ioore(i); + if ($.eqB(a[i], element)) + return i; } - return a === b; + return -1; }; $.HashMapImplementation$ = function() { @@ -3770,19 +4808,26 @@ $.HashMapImplementation$ = function() { }; $.substring$1 = function(receiver, startIndex) { - if (!(typeof receiver === 'string')) return receiver.substring$1(startIndex); + if (!(typeof receiver === 'string')) + return receiver.substring$1(startIndex); return $.substring$2(receiver, startIndex, null); }; $.div$slow = function(a, b) { - if ($.checkNumbers(a, b) === true) return a / b; + if ($.checkNumbers(a, b)) + return a / b; return a.operator$div$1(b); }; -$.StringBufferImpl$ = function(content$) { - var t1 = new $.StringBufferImpl(null, null); - t1.StringBufferImpl$1(content$); - return t1; +$.eq = function(a, b) { + if (a == null) + return b == null; + if (b == null) + return false; + if (typeof a === "object") + if (!!a.operator$eq$1) + return a.operator$eq$1(b); + return a === b; }; $.FormatException$ = function(message) { @@ -3798,19 +4843,22 @@ $._IDBVersionChangeRequestEventsImpl$ = function(_ptr) { }; $.gtB = function(a, b) { - return typeof a === 'number' && typeof b === 'number' ? (a > b) : $.gt$slow(a, b) === true; + return typeof a === 'number' && typeof b === 'number' ? a > b : $.gt$slow(a, b) === true; }; $.setRuntimeTypeInfo = function(target, typeInfo) { - !(target == null) && (target.builtin$typeInfo = typeInfo); + if (!(target == null)) + target.builtin$typeInfo = typeInfo; }; $.shl = function(a, b) { - if ($.checkNumbers(a, b) === true) { - a = (a); - b = (b); - if (b < 0) throw $.captureStackTrace($.IllegalArgumentException$(b)); - if (b > 31) return 0; + if ($.checkNumbers(a, b)) { + a = a; + b = b; + if (b < 0) + throw $.captureStackTrace($.IllegalArgumentException$(b)); + if (b > 31) + return 0; return (a << b) >>> 0; } return a.operator$shl$1(b); @@ -3820,124 +4868,95 @@ $._FileWriterEventsImpl$ = function(_ptr) { return new $._FileWriterEventsImpl(_ptr); }; +$.FutureNotCompleteException$ = function() { + return new $.FutureNotCompleteException(); +}; + $.NoSuchMethodException$ = function(_receiver, _functionName, _arguments, existingArgumentNames) { return new $.NoSuchMethodException(existingArgumentNames, _arguments, _functionName, _receiver); }; $.lt = function(a, b) { - return typeof a === 'number' && typeof b === 'number' ? (a < b) : $.lt$slow(a, b); + return typeof a === 'number' && typeof b === 'number' ? a < b : $.lt$slow(a, b); }; $.unwrapException = function(ex) { - if ("dartException" in ex) return ex.dartException; - var message = (ex.message); + if ("dartException" in ex) + return ex.dartException; + var message = ex.message; if (ex instanceof TypeError) { - var type = (ex.type); - var name$ = (ex.arguments ? ex.arguments[0] : ""); - if ($.eqB(type, 'property_not_function') || ($.eqB(type, 'called_non_callable') || ($.eqB(type, 'non_object_property_call') || $.eqB(type, 'non_object_property_load')))) { - if (typeof name$ === 'string' && $.startsWith(name$, '$call$') === true) return $.ObjectNotClosureException$(); - return $.NullPointerException$(null, $.CTC); - } - if ($.eqB(type, 'undefined_method')) { - if (typeof name$ === 'string' && $.startsWith(name$, '$call$') === true) return $.ObjectNotClosureException$(); - return $.NoSuchMethodException$('', name$, [], null); - } - if (typeof message === 'string') { - if ($.endsWith(message, 'is null') === true || ($.endsWith(message, 'is undefined') === true || $.endsWith(message, 'is null or undefined') === true)) return $.NullPointerException$(null, $.CTC); - if ($.endsWith(message, 'is not a function') === true) return $.NoSuchMethodException$('', '', [], null); - } + var type = ex.type; + var name$ = ex.arguments ? ex.arguments[0] : ""; + if ($.eqB(type, 'property_not_function') || $.eqB(type, 'called_non_callable') || $.eqB(type, 'non_object_property_call') || $.eqB(type, 'non_object_property_load')) + if (typeof name$ === 'string' && $.startsWith(name$, 'call$') === true) + return $.ObjectNotClosureException$(); + else + return $.NullPointerException$(null, $.CTC); + else if ($.eqB(type, 'undefined_method')) + if (typeof name$ === 'string' && $.startsWith(name$, 'call$') === true) + return $.ObjectNotClosureException$(); + else + return $.NoSuchMethodException$('', name$, [], null); + if (typeof message === 'string') + if ($.endsWith(message, 'is null') === true || $.endsWith(message, 'is undefined') === true || $.endsWith(message, 'is null or undefined') === true) + return $.NullPointerException$(null, $.CTC); + else if ($.contains$1(message, ' is not a function') === true) + return $.NoSuchMethodException$('', '', [], null); return $.ExceptionImplementation$(typeof message === 'string' ? message : ''); } if (ex instanceof RangeError) { - if (typeof message === 'string' && $.contains$1(message, 'call stack') === true) return $.StackOverflowException$(); + if (typeof message === 'string' && $.contains$1(message, 'call stack') === true) + return $.StackOverflowException$(); return $.IllegalArgumentException$(''); } - if (typeof InternalError == 'function' && ex instanceof InternalError) { - if (typeof message === 'string' && message === 'too much recursion') return $.StackOverflowException$(); - } + if (typeof InternalError == 'function' && ex instanceof InternalError) + if (typeof message === 'string' && message === 'too much recursion') + return $.StackOverflowException$(); return ex; }; $.ceil = function(receiver) { - if (!(typeof receiver === 'number')) return receiver.ceil$0(); return Math.ceil(receiver); }; $.getTypeNameOf = function(obj) { - if ($._getTypeNameOf == null) $._getTypeNameOf = $.getFunctionForTypeNameOf(); - return $._getTypeNameOf.$call$1(obj); + if ($._getTypeNameOf == null) + $._getTypeNameOf = $.getFunctionForTypeNameOf(); + return $._getTypeNameOf.call$1(obj); }; -$.Math_cos = function(x) { - return $.MathNatives_cos(x); +$._HttpRequestUploadEventsImpl$ = function(_ptr) { + return new $._HttpRequestUploadEventsImpl(_ptr); }; -$.MathNatives_cos = function(value) { +$.cos = function(value) { return Math.cos($.checkNum(value)); }; $.sub = function(a, b) { - return typeof a === 'number' && typeof b === 'number' ? (a - b) : $.sub$slow(a, b); + return typeof a === 'number' && typeof b === 'number' ? a - b : $.sub$slow(a, b); }; -$._Lists_indexOf$bailout = function(state, env0, env1, env2, env3) { - switch (state) { - case 1: - var a = env0; - var element = env1; - var startIndex = env2; - var endIndex = env3; - break; - case 2: - a = env0; - element = env1; - startIndex = env2; - endIndex = env3; - break; - } - switch (state) { - case 0: - case 1: - state = 0; - if ($.geB(startIndex, $.get$length(a))) return -1; - if ($.ltB(startIndex, 0)) startIndex = 0; - case 2: - state = 0; - for (var i = startIndex; $.ltB(i, endIndex); i = $.add(i, 1)) { - if ($.eqB($.index(a, i), element)) return i; - } - return -1; - } +$._Lists_indexOf$bailout = function(state, a, element, startIndex, endIndex) { + if ($.geB(startIndex, $.get$length(a))) + return -1; + if (startIndex < 0) + startIndex = 0; + for (var i = startIndex; $.ltB(i, endIndex); ++i) + if ($.eqB($.index(a, i), element)) + return i; + return -1; }; -$.Arrays_indexOf$bailout = function(state, env0, env1, env2, env3) { - switch (state) { - case 1: - var a = env0; - var element = env1; - var startIndex = env2; - var endIndex = env3; - break; - case 2: - a = env0; - element = env1; - startIndex = env2; - endIndex = env3; - break; - } - switch (state) { - case 0: - case 1: - state = 0; - if ($.geB(startIndex, $.get$length(a))) return -1; - if ($.ltB(startIndex, 0)) startIndex = 0; - case 2: - state = 0; - for (var i = startIndex; $.ltB(i, endIndex); i = $.add(i, 1)) { - if ($.eqB($.index(a, i), element)) return i; - } - return -1; - } +$.Arrays_indexOf$bailout = function(state, a, element, startIndex, endIndex) { + if ($.geB(startIndex, $.get$length(a))) + return -1; + if (startIndex < 0) + startIndex = 0; + for (var i = startIndex; i < endIndex; ++i) + if ($.eqB($.index(a, i), element)) + return i; + return -1; }; $.buildDynamicMetadata$bailout = function(state, env0, env1, env2, env3, env4, env5, env6) { @@ -3960,79 +4979,48 @@ $.buildDynamicMetadata$bailout = function(state, env0, env1, env2, env3, env4, e case 1: state = 0; var result = []; - var i = 0; - case 2: - L0: while (true) { - switch (state) { - case 0: - if (!$.ltB(i, $.get$length(inputTable))) break L0; - var tag = $.index($.index(inputTable, i), 0); - var tags = $.index($.index(inputTable, i), 1); - var set = $.HashSetImplementation$(); - $.setRuntimeTypeInfo(set, ({E: 'String'})); - var tagNames = $.split(tags, '|'); - case 2: - state = 0; - for (var j = 0; $.ltB(j, $.get$length(tagNames)); ++j) { - set.add$1($.index(tagNames, j)); - } - $.add$1(result, $.MetaInfo$(tag, tags, set)); - ++i; - } - } - return result; - } -}; - -$.gcf$bailout = function(state, env0, env1, env2) { - switch (state) { - case 1: - var n = env0; - var d = env1; - break; - case 2: - n = env0; - d = env1; - i = env2; - break; - } - switch (state) { - case 0: - case 1: - state = 0; - if ($.eqB(n, d)) return n; - var i = $.tdiv($.Math_max(n, d), 2); + var i = 0; case 2: - state = 0; - for (; $.gtB(i, 1); i = $.sub(i, 1)) { - if ($.eqB($.mod(n, i), 0) && $.eqB($.mod(d, i), 0)) return i; - } - return 1; + L0: + while (true) + switch (state) { + case 0: + if (!$.ltB(i, $.get$length(inputTable))) + break L0; + var tag = $.index($.index(inputTable, i), 0); + var tags = $.index($.index(inputTable, i), 1); + var set = $.HashSetImplementation$(); + $.setRuntimeTypeInfo(set, {E: 'String'}); + var tagNames = $.split(tags, '|'); + case 2: + state = 0; + for (var j = 0; $.ltB(j, $.get$length(tagNames)); ++j) + set.add$1($.index(tagNames, j)); + $.add$1(result, $.MetaInfo$(tag, tags, set)); + ++i; + } + return result; } }; -$.allMatchesInStringUnchecked$bailout = function(state, needle, haystack, length$, patternLength, result) { - for (var startIndex = 0; true; ) { - var position = $.indexOf$2(haystack, needle, startIndex); - if ($.eqB(position, -1)) break; - result.push($.StringMatch$(position, haystack, needle)); - var endIndex = $.add(position, patternLength); - if ($.eqB(endIndex, length$)) break; - else { - startIndex = $.eqB(position, endIndex) ? $.add(startIndex, 1) : endIndex; - } - } - return result; +$.gcf$bailout = function(state, n, d) { + if ($.eqB(n, d)) + return n; + for (var i = $.tdiv($.max(n, d), 2); i > 1; --i) + if ($.eqB($.mod(n, i), 0) && $.eqB($.mod(d, i), 0)) + return i; + return 1; }; $.StringBase__toJsStringArray$bailout = function(state, strings) { $.checkNull(strings); var length$ = $.get$length(strings); - if ($.isJsArray(strings) === true) { + if ($.isJsArray(strings)) { for (var i = 0; $.ltB(i, length$); ++i) { var string = $.index(strings, i); $.checkNull(string); - if (!(typeof string === 'string')) throw $.captureStackTrace($.IllegalArgumentException$(string)); + if (!(typeof string === 'string')) + throw $.captureStackTrace($.IllegalArgumentException$(string)); } var array = strings; } else { @@ -4040,35 +5028,58 @@ $.StringBase__toJsStringArray$bailout = function(state, strings) { for (i = 0; $.ltB(i, length$); ++i) { string = $.index(strings, i); $.checkNull(string); - if (!(typeof string === 'string')) throw $.captureStackTrace($.IllegalArgumentException$(string)); + if (!(typeof string === 'string')) + throw $.captureStackTrace($.IllegalArgumentException$(string)); var t1 = array.length; - if (i < 0 || i >= t1) throw $.ioore(i); + if (i < 0 || i >= t1) + throw $.ioore(i); array[i] = string; } } return array; }; -$.dynamicBind.$call$4 = $.dynamicBind; +$.Futures_wait$bailout = function(state, futures, t1) { + if ($.isEmpty(futures) === true) { + t1 = $.FutureImpl_FutureImpl$immediate($.CTC); + $.setRuntimeTypeInfo(t1, {T: 'List'}); + return t1; + } + var completer = $.CompleterImpl$(); + $.setRuntimeTypeInfo(completer, {T: 'List'}); + var result = completer.get$future(); + t1.remaining_1 = $.get$length(futures); + var values = $.ListFactory_List($.get$length(futures)); + for (var i = 0; $.ltB(i, $.get$length(futures)); ++i) { + var future = $.index(futures, i); + future.then$1(new $.Futures_wait_anon(result, i, completer, t1, values)); + future.handleException$1(new $.Futures_wait_anon0(result, completer, future)); + } + return result; +}; + +$.dynamicBind.call$4 = $.dynamicBind; $.dynamicBind.$name = "dynamicBind"; -$.typeNameInOpera.$call$1 = $.typeNameInOpera; +$.typeNameInOpera.call$1 = $.typeNameInOpera; $.typeNameInOpera.$name = "typeNameInOpera"; -$.throwNoSuchMethod.$call$3 = $.throwNoSuchMethod; -$.throwNoSuchMethod.$name = "throwNoSuchMethod"; -$.typeNameInIE.$call$1 = $.typeNameInIE; +$.typeNameInIE.call$1 = $.typeNameInIE; $.typeNameInIE.$name = "typeNameInIE"; -$.typeNameInChrome.$call$1 = $.typeNameInChrome; +$.typeNameInFirefox.call$1 = $.typeNameInFirefox; +$.typeNameInFirefox.$name = "typeNameInFirefox"; +$.constructorNameFallback.call$1 = $.constructorNameFallback; +$.constructorNameFallback.$name = "constructorNameFallback"; +$._timerFactory.call$3 = $._timerFactory; +$._timerFactory.$name = "_timerFactory"; +$.throwNoSuchMethod.call$3 = $.throwNoSuchMethod; +$.throwNoSuchMethod.$name = "throwNoSuchMethod"; +$.invokeClosure.call$5 = $.invokeClosure; +$.invokeClosure.$name = "invokeClosure"; +$.typeNameInChrome.call$1 = $.typeNameInChrome; $.typeNameInChrome.$name = "typeNameInChrome"; -$.toStringWrapper.$call$0 = $.toStringWrapper; +$.toStringWrapper.call$0 = $.toStringWrapper; $.toStringWrapper.$name = "toStringWrapper"; -$.invokeClosure.$call$5 = $.invokeClosure; -$.invokeClosure.$name = "invokeClosure"; -$.typeNameInSafari.$call$1 = $.typeNameInSafari; +$.typeNameInSafari.call$1 = $.typeNameInSafari; $.typeNameInSafari.$name = "typeNameInSafari"; -$.typeNameInFirefox.$call$1 = $.typeNameInFirefox; -$.typeNameInFirefox.$name = "typeNameInFirefox"; -$.constructorNameFallback.$call$1 = $.constructorNameFallback; -$.constructorNameFallback.$name = "constructorNameFallback"; Isolate.$finishClasses($$); $$ = {}; Isolate.makeConstantList = function(list) { @@ -4077,16 +5088,19 @@ Isolate.makeConstantList = function(list) { return list; }; $.CTC = Isolate.makeConstantList([]); -$.CTC6 = new Isolate.$isolateProperties.Object(); -$.CTC4 = new Isolate.$isolateProperties.JSSyntaxRegExp(false, false, 'Chrome|DumpRenderTree'); -$.CTC3 = new Isolate.$isolateProperties.JSSyntaxRegExp(false, false, '^#[_a-zA-Z]\\w*$'); -$.CTC2 = Isolate.makeConstantList(['00', '33', '66', '99', 'CC', 'FF']); +$.CTC7 = new Isolate.$isolateProperties.Object(); $.CTC0 = new Isolate.$isolateProperties.NullPointerException(Isolate.$isolateProperties.CTC, null); -$.CTC5 = new Isolate.$isolateProperties._DeletedKeySentinel(); +$.CTC3 = new Isolate.$isolateProperties._Random(); $.CTC1 = new Isolate.$isolateProperties.NoMoreElementsException(); -$.CTC7 = new Isolate.$isolateProperties.EmptyQueueException(); +$.CTC5 = new Isolate.$isolateProperties.JSSyntaxRegExp(false, false, 'Chrome|DumpRenderTree'); +$.CTC8 = new Isolate.$isolateProperties.EmptyQueueException(); +$.CTC4 = new Isolate.$isolateProperties.JSSyntaxRegExp(false, false, '^#[_a-zA-Z]\\w*$'); +$.CTC2 = Isolate.makeConstantList(['00', '33', '66', '99', 'CC', 'FF']); +$.CTC6 = new Isolate.$isolateProperties._DeletedKeySentinel(); $._getTypeNameOf = null; +$._TimerFactory__factory = null; $.Spirodraw_PI2 = 6.283185307179586; +$._ReceivePortImpl__nextFreeId = 1; var $ = null; Isolate.$finishClasses($$); $$ = {}; @@ -4130,22 +5144,28 @@ $.$defineNativeClass = function(cls, fields, methods) { }); $.$defineNativeClass('AbstractWorker', [], { + $dom_removeEventListener$3: function(type, listener, useCapture) { + return this.removeEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +}, $dom_addEventListener$3: function(type, listener, useCapture) { return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); - }, +}, get$on: function() { if (Object.getPrototypeOf(this).hasOwnProperty('get$on')) { - return $._AbstractWorkerEventsImpl$(this); + { + return $._AbstractWorkerEventsImpl$(this); +} } else { return Object.prototype.get$on.call(this); } - } + +} }); $.$defineNativeClass('HTMLAnchorElement', ["target?"], { toString$0: function() { return this.toString(); - } +} }); $.$defineNativeClass('WebKitAnimationList', ["length?"], { @@ -4166,32 +5186,35 @@ $.$defineNativeClass('AudioBuffer', ["length?"], { $.$defineNativeClass('AudioContext', [], { get$on: function() { return $._AudioContextEventsImpl$(this); - } +} }); $.$defineNativeClass('AudioParam', ["value="], { }); $.$defineNativeClass('HTMLBRElement', [], { - clear$0: function() { return this.clear.$call$0(); } + clear$0: function() { return this.clear.call$0(); } }); $.$defineNativeClass('HTMLBaseElement', ["target?"], { }); $.$defineNativeClass('BatteryManager', [], { + $dom_removeEventListener$3: function(type, listener, useCapture) { + return this.removeEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +}, $dom_addEventListener$3: function(type, listener, useCapture) { return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); - }, +}, get$on: function() { return $._BatteryManagerEventsImpl$(this); - } +} }); $.$defineNativeClass('HTMLBodyElement', [], { get$on: function() { return $._BodyElementEventsImpl$(this); - } +} }); $.$defineNativeClass('HTMLButtonElement', ["value="], { @@ -4200,7 +5223,7 @@ $.$defineNativeClass('HTMLButtonElement', ["value="], { $.$defineNativeClass('WebKitCSSMatrix', [], { toString$0: function() { return this.toString(); - } +} }); $.$defineNativeClass('CSSRuleList', ["length?"], { @@ -4209,23 +5232,23 @@ $.$defineNativeClass('CSSRuleList', ["length?"], { $.$defineNativeClass('CSSStyleDeclaration', ["length?"], { set$width: function(value) { this.setProperty$3('width', value, ''); - }, +}, get$resize: function() { return this.getPropertyValue$1('resize'); - }, +}, set$height: function(value) { this.setProperty$3('height', value, ''); - }, +}, get$clear: function() { return this.getPropertyValue$1('clear'); - }, - clear$0: function() { return this.get$clear().$call$0(); }, +}, + clear$0: function() { return this.get$clear().call$0(); }, setProperty$3: function(propertyName, value, priority) { return this.setProperty(propertyName,value,priority); - }, +}, getPropertyValue$1: function(propertyName) { return this.getPropertyValue(propertyName); - } +} }); $.$defineNativeClass('CSSValueList', ["length?"], { @@ -4234,49 +5257,49 @@ $.$defineNativeClass('CSSValueList', ["length?"], { $.$defineNativeClass('HTMLCanvasElement', ["width!", "height!"], { get$context2d: function() { return this.getContext$1('2d'); - }, +}, getContext$1: function(contextId) { return this.getContext(contextId); - } +} }); $.$defineNativeClass('CanvasRenderingContext2D', ["strokeStyle!", "fillStyle!"], { stroke$0: function() { return this.stroke(); - }, +}, setLineWidth$1: function(width) { return this.setLineWidth(width); - }, +}, moveTo$2: function(x, y) { return this.moveTo(x,y); - }, +}, lineTo$2: function(x, y) { return this.lineTo(x,y); - }, +}, fillRect$4: function(x, y, width, height) { return this.fillRect(x,y,width,height); - }, +}, fill$0: function() { return this.fill(); - }, +}, drawImage$9: function(canvas_OR_image_OR_video, sx_OR_x, sy_OR_y, sw_OR_width, height_OR_sh, dx, dy, dw, dh) { return this.drawImage(canvas_OR_image_OR_video,sx_OR_x,sy_OR_y,sw_OR_width,height_OR_sh,dx,dy,dw,dh); - }, +}, drawImage$3: function(canvas_OR_image_OR_video,sx_OR_x,sy_OR_y) { return this.drawImage(canvas_OR_image_OR_video,sx_OR_x,sy_OR_y); }, closePath$0: function() { return this.closePath(); - }, +}, clearRect$4: function(x, y, width, height) { return this.clearRect(x,y,width,height); - }, +}, beginPath$0: function() { return this.beginPath(); - }, +}, arc$6: function(x, y, radius, startAngle, endAngle, anticlockwise) { return this.arc(x,y,radius,startAngle,endAngle,anticlockwise); - } +} }); $.$defineNativeClass('CharacterData', ["length?"], { @@ -4287,18 +5310,21 @@ $.$defineNativeClass('ClientRectList', ["length?"], { _ConsoleImpl = (typeof console == 'undefined' ? {} : console); $.$defineNativeClass('DOMApplicationCache', [], { + $dom_removeEventListener$3: function(type, listener, useCapture) { + return this.removeEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +}, $dom_addEventListener$3: function(type, listener, useCapture) { return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); - }, +}, get$on: function() { return $._DOMApplicationCacheEventsImpl$(this); - } +} }); $.$defineNativeClass('DOMException', [], { toString$0: function() { return this.toString(); - } +} }); $.$defineNativeClass('DOMMimeTypeArray', ["length?"], { @@ -4313,7 +5339,7 @@ $.$defineNativeClass('DOMPluginArray', ["length?"], { $.$defineNativeClass('DOMSelection', [], { toString$0: function() { return this.toString(); - } +} }); $.$defineNativeClass('DOMSettableTokenList', ["value="], { @@ -4322,36 +5348,36 @@ $.$defineNativeClass('DOMSettableTokenList', ["value="], { $.$defineNativeClass('DOMStringList', ["length?"], { contains$1: function(string) { return this.contains(string); - }, +}, removeLast$0: function() { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot removeLast on immutable List.')); - }, +}, indexOf$2: function(element, start) { return $._Lists_indexOf(this, element, start, $.get$length(this)); - }, +}, isEmpty$0: function() { return $.eq($.get$length(this), 0); - }, +}, forEach$1: function(f) { return $._Collections_forEach(this, f); - }, +}, addLast$1: function(value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot add to immutable List.')); - }, +}, add$1: function(value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot add to immutable List.')); - }, +}, iterator$0: function() { var t1 = $._FixedSizeListIterator$(this); - $.setRuntimeTypeInfo(t1, ({T: 'String'})); + $.setRuntimeTypeInfo(t1, {T: 'String'}); return t1; - }, +}, operator$indexSet$2: function(index, value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot assign element of immutable List.')); - }, +}, operator$index$1: function(index) { - return this[index];; - }, +return this[index]; +}, is$JavaScriptIndexingBehavior: function() { return true; }, is$List: function() { return true; }, is$Collection: function() { return true; } @@ -4360,22 +5386,25 @@ $.$defineNativeClass('DOMStringList', ["length?"], { $.$defineNativeClass('DOMTokenList', ["length?"], { toString$0: function() { return this.toString(); - }, +}, + remove$1: function(token) { + return this.remove(token); +}, contains$1: function(token) { return this.contains(token); - }, +}, add$1: function(token) { return this.add(token); - } +} }); $.$defineNativeClass('DataTransferItemList', ["length?"], { clear$0: function() { return this.clear(); - }, +}, add$2: function(data_OR_file, type) { return this.add(data_OR_file,type); - }, +}, add$1: function(data_OR_file) { return this.add(data_OR_file); } @@ -4384,79 +5413,90 @@ $.$defineNativeClass('DataTransferItemList', ["length?"], { $.$defineNativeClass('DedicatedWorkerContext', [], { postMessage$2: function(message, messagePorts) { return this.postMessage(message,messagePorts); - }, +}, postMessage$1: function(message) { return this.postMessage(message); }, get$on: function() { return $._DedicatedWorkerContextEventsImpl$(this); - } +} }); $.$defineNativeClass('HTMLDocument', [], { query$1: function(selectors) { - if ($.CTC3.hasMatch$1(selectors) === true) return this.$dom_getElementById$1($.substring$1(selectors, 1)); + if ($.CTC4.hasMatch$1(selectors) === true) + return this.$dom_getElementById$1($.substring$1(selectors, 1)); return this.$dom_querySelector$1(selectors); - }, +}, $dom_querySelector$1: function(selectors) { return this.querySelector(selectors); - }, +}, $dom_getElementById$1: function(elementId) { return this.getElementById(elementId); - }, +}, get$on: function() { return $._DocumentEventsImpl$(this); - } +} }); $.$defineNativeClass('DocumentFragment', [], { $dom_querySelector$1: function(selectors) { return this.querySelector(selectors); - }, +}, get$on: function() { return $._ElementEventsImpl$(this); - }, +}, click$0: function() { - }, +}, get$click: function() { return new $.BoundClosure0(this, 'click$0'); }, get$parent: function() { return; - }, +}, get$id: function() { return ''; - }, +}, query$1: function(selectors) { return this.$dom_querySelector$1(selectors); - } +} }); $.$defineNativeClass('Element', ["id?"], { $dom_querySelector$1: function(selectors) { return this.querySelector(selectors); - }, +}, click$0: function() { return this.click(); - }, +}, get$click: function() { return new $.BoundClosure0(this, 'click$0'); }, get$on: function() { if (Object.getPrototypeOf(this).hasOwnProperty('get$on')) { - return $._ElementEventsImpl$(this); + { + return $._ElementEventsImpl$(this); +} } else { return Object.prototype.get$on.call(this); } - }, + +}, query$1: function(selectors) { return this.$dom_querySelector$1(selectors); - } +} }); $.$defineNativeClass('HTMLEmbedElement', ["width!", "height!"], { }); $.$defineNativeClass('Entry', [], { + remove$2: function(successCallback, errorCallback) { + return this.remove($.convertDartClosureToJS(successCallback, 0),$.convertDartClosureToJS(errorCallback, 1)); +}, + remove$1: function(successCallback) { + successCallback = $.convertDartClosureToJS(successCallback, 0); + return this.remove(successCallback); +}, moveTo$4: function(parent, name, successCallback, errorCallback) { return this.moveTo(parent,name,$.convertDartClosureToJS(successCallback, 1),$.convertDartClosureToJS(errorCallback, 1)); - }, +}, moveTo$2: function(parent$,name$) { return this.moveTo(parent$,name$); } @@ -4471,10 +5511,10 @@ $.$defineNativeClass('EntryArraySync', ["length?"], { $.$defineNativeClass('EntrySync', [], { remove$0: function() { return this.remove(); - }, +}, moveTo$2: function(parent, name) { return this.moveTo(parent,name); - } +} }); $.$defineNativeClass('Event', ["target?", "cancelBubble!"], { @@ -4483,92 +5523,120 @@ $.$defineNativeClass('Event', ["target?", "cancelBubble!"], { $.$defineNativeClass('EventException', [], { toString$0: function() { return this.toString(); - } +} }); $.$defineNativeClass('EventSource', [], { + $dom_removeEventListener$3: function(type, listener, useCapture) { + return this.removeEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +}, + close$0: function() { + return this.close(); +}, $dom_addEventListener$3: function(type, listener, useCapture) { return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); - }, +}, get$on: function() { return $._EventSourceEventsImpl$(this); - } +} }); $.$defineNativeClass('EventTarget', [], { + $dom_removeEventListener$3: function(type, listener, useCapture) { + if (Object.getPrototypeOf(this).hasOwnProperty('$dom_removeEventListener$3')) { + { + return this.removeEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +} + } else { + return Object.prototype.$dom_removeEventListener$3.call(this, type, listener, useCapture); + } + +}, $dom_addEventListener$3: function(type, listener, useCapture) { if (Object.getPrototypeOf(this).hasOwnProperty('$dom_addEventListener$3')) { - return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); + { + return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +} } else { return Object.prototype.$dom_addEventListener$3.call(this, type, listener, useCapture); } - }, + +}, get$on: function() { if (Object.getPrototypeOf(this).hasOwnProperty('get$on')) { - return $._EventsImpl$(this); + { + return $._EventsImpl$(this); +} } else { return Object.prototype.get$on.call(this); } - } + +} }); $.$defineNativeClass('FileException', [], { toString$0: function() { return this.toString(); - } +} }); $.$defineNativeClass('FileList', ["length?"], { removeLast$0: function() { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot removeLast on immutable List.')); - }, +}, indexOf$2: function(element, start) { return $._Lists_indexOf(this, element, start, $.get$length(this)); - }, +}, isEmpty$0: function() { return $.eq($.get$length(this), 0); - }, +}, forEach$1: function(f) { return $._Collections_forEach(this, f); - }, +}, addLast$1: function(value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot add to immutable List.')); - }, +}, add$1: function(value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot add to immutable List.')); - }, +}, iterator$0: function() { var t1 = $._FixedSizeListIterator$(this); - $.setRuntimeTypeInfo(t1, ({T: 'File'})); + $.setRuntimeTypeInfo(t1, {T: 'File'}); return t1; - }, +}, operator$indexSet$2: function(index, value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot assign element of immutable List.')); - }, +}, operator$index$1: function(index) { - return this[index];; - }, +return this[index]; +}, is$JavaScriptIndexingBehavior: function() { return true; }, is$List: function() { return true; }, is$Collection: function() { return true; } }); $.$defineNativeClass('FileReader', [], { + $dom_removeEventListener$3: function(type, listener, useCapture) { + return this.removeEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +}, $dom_addEventListener$3: function(type, listener, useCapture) { return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); - }, +}, get$on: function() { return $._FileReaderEventsImpl$(this); - } +} }); $.$defineNativeClass('FileWriter', ["length?"], { + $dom_removeEventListener$3: function(type, listener, useCapture) { + return this.removeEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +}, $dom_addEventListener$3: function(type, listener, useCapture) { return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); - }, +}, get$on: function() { return $._FileWriterEventsImpl$(this); - } +} }); $.$defineNativeClass('FileWriterSync', ["length?"], { @@ -4577,33 +5645,33 @@ $.$defineNativeClass('FileWriterSync', ["length?"], { $.$defineNativeClass('Float32Array', ["length?"], { removeLast$0: function() { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot removeLast on immutable List.')); - }, +}, indexOf$2: function(element, start) { return $._Lists_indexOf(this, element, start, $.get$length(this)); - }, +}, isEmpty$0: function() { return $.eq($.get$length(this), 0); - }, +}, forEach$1: function(f) { return $._Collections_forEach(this, f); - }, +}, addLast$1: function(value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot add to immutable List.')); - }, +}, add$1: function(value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot add to immutable List.')); - }, +}, iterator$0: function() { var t1 = $._FixedSizeListIterator$(this); - $.setRuntimeTypeInfo(t1, ({T: 'num'})); + $.setRuntimeTypeInfo(t1, {T: 'num'}); return t1; - }, +}, operator$indexSet$2: function(index, value) { - this[index] = value; - }, +this[index] = value +}, operator$index$1: function(index) { - return this[index];; - }, +return this[index]; +}, is$JavaScriptIndexingBehavior: function() { return true; }, is$List: function() { return true; }, is$Collection: function() { return true; } @@ -4612,33 +5680,33 @@ $.$defineNativeClass('Float32Array', ["length?"], { $.$defineNativeClass('Float64Array', ["length?"], { removeLast$0: function() { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot removeLast on immutable List.')); - }, +}, indexOf$2: function(element, start) { return $._Lists_indexOf(this, element, start, $.get$length(this)); - }, +}, isEmpty$0: function() { return $.eq($.get$length(this), 0); - }, +}, forEach$1: function(f) { return $._Collections_forEach(this, f); - }, +}, addLast$1: function(value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot add to immutable List.')); - }, +}, add$1: function(value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot add to immutable List.')); - }, +}, iterator$0: function() { var t1 = $._FixedSizeListIterator$(this); - $.setRuntimeTypeInfo(t1, ({T: 'num'})); + $.setRuntimeTypeInfo(t1, {T: 'num'}); return t1; - }, +}, operator$indexSet$2: function(index, value) { - this[index] = value; - }, +this[index] = value +}, operator$index$1: function(index) { - return this[index];; - }, +return this[index]; +}, is$JavaScriptIndexingBehavior: function() { return true; }, is$List: function() { return true; }, is$Collection: function() { return true; } @@ -4647,13 +5715,13 @@ $.$defineNativeClass('Float64Array', ["length?"], { $.$defineNativeClass('HTMLFormElement', ["target?", "length?"], { reset$0: function() { return this.reset(); - } +} }); $.$defineNativeClass('HTMLFrameSetElement', [], { get$on: function() { return $._FrameSetElementEventsImpl$(this); - } +} }); $.$defineNativeClass('Gamepad', ["id?"], { @@ -4671,45 +5739,48 @@ $.$defineNativeClass('HTMLAllCollection', ["length?"], { $.$defineNativeClass('HTMLCollection', ["length?"], { removeLast$0: function() { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot removeLast on immutable List.')); - }, +}, indexOf$2: function(element, start) { return $._Lists_indexOf(this, element, start, $.get$length(this)); - }, +}, isEmpty$0: function() { return $.eq($.get$length(this), 0); - }, +}, forEach$1: function(f) { return $._Collections_forEach(this, f); - }, +}, addLast$1: function(value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot add to immutable List.')); - }, +}, add$1: function(value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot add to immutable List.')); - }, +}, iterator$0: function() { var t1 = $._FixedSizeListIterator$(this); - $.setRuntimeTypeInfo(t1, ({T: 'Node'})); + $.setRuntimeTypeInfo(t1, {T: 'Node'}); return t1; - }, +}, operator$indexSet$2: function(index, value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot assign element of immutable List.')); - }, +}, operator$index$1: function(index) { - return this[index];; - }, +return this[index]; +}, is$JavaScriptIndexingBehavior: function() { return true; }, is$List: function() { return true; }, is$Collection: function() { return true; } }); $.$defineNativeClass('HTMLOptionsCollection', [], { + remove$1: function(index) { + return this.remove(index); +}, set$length: function(value) { - this.length = value;; - }, +this.length = value; +}, get$length: function() { - return this.length;; - }, +return this.length; +}, is$List: function() { return true; }, is$Collection: function() { return true; } }); @@ -4717,6 +5788,36 @@ $.$defineNativeClass('HTMLOptionsCollection', [], { $.$defineNativeClass('History', ["length?"], { }); +$.$defineNativeClass('XMLHttpRequest', [], { + $dom_removeEventListener$3: function(type, listener, useCapture) { + return this.removeEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +}, + $dom_addEventListener$3: function(type, listener, useCapture) { + return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +}, + get$on: function() { + return $._HttpRequestEventsImpl$(this); +} +}); + +$.$defineNativeClass('XMLHttpRequestException', [], { + toString$0: function() { + return this.toString(); +} +}); + +$.$defineNativeClass('XMLHttpRequestUpload', [], { + $dom_removeEventListener$3: function(type, listener, useCapture) { + return this.removeEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +}, + $dom_addEventListener$3: function(type, listener, useCapture) { + return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +}, + get$on: function() { + return $._HttpRequestUploadEventsImpl$(this); +} +}); + $.$defineNativeClass('IDBCursor', ["key?"], { }); @@ -4724,109 +5825,150 @@ $.$defineNativeClass('IDBCursorWithValue', ["value?"], { }); $.$defineNativeClass('IDBDatabase', [], { + $dom_removeEventListener$3: function(type, listener, useCapture) { + return this.removeEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +}, + close$0: function() { + return this.close(); +}, $dom_addEventListener$3: function(type, listener, useCapture) { return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); - }, +}, get$on: function() { return $._IDBDatabaseEventsImpl$(this); - } +} }); $.$defineNativeClass('IDBDatabaseException', [], { toString$0: function() { return this.toString(); - } +} }); $.$defineNativeClass('IDBObjectStore', [], { clear$0: function() { return this.clear(); - }, +}, add$2: function(value, key) { return this.add(value,key); - }, +}, add$1: function(value) { return this.add(value); } }); +$.$defineNativeClass('IDBOpenDBRequest', [], { + $dom_removeEventListener$3: function(type, listener, useCapture) { + return this.removeEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +}, + $dom_addEventListener$3: function(type, listener, useCapture) { + return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +}, + get$on: function() { + return $._IDBOpenDBRequestEventsImpl$(this); +} +}); + $.$defineNativeClass('IDBRequest', [], { + $dom_removeEventListener$3: function(type, listener, useCapture) { + if (Object.getPrototypeOf(this).hasOwnProperty('$dom_removeEventListener$3')) { + { + return this.removeEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +} + } else { + return Object.prototype.$dom_removeEventListener$3.call(this, type, listener, useCapture); + } + +}, $dom_addEventListener$3: function(type, listener, useCapture) { if (Object.getPrototypeOf(this).hasOwnProperty('$dom_addEventListener$3')) { - return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); + { + return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +} } else { return Object.prototype.$dom_addEventListener$3.call(this, type, listener, useCapture); } - }, + +}, get$on: function() { if (Object.getPrototypeOf(this).hasOwnProperty('get$on')) { - return $._IDBRequestEventsImpl$(this); + { + return $._IDBRequestEventsImpl$(this); +} } else { return Object.prototype.get$on.call(this); } - } + +} }); $.$defineNativeClass('IDBTransaction', [], { + $dom_removeEventListener$3: function(type, listener, useCapture) { + return this.removeEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +}, $dom_addEventListener$3: function(type, listener, useCapture) { return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); - }, +}, get$on: function() { return $._IDBTransactionEventsImpl$(this); - } +} }); $.$defineNativeClass('IDBVersionChangeRequest', [], { + $dom_removeEventListener$3: function(type, listener, useCapture) { + return this.removeEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +}, $dom_addEventListener$3: function(type, listener, useCapture) { return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); - }, +}, get$on: function() { return $._IDBVersionChangeRequestEventsImpl$(this); - } +} }); $.$defineNativeClass('HTMLIFrameElement', ["width!", "height!"], { }); $.$defineNativeClass('HTMLImageElement', ["width!", "height!"], { + complete$1: function(arg0) { return this.complete.call$1(arg0); } }); $.$defineNativeClass('HTMLInputElement', ["width!", "valueAsNumber=", "value=", "pattern?", "height!"], { get$on: function() { return $._InputElementEventsImpl$(this); - } +} }); $.$defineNativeClass('Int16Array', ["length?"], { removeLast$0: function() { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot removeLast on immutable List.')); - }, +}, indexOf$2: function(element, start) { return $._Lists_indexOf(this, element, start, $.get$length(this)); - }, +}, isEmpty$0: function() { return $.eq($.get$length(this), 0); - }, +}, forEach$1: function(f) { return $._Collections_forEach(this, f); - }, +}, addLast$1: function(value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot add to immutable List.')); - }, +}, add$1: function(value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot add to immutable List.')); - }, +}, iterator$0: function() { var t1 = $._FixedSizeListIterator$(this); - $.setRuntimeTypeInfo(t1, ({T: 'int'})); + $.setRuntimeTypeInfo(t1, {T: 'int'}); return t1; - }, +}, operator$indexSet$2: function(index, value) { - this[index] = value; - }, +this[index] = value +}, operator$index$1: function(index) { - return this[index];; - }, +return this[index]; +}, is$JavaScriptIndexingBehavior: function() { return true; }, is$List: function() { return true; }, is$Collection: function() { return true; } @@ -4835,33 +5977,33 @@ $.$defineNativeClass('Int16Array', ["length?"], { $.$defineNativeClass('Int32Array', ["length?"], { removeLast$0: function() { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot removeLast on immutable List.')); - }, +}, indexOf$2: function(element, start) { return $._Lists_indexOf(this, element, start, $.get$length(this)); - }, +}, isEmpty$0: function() { return $.eq($.get$length(this), 0); - }, +}, forEach$1: function(f) { return $._Collections_forEach(this, f); - }, +}, addLast$1: function(value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot add to immutable List.')); - }, +}, add$1: function(value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot add to immutable List.')); - }, +}, iterator$0: function() { var t1 = $._FixedSizeListIterator$(this); - $.setRuntimeTypeInfo(t1, ({T: 'int'})); + $.setRuntimeTypeInfo(t1, {T: 'int'}); return t1; - }, +}, operator$indexSet$2: function(index, value) { - this[index] = value; - }, +this[index] = value +}, operator$index$1: function(index) { - return this[index];; - }, +return this[index]; +}, is$JavaScriptIndexingBehavior: function() { return true; }, is$List: function() { return true; }, is$Collection: function() { return true; } @@ -4870,45 +6012,48 @@ $.$defineNativeClass('Int32Array', ["length?"], { $.$defineNativeClass('Int8Array', ["length?"], { removeLast$0: function() { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot removeLast on immutable List.')); - }, +}, indexOf$2: function(element, start) { return $._Lists_indexOf(this, element, start, $.get$length(this)); - }, +}, isEmpty$0: function() { return $.eq($.get$length(this), 0); - }, +}, forEach$1: function(f) { return $._Collections_forEach(this, f); - }, +}, addLast$1: function(value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot add to immutable List.')); - }, +}, add$1: function(value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot add to immutable List.')); - }, +}, iterator$0: function() { var t1 = $._FixedSizeListIterator$(this); - $.setRuntimeTypeInfo(t1, ({T: 'int'})); + $.setRuntimeTypeInfo(t1, {T: 'int'}); return t1; - }, +}, operator$indexSet$2: function(index, value) { - this[index] = value; - }, +this[index] = value +}, operator$index$1: function(index) { - return this[index];; - }, +return this[index]; +}, is$JavaScriptIndexingBehavior: function() { return true; }, is$List: function() { return true; }, is$Collection: function() { return true; } }); $.$defineNativeClass('JavaScriptAudioNode', [], { + $dom_removeEventListener$3: function(type, listener, useCapture) { + return this.removeEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +}, $dom_addEventListener$3: function(type, listener, useCapture) { return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); - }, +}, get$on: function() { return $._JavaScriptAudioNodeEventsImpl$(this); - } +} }); $.$defineNativeClass('HTMLLIElement', ["value="], { @@ -4918,71 +6063,77 @@ $.$defineNativeClass('HTMLLinkElement', ["target?"], { }); $.$defineNativeClass('LocalMediaStream', [], { + $dom_removeEventListener$3: function(type, listener, useCapture) { + return this.removeEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +}, $dom_addEventListener$3: function(type, listener, useCapture) { return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); - }, +}, stop$0: function() { return this.stop(); - } +} }); $.$defineNativeClass('Location', [], { toString$0: function() { return this.toString(); - } +} }); $.$defineNativeClass('HTMLMarqueeElement', ["width!", "height!"], { stop$0: function() { return this.stop(); - }, +}, start$0: function() { return this.start(); - } +} }); $.$defineNativeClass('MediaController', [], { + $dom_removeEventListener$3: function(type, listener, useCapture) { + return this.removeEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +}, $dom_addEventListener$3: function(type, listener, useCapture) { return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); - } +} }); $.$defineNativeClass('HTMLMediaElement', [], { get$on: function() { return $._MediaElementEventsImpl$(this); - } +} }); $.$defineNativeClass('MediaList', ["length?"], { removeLast$0: function() { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot removeLast on immutable List.')); - }, +}, indexOf$2: function(element, start) { return $._Lists_indexOf(this, element, start, $.get$length(this)); - }, +}, isEmpty$0: function() { return $.eq($.get$length(this), 0); - }, +}, forEach$1: function(f) { return $._Collections_forEach(this, f); - }, +}, addLast$1: function(value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot add to immutable List.')); - }, +}, add$1: function(value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot add to immutable List.')); - }, +}, iterator$0: function() { var t1 = $._FixedSizeListIterator$(this); - $.setRuntimeTypeInfo(t1, ({T: 'String'})); + $.setRuntimeTypeInfo(t1, {T: 'String'}); return t1; - }, +}, operator$indexSet$2: function(index, value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot assign element of immutable List.')); - }, +}, operator$index$1: function(index) { - return this[index];; - }, +return this[index]; +}, is$JavaScriptIndexingBehavior: function() { return true; }, is$List: function() { return true; }, is$Collection: function() { return true; } @@ -4991,44 +6142,75 @@ $.$defineNativeClass('MediaList', ["length?"], { $.$defineNativeClass('MediaQueryList', [], { addListener$1: function(listener) { return this.addListener(listener); - } +} +}); + +$.$defineNativeClass('MediaSource', [], { + $dom_removeEventListener$3: function(type, listener, useCapture) { + return this.removeEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +}, + $dom_addEventListener$3: function(type, listener, useCapture) { + return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +} }); $.$defineNativeClass('MediaStream', [], { + $dom_removeEventListener$3: function(type, listener, useCapture) { + if (Object.getPrototypeOf(this).hasOwnProperty('$dom_removeEventListener$3')) { + { + return this.removeEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +} + } else { + return Object.prototype.$dom_removeEventListener$3.call(this, type, listener, useCapture); + } + +}, $dom_addEventListener$3: function(type, listener, useCapture) { if (Object.getPrototypeOf(this).hasOwnProperty('$dom_addEventListener$3')) { - return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); + { + return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +} } else { return Object.prototype.$dom_addEventListener$3.call(this, type, listener, useCapture); } - }, + +}, get$on: function() { return $._MediaStreamEventsImpl$(this); - } +} }); $.$defineNativeClass('MediaStreamList', ["length?"], { }); $.$defineNativeClass('MediaStreamTrack', [], { + $dom_removeEventListener$3: function(type, listener, useCapture) { + return this.removeEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +}, $dom_addEventListener$3: function(type, listener, useCapture) { return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); - }, +}, get$on: function() { return $._MediaStreamTrackEventsImpl$(this); - } +} }); $.$defineNativeClass('MediaStreamTrackList', ["length?"], { + $dom_removeEventListener$3: function(type, listener, useCapture) { + return this.removeEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +}, + remove$1: function(track) { + return this.remove(track); +}, $dom_addEventListener$3: function(type, listener, useCapture) { return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); - }, +}, add$1: function(track) { return this.add(track); - }, +}, get$on: function() { return $._MediaStreamTrackListEventsImpl$(this); - } +} }); $.$defineNativeClass('MessageEvent', ["ports?"], { @@ -5037,19 +6219,25 @@ $.$defineNativeClass('MessageEvent', ["ports?"], { $.$defineNativeClass('MessagePort', [], { start$0: function() { return this.start(); - }, +}, + $dom_removeEventListener$3: function(type, listener, useCapture) { + return this.removeEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +}, postMessage$2: function(message, messagePorts) { return this.postMessage(message,messagePorts); - }, +}, postMessage$1: function(message) { return this.postMessage(message); +}, + close$0: function() { + return this.close(); }, $dom_addEventListener$3: function(type, listener, useCapture) { return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); - }, +}, get$on: function() { return $._MessagePortEventsImpl$(this); - } +} }); $.$defineNativeClass('HTMLMeterElement', ["value="], { @@ -5064,33 +6252,33 @@ $.$defineNativeClass('MutationRecord', ["target?"], { $.$defineNativeClass('NamedNodeMap', ["length?"], { removeLast$0: function() { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot removeLast on immutable List.')); - }, +}, indexOf$2: function(element, start) { return $._Lists_indexOf(this, element, start, $.get$length(this)); - }, +}, isEmpty$0: function() { return $.eq($.get$length(this), 0); - }, +}, forEach$1: function(f) { return $._Collections_forEach(this, f); - }, +}, addLast$1: function(value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot add to immutable List.')); - }, +}, add$1: function(value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot add to immutable List.')); - }, +}, iterator$0: function() { var t1 = $._FixedSizeListIterator$(this); - $.setRuntimeTypeInfo(t1, ({T: 'Node'})); + $.setRuntimeTypeInfo(t1, {T: 'Node'}); return t1; - }, +}, operator$indexSet$2: function(index, value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot assign element of immutable List.')); - }, +}, operator$index$1: function(index) { - return this[index];; - }, +return this[index]; +}, is$JavaScriptIndexingBehavior: function() { return true; }, is$List: function() { return true; }, is$Collection: function() { return true; } @@ -5099,92 +6287,106 @@ $.$defineNativeClass('NamedNodeMap', ["length?"], { $.$defineNativeClass('Node', [], { $dom_replaceChild$2: function(newChild, oldChild) { return this.replaceChild(newChild,oldChild); - }, +}, + $dom_removeEventListener$3: function(type, listener, useCapture) { + return this.removeEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +}, $dom_removeChild$1: function(oldChild) { return this.removeChild(oldChild); - }, +}, contains$1: function(other) { return this.contains(other); - }, +}, $dom_appendChild$1: function(newChild) { return this.appendChild(newChild); - }, +}, $dom_addEventListener$3: function(type, listener, useCapture) { return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); - }, +}, set$text: function(value) { - this.textContent = value;; - }, +this.textContent = value; +}, get$parent: function() { if (Object.getPrototypeOf(this).hasOwnProperty('get$parent')) { - return this.parentNode;; + { +return this.parentNode; +} } else { return Object.prototype.get$parent.call(this); } - }, + +}, get$document: function() { - return this.ownerDocument;; - }, +return this.ownerDocument; +}, remove$0: function() { - !(this.get$parent() == null) && this.get$parent().$dom_removeChild$1(this); + if (!(this.get$parent() == null)) + this.get$parent().$dom_removeChild$1(this); return this; - } +} }); $.$defineNativeClass('NodeList', ["length?"], { operator$index$1: function(index) { - return this[index];; - }, +return this[index]; +}, last$0: function() { return this.operator$index$1($.sub($.get$length(this), 1)); - }, +}, indexOf$2: function(element, start) { return $._Lists_indexOf(this, element, start, $.get$length(this)); - }, +}, isEmpty$0: function() { return $.eq($.get$length(this), 0); - }, +}, forEach$1: function(f) { return $._Collections_forEach(this, f); - }, +}, operator$indexSet$2: function(index, value) { this._parent.$dom_replaceChild$2(value, this.operator$index$1(index)); - }, +}, clear$0: function() { this._parent.set$text(''); - }, +}, removeLast$0: function() { var result = this.last$0(); - !(result == null) && this._parent.$dom_removeChild$1(result); + if (!(result == null)) + this._parent.$dom_removeChild$1(result); return result; - }, +}, addLast$1: function(value) { this._parent.$dom_appendChild$1(value); - }, +}, add$1: function(value) { this._parent.$dom_appendChild$1(value); - }, +}, iterator$0: function() { var t1 = $._FixedSizeListIterator$(this); - $.setRuntimeTypeInfo(t1, ({T: 'Node'})); + $.setRuntimeTypeInfo(t1, {T: 'Node'}); return t1; - }, +}, is$JavaScriptIndexingBehavior: function() { return true; }, is$List: function() { return true; }, is$Collection: function() { return true; } }); $.$defineNativeClass('Notification', ["tag?"], { + $dom_removeEventListener$3: function(type, listener, useCapture) { + return this.removeEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +}, + close$0: function() { + return this.close(); +}, $dom_addEventListener$3: function(type, listener, useCapture) { return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); - }, +}, get$on: function() { return $._NotificationEventsImpl$(this); - } +} }); $.$defineNativeClass('HTMLOListElement', [], { - start$0: function() { return this.start.$call$0(); } + start$0: function() { return this.start.call$0(); } }); $.$defineNativeClass('HTMLObjectElement', ["width!", "height!"], { @@ -5200,12 +6402,18 @@ $.$defineNativeClass('HTMLParamElement', ["value="], { }); $.$defineNativeClass('PeerConnection00', [], { + $dom_removeEventListener$3: function(type, listener, useCapture) { + return this.removeEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +}, + close$0: function() { + return this.close(); +}, $dom_addEventListener$3: function(type, listener, useCapture) { return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); - }, +}, get$on: function() { return $._PeerConnection00EventsImpl$(this); - } +} }); $.$defineNativeClass('HTMLPreElement', ["width!"], { @@ -5217,6 +6425,15 @@ $.$defineNativeClass('ProcessingInstruction', ["target?"], { $.$defineNativeClass('HTMLProgressElement', ["value="], { }); +$.$defineNativeClass('RTCPeerConnection', [], { + $dom_removeEventListener$3: function(type, listener, useCapture) { + return this.removeEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +}, + $dom_addEventListener$3: function(type, listener, useCapture) { + return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +} +}); + $.$defineNativeClass('RadioNodeList', ["value="], { is$List: function() { return true; }, is$Collection: function() { return true; } @@ -5225,13 +6442,13 @@ $.$defineNativeClass('RadioNodeList', ["value="], { $.$defineNativeClass('Range', [], { toString$0: function() { return this.toString(); - } +} }); $.$defineNativeClass('RangeException', [], { toString$0: function() { return this.toString(); - } +} }); $.$defineNativeClass('SQLResultSetRowList', ["length?"], { @@ -5245,14 +6462,14 @@ $.$defineNativeClass('SVGAngle', ["value="], { $.$defineNativeClass('SVGElement', [], { get$id: function() { - return this.id;; - } +return this.id; +} }); $.$defineNativeClass('SVGElementInstance', [], { get$on: function() { return $._SVGElementInstanceEventsImpl$(this); - } +} }); $.$defineNativeClass('SVGElementInstanceList', ["length?"], { @@ -5261,7 +6478,7 @@ $.$defineNativeClass('SVGElementInstanceList', ["length?"], { $.$defineNativeClass('SVGException', [], { toString$0: function() { return this.toString(); - } +} }); $.$defineNativeClass('SVGLength', ["value="], { @@ -5270,7 +6487,7 @@ $.$defineNativeClass('SVGLength', ["value="], { $.$defineNativeClass('SVGLengthList', [], { clear$0: function() { return this.clear(); - } +} }); $.$defineNativeClass('SVGNumber', ["value="], { @@ -5279,19 +6496,19 @@ $.$defineNativeClass('SVGNumber', ["value="], { $.$defineNativeClass('SVGNumberList', [], { clear$0: function() { return this.clear(); - } +} }); $.$defineNativeClass('SVGPathSegList', [], { clear$0: function() { return this.clear(); - } +} }); $.$defineNativeClass('SVGPointList', [], { clear$0: function() { return this.clear(); - } +} }); $.$defineNativeClass('SVGRect', ["width!", "height!"], { @@ -5300,31 +6517,34 @@ $.$defineNativeClass('SVGRect', ["width!", "height!"], { $.$defineNativeClass('SVGStringList', [], { clear$0: function() { return this.clear(); - } +} }); $.$defineNativeClass('SVGTransformList', [], { clear$0: function() { return this.clear(); - } +} }); $.$defineNativeClass('HTMLSelectElement', ["value=", "length="], { add$2: function(element, before) { return this.add(element,before); - } +} }); $.$defineNativeClass('SharedWorkerContext', [], { get$on: function() { return $._SharedWorkerContextEventsImpl$(this); - } +} }); $.$defineNativeClass('SourceBufferList', ["length?"], { + $dom_removeEventListener$3: function(type, listener, useCapture) { + return this.removeEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +}, $dom_addEventListener$3: function(type, listener, useCapture) { return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); - } +} }); $.$defineNativeClass('SpeechGrammarList', ["length?"], { @@ -5336,16 +6556,19 @@ $.$defineNativeClass('SpeechInputResultList', ["length?"], { $.$defineNativeClass('SpeechRecognition', [], { stop$0: function() { return this.stop(); - }, +}, start$0: function() { return this.start(); - }, +}, + $dom_removeEventListener$3: function(type, listener, useCapture) { + return this.removeEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +}, $dom_addEventListener$3: function(type, listener, useCapture) { return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); - }, +}, get$on: function() { return $._SpeechRecognitionEventsImpl$(this); - } +} }); $.$defineNativeClass('SpeechRecognitionResult', ["length?"], { @@ -5357,54 +6580,63 @@ $.$defineNativeClass('SpeechRecognitionResultList', ["length?"], { $.$defineNativeClass('Storage', [], { $dom_setItem$2: function(key, data) { return this.setItem(key,data); - }, +}, + $dom_removeItem$1: function(key) { + return this.removeItem(key); +}, $dom_key$1: function(index) { return this.key(index); - }, +}, $dom_getItem$1: function(key) { return this.getItem(key); - }, +}, $dom_clear$0: function() { return this.clear(); - }, +}, get$$$dom_length: function() { - return this.length;; - }, +return this.length; +}, isEmpty$0: function() { return this.$dom_key$1(0) == null; - }, +}, get$length: function() { return this.get$$$dom_length(); - }, +}, getValues$0: function() { var values = []; this.forEach$1(new $._StorageImpl_getValues_anon(values)); return values; - }, +}, getKeys$0: function() { var keys = []; this.forEach$1(new $._StorageImpl_getKeys_anon(keys)); return keys; - }, +}, forEach$1: function(f) { for (var i = 0; true; ++i) { var key = this.$dom_key$1(i); - if (key == null) return; - f.$call$2(key, this.operator$index$1(key)); + if (key == null) + return; + f.call$2(key, this.operator$index$1(key)); } - }, +}, clear$0: function() { return this.$dom_clear$0(); - }, +}, + remove$1: function(key) { + var value = this.operator$index$1(key); + this.$dom_removeItem$1(key); + return value; +}, operator$indexSet$2: function(key, value) { return this.$dom_setItem$2(key, value); - }, +}, operator$index$1: function(key) { return this.$dom_getItem$1(key); - }, +}, containsKey$1: function(key) { return !(this.$dom_getItem$1(key) == null); - }, +}, is$Map: function() { return true; } }); @@ -5414,33 +6646,33 @@ $.$defineNativeClass('StorageEvent', ["key?"], { $.$defineNativeClass('StyleSheetList', ["length?"], { removeLast$0: function() { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot removeLast on immutable List.')); - }, +}, indexOf$2: function(element, start) { return $._Lists_indexOf(this, element, start, $.get$length(this)); - }, +}, isEmpty$0: function() { return $.eq($.get$length(this), 0); - }, +}, forEach$1: function(f) { return $._Collections_forEach(this, f); - }, +}, addLast$1: function(value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot add to immutable List.')); - }, +}, add$1: function(value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot add to immutable List.')); - }, +}, iterator$0: function() { var t1 = $._FixedSizeListIterator$(this); - $.setRuntimeTypeInfo(t1, ({T: 'StyleSheet'})); + $.setRuntimeTypeInfo(t1, {T: 'StyleSheet'}); return t1; - }, +}, operator$indexSet$2: function(index, value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot assign element of immutable List.')); - }, +}, operator$index$1: function(index) { - return this[index];; - }, +return this[index]; +}, is$JavaScriptIndexingBehavior: function() { return true; }, is$List: function() { return true; }, is$Collection: function() { return true; } @@ -5459,33 +6691,42 @@ $.$defineNativeClass('HTMLTextAreaElement', ["value="], { }); $.$defineNativeClass('TextTrack', [], { + $dom_removeEventListener$3: function(type, listener, useCapture) { + return this.removeEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +}, $dom_addEventListener$3: function(type, listener, useCapture) { return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); - }, +}, get$on: function() { return $._TextTrackEventsImpl$(this); - } +} }); $.$defineNativeClass('TextTrackCue', ["text!", "id?"], { + $dom_removeEventListener$3: function(type, listener, useCapture) { + return this.removeEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +}, $dom_addEventListener$3: function(type, listener, useCapture) { return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); - }, +}, get$on: function() { return $._TextTrackCueEventsImpl$(this); - } +} }); $.$defineNativeClass('TextTrackCueList', ["length?"], { }); $.$defineNativeClass('TextTrackList', ["length?"], { + $dom_removeEventListener$3: function(type, listener, useCapture) { + return this.removeEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +}, $dom_addEventListener$3: function(type, listener, useCapture) { return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); - }, +}, get$on: function() { return $._TextTrackListEventsImpl$(this); - } +} }); $.$defineNativeClass('TimeRanges', ["length?"], { @@ -5497,33 +6738,33 @@ $.$defineNativeClass('Touch', ["target?"], { $.$defineNativeClass('TouchList', ["length?"], { removeLast$0: function() { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot removeLast on immutable List.')); - }, +}, indexOf$2: function(element, start) { return $._Lists_indexOf(this, element, start, $.get$length(this)); - }, +}, isEmpty$0: function() { return $.eq($.get$length(this), 0); - }, +}, forEach$1: function(f) { return $._Collections_forEach(this, f); - }, +}, addLast$1: function(value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot add to immutable List.')); - }, +}, add$1: function(value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot add to immutable List.')); - }, +}, iterator$0: function() { var t1 = $._FixedSizeListIterator$(this); - $.setRuntimeTypeInfo(t1, ({T: 'Touch'})); + $.setRuntimeTypeInfo(t1, {T: 'Touch'}); return t1; - }, +}, operator$indexSet$2: function(index, value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot assign element of immutable List.')); - }, +}, operator$index$1: function(index) { - return this[index];; - }, +return this[index]; +}, is$JavaScriptIndexingBehavior: function() { return true; }, is$List: function() { return true; }, is$Collection: function() { return true; } @@ -5532,33 +6773,33 @@ $.$defineNativeClass('TouchList', ["length?"], { $.$defineNativeClass('Uint16Array', ["length?"], { removeLast$0: function() { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot removeLast on immutable List.')); - }, +}, indexOf$2: function(element, start) { return $._Lists_indexOf(this, element, start, $.get$length(this)); - }, +}, isEmpty$0: function() { return $.eq($.get$length(this), 0); - }, +}, forEach$1: function(f) { return $._Collections_forEach(this, f); - }, +}, addLast$1: function(value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot add to immutable List.')); - }, +}, add$1: function(value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot add to immutable List.')); - }, +}, iterator$0: function() { var t1 = $._FixedSizeListIterator$(this); - $.setRuntimeTypeInfo(t1, ({T: 'int'})); + $.setRuntimeTypeInfo(t1, {T: 'int'}); return t1; - }, +}, operator$indexSet$2: function(index, value) { - this[index] = value; - }, +this[index] = value +}, operator$index$1: function(index) { - return this[index];; - }, +return this[index]; +}, is$JavaScriptIndexingBehavior: function() { return true; }, is$List: function() { return true; }, is$Collection: function() { return true; } @@ -5567,33 +6808,33 @@ $.$defineNativeClass('Uint16Array', ["length?"], { $.$defineNativeClass('Uint32Array', ["length?"], { removeLast$0: function() { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot removeLast on immutable List.')); - }, +}, indexOf$2: function(element, start) { return $._Lists_indexOf(this, element, start, $.get$length(this)); - }, +}, isEmpty$0: function() { return $.eq($.get$length(this), 0); - }, +}, forEach$1: function(f) { return $._Collections_forEach(this, f); - }, +}, addLast$1: function(value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot add to immutable List.')); - }, +}, add$1: function(value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot add to immutable List.')); - }, +}, iterator$0: function() { var t1 = $._FixedSizeListIterator$(this); - $.setRuntimeTypeInfo(t1, ({T: 'int'})); + $.setRuntimeTypeInfo(t1, {T: 'int'}); return t1; - }, +}, operator$indexSet$2: function(index, value) { - this[index] = value; - }, +this[index] = value +}, operator$index$1: function(index) { - return this[index];; - }, +return this[index]; +}, is$JavaScriptIndexingBehavior: function() { return true; }, is$List: function() { return true; }, is$Collection: function() { return true; } @@ -5602,33 +6843,33 @@ $.$defineNativeClass('Uint32Array', ["length?"], { $.$defineNativeClass('Uint8Array', ["length?"], { removeLast$0: function() { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot removeLast on immutable List.')); - }, +}, indexOf$2: function(element, start) { return $._Lists_indexOf(this, element, start, $.get$length(this)); - }, +}, isEmpty$0: function() { return $.eq($.get$length(this), 0); - }, +}, forEach$1: function(f) { return $._Collections_forEach(this, f); - }, +}, addLast$1: function(value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot add to immutable List.')); - }, +}, add$1: function(value) { throw $.captureStackTrace($.UnsupportedOperationException$('Cannot add to immutable List.')); - }, +}, iterator$0: function() { var t1 = $._FixedSizeListIterator$(this); - $.setRuntimeTypeInfo(t1, ({T: 'int'})); + $.setRuntimeTypeInfo(t1, {T: 'int'}); return t1; - }, +}, operator$indexSet$2: function(index, value) { - this[index] = value; - }, +this[index] = value +}, operator$index$1: function(index) { - return this[index];; - }, +return this[index]; +}, is$JavaScriptIndexingBehavior: function() { return true; }, is$List: function() { return true; }, is$Collection: function() { return true; } @@ -5642,171 +6883,183 @@ $.$defineNativeClass('Uint8ClampedArray', [], { $.$defineNativeClass('HTMLVideoElement', ["width!", "height!"], { }); +$.$defineNativeClass('WebKitNamedFlow', [], { + $dom_removeEventListener$3: function(type, listener, useCapture) { + return this.removeEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +}, + $dom_addEventListener$3: function(type, listener, useCapture) { + return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +} +}); + $.$defineNativeClass('WebSocket', [], { + $dom_removeEventListener$3: function(type, listener, useCapture) { + return this.removeEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +}, + close$2: function(code, reason) { + return this.close(code,reason); +}, + close$0: function() { + return this.close(); +}, $dom_addEventListener$3: function(type, listener, useCapture) { return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); - }, +}, get$on: function() { return $._WebSocketEventsImpl$(this); - } +} }); $.$defineNativeClass('DOMWindow', ["length?", "innerWidth?", "innerHeight?"], { webkitRequestAnimationFrame$1: function(callback) { return this.webkitRequestAnimationFrame($.convertDartClosureToJS(callback, 1)); - }, +}, stop$0: function() { return this.stop(); - }, +}, setTimeout$2: function(handler, timeout) { return this.setTimeout($.convertDartClosureToJS(handler, 0),timeout); - }, +}, + setInterval$2: function(handler, timeout) { + return this.setInterval($.convertDartClosureToJS(handler, 0),timeout); +}, + $dom_removeEventListener$3: function(type, listener, useCapture) { + return this.removeEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +}, moveTo$2: function(x, y) { return this.moveTo(x,y); - }, +}, + close$0: function() { + return this.close(); +}, $dom_addEventListener$3: function(type, listener, useCapture) { return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); - }, +}, get$on: function() { return $._WindowEventsImpl$(this); - }, +}, get$document: function() { - return this.document;; - } +return this.document; +} }); $.$defineNativeClass('Worker', [], { postMessage$2: function(message, messagePorts) { return this.postMessage(message,messagePorts); - }, +}, postMessage$1: function(message) { return this.postMessage(message); }, get$on: function() { return $._WorkerEventsImpl$(this); - } +} }); $.$defineNativeClass('WorkerContext', [], { setTimeout$2: function(handler, timeout) { return this.setTimeout($.convertDartClosureToJS(handler, 0),timeout); - }, +}, + setInterval$2: function(handler, timeout) { + return this.setInterval($.convertDartClosureToJS(handler, 0),timeout); +}, + $dom_removeEventListener$3: function(type, listener, useCapture) { + return this.removeEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); +}, + close$0: function() { + return this.close(); +}, $dom_addEventListener$3: function(type, listener, useCapture) { return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); - }, +}, get$on: function() { if (Object.getPrototypeOf(this).hasOwnProperty('get$on')) { - return $._WorkerContextEventsImpl$(this); + { + return $._WorkerContextEventsImpl$(this); +} } else { return Object.prototype.get$on.call(this); } - } -}); - -$.$defineNativeClass('WorkerLocation', [], { - toString$0: function() { - return this.toString(); - } -}); -$.$defineNativeClass('XMLHttpRequest', [], { - $dom_addEventListener$3: function(type, listener, useCapture) { - return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); - }, - get$on: function() { - return $._XMLHttpRequestEventsImpl$(this); - } +} }); -$.$defineNativeClass('XMLHttpRequestException', [], { +$.$defineNativeClass('WorkerLocation', [], { toString$0: function() { return this.toString(); - } -}); - -$.$defineNativeClass('XMLHttpRequestUpload', [], { - $dom_addEventListener$3: function(type, listener, useCapture) { - return this.addEventListener(type,$.convertDartClosureToJS(listener, 1),useCapture); - }, - get$on: function() { - return $._XMLHttpRequestUploadEventsImpl$(this); - } +} }); $.$defineNativeClass('XPathException', [], { toString$0: function() { return this.toString(); - } +} }); $.$defineNativeClass('XSLTProcessor', [], { reset$0: function() { return this.reset(); - } +} }); -$.$defineNativeClass('IDBOpenDBRequest', [], { - get$on: function() { - return $._IDBOpenDBRequestEventsImpl$(this); - } +$.$defineNativeClass('Worker', [], { + postMessage$1: function(msg) { +return this.postMessage(msg); +}, + get$id: function() { +return this.id; +} }); $.$defineNativeClass('DOMWindow', [], { + setInterval$2: function(handler, timeout) { + return this.setInterval($.convertDartClosureToJS(handler, 0),timeout); +}, setTimeout$2: function(handler, timeout) { return this.setTimeout($.convertDartClosureToJS(handler, 0),timeout); - } -}); - -$.$defineNativeClass('Worker', [], { - postMessage$1: function(msg) { - return this.postMessage(msg);; - }, - get$id: function() { - return this.id;; - } +} }); -// 166 dynamic classes. -// 337 classes +// 169 dynamic classes. +// 342 classes // 31 !leaf (function(){ - var v0/*class(_SVGElementImpl)*/ = 'SVGElement|SVGViewElement|SVGVKernElement|SVGUseElement|SVGTitleElement|SVGTextContentElement|SVGTextPositioningElement|SVGTextElement|SVGTSpanElement|SVGTRefElement|SVGAltGlyphElement|SVGTextElement|SVGTSpanElement|SVGTRefElement|SVGAltGlyphElement|SVGTextPathElement|SVGTextPositioningElement|SVGTextElement|SVGTSpanElement|SVGTRefElement|SVGAltGlyphElement|SVGTextElement|SVGTSpanElement|SVGTRefElement|SVGAltGlyphElement|SVGTextPathElement|SVGSymbolElement|SVGSwitchElement|SVGStyleElement|SVGStopElement|SVGScriptElement|SVGSVGElement|SVGRectElement|SVGPolylineElement|SVGPolygonElement|SVGPatternElement|SVGPathElement|SVGMissingGlyphElement|SVGMetadataElement|SVGMaskElement|SVGMarkerElement|SVGMPathElement|SVGLineElement|SVGImageElement|SVGHKernElement|SVGGradientElement|SVGRadialGradientElement|SVGLinearGradientElement|SVGRadialGradientElement|SVGLinearGradientElement|SVGGlyphRefElement|SVGGlyphElement|SVGGElement|SVGForeignObjectElement|SVGFontFaceUriElement|SVGFontFaceSrcElement|SVGFontFaceNameElement|SVGFontFaceFormatElement|SVGFontFaceElement|SVGFontElement|SVGFilterElement|SVGFETurbulenceElement|SVGFETileElement|SVGFESpotLightElement|SVGFESpecularLightingElement|SVGFEPointLightElement|SVGFEOffsetElement|SVGFEMorphologyElement|SVGFEMergeNodeElement|SVGFEMergeElement|SVGFEImageElement|SVGFEGaussianBlurElement|SVGFEFloodElement|SVGFEDropShadowElement|SVGFEDistantLightElement|SVGFEDisplacementMapElement|SVGFEDiffuseLightingElement|SVGFEConvolveMatrixElement|SVGFECompositeElement|SVGFEComponentTransferElement|SVGFEColorMatrixElement|SVGFEBlendElement|SVGEllipseElement|SVGDescElement|SVGDefsElement|SVGCursorElement|SVGComponentTransferFunctionElement|SVGFEFuncRElement|SVGFEFuncGElement|SVGFEFuncBElement|SVGFEFuncAElement|SVGFEFuncRElement|SVGFEFuncGElement|SVGFEFuncBElement|SVGFEFuncAElement|SVGClipPathElement|SVGCircleElement|SVGAnimationElement|SVGSetElement|SVGAnimateTransformElement|SVGAnimateMotionElement|SVGAnimateElement|SVGAnimateColorElement|SVGSetElement|SVGAnimateTransformElement|SVGAnimateMotionElement|SVGAnimateElement|SVGAnimateColorElement|SVGAltGlyphItemElement|SVGAltGlyphDefElement|SVGAElement|SVGViewElement|SVGVKernElement|SVGUseElement|SVGTitleElement|SVGTextContentElement|SVGTextPositioningElement|SVGTextElement|SVGTSpanElement|SVGTRefElement|SVGAltGlyphElement|SVGTextElement|SVGTSpanElement|SVGTRefElement|SVGAltGlyphElement|SVGTextPathElement|SVGTextPositioningElement|SVGTextElement|SVGTSpanElement|SVGTRefElement|SVGAltGlyphElement|SVGTextElement|SVGTSpanElement|SVGTRefElement|SVGAltGlyphElement|SVGTextPathElement|SVGSymbolElement|SVGSwitchElement|SVGStyleElement|SVGStopElement|SVGScriptElement|SVGSVGElement|SVGRectElement|SVGPolylineElement|SVGPolygonElement|SVGPatternElement|SVGPathElement|SVGMissingGlyphElement|SVGMetadataElement|SVGMaskElement|SVGMarkerElement|SVGMPathElement|SVGLineElement|SVGImageElement|SVGHKernElement|SVGGradientElement|SVGRadialGradientElement|SVGLinearGradientElement|SVGRadialGradientElement|SVGLinearGradientElement|SVGGlyphRefElement|SVGGlyphElement|SVGGElement|SVGForeignObjectElement|SVGFontFaceUriElement|SVGFontFaceSrcElement|SVGFontFaceNameElement|SVGFontFaceFormatElement|SVGFontFaceElement|SVGFontElement|SVGFilterElement|SVGFETurbulenceElement|SVGFETileElement|SVGFESpotLightElement|SVGFESpecularLightingElement|SVGFEPointLightElement|SVGFEOffsetElement|SVGFEMorphologyElement|SVGFEMergeNodeElement|SVGFEMergeElement|SVGFEImageElement|SVGFEGaussianBlurElement|SVGFEFloodElement|SVGFEDropShadowElement|SVGFEDistantLightElement|SVGFEDisplacementMapElement|SVGFEDiffuseLightingElement|SVGFEConvolveMatrixElement|SVGFECompositeElement|SVGFEComponentTransferElement|SVGFEColorMatrixElement|SVGFEBlendElement|SVGEllipseElement|SVGDescElement|SVGDefsElement|SVGCursorElement|SVGComponentTransferFunctionElement|SVGFEFuncRElement|SVGFEFuncGElement|SVGFEFuncBElement|SVGFEFuncAElement|SVGFEFuncRElement|SVGFEFuncGElement|SVGFEFuncBElement|SVGFEFuncAElement|SVGClipPathElement|SVGCircleElement|SVGAnimationElement|SVGSetElement|SVGAnimateTransformElement|SVGAnimateMotionElement|SVGAnimateElement|SVGAnimateColorElement|SVGSetElement|SVGAnimateTransformElement|SVGAnimateMotionElement|SVGAnimateElement|SVGAnimateColorElement|SVGAltGlyphItemElement|SVGAltGlyphDefElement|SVGAElement'; - var v1/*class(_MediaElementImpl)*/ = 'HTMLMediaElement|HTMLVideoElement|HTMLAudioElement|HTMLVideoElement|HTMLAudioElement'; - var v2/*class(_ElementImpl)*/ = [v0/*class(_SVGElementImpl)*/,v1/*class(_MediaElementImpl)*/,v0/*class(_SVGElementImpl)*/,v1/*class(_MediaElementImpl)*/,'Element|HTMLUnknownElement|HTMLUListElement|HTMLTrackElement|HTMLTitleElement|HTMLTextAreaElement|HTMLTableSectionElement|HTMLTableRowElement|HTMLTableElement|HTMLTableColElement|HTMLTableCellElement|HTMLTableCaptionElement|HTMLStyleElement|HTMLSpanElement|HTMLSourceElement|HTMLShadowElement|HTMLSelectElement|HTMLScriptElement|HTMLQuoteElement|HTMLProgressElement|HTMLPreElement|HTMLParamElement|HTMLParagraphElement|HTMLOutputElement|HTMLOptionElement|HTMLOptGroupElement|HTMLObjectElement|HTMLOListElement|HTMLModElement|HTMLMeterElement|HTMLMetaElement|HTMLMenuElement|HTMLMarqueeElement|HTMLMapElement|HTMLLinkElement|HTMLLegendElement|HTMLLabelElement|HTMLLIElement|HTMLKeygenElement|HTMLInputElement|HTMLImageElement|HTMLIFrameElement|HTMLHtmlElement|HTMLHeadingElement|HTMLHeadElement|HTMLHRElement|HTMLFrameSetElement|HTMLFrameElement|HTMLFormElement|HTMLFontElement|HTMLFieldSetElement|HTMLEmbedElement|HTMLDivElement|HTMLDirectoryElement|HTMLDetailsElement|HTMLDListElement|HTMLContentElement|HTMLCanvasElement|HTMLButtonElement|HTMLBodyElement|HTMLBaseFontElement|HTMLBaseElement|HTMLBRElement|HTMLAreaElement|HTMLAppletElement|HTMLAnchorElement|HTMLElement|HTMLUnknownElement|HTMLUListElement|HTMLTrackElement|HTMLTitleElement|HTMLTextAreaElement|HTMLTableSectionElement|HTMLTableRowElement|HTMLTableElement|HTMLTableColElement|HTMLTableCellElement|HTMLTableCaptionElement|HTMLStyleElement|HTMLSpanElement|HTMLSourceElement|HTMLShadowElement|HTMLSelectElement|HTMLScriptElement|HTMLQuoteElement|HTMLProgressElement|HTMLPreElement|HTMLParamElement|HTMLParagraphElement|HTMLOutputElement|HTMLOptionElement|HTMLOptGroupElement|HTMLObjectElement|HTMLOListElement|HTMLModElement|HTMLMeterElement|HTMLMetaElement|HTMLMenuElement|HTMLMarqueeElement|HTMLMapElement|HTMLLinkElement|HTMLLegendElement|HTMLLabelElement|HTMLLIElement|HTMLKeygenElement|HTMLInputElement|HTMLImageElement|HTMLIFrameElement|HTMLHtmlElement|HTMLHeadingElement|HTMLHeadElement|HTMLHRElement|HTMLFrameSetElement|HTMLFrameElement|HTMLFormElement|HTMLFontElement|HTMLFieldSetElement|HTMLEmbedElement|HTMLDivElement|HTMLDirectoryElement|HTMLDetailsElement|HTMLDListElement|HTMLContentElement|HTMLCanvasElement|HTMLButtonElement|HTMLBodyElement|HTMLBaseFontElement|HTMLBaseElement|HTMLBRElement|HTMLAreaElement|HTMLAppletElement|HTMLAnchorElement|HTMLElement'].join('|'); - var v3/*class(_DocumentFragmentImpl)*/ = 'DocumentFragment|ShadowRoot|ShadowRoot'; - var v4/*class(_DocumentImpl)*/ = 'HTMLDocument|SVGDocument|SVGDocument'; - var v5/*class(_CharacterDataImpl)*/ = 'CharacterData|Text|CDATASection|CDATASection|Comment|Text|CDATASection|CDATASection|Comment'; - var v6/*class(_WorkerContextImpl)*/ = 'WorkerContext|SharedWorkerContext|DedicatedWorkerContext|SharedWorkerContext|DedicatedWorkerContext'; - var v7/*class(_NodeImpl)*/ = [v2/*class(_ElementImpl)*/,v3/*class(_DocumentFragmentImpl)*/,v4/*class(_DocumentImpl)*/,v5/*class(_CharacterDataImpl)*/,v2/*class(_ElementImpl)*/,v3/*class(_DocumentFragmentImpl)*/,v4/*class(_DocumentImpl)*/,v5/*class(_CharacterDataImpl)*/,'Node|ProcessingInstruction|Notation|EntityReference|Entity|DocumentType|Attr|ProcessingInstruction|Notation|EntityReference|Entity|DocumentType|Attr'].join('|'); - var v8/*class(_MediaStreamImpl)*/ = 'MediaStream|LocalMediaStream|LocalMediaStream'; - var v9/*class(_IDBRequestImpl)*/ = 'IDBRequest|IDBOpenDBRequest|IDBVersionChangeRequest|IDBOpenDBRequest|IDBVersionChangeRequest'; - var v10/*class(_AbstractWorkerImpl)*/ = 'AbstractWorker|Worker|SharedWorker|Worker|SharedWorker'; - var v11/*class(_MouseEventImpl)*/ = 'MouseEvent|WheelEvent|WheelEvent'; + var v0/*class(_MouseEventImpl)*/ = 'MouseEvent|WheelEvent|WheelEvent'; + var v1/*class(_SVGElementImpl)*/ = 'SVGElement|SVGViewElement|SVGVKernElement|SVGUseElement|SVGTitleElement|SVGTextContentElement|SVGTextPositioningElement|SVGTextElement|SVGTSpanElement|SVGTRefElement|SVGAltGlyphElement|SVGTextElement|SVGTSpanElement|SVGTRefElement|SVGAltGlyphElement|SVGTextPathElement|SVGTextPositioningElement|SVGTextElement|SVGTSpanElement|SVGTRefElement|SVGAltGlyphElement|SVGTextElement|SVGTSpanElement|SVGTRefElement|SVGAltGlyphElement|SVGTextPathElement|SVGSymbolElement|SVGSwitchElement|SVGStyleElement|SVGStopElement|SVGScriptElement|SVGSVGElement|SVGRectElement|SVGPolylineElement|SVGPolygonElement|SVGPatternElement|SVGPathElement|SVGMissingGlyphElement|SVGMetadataElement|SVGMaskElement|SVGMarkerElement|SVGMPathElement|SVGLineElement|SVGImageElement|SVGHKernElement|SVGGradientElement|SVGRadialGradientElement|SVGLinearGradientElement|SVGRadialGradientElement|SVGLinearGradientElement|SVGGlyphRefElement|SVGGlyphElement|SVGGElement|SVGForeignObjectElement|SVGFontFaceUriElement|SVGFontFaceSrcElement|SVGFontFaceNameElement|SVGFontFaceFormatElement|SVGFontFaceElement|SVGFontElement|SVGFilterElement|SVGFETurbulenceElement|SVGFETileElement|SVGFESpotLightElement|SVGFESpecularLightingElement|SVGFEPointLightElement|SVGFEOffsetElement|SVGFEMorphologyElement|SVGFEMergeNodeElement|SVGFEMergeElement|SVGFEImageElement|SVGFEGaussianBlurElement|SVGFEFloodElement|SVGFEDropShadowElement|SVGFEDistantLightElement|SVGFEDisplacementMapElement|SVGFEDiffuseLightingElement|SVGFEConvolveMatrixElement|SVGFECompositeElement|SVGFEComponentTransferElement|SVGFEColorMatrixElement|SVGFEBlendElement|SVGEllipseElement|SVGDescElement|SVGDefsElement|SVGCursorElement|SVGComponentTransferFunctionElement|SVGFEFuncRElement|SVGFEFuncGElement|SVGFEFuncBElement|SVGFEFuncAElement|SVGFEFuncRElement|SVGFEFuncGElement|SVGFEFuncBElement|SVGFEFuncAElement|SVGClipPathElement|SVGCircleElement|SVGAnimationElement|SVGSetElement|SVGAnimateTransformElement|SVGAnimateMotionElement|SVGAnimateElement|SVGAnimateColorElement|SVGSetElement|SVGAnimateTransformElement|SVGAnimateMotionElement|SVGAnimateElement|SVGAnimateColorElement|SVGAltGlyphItemElement|SVGAltGlyphDefElement|SVGAElement|SVGViewElement|SVGVKernElement|SVGUseElement|SVGTitleElement|SVGTextContentElement|SVGTextPositioningElement|SVGTextElement|SVGTSpanElement|SVGTRefElement|SVGAltGlyphElement|SVGTextElement|SVGTSpanElement|SVGTRefElement|SVGAltGlyphElement|SVGTextPathElement|SVGTextPositioningElement|SVGTextElement|SVGTSpanElement|SVGTRefElement|SVGAltGlyphElement|SVGTextElement|SVGTSpanElement|SVGTRefElement|SVGAltGlyphElement|SVGTextPathElement|SVGSymbolElement|SVGSwitchElement|SVGStyleElement|SVGStopElement|SVGScriptElement|SVGSVGElement|SVGRectElement|SVGPolylineElement|SVGPolygonElement|SVGPatternElement|SVGPathElement|SVGMissingGlyphElement|SVGMetadataElement|SVGMaskElement|SVGMarkerElement|SVGMPathElement|SVGLineElement|SVGImageElement|SVGHKernElement|SVGGradientElement|SVGRadialGradientElement|SVGLinearGradientElement|SVGRadialGradientElement|SVGLinearGradientElement|SVGGlyphRefElement|SVGGlyphElement|SVGGElement|SVGForeignObjectElement|SVGFontFaceUriElement|SVGFontFaceSrcElement|SVGFontFaceNameElement|SVGFontFaceFormatElement|SVGFontFaceElement|SVGFontElement|SVGFilterElement|SVGFETurbulenceElement|SVGFETileElement|SVGFESpotLightElement|SVGFESpecularLightingElement|SVGFEPointLightElement|SVGFEOffsetElement|SVGFEMorphologyElement|SVGFEMergeNodeElement|SVGFEMergeElement|SVGFEImageElement|SVGFEGaussianBlurElement|SVGFEFloodElement|SVGFEDropShadowElement|SVGFEDistantLightElement|SVGFEDisplacementMapElement|SVGFEDiffuseLightingElement|SVGFEConvolveMatrixElement|SVGFECompositeElement|SVGFEComponentTransferElement|SVGFEColorMatrixElement|SVGFEBlendElement|SVGEllipseElement|SVGDescElement|SVGDefsElement|SVGCursorElement|SVGComponentTransferFunctionElement|SVGFEFuncRElement|SVGFEFuncGElement|SVGFEFuncBElement|SVGFEFuncAElement|SVGFEFuncRElement|SVGFEFuncGElement|SVGFEFuncBElement|SVGFEFuncAElement|SVGClipPathElement|SVGCircleElement|SVGAnimationElement|SVGSetElement|SVGAnimateTransformElement|SVGAnimateMotionElement|SVGAnimateElement|SVGAnimateColorElement|SVGSetElement|SVGAnimateTransformElement|SVGAnimateMotionElement|SVGAnimateElement|SVGAnimateColorElement|SVGAltGlyphItemElement|SVGAltGlyphDefElement|SVGAElement'; + var v2/*class(_MediaElementImpl)*/ = 'HTMLMediaElement|HTMLVideoElement|HTMLAudioElement|HTMLVideoElement|HTMLAudioElement'; + var v3/*class(_ElementImpl)*/ = [v1/*class(_SVGElementImpl)*/,v2/*class(_MediaElementImpl)*/,v1/*class(_SVGElementImpl)*/,v2/*class(_MediaElementImpl)*/,'Element|HTMLUnknownElement|HTMLUListElement|HTMLTrackElement|HTMLTitleElement|HTMLTextAreaElement|HTMLTableSectionElement|HTMLTableRowElement|HTMLTableElement|HTMLTableColElement|HTMLTableCellElement|HTMLTableCaptionElement|HTMLStyleElement|HTMLSpanElement|HTMLSourceElement|HTMLShadowElement|HTMLSelectElement|HTMLScriptElement|HTMLQuoteElement|HTMLProgressElement|HTMLPreElement|HTMLParamElement|HTMLParagraphElement|HTMLOutputElement|HTMLOptionElement|HTMLOptGroupElement|HTMLObjectElement|HTMLOListElement|HTMLModElement|HTMLMeterElement|HTMLMetaElement|HTMLMenuElement|HTMLMarqueeElement|HTMLMapElement|HTMLLinkElement|HTMLLegendElement|HTMLLabelElement|HTMLLIElement|HTMLKeygenElement|HTMLInputElement|HTMLImageElement|HTMLIFrameElement|HTMLHtmlElement|HTMLHeadingElement|HTMLHeadElement|HTMLHRElement|HTMLFrameSetElement|HTMLFrameElement|HTMLFormElement|HTMLFontElement|HTMLFieldSetElement|HTMLEmbedElement|HTMLDivElement|HTMLDirectoryElement|HTMLDetailsElement|HTMLDataListElement|HTMLDListElement|HTMLContentElement|HTMLCanvasElement|HTMLButtonElement|HTMLBodyElement|HTMLBaseFontElement|HTMLBaseElement|HTMLBRElement|HTMLAreaElement|HTMLAppletElement|HTMLAnchorElement|HTMLElement|HTMLUnknownElement|HTMLUListElement|HTMLTrackElement|HTMLTitleElement|HTMLTextAreaElement|HTMLTableSectionElement|HTMLTableRowElement|HTMLTableElement|HTMLTableColElement|HTMLTableCellElement|HTMLTableCaptionElement|HTMLStyleElement|HTMLSpanElement|HTMLSourceElement|HTMLShadowElement|HTMLSelectElement|HTMLScriptElement|HTMLQuoteElement|HTMLProgressElement|HTMLPreElement|HTMLParamElement|HTMLParagraphElement|HTMLOutputElement|HTMLOptionElement|HTMLOptGroupElement|HTMLObjectElement|HTMLOListElement|HTMLModElement|HTMLMeterElement|HTMLMetaElement|HTMLMenuElement|HTMLMarqueeElement|HTMLMapElement|HTMLLinkElement|HTMLLegendElement|HTMLLabelElement|HTMLLIElement|HTMLKeygenElement|HTMLInputElement|HTMLImageElement|HTMLIFrameElement|HTMLHtmlElement|HTMLHeadingElement|HTMLHeadElement|HTMLHRElement|HTMLFrameSetElement|HTMLFrameElement|HTMLFormElement|HTMLFontElement|HTMLFieldSetElement|HTMLEmbedElement|HTMLDivElement|HTMLDirectoryElement|HTMLDetailsElement|HTMLDataListElement|HTMLDListElement|HTMLContentElement|HTMLCanvasElement|HTMLButtonElement|HTMLBodyElement|HTMLBaseFontElement|HTMLBaseElement|HTMLBRElement|HTMLAreaElement|HTMLAppletElement|HTMLAnchorElement|HTMLElement'].join('|'); + var v4/*class(_DocumentFragmentImpl)*/ = 'DocumentFragment|ShadowRoot|ShadowRoot'; + var v5/*class(_DocumentImpl)*/ = 'HTMLDocument|SVGDocument|SVGDocument'; + var v6/*class(_CharacterDataImpl)*/ = 'CharacterData|Text|CDATASection|CDATASection|Comment|Text|CDATASection|CDATASection|Comment'; + var v7/*class(_WorkerContextImpl)*/ = 'WorkerContext|SharedWorkerContext|DedicatedWorkerContext|SharedWorkerContext|DedicatedWorkerContext'; + var v8/*class(_NodeImpl)*/ = [v3/*class(_ElementImpl)*/,v4/*class(_DocumentFragmentImpl)*/,v5/*class(_DocumentImpl)*/,v6/*class(_CharacterDataImpl)*/,v3/*class(_ElementImpl)*/,v4/*class(_DocumentFragmentImpl)*/,v5/*class(_DocumentImpl)*/,v6/*class(_CharacterDataImpl)*/,'Node|ProcessingInstruction|Notation|EntityReference|Entity|DocumentType|Attr|ProcessingInstruction|Notation|EntityReference|Entity|DocumentType|Attr'].join('|'); + var v9/*class(_MediaStreamImpl)*/ = 'MediaStream|LocalMediaStream|LocalMediaStream'; + var v10/*class(_IDBRequestImpl)*/ = 'IDBRequest|IDBVersionChangeRequest|IDBOpenDBRequest|IDBVersionChangeRequest|IDBOpenDBRequest'; + var v11/*class(_AbstractWorkerImpl)*/ = 'AbstractWorker|Worker|SharedWorker|Worker|SharedWorker'; var table = [ // [dynamic-dispatch-tag, tags of classes implementing dynamic-dispatch-tag] - ['WorkerContext', v6/*class(_WorkerContextImpl)*/], - ['SVGElement', v0/*class(_SVGElementImpl)*/], - ['HTMLMediaElement', v1/*class(_MediaElementImpl)*/], - ['Element', v2/*class(_ElementImpl)*/], - ['DocumentFragment', v3/*class(_DocumentFragmentImpl)*/], - ['HTMLDocument', v4/*class(_DocumentImpl)*/], - ['CharacterData', v5/*class(_CharacterDataImpl)*/], - ['Node', v7/*class(_NodeImpl)*/], - ['MediaStream', v8/*class(_MediaStreamImpl)*/], - ['IDBRequest', v9/*class(_IDBRequestImpl)*/], - ['AbstractWorker', v10/*class(_AbstractWorkerImpl)*/], - ['EventTarget', [v6/*class(_WorkerContextImpl)*/,v7/*class(_NodeImpl)*/,v8/*class(_MediaStreamImpl)*/,v9/*class(_IDBRequestImpl)*/,v10/*class(_AbstractWorkerImpl)*/,v6/*class(_WorkerContextImpl)*/,v7/*class(_NodeImpl)*/,v8/*class(_MediaStreamImpl)*/,v9/*class(_IDBRequestImpl)*/,v10/*class(_AbstractWorkerImpl)*/,'EventTarget|XMLHttpRequestUpload|XMLHttpRequest|DOMWindow|WebSocket|TextTrackList|TextTrackCue|TextTrack|SpeechRecognition|SourceBufferList|Performance|PeerConnection00|Notification|MessagePort|MediaStreamTrackList|MediaStreamTrack|MediaController|IDBTransaction|IDBDatabase|FileWriter|FileReader|EventSource|DOMApplicationCache|BatteryManager|AudioContext|XMLHttpRequestUpload|XMLHttpRequest|DOMWindow|WebSocket|TextTrackList|TextTrackCue|TextTrack|SpeechRecognition|SourceBufferList|Performance|PeerConnection00|Notification|MessagePort|MediaStreamTrackList|MediaStreamTrack|MediaController|IDBTransaction|IDBDatabase|FileWriter|FileReader|EventSource|DOMApplicationCache|BatteryManager|AudioContext'].join('|')], + ['MouseEvent', v0/*class(_MouseEventImpl)*/], + ['Event', [v0/*class(_MouseEventImpl)*/,v0/*class(_MouseEventImpl)*/,v0/*class(_MouseEventImpl)*/,v0/*class(_MouseEventImpl)*/,'Event|WebGLContextEvent|UIEvent|TouchEvent|TextEvent|SVGZoomEvent|KeyboardEvent|CompositionEvent|TouchEvent|TextEvent|SVGZoomEvent|KeyboardEvent|CompositionEvent|WebKitTransitionEvent|TrackEvent|StorageEvent|SpeechRecognitionEvent|SpeechRecognitionError|SpeechInputEvent|ProgressEvent|XMLHttpRequestProgressEvent|XMLHttpRequestProgressEvent|PopStateEvent|PageTransitionEvent|OverflowEvent|OfflineAudioCompletionEvent|MutationEvent|MessageEvent|MediaStreamTrackEvent|MediaStreamEvent|MediaKeyEvent|IDBVersionChangeEvent|IDBUpgradeNeededEvent|HashChangeEvent|ErrorEvent|DeviceOrientationEvent|DeviceMotionEvent|CustomEvent|CloseEvent|BeforeLoadEvent|AudioProcessingEvent|WebKitAnimationEvent|WebGLContextEvent|UIEvent|TouchEvent|TextEvent|SVGZoomEvent|KeyboardEvent|CompositionEvent|TouchEvent|TextEvent|SVGZoomEvent|KeyboardEvent|CompositionEvent|WebKitTransitionEvent|TrackEvent|StorageEvent|SpeechRecognitionEvent|SpeechRecognitionError|SpeechInputEvent|ProgressEvent|XMLHttpRequestProgressEvent|XMLHttpRequestProgressEvent|PopStateEvent|PageTransitionEvent|OverflowEvent|OfflineAudioCompletionEvent|MutationEvent|MessageEvent|MediaStreamTrackEvent|MediaStreamEvent|MediaKeyEvent|IDBVersionChangeEvent|IDBUpgradeNeededEvent|HashChangeEvent|ErrorEvent|DeviceOrientationEvent|DeviceMotionEvent|CustomEvent|CloseEvent|BeforeLoadEvent|AudioProcessingEvent|WebKitAnimationEvent'].join('|')], + ['WorkerContext', v7/*class(_WorkerContextImpl)*/], + ['SVGElement', v1/*class(_SVGElementImpl)*/], + ['HTMLMediaElement', v2/*class(_MediaElementImpl)*/], + ['Element', v3/*class(_ElementImpl)*/], + ['DocumentFragment', v4/*class(_DocumentFragmentImpl)*/], + ['HTMLDocument', v5/*class(_DocumentImpl)*/], + ['CharacterData', v6/*class(_CharacterDataImpl)*/], + ['Node', v8/*class(_NodeImpl)*/], + ['MediaStream', v9/*class(_MediaStreamImpl)*/], + ['IDBRequest', v10/*class(_IDBRequestImpl)*/], + ['AbstractWorker', v11/*class(_AbstractWorkerImpl)*/], + ['EventTarget', [v7/*class(_WorkerContextImpl)*/,v8/*class(_NodeImpl)*/,v9/*class(_MediaStreamImpl)*/,v10/*class(_IDBRequestImpl)*/,v11/*class(_AbstractWorkerImpl)*/,v7/*class(_WorkerContextImpl)*/,v8/*class(_NodeImpl)*/,v9/*class(_MediaStreamImpl)*/,v10/*class(_IDBRequestImpl)*/,v11/*class(_AbstractWorkerImpl)*/,'EventTarget|DOMWindow|WebSocket|WebKitNamedFlow|TextTrackList|TextTrackCue|TextTrack|SpeechRecognition|SourceBufferList|SVGElementInstance|RTCPeerConnection|Performance|PeerConnection00|Notification|MessagePort|MediaStreamTrackList|MediaStreamTrack|MediaSource|MediaController|IDBTransaction|IDBDatabase|XMLHttpRequestUpload|XMLHttpRequest|FileWriter|FileReader|EventSource|DOMApplicationCache|BatteryManager|AudioContext|DOMWindow|WebSocket|WebKitNamedFlow|TextTrackList|TextTrackCue|TextTrack|SpeechRecognition|SourceBufferList|SVGElementInstance|RTCPeerConnection|Performance|PeerConnection00|Notification|MessagePort|MediaStreamTrackList|MediaStreamTrack|MediaSource|MediaController|IDBTransaction|IDBDatabase|XMLHttpRequestUpload|XMLHttpRequest|FileWriter|FileReader|EventSource|DOMApplicationCache|BatteryManager|AudioContext'].join('|')], ['HTMLCollection', 'HTMLCollection|HTMLOptionsCollection|HTMLOptionsCollection'], ['IDBCursor', 'IDBCursor|IDBCursorWithValue|IDBCursorWithValue'], - ['MouseEvent', v11/*class(_MouseEventImpl)*/], ['NodeList', 'NodeList|RadioNodeList|RadioNodeList'], ['Uint8Array', 'Uint8Array|Uint8ClampedArray|Uint8ClampedArray'], ['AudioParam', 'AudioParam|AudioGain|AudioGain'], ['CSSValueList', 'CSSValueList|WebKitCSSFilterValue|WebKitCSSTransformValue|WebKitCSSFilterValue|WebKitCSSTransformValue'], ['DOMTokenList', 'DOMTokenList|DOMSettableTokenList|DOMSettableTokenList'], ['Entry', 'Entry|FileEntry|DirectoryEntry|FileEntry|DirectoryEntry'], - ['EntrySync', 'EntrySync|FileEntrySync|DirectoryEntrySync|FileEntrySync|DirectoryEntrySync'], - ['Event', [v11/*class(_MouseEventImpl)*/,v11/*class(_MouseEventImpl)*/,v11/*class(_MouseEventImpl)*/,v11/*class(_MouseEventImpl)*/,'Event|WebGLContextEvent|UIEvent|TouchEvent|TextEvent|SVGZoomEvent|KeyboardEvent|CompositionEvent|TouchEvent|TextEvent|SVGZoomEvent|KeyboardEvent|CompositionEvent|WebKitTransitionEvent|TrackEvent|StorageEvent|SpeechRecognitionEvent|SpeechRecognitionError|SpeechInputEvent|ProgressEvent|XMLHttpRequestProgressEvent|XMLHttpRequestProgressEvent|PopStateEvent|PageTransitionEvent|OverflowEvent|OfflineAudioCompletionEvent|MutationEvent|MessageEvent|MediaStreamTrackEvent|MediaStreamEvent|MediaKeyEvent|IDBVersionChangeEvent|HashChangeEvent|ErrorEvent|DeviceOrientationEvent|DeviceMotionEvent|CustomEvent|CloseEvent|BeforeLoadEvent|AudioProcessingEvent|WebKitAnimationEvent|WebGLContextEvent|UIEvent|TouchEvent|TextEvent|SVGZoomEvent|KeyboardEvent|CompositionEvent|TouchEvent|TextEvent|SVGZoomEvent|KeyboardEvent|CompositionEvent|WebKitTransitionEvent|TrackEvent|StorageEvent|SpeechRecognitionEvent|SpeechRecognitionError|SpeechInputEvent|ProgressEvent|XMLHttpRequestProgressEvent|XMLHttpRequestProgressEvent|PopStateEvent|PageTransitionEvent|OverflowEvent|OfflineAudioCompletionEvent|MutationEvent|MessageEvent|MediaStreamTrackEvent|MediaStreamEvent|MediaKeyEvent|IDBVersionChangeEvent|HashChangeEvent|ErrorEvent|DeviceOrientationEvent|DeviceMotionEvent|CustomEvent|CloseEvent|BeforeLoadEvent|AudioProcessingEvent|WebKitAnimationEvent'].join('|')]]; + ['EntrySync', 'EntrySync|FileEntrySync|DirectoryEntrySync|FileEntrySync|DirectoryEntrySync']]; $.dynamicSetMetadata(table); })(); @@ -5825,7 +7078,7 @@ function $setGlobals(context) { $ = context.isolateStatics; $globalThis = $; } -$.main.$call$0 = $.main +$.main.call$0 = $.main if (typeof document != 'undefined' && document.readyState != 'complete') { document.addEventListener('readystatechange', function () { if (document.readyState == 'complete') { diff --git a/src/site/samples/spirodraw/index.html b/src/site/samples/spirodraw/index.html index 451dabafc..f8e6083d4 100644 --- a/src/site/samples/spirodraw/index.html +++ b/src/site/samples/spirodraw/index.html @@ -36,6 +36,7 @@

Code organization

#library('spirodraw'); #import('dart:dom'); +#import('dart:math', prefix:'Math'); #source("ColorPicker.dart"); {% endhighlight %} diff --git a/src/site/samples/sunflower/index.html b/src/site/samples/sunflower/index.html index 5a2d0b73b..221ab25b0 100644 --- a/src/site/samples/sunflower/index.html +++ b/src/site/samples/sunflower/index.html @@ -64,6 +64,7 @@

drfibonacci's Sunflower Spectacular

#library('sunflower'); #import('dart:html'); +#import('dart:math', prefix: 'Math'); final SEED_RADIUS = 2; final SCALE_FACTOR = 4; @@ -104,7 +105,7 @@

drfibonacci's Sunflower Spectacular

Notice the event handler on.change.add, inside the main() function, that runs whenever the value of the slider changes. The block of code inside the curly braces is a closure, a function which can be passed around as a variable. This construct, familiar to JavaScript developers, is less verbose than Java's anonymous inner classes familiar to GWT developers.

-

Note the use of Math.parseInt() to convert a String to a number. In Dart, the methods to convert a String to a number are located in the Math class.

+

Note the use of Math.parseInt() to convert a String to a number. In Dart, the methods to convert a String to a number are located in the Math library.

Finally, let's take a look at the methods that actually draw on the Canvas.

diff --git a/src/site/samples/sunflower/sunflower.dart b/src/site/samples/sunflower/sunflower.dart index 0f7f6573c..973571061 100644 --- a/src/site/samples/sunflower/sunflower.dart +++ b/src/site/samples/sunflower/sunflower.dart @@ -5,6 +5,7 @@ #library('sunflower'); #import('dart:html'); +#import('dart:math', prefix: 'Math'); final SEED_RADIUS = 2; final SCALE_FACTOR = 4; diff --git a/src/site/slides/2012/03/bootstrap/index.html b/src/site/slides/2012/03/bootstrap/index.html index 579f4a96b..864d20991 100644 --- a/src/site/slides/2012/03/bootstrap/index.html +++ b/src/site/slides/2012/03/bootstrap/index.html @@ -1230,6 +1230,7 @@

Initializers list

+#import('dart:math');
 class Point {
   final num x;
   final num y;
@@ -1243,7 +1244,7 @@ 

Initializers list

} static calcDistance(x, y) { - Math.sqrt((x*x) + (y*y)); + sqrt((x*x) + (y*y)); } }
@@ -1804,9 +1805,6 @@

Other APIs of interest

  • Date
  • -
  • - Math -
  • RegExp