Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Unified Diff: comp.js

Issue 11183040: Comparison between original, modified and --disable-eval. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: --disable-eval Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: comp.js
diff --git a/comp.js b/comp.js
new file mode 100644
index 0000000000000000000000000000000000000000..d11cd43416ab89280feb1bb3fcd856ca85aa0727
--- /dev/null
+++ b/comp.js
@@ -0,0 +1,1017 @@
+// Generated by dart2js, the Dart to JavaScript compiler.
+// The code supports the following hooks:
+// dartPrint(message) - if this function is defined it is called
+// instead of the Dart [print] method.
+// dartMainRunner(main) - if this function is defined, the Dart [main]
+// method will not be invoked directly.
+// Instead, a closure that will invoke [main] is
+// passed to [dartMainRunner].
+function Isolate() {}
+init();
+
+var $$ = {};
+var $ = Isolate.$isolateProperties;
+$$.StringBufferImpl = {'': function StringBufferImpl(_buffer, _length) { this._buffer = _buffer; this._length = _length; },
kasperl 2012/10/18 09:20:07 Looks like we could use shorter argument names fai
floitsch 2012/10/18 10:33:09 Done.
+ "super": "Object",
+ get$length: function() {
+ return this._length;
+},
+ isEmpty$0: function() {
+ return this._length === 0;
+},
+ add$1: function(obj) {
+ var str = $.toString(obj);
+ if (str == null || $.isEmpty(str) === true)
+ return this;
+ $.add$1(this._buffer, str);
+ this._length = $.add(this._length, $.get$length(str));
+ return this;
+},
+ clear$0: function() {
+ this._buffer = $.ListImplementation_List(null);
+ this._length = 0;
+ return this;
+},
+ toString$0: function() {
+ if ($.get$length(this._buffer) === 0)
+ return '';
+ if ($.get$length(this._buffer) === 1)
+ return $.index(this._buffer, 0);
+ var result = $.StringImplementation_concatAll(this._buffer);
+ $.clear(this._buffer);
+ $.add$1(this._buffer, result);
+ return result;
+},
+ StringBufferImpl$1: function(content$) {
+ this.clear$0();
+ this.add$1(content$);
+}
+};
+
+$$.ArgumentError = {'': function ArgumentError(message) { this.message = message; },
+ "super": "Object",
+ toString$0: function() {
+ var t1 = this.message;
+ if (!(t1 == null))
+ return 'Illegal argument(s): ' + $.S(t1);
+ return 'Illegal argument(s)';
+}
+};
+
+$$.IndexOutOfRangeException = {'': function IndexOutOfRangeException(_value) { this._value = _value; },
+ "super": "Object",
+ toString$0: function() {
+ return 'IndexOutOfRangeException: ' + $.S(this._value);
+}
+};
+
+$$.NullPointerException = {'': function NullPointerException(functionName, arguments) { this.functionName = functionName; this.arguments = arguments; },
+ "super": "Object",
+ toString$0: function() {
+ var t1 = this.functionName;
+ if (t1 == null)
+ return this.get$exceptionName();
+ else
+ return $.S(this.get$exceptionName()) + ' : method: \'' + $.S(t1) + '\'\n' + 'Receiver: null\n' + 'Arguments: ' + $.S(this.arguments);
+},
+ get$exceptionName: function() {
+ return 'NullPointerException';
+}
+};
+
+$$.NoMoreElementsException = {'': function NoMoreElementsException() { },
+ "super": "Object",
+ toString$0: function() {
+ return 'NoMoreElementsException';
+}
+};
+
+$$.UnsupportedOperationException = {'': function UnsupportedOperationException(_message) { this._message = _message; },
+ "super": "Object",
+ toString$0: function() {
+ return 'UnsupportedOperationException: ' + this._message;
+}
+};
+
+$$.Object = {'': function Object() { },
+ "super": "",
+ operator$eq$1: function(other) {
+ return this === other;
+},
+ toString$0: function() {
+ return $.Primitives_objectToString(this);
+}
+};
+
+$$.ListIterator = {'': function ListIterator(i, list) { this.i = i; this.list = list; },
+ "super": "Object",
+ hasNext$0: function() {
+ return this.i < this.list.length;
+},
+ next$0: function() {
+ if (this.hasNext$0() !== true)
+ throw $.$$throw($.NoMoreElementsException$());
+ var value = this.list[this.i];
+ this.i = this.i + 1;
+ return value;
+}
+};
+
+$$.Closure = {'': function Closure() { },
+ "super": "Object",
+ toString$0: function() {
+ return 'Closure';
+}
+};
+
+$$.MetaInfo = {'': function MetaInfo(_tag, _tags, _set) { this._tag = _tag; this._tags = _tags; this._set = _set; },
+ "super": "Object",
+ get$_tag: function() { return this._tag; },
+ get$_set: function() { return this._set; }
+};
+
+$$.C = {'': function C(titi, toto) { this.titi = titi; this.toto = toto; },
+ "super": "Object",
+ set$titi: function(v) { this.titi = v; },
+ get$toto: function() { return this.toto; },
+ foo$0: function() {
+ return 499;
+}
+};
+
+$$.Maps__emitMap_anon = {'': function Maps__emitMap_anon(result_3, box_0, visiting_2) { this.result_3 = result_3; this.box_0 = box_0; this.visiting_2 = visiting_2; },
+ "super": "Closure",
+ call$2: function(k, v) {
+ var t1 = this.box_0;
+ if (t1.first_1 !== true)
+ $.add$1(this.result_3, ', ');
+ t1.first_1 = false;
+ t1 = this.result_3;
+ var t2 = this.visiting_2;
+ $.Collections__emitObject(k, t1, t2);
+ $.add$1(t1, ': ');
+ $.Collections__emitObject(v, t1, t2);
+}
+};
+
+$.S = function(value) {
+ var res = $.toString(value);
+ if (!(typeof res === 'string'))
+ throw $.$$throw($.ArgumentError$(value));
+ return res;
+};
+
+$.Collections__emitObject = function(o, result, visiting) {
+ 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))
+ $.add$1(result, '{...}');
+ else
+ $.Maps__emitMap(o, result, visiting);
+ else
+ $.add$1(result, o);
+};
+
+$.typeNameInOpera = function(obj) {
+ var name$ = $.constructorNameFallback(obj);
+ if (name$ === 'Window')
+ return 'DOMWindow';
+ return name$;
+};
+
+$._dynamicMetadata = function(table) {
+ $dynamicMetadata = table;
+};
+
+$.Maps__emitMap = function(m, result, visiting) {
+ var t1 = {};
+ $.add$1(visiting, m);
+ $.add$1(result, '{');
+ t1.first_1 = true;
+ m.forEach$1(new $.Maps__emitMap_anon(result, t1, visiting));
+ $.add$1(result, '}');
+ $.removeLast(visiting);
+};
+
+$._dynamicMetadata0 = function() {
+ if ($.identical(typeof($dynamicMetadata), 'undefined')) {
+ var t1 = [];
+ $._dynamicMetadata(t1);
+ }
+ return $dynamicMetadata;
+};
+
+$.floor = function(receiver) {
+ return Math.floor(receiver);
+};
+
+$.truncate = function(receiver) {
+ return receiver < 0 ? $.ceil(receiver) : $.floor(receiver);
+};
+
+$.toStringForNativeObject = function(obj) {
+ return 'Instance of ' + $.getTypeNameOf(obj);
+};
+
+$.charCodeAt = function(receiver, index) {
+ if (typeof receiver === 'string') {
+ if (index < 0)
+ throw $.$$throw($.IndexOutOfRangeException$(index));
+ if (index >= receiver.length)
+ throw $.$$throw($.IndexOutOfRangeException$(index));
+ return receiver.charCodeAt(index);
+ } else
+ return receiver.charCodeAt$1(index);
+};
+
+$.identical = function(a, b) {
+ return a == null ? b == null : a === b;
+};
+
+$.checkNull = function(object) {
+ if (object == null)
+ throw $.$$throw($.NullPointerException$(null, $.CTC0));
+ return object;
+};
+
+$.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 $.identical(a.operator$eq$1(b), true);
+ return a === b;
+};
+
+$.substring$2 = function(receiver, startIndex, endIndex) {
+ $.checkNum(startIndex);
+ var length$ = receiver.length;
+ if (endIndex == null)
+ endIndex = length$;
+ $.checkNum(endIndex);
+ if (startIndex < 0)
+ throw $.$$throw($.IndexOutOfRangeException$(startIndex));
+ if ($.gtB(startIndex, endIndex))
+ throw $.$$throw($.IndexOutOfRangeException$(startIndex));
+ if ($.gtB(endIndex, length$))
+ throw $.$$throw($.IndexOutOfRangeException$(endIndex));
+ return $.substringUnchecked(receiver, startIndex, endIndex);
+};
+
+$.Collections__containsRef = function(c, ref) {
+ for (var t1 = $.iterator(c); t1.hasNext$0() === true;) {
+ var t2 = t1.next$0();
+ if (t2 == null ? ref == null : t2 === ref)
+ return true;
+ }
+ return false;
+};
+
+$.dynamicBind = function(obj, name$, methods, arguments$) {
+ var tag = $.getTypeNameOf(obj);
+ var method = methods[tag];
+ if (method == null && !($._dynamicMetadata0() == null))
+ for (var i = 0; i < $._dynamicMetadata0().length; ++i) {
+ var entry = $._dynamicMetadata0()[i];
+ if (entry.get$_set()[tag]) {
+ 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) {throw new TypeError(name$ + " is not a function");} else {return Object.prototype[name$].apply(this, arguments);}};
+ if (!proto.hasOwnProperty(name$))
+ $.defineProperty(proto, name$, method);
+ return method.apply(obj, arguments$);
+};
+
+$.ArgumentError$ = function(message) {
+ return new $.ArgumentError(message);
+};
+
+$.C$ = function(titi, toto) {
+ return new $.C(titi, toto);
+};
+
+$.checkGrowable = function(list, reason) {
+ if (!!(list.fixed$length))
+ throw $.$$throw($.UnsupportedOperationException$(reason));
+};
+
+$.getFunctionForTypeNameOf = function() {
+ if (!$.identical(typeof(navigator), 'object'))
+ return $.typeNameInChrome;
+ var userAgent = navigator.userAgent;
+ if ($.contains(userAgent, 'Chrome') || $.contains(userAgent, 'DumpRenderTree'))
+ return $.typeNameInChrome;
+ else if ($.contains(userAgent, 'Firefox'))
+ return $.typeNameInFirefox;
+ else if ($.contains(userAgent, 'MSIE'))
+ return $.typeNameInIE;
+ else if ($.contains(userAgent, 'Opera'))
+ return $.typeNameInOpera;
+ else if ($.contains(userAgent, 'AppleWebKit'))
+ return $.typeNameInSafari;
+ else
+ return $.constructorNameFallback;
+};
+
+$.index = function(a, index) {
+ if (typeof a == "string" || a.constructor === Array) {
+ var key = index >>> 0;
+ if ($.identical(key, index) && key < a.length)
+ return a[key];
+ }
+ return $.index$slow(a, index);
+};
+
+$.stringJoinUnchecked = function(array, separator) {
+ return array.join(separator);
+};
+
+$.isJsArray = function(value) {
+ return !(value == null) && value.constructor === Array;
+};
+
+$.Collections_collectionToString = function(c) {
+ var result = $.StringBuffer_StringBuffer('');
+ $.Collections__emitCollection(c, result, $.ListImplementation_List(null));
+ return $.toString(result);
+};
+
+$.MetaInfo$ = function(_tag, _tags, _set) {
+ return new $.MetaInfo(_tag, _tags, _set);
+};
+
+$.makeA = function() {
+ return makeA();
+};
+
+$.id = function(x) {
+ if (x == null)
+ return x;
+ return x;
+};
+
+$.dynamicSetMetadata = function(inputTable) {
+ var t1 = $.buildDynamicMetadata(inputTable);
+ $._dynamicMetadata(t1);
+};
+
+$.buildDynamicMetadata = function(inputTable) {
+ var result = [];
+ for (var i = 0; i < inputTable.length; ++i) {
+ var tag = inputTable[i][0];
+ var array = inputTable[i];
+ var tags = array[1];
+ var set = {};
+ var tagNames = tags.split('|');
+ for (var j = 0, index = 1; j < tagNames.length; ++j) {
+ $.propertySet(set, tagNames[j], true);
+ index = j;
+ array = tagNames;
+ }
+ result.push($.MetaInfo$(tag, tags, set));
+ }
+ return result;
+};
+
+$.add$1 = function(receiver, value) {
+ if ($.isJsArray(receiver)) {
+ $.checkGrowable(receiver, 'add');
+ receiver.push(value);
+ return;
+ }
+ return receiver.add$1(value);
+};
+
+$.defineProperty = function(obj, property, value) {
+ Object.defineProperty(obj, property,
+ {value: value, enumerable: false, writable: true, configurable: true});
+};
+
+$.propertySet = function(object, property, value) {
+ object[property] = value;
+};
+
+$.substringUnchecked = function(receiver, startIndex, endIndex) {
+ return receiver.substring(startIndex, endIndex);
+};
+
+$.ListImplementation_List = function(length$) {
+ return $.Primitives_newList(length$);
+};
+
+$.dynamicFunction = function(name$) {
+ var f = Object.prototype[name$];
+ if (!(f == null) && !!f.methods)
+ return f.methods;
+ var methods = {};
+ var dartMethod = Object.getPrototypeOf($.CTC1)[name$];
+ if (!(dartMethod == null))
+ $.propertySet(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);
+ return methods;
+};
+
+$.add = function(a, b) {
+ return typeof a === 'number' && typeof b === 'number' ? a + b : $.add$slow(a, b);
+};
+
+$.checkNumbers = function(a, b) {
+ if (typeof a === 'number')
+ if (typeof b === 'number')
+ return true;
+ else {
+ $.checkNull(b);
+ throw $.$$throw($.ArgumentError$(b));
+ }
+ return false;
+};
+
+$.UnsupportedOperationException$ = function(_message) {
+ return new $.UnsupportedOperationException(_message);
+};
+
+$.contains = function(userAgent, name$) {
+ return userAgent.indexOf(name$) !== -1;
+};
+
+$.get$length = function(receiver) {
+ if (typeof receiver === 'string' || $.isJsArray(receiver))
+ return receiver.length;
+ else
+ return receiver.get$length();
+};
+
+$.hashCodeForNativeObject = function(object) {
+ return $.Primitives_objectHashCode(object);
+};
+
+$.ge$slow = function(a, b) {
+ if ($.checkNumbers(a, b))
+ return a >= b;
+ return a.operator$ge$1(b);
+};
+
+$.geB = function(a, b) {
+ return typeof a === 'number' && typeof b === 'number' ? a >= b : $.identical($.ge$slow(a, b), true);
+};
+
+$.ListIterator$ = function(list) {
+ return new $.ListIterator(0, list);
+};
+
+$.lt$slow = function(a, b) {
+ if ($.checkNumbers(a, b))
+ return a < b;
+ return a.operator$lt$1(b);
+};
+
+$.checkNum = function(value) {
+ if (!(typeof value === 'number')) {
+ $.checkNull(value);
+ throw $.$$throw($.ArgumentError$(value));
+ }
+ return value;
+};
+
+$.StringBufferImpl$ = function(content$) {
+ var t1 = new $.StringBufferImpl(null, null);
+ t1.StringBufferImpl$1(content$);
+ return t1;
+};
+
+$.Primitives_objectToString = function(object) {
+ return 'Instance of \'' + $.S($.Primitives_objectTypeName(object)) + '\'';
+};
+
+$.index$slow = function(a, index) {
+ if (typeof a === 'string' || $.isJsArray(a)) {
+ if (!(typeof index === 'number' && Math.floor(index) === index)) {
+ if (!(typeof index === 'number'))
+ throw $.$$throw($.ArgumentError$(index));
+ if (!$.identical($.truncate(index), index))
+ throw $.$$throw($.ArgumentError$(index));
+ }
+ if ($.ltB(index, 0) || $.geB(index, $.get$length(a)))
+ throw $.$$throw($.IndexOutOfRangeException$(index));
+ return a[index];
+ }
+ return a.operator$index$1(index);
+};
+
+$.substring$1 = function(receiver, startIndex) {
+ if (!(typeof receiver === 'string'))
+ return receiver.substring$1(startIndex);
+ return $.substring$2(receiver, startIndex, null);
+};
+
+$.typeNameInSafari = function(obj) {
+ var name$ = $.constructorNameFallback(obj);
+ if (name$ === 'Window')
+ return 'DOMWindow';
+ if (name$ === 'CanvasPixelArray')
+ return 'Uint8ClampedArray';
+ if (name$ === 'WebKitMutationObserver')
+ return 'MutationObserver';
+ return name$;
+};
+
+$.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;) {
+ var t2 = t1.next$0();
+ if (!first)
+ $.add$1(result, ', ');
+ $.Collections__emitObject(t2, result, visiting);
+ first = false;
+ }
+ $.add$1(result, isList ? ']' : '}');
+ $.removeLast(visiting);
+};
+
+$.clear = function(receiver) {
+ if (!$.isJsArray(receiver))
+ return receiver.clear$0();
+ $.set$length(receiver, 0);
+};
+
+$.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;
+ }
+ return $.identical($.charCodeAt(name$, 0), 36) ? $.substring$1(name$, 1) : name$;
+};
+
+$.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);
+};
+
+$.typeNameInIE = function(obj) {
+ var name$ = $.constructorNameFallback(obj);
+ if (name$ === 'Window')
+ return 'DOMWindow';
+ if (name$ === 'Document') {
+ if (!!obj.xmlVersion)
+ return 'Document';
+ return 'HTMLDocument';
+ }
+ if (name$ === 'ApplicationCache')
+ return 'DOMApplicationCache';
+ if (name$ === 'CanvasPixelArray')
+ return 'Uint8ClampedArray';
+ if (name$ === 'DataTransfer')
+ return 'Clipboard';
+ if (name$ === 'DragEvent')
+ return 'MouseEvent';
+ if (name$ === 'HTMLDDElement')
+ return 'HTMLElement';
+ if (name$ === 'HTMLDTElement')
+ return 'HTMLElement';
+ if (name$ === 'HTMLTableDataCellElement')
+ return 'HTMLTableCellElement';
+ if (name$ === 'HTMLTableHeaderCellElement')
+ return 'HTMLTableCellElement';
+ if (name$ === 'HTMLPhraseElement')
+ return 'HTMLElement';
+ if (name$ === 'MSStyleCSSProperties')
+ return 'CSSStyleDeclaration';
+ if (name$ === 'MouseWheelEvent')
+ return 'WheelEvent';
+ return name$;
+};
+
+$.set$length = function(receiver, newLength) {
+ if ($.isJsArray(receiver)) {
+ $.checkNull(newLength);
+ if (newLength < 0)
+ throw $.$$throw($.IndexOutOfRangeException$(newLength));
+ $.checkGrowable(receiver, 'set length');
+ receiver.length = newLength;
+ } else
+ receiver.set$length(newLength);
+ return newLength;
+};
+
+$.ioore = function(index) {
+ throw $.$$throw($.IndexOutOfRangeException$(index));
+};
+
+$.typeNameInFirefox = function(obj) {
+ var name$ = $.constructorNameFallback(obj);
+ if (name$ === 'Window')
+ return 'DOMWindow';
+ if (name$ === 'Document')
+ return 'HTMLDocument';
+ if (name$ === 'XMLDocument')
+ return 'Document';
+ if (name$ === 'WorkerMessageEvent')
+ return 'MessageEvent';
+ if (name$ === 'DragEvent')
+ return 'MouseEvent';
+ if (name$ === 'DataTransfer')
+ return 'Clipboard';
+ if (name$ === 'MouseScrollEvent')
+ return 'WheelEvent';
+ if (name$ === 'OfflineResourceList')
+ return 'DOMApplicationCache';
+ return name$;
+};
+
+$.constructorNameFallback = function(object) {
+ if (object == null)
+ return 'Null';
+ var constructor$ = object.constructor;
+ if ($.identical(typeof(constructor$), 'function')) {
+ var name$ = constructor$.name;
+ if (typeof name$ === 'string')
+ var t1 = !$.identical(name$, '') && !$.identical(name$, 'Object') && !$.identical(name$, 'Function.prototype');
+ else
+ t1 = false;
+ if (t1)
+ return name$;
+ }
+ var string = Object.prototype.toString.call(object);
+ return string.substring(8, string.length - 1);
+};
+
+$.gt$slow = function(a, b) {
+ if ($.checkNumbers(a, b))
+ return a > b;
+ return a.operator$gt$1(b);
+};
+
+$.toStringWrapper = function() {
+ return $.toString(this.dartException);
+};
+
+$.gtB = function(a, b) {
+ return typeof a === 'number' && typeof b === 'number' ? a > b : $.identical($.gt$slow(a, b), true);
+};
+
+$.NullPointerException$ = function(functionName, arguments$) {
+ return new $.NullPointerException(functionName, arguments$);
+};
+
+$.removeLast = function(receiver) {
+ if ($.isJsArray(receiver)) {
+ $.checkGrowable(receiver, 'removeLast');
+ if ($.eqB($.get$length(receiver), 0))
+ throw $.$$throw($.IndexOutOfRangeException$(-1));
+ return receiver.pop();
+ }
+ return receiver.removeLast$0();
+};
+
+$.NoMoreElementsException$ = function() {
+ return new $.NoMoreElementsException();
+};
+
+$.ltB = function(a, b) {
+ return typeof a === 'number' && typeof b === 'number' ? a < b : $.identical($.lt$slow(a, b), true);
+};
+
+$.Primitives_objectHashCode = function(object) {
+ var hash = object.$identityHash;
+ if (hash == null) {
+ hash = $.add($.Primitives_hashCodeSeed, 1);
+ $.Primitives_hashCodeSeed = hash;
+ object.$identityHash = hash;
+ }
+ return hash;
+};
+
+$.add$slow = function(a, b) {
+ if ($.checkNumbers(a, b))
+ return a + b;
+ return a.operator$add$1(b);
+};
+
+$.Primitives_newList = function(length$) {
+ if (length$ == null)
+ return new Array();
+ if (!(typeof length$ === 'number' && Math.floor(length$) === length$) || length$ < 0)
+ throw $.$$throw($.ArgumentError$(length$));
+ var result = new Array(length$);
+ result.fixed$length = true;
+ return result;
+};
+
+$.main = function() {
+ var a = $.makeA();
+ var c = $.C$($.id(1), $.id(2));
+ $.id($.id(a).get$toto());
+ $.id(a).set$titi(499);
+ $.id(c).foo$0();
+};
+
+$.StringBuffer_StringBuffer = function(content$) {
+ return $.StringBufferImpl$(content$);
+};
+
+$.$$throw = function(ex) {
+ if (ex == null)
+ ex = $.CTC;
+ var jsError = new Error();
+ jsError.name = ex;
+ jsError.description = ex;
+ jsError.dartException = ex;
+ jsError.toString = $.toStringWrapper.call$0;
+ throw jsError;
+};
+
+$.typeNameInChrome = function(obj) {
+ var name$ = obj.constructor.name;
+ if (name$ === 'Window')
+ return 'DOMWindow';
+ if (name$ === 'CanvasPixelArray')
+ return 'Uint8ClampedArray';
+ if (name$ === 'WebKitMutationObserver')
+ return 'MutationObserver';
+ return name$;
+};
+
+$.isEmpty = function(receiver) {
+ if (typeof receiver === 'string' || $.isJsArray(receiver))
+ return receiver.length === 0;
+ return receiver.isEmpty$0();
+};
+
+$.StringImplementation_concatAll = function(strings) {
+ return $.stringJoinUnchecked($.StringImplementation__toJsStringArray(strings), '');
+};
+
+$.ceil = function(receiver) {
+ return Math.ceil(receiver);
+};
+
+$.getTypeNameOf = function(obj) {
+ if ($._getTypeNameOf == null)
+ $._getTypeNameOf = $.getFunctionForTypeNameOf();
+ return $._getTypeNameOf.call$1(obj);
+};
+
+$.iterator = function(receiver) {
+ if ($.isJsArray(receiver))
+ return $.ListIterator$(receiver);
+ return receiver.iterator$0();
+};
+
+$.StringImplementation__toJsStringArray = function(strings) {
+ if (typeof strings !== 'object' || strings === null || (strings.constructor !== Array || !!strings.immutable$list) && !strings.is$JavaScriptIndexingBehavior)
+ return $.StringImplementation__toJsStringArray$bailout(1, strings);
+ $.checkNull(strings);
+ var length$ = strings.length;
+ if ($.isJsArray(strings)) {
+ for (var i = 0; i < length$; ++i) {
+ if (i >= strings.length)
+ throw $.ioore(i);
+ var string = strings[i];
+ $.checkNull(string);
+ if (!(typeof string === 'string'))
+ throw $.$$throw($.ArgumentError$(string));
+ }
+ var array = strings;
+ } else {
+ array = $.ListImplementation_List(length$);
+ for (i = 0; i < length$; ++i) {
+ if (i >= strings.length)
+ throw $.ioore(i);
+ string = strings[i];
+ $.checkNull(string);
+ if (!(typeof string === 'string'))
+ throw $.$$throw($.ArgumentError$(string));
+ array[i] = string;
+ }
+ }
+ return array;
+};
+
+$.IndexOutOfRangeException$ = function(_value) {
+ return new $.IndexOutOfRangeException(_value);
+};
+
+$.StringImplementation__toJsStringArray$bailout = function(state0, strings) {
+ $.checkNull(strings);
+ var length$ = $.get$length(strings);
+ if ($.isJsArray(strings)) {
+ for (var i = 0; $.ltB(i, length$); ++i) {
+ var string = $.index(strings, i);
+ $.checkNull(string);
+ if (!(typeof string === 'string'))
+ throw $.$$throw($.ArgumentError$(string));
+ }
+ var array = strings;
+ } else {
+ array = $.ListImplementation_List(length$);
+ for (i = 0; $.ltB(i, length$); ++i) {
+ string = $.index(strings, i);
+ $.checkNull(string);
+ if (!(typeof string === 'string'))
+ throw $.$$throw($.ArgumentError$(string));
+ if (i >= array.length)
+ throw $.ioore(i);
+ array[i] = string;
+ }
+ }
+ return array;
+};
+
+$.dynamicBind.call$4 = $.dynamicBind;
+$.dynamicBind.$name = "dynamicBind";
+$.typeNameInOpera.call$1 = $.typeNameInOpera;
+$.typeNameInOpera.$name = "typeNameInOpera";
+$.typeNameInIE.call$1 = $.typeNameInIE;
+$.typeNameInIE.$name = "typeNameInIE";
+$.typeNameInChrome.call$1 = $.typeNameInChrome;
+$.typeNameInChrome.$name = "typeNameInChrome";
+$.toStringWrapper.call$0 = $.toStringWrapper;
+$.toStringWrapper.$name = "toStringWrapper";
+$.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) {
+ list.immutable$list = true;
+ list.fixed$length = true;
+ return list;
+};
+$.CTC0 = Isolate.makeConstantList([]);
+$.CTC2 = null;
+$.CTC = new Isolate.$isolateProperties.NullPointerException(null, Isolate.$isolateProperties.CTC0);
+$.CTC1 = new Isolate.$isolateProperties.Object();
+$.Primitives_DOLLAR_CHAR_VALUE = 36;
+$._getTypeNameOf = null;
+$.Primitives_hashCodeSeed = 0;
+var $ = null;
+Isolate.$finishClasses($$);
+$$ = {};
+Isolate = Isolate.$finishIsolateConstructor(Isolate);
+var $ = new Isolate();
+$.$defineNativeClass = function(cls, desc) {
+ var fields = desc[''] || [];
+ var generateGetterSetter = function() {
+ throw 'Internal Error: no dynamic generation of getters and setters allowed';
+};
+ for (var i = 0; i < fields.length; i++) {
+ generateGetterSetter(fields[i], desc);
+ }
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
+ for (var method in desc) {
+ if (method !== '') {
+ if (hasOwnProperty.call(desc, method)) {
+ $.dynamicFunction(method)[cls] = desc[method];
+ }
+ }
+ }
+};
+
+(function(table) {
+ for (var key in table) {
+ $.defineProperty(Object.prototype, key, table[key]);
+ }
+})({
+ toString$0: function() { return $.toStringForNativeObject(this); },
+ hashCode$0: function() { return $.hashCodeForNativeObject(this); }
+});
+
+$.$defineNativeClass('B', {
+ set$titi: function(v) { this.titi = v; },
+ get$toto: function() { return this.toto; },
+ foo$0: function() {
+ return 499;
+}
+});
+
+// 1 dynamic classes.
+// 1 classes
+// 0 !leaf
+
+
+//
+// BEGIN invoke [main].
+//
+if (typeof document != 'undefined' && document.readyState != 'complete') {
+ document.addEventListener('readystatechange', function () {
+ if (document.readyState == 'complete') {
+ if (typeof dartMainRunner == 'function') {
+ dartMainRunner(function() { $.main(); });
+ } else {
+ $.main();
+ }
+ }
+ }, false);
+} else {
+ if (typeof dartMainRunner == 'function') {
+ dartMainRunner(function() { $.main(); });
+ } else {
+ $.main();
+ }
+}
+//
+// END invoke [main].
+//
+
+function init() {
+Isolate.$isolateProperties = {};
+Isolate.$defineClass = function(cls, constructor, prototype) {
+ constructor.prototype = prototype;
+ return constructor;
+};
+var supportsProto = !!{}.__proto__;Isolate.$pendingClasses = {};
kasperl 2012/10/18 09:20:07 Would be nice with a newline after ;.
floitsch 2012/10/18 10:33:09 Done.
+Isolate.$finishClasses = function(collectedClasses) {
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
+ for (var cls in collectedClasses) {
+ if (hasOwnProperty.call(collectedClasses, cls)) {
+ var desc = collectedClasses[cls];
+ Isolate.$isolateProperties[cls] = Isolate.$defineClass(cls, desc[''], desc);
+ if (desc['super'] !== "") Isolate.$pendingClasses[cls] = desc['super'];
+ }
+ }
+ var pendingClasses = Isolate.$pendingClasses;
+ Isolate.$pendingClasses = {};
+ var finishedClasses = {};
+ function finishClass(cls) {
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
+ if (hasOwnProperty.call(finishedClasses, cls)) return;
+ finishedClasses[cls] = true;
+ var superclass = pendingClasses[cls];
+ if (!superclass) return;
+ finishClass(superclass);
+ var constructor = Isolate.$isolateProperties[cls];
+ var superConstructor = Isolate.$isolateProperties[superclass];
+ var prototype = constructor.prototype;
+ if (supportsProto) {
+ prototype.__proto__ = superConstructor.prototype;
+ prototype.constructor = constructor;
+ } else {
+ function tmp() {};
+ tmp.prototype = superConstructor.prototype;
+ var newPrototype = new tmp();
+ constructor.prototype = newPrototype;
+ newPrototype.constructor = constructor;
+ for (var member in prototype) {
+ if (member == '' || member == 'super') continue;
+ if (hasOwnProperty.call(prototype, member)) {
+ newPrototype[member] = prototype[member];
+ }
+ }
+ }
+ }
+ for (var cls in pendingClasses) finishClass(cls);
+};
+Isolate.$finishIsolateConstructor = function(oldIsolate) {
+ var isolateProperties = oldIsolate.$isolateProperties;
+ function Isolate() {
+ for (var staticName in isolateProperties) {
+ if (Object.prototype.hasOwnProperty.call(isolateProperties, staticName)) {
+ this[staticName] = isolateProperties[staticName];
+ }
+ }
+ // Use the newly created object as prototype. In Chrome this creates a
+ // hidden class for the object and makes sure it is fast to access.
+ function forceEfficientMap() {}
kasperl 2012/10/18 09:20:07 I think I'd prefer to call this ForceEfficientMap
floitsch 2012/10/18 10:33:09 Done.
+ forceEfficientMap.prototype = this;
+ new forceEfficientMap;
kasperl 2012/10/18 09:20:07 Not necessary.
floitsch 2012/10/18 10:33:09 Benchmark says it is.
+ }
+ Isolate.prototype = oldIsolate.prototype;
+ Isolate.prototype.constructor = Isolate;
+ Isolate.$isolateProperties = isolateProperties;
+ return Isolate;
+};
+}
+
+//@ sourceMappingURL=comp.js.map
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698