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

Side by Side Diff: frog/frogsh

Issue 8469016: Adding in-browser correctness testing via selenium. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | frog/gen.dart » ('j') | frog/gen.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env node 1 #!/usr/bin/env node
2 // ********** Library dart:core ************** 2 // ********** Library dart:core **************
3 // ********** Natives dart:core ************** 3 // ********** Natives dart:core **************
4 /** 4 /**
5 * Generates a dynamic call stub for a function. 5 * Generates a dynamic call stub for a function.
6 * Our goal is to create a stub method like this on-the-fly: 6 * Our goal is to create a stub method like this on-the-fly:
7 * function($0, $1, capture) { this($0, $1, true, capture); } 7 * function($0, $1, capture) { this($0, $1, true, capture); }
8 * 8 *
9 * This stub then replaces the dynamic one on Function, with one that is 9 * This stub then replaces the dynamic one on Function, with one that is
10 * specialized for that particular function, taking into account its default 10 * specialized for that particular function, taking into account its default
(...skipping 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after
1052 ImmutableMap.prototype.$index = function(key) { 1052 ImmutableMap.prototype.$index = function(key) {
1053 return this._internal.$index(key); 1053 return this._internal.$index(key);
1054 } 1054 }
1055 ImmutableMap.prototype.isEmpty = function() { 1055 ImmutableMap.prototype.isEmpty = function() {
1056 return this._internal.isEmpty(); 1056 return this._internal.isEmpty();
1057 } 1057 }
1058 ImmutableMap.prototype.get$length = function() { 1058 ImmutableMap.prototype.get$length = function() {
1059 return this._internal.get$length(); 1059 return this._internal.get$length();
1060 } 1060 }
1061 Object.defineProperty(ImmutableMap.prototype, "length", { 1061 Object.defineProperty(ImmutableMap.prototype, "length", {
1062 get: ImmutableMap.prototype.get$length, 1062 get: ImmutableMap.prototype.get$length
1063 }); 1063 });
1064 ImmutableMap.prototype.forEach = function(f) { 1064 ImmutableMap.prototype.forEach = function(f) {
1065 this._internal.forEach(f); 1065 this._internal.forEach(f);
1066 } 1066 }
1067 ImmutableMap.prototype.getKeys = function() { 1067 ImmutableMap.prototype.getKeys = function() {
1068 return this._internal.getKeys(); 1068 return this._internal.getKeys();
1069 } 1069 }
1070 ImmutableMap.prototype.getValues = function() { 1070 ImmutableMap.prototype.getValues = function() {
1071 return this._internal.getValues(); 1071 return this._internal.getValues();
1072 } 1072 }
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
1281 } 1281 }
1282 return null; 1282 return null;
1283 } 1283 }
1284 HashMapImplementation.prototype.isEmpty = function() { 1284 HashMapImplementation.prototype.isEmpty = function() {
1285 return this._numberOfEntries == 0; 1285 return this._numberOfEntries == 0;
1286 } 1286 }
1287 HashMapImplementation.prototype.get$length = function() { 1287 HashMapImplementation.prototype.get$length = function() {
1288 return this._numberOfEntries; 1288 return this._numberOfEntries;
1289 } 1289 }
1290 Object.defineProperty(HashMapImplementation.prototype, "length", { 1290 Object.defineProperty(HashMapImplementation.prototype, "length", {
1291 get: HashMapImplementation.prototype.get$length, 1291 get: HashMapImplementation.prototype.get$length
1292 }); 1292 });
1293 HashMapImplementation.prototype.forEach = function(f) { 1293 HashMapImplementation.prototype.forEach = function(f) {
1294 var length = this._keys.length; 1294 var length = this._keys.length;
1295 for (var i = 0; 1295 for (var i = 0;
1296 $notnull_bool(i < length); i++) { 1296 $notnull_bool(i < length); i++) {
1297 if ($notnull_bool((this._keys.$index(i) != null) && (this._keys.$index(i) != = HashMapImplementation._deletedKey))) { 1297 if ($notnull_bool((this._keys.$index(i) != null) && (this._keys.$index(i) != = HashMapImplementation._deletedKey))) {
1298 f(this._keys.$index(i), this._values.$index(i)); 1298 f(this._keys.$index(i), this._values.$index(i));
1299 } 1299 }
1300 } 1300 }
1301 } 1301 }
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
1655 var keys = this._backingMap.getKeys(); 1655 var keys = this._backingMap.getKeys();
1656 return keys.some(f); 1656 return keys.some(f);
1657 } 1657 }
1658 HashSetImplementation.prototype.isEmpty = function() { 1658 HashSetImplementation.prototype.isEmpty = function() {
1659 return this._backingMap.isEmpty(); 1659 return this._backingMap.isEmpty();
1660 } 1660 }
1661 HashSetImplementation.prototype.get$length = function() { 1661 HashSetImplementation.prototype.get$length = function() {
1662 return this._backingMap.get$length(); 1662 return this._backingMap.get$length();
1663 } 1663 }
1664 Object.defineProperty(HashSetImplementation.prototype, "length", { 1664 Object.defineProperty(HashSetImplementation.prototype, "length", {
1665 get: HashSetImplementation.prototype.get$length, 1665 get: HashSetImplementation.prototype.get$length
1666 }); 1666 });
1667 HashSetImplementation.prototype.iterator = function() { 1667 HashSetImplementation.prototype.iterator = function() {
1668 return new HashSetIterator$E(this); 1668 return new HashSetIterator$E(this);
1669 } 1669 }
1670 // ********** Code for HashSetImplementation$E ************** 1670 // ********** Code for HashSetImplementation$E **************
1671 function HashSetImplementation$E() { 1671 function HashSetImplementation$E() {
1672 // Initializers done 1672 // Initializers done
1673 this._backingMap = new HashMapImplementation$E$E(); 1673 this._backingMap = new HashMapImplementation$E$E();
1674 } 1674 }
1675 $inherits(HashSetImplementation$E, HashSetImplementation); 1675 $inherits(HashSetImplementation$E, HashSetImplementation);
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
1813 } 1813 }
1814 ); 1814 );
1815 } 1815 }
1816 LinkedHashMapImplementation.prototype.containsKey = function(key) { 1816 LinkedHashMapImplementation.prototype.containsKey = function(key) {
1817 return this._map.containsKey(key); 1817 return this._map.containsKey(key);
1818 } 1818 }
1819 LinkedHashMapImplementation.prototype.get$length = function() { 1819 LinkedHashMapImplementation.prototype.get$length = function() {
1820 return this._map.get$length(); 1820 return this._map.get$length();
1821 } 1821 }
1822 Object.defineProperty(LinkedHashMapImplementation.prototype, "length", { 1822 Object.defineProperty(LinkedHashMapImplementation.prototype, "length", {
1823 get: LinkedHashMapImplementation.prototype.get$length, 1823 get: LinkedHashMapImplementation.prototype.get$length
1824 }); 1824 });
1825 LinkedHashMapImplementation.prototype.isEmpty = function() { 1825 LinkedHashMapImplementation.prototype.isEmpty = function() {
1826 return this.get$length() == 0; 1826 return this.get$length() == 0;
1827 } 1827 }
1828 // ********** Code for LinkedHashMapImplementation$Node$Element ************** 1828 // ********** Code for LinkedHashMapImplementation$Node$Element **************
1829 function LinkedHashMapImplementation$Node$Element() { 1829 function LinkedHashMapImplementation$Node$Element() {
1830 // Initializers done 1830 // Initializers done
1831 this._map = new HashMapImplementation$Node$DoubleLinkedQueueEntry$KeyValuePair $Node$Element(); 1831 this._map = new HashMapImplementation$Node$DoubleLinkedQueueEntry$KeyValuePair $Node$Element();
1832 this._list = new DoubleLinkedQueue$KeyValuePair$Node$Element(); 1832 this._list = new DoubleLinkedQueue$KeyValuePair$Node$Element();
1833 } 1833 }
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
2036 } 2036 }
2037 DoubleLinkedQueue.prototype.get$length = function() { 2037 DoubleLinkedQueue.prototype.get$length = function() {
2038 var counter = 0; 2038 var counter = 0;
2039 this.forEach(function _(element) { 2039 this.forEach(function _(element) {
2040 counter++; 2040 counter++;
2041 } 2041 }
2042 ); 2042 );
2043 return counter; 2043 return counter;
2044 } 2044 }
2045 Object.defineProperty(DoubleLinkedQueue.prototype, "length", { 2045 Object.defineProperty(DoubleLinkedQueue.prototype, "length", {
2046 get: DoubleLinkedQueue.prototype.get$length, 2046 get: DoubleLinkedQueue.prototype.get$length
2047 }); 2047 });
2048 DoubleLinkedQueue.prototype.isEmpty = function() { 2048 DoubleLinkedQueue.prototype.isEmpty = function() {
2049 return (this._sentinel._next === this._sentinel); 2049 return (this._sentinel._next === this._sentinel);
2050 } 2050 }
2051 DoubleLinkedQueue.prototype.forEach = function(f) { 2051 DoubleLinkedQueue.prototype.forEach = function(f) {
2052 var entry = this._sentinel._next; 2052 var entry = this._sentinel._next;
2053 while ($notnull_bool(entry !== this._sentinel)) { 2053 while ($notnull_bool(entry !== this._sentinel)) {
2054 f(entry._element); 2054 f(entry._element);
2055 entry = entry._next; 2055 entry = entry._next;
2056 } 2056 }
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
2190 // ********** Code for StringBufferImpl ************** 2190 // ********** Code for StringBufferImpl **************
2191 function StringBufferImpl(content) { 2191 function StringBufferImpl(content) {
2192 // Initializers done 2192 // Initializers done
2193 this.clear(); 2193 this.clear();
2194 this.add(content); 2194 this.add(content);
2195 } 2195 }
2196 StringBufferImpl.prototype.get$length = function() { 2196 StringBufferImpl.prototype.get$length = function() {
2197 return this._length; 2197 return this._length;
2198 } 2198 }
2199 Object.defineProperty(StringBufferImpl.prototype, "length", { 2199 Object.defineProperty(StringBufferImpl.prototype, "length", {
2200 get: StringBufferImpl.prototype.get$length, 2200 get: StringBufferImpl.prototype.get$length
2201 }); 2201 });
2202 StringBufferImpl.prototype.isEmpty = function() { 2202 StringBufferImpl.prototype.isEmpty = function() {
2203 return this._length == 0; 2203 return this._length == 0;
2204 } 2204 }
2205 StringBufferImpl.prototype.add = function(obj) { 2205 StringBufferImpl.prototype.add = function(obj) {
2206 var str = obj.toString(); 2206 var str = obj.toString();
2207 if ($notnull_bool(str == null || str.isEmpty())) return this; 2207 if ($notnull_bool(str == null || str.isEmpty())) return this;
2208 this._buffer.add(str); 2208 this._buffer.add(str);
2209 this._length += str.length; 2209 this._length += str.length;
2210 return this; 2210 return this;
(...skipping 8422 matching lines...) Expand 10 before | Expand all | Expand 10 after
10633 this.writer.writeln(('' + field.declaringType.get$jsname() + '.prototype.s et\$' + field.get$jsname() + ' = ') + ('function(value) { return this.' + field. get$jsname() + ' = value; };')); 10633 this.writer.writeln(('' + field.declaringType.get$jsname() + '.prototype.s et\$' + field.get$jsname() + ' = ') + ('function(value) { return this.' + field. get$jsname() + ' = value; };'));
10634 } 10634 }
10635 } 10635 }
10636 } 10636 }
10637 WorldGenerator.prototype._writeProperty = function(property) { 10637 WorldGenerator.prototype._writeProperty = function(property) {
10638 if ($notnull_bool(property.getter != null)) this._writeMethod(property.getter) ; 10638 if ($notnull_bool(property.getter != null)) this._writeMethod(property.getter) ;
10639 if ($notnull_bool(property.setter != null)) this._writeMethod(property.setter) ; 10639 if ($notnull_bool(property.setter != null)) this._writeMethod(property.setter) ;
10640 if ($notnull_bool(property._provideFieldSyntax)) { 10640 if ($notnull_bool(property._provideFieldSyntax)) {
10641 this.writer.enterBlock('Object.defineProperty(' + ('' + property.declaringTy pe.get$jsname() + '.prototype, "' + property.get$jsname() + '", {')); 10641 this.writer.enterBlock('Object.defineProperty(' + ('' + property.declaringTy pe.get$jsname() + '.prototype, "' + property.get$jsname() + '", {'));
10642 if ($notnull_bool(property.getter != null)) { 10642 if ($notnull_bool(property.getter != null)) {
10643 this.writer.writeln(('get: ' + property.declaringType.get$jsname() + '.pro totype.' + property.getter.get$jsname() + ',')); 10643 this.writer.write(('get: ' + property.declaringType.get$jsname() + '.proto type.' + property.getter.get$jsname() + ''));
10644 var endOfLine = '';
10645 if ($notnull_bool(property.setter != null)) {
10646 endOfLine = ',';
10647 }
10648 this.writer.writeln(endOfLine);
10644 } 10649 }
10645 if ($notnull_bool(property.setter != null)) { 10650 if ($notnull_bool(property.setter != null)) {
10646 this.writer.writeln(('set: ' + property.declaringType.get$jsname() + '.pro totype.' + property.setter.get$jsname() + '')); 10651 this.writer.writeln(('set: ' + property.declaringType.get$jsname() + '.pro totype.' + property.setter.get$jsname() + ''));
10647 } 10652 }
10648 this.writer.exitBlock('});'); 10653 this.writer.exitBlock('});');
10649 } 10654 }
10650 } 10655 }
10651 WorldGenerator.prototype._writeMethod = function(method) { 10656 WorldGenerator.prototype._writeMethod = function(method) {
10652 if ($notnull_bool(method.generator != null)) { 10657 if ($notnull_bool(method.generator != null)) {
10653 method.generator.writeDefinition(this.writer, null); 10658 method.generator.writeDefinition(this.writer, null);
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
10920 else if ($notnull_bool(this.method.get$isStatic())) { 10925 else if ($notnull_bool(this.method.get$isStatic())) {
10921 defWriter.enterBlock(('' + this.method.declaringType.get$jsname() + '.' + th is.method.get$jsname() + ' = function' + _params + ' {')); 10926 defWriter.enterBlock(('' + this.method.declaringType.get$jsname() + '.' + th is.method.get$jsname() + ' = function' + _params + ' {'));
10922 } 10927 }
10923 else { 10928 else {
10924 defWriter.enterBlock(('' + this.method.declaringType.get$jsname() + '.protot ype.') + ('' + this.method.get$jsname() + ' = function' + _params + ' {')); 10929 defWriter.enterBlock(('' + this.method.declaringType.get$jsname() + '.protot ype.') + ('' + this.method.get$jsname() + ' = function' + _params + ' {'));
10925 } 10930 }
10926 if ($notnull_bool(this.needsThis)) { 10931 if ($notnull_bool(this.needsThis)) {
10927 defWriter.writeln('var \$this = this; // closure support'); 10932 defWriter.writeln('var \$this = this; // closure support');
10928 } 10933 }
10929 if ($notnull_bool(this._usedTemps.get$length() > 0 || this._freeTemps.length > 0)) { 10934 if ($notnull_bool(this._usedTemps.get$length() > 0 || this._freeTemps.length > 0)) {
10930 $assert(this._usedTemps.get$length() == 0, "_usedTemps.length == 0", "gen.da rt", 694, 14); 10935 $assert(this._usedTemps.get$length() == 0, "_usedTemps.length == 0", "gen.da rt", 699, 14);
10931 this._freeTemps.addAll(this._usedTemps); 10936 this._freeTemps.addAll(this._usedTemps);
10932 this._freeTemps.sort((function (x, y) { 10937 this._freeTemps.sort((function (x, y) {
10933 return x.compareTo(y); 10938 return x.compareTo(y);
10934 }) 10939 })
10935 ); 10940 );
10936 defWriter.writeln(('var ' + Strings.join(this._freeTemps, ", ") + ';')); 10941 defWriter.writeln(('var ' + Strings.join(this._freeTemps, ", ") + ';'));
10937 } 10942 }
10938 defWriter.writeln(this.writer.get$text()); 10943 defWriter.writeln(this.writer.get$text());
10939 if ($notnull_bool($ne(names, null))) { 10944 if ($notnull_bool($ne(names, null))) {
10940 defWriter.exitBlock(('}).bind(null, ' + Strings.join((names && names.is$List $String()), ", ") + ')')); 10945 defWriter.exitBlock(('}).bind(null, ' + Strings.join((names && names.is$List $String()), ", ") + ')'));
(...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after
12058 } 12063 }
12059 MethodGenerator.prototype.visitSuperExpression = function(node) { 12064 MethodGenerator.prototype.visitSuperExpression = function(node) {
12060 return this._makeSuperValue(node); 12065 return this._makeSuperValue(node);
12061 } 12066 }
12062 MethodGenerator.prototype.visitNullExpression = function(node) { 12067 MethodGenerator.prototype.visitNullExpression = function(node) {
12063 return EvaluatedValue.EvaluatedValue$factory(null, null, 'null', null); 12068 return EvaluatedValue.EvaluatedValue$factory(null, null, 'null', null);
12064 } 12069 }
12065 MethodGenerator.prototype.visitLiteralExpression = function(node) { 12070 MethodGenerator.prototype.visitLiteralExpression = function(node) {
12066 var $0; 12071 var $0;
12067 var type = node.type.type; 12072 var type = node.type.type;
12068 $assert($ne(type, null), "type != null", "gen.dart", 2072, 12); 12073 $assert($ne(type, null), "type != null", "gen.dart", 2077, 12);
12069 if ($notnull_bool(!!(($0 = node.value) && $0.is$List))) { 12074 if ($notnull_bool(!!(($0 = node.value) && $0.is$List))) {
12070 var items = []; 12075 var items = [];
12071 var $list = node.value; 12076 var $list = node.value;
12072 for (var $i = node.value.iterator(); $i.hasNext(); ) { 12077 for (var $i = node.value.iterator(); $i.hasNext(); ) {
12073 var item = $i.next(); 12078 var item = $i.next();
12074 var val = this.visitValue((item && item.is$lang_Expression())); 12079 var val = this.visitValue((item && item.is$lang_Expression()));
12075 val.invoke$4(this, 'toString', item, Arguments.get$EMPTY()); 12080 val.invoke$4(this, 'toString', item, Arguments.get$EMPTY());
12076 var code = val.code; 12081 var code = val.code;
12077 if ($notnull_bool((item instanceof BinaryExpression) || (item instanceof C onditionalExpression))) { 12082 if ($notnull_bool((item instanceof BinaryExpression) || (item instanceof C onditionalExpression))) {
12078 code = ('(' + code + ')'); 12083 code = ('(' + code + ')');
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
12128 Arguments.prototype.get$nameCount = function() { 12133 Arguments.prototype.get$nameCount = function() {
12129 return this.get$length() - this.get$bareCount(); 12134 return this.get$length() - this.get$bareCount();
12130 } 12135 }
12131 Arguments.prototype.get$hasNames = function() { 12136 Arguments.prototype.get$hasNames = function() {
12132 return this.get$bareCount() < this.get$length(); 12137 return this.get$bareCount() < this.get$length();
12133 } 12138 }
12134 Arguments.prototype.get$length = function() { 12139 Arguments.prototype.get$length = function() {
12135 return this.values.length; 12140 return this.values.length;
12136 } 12141 }
12137 Object.defineProperty(Arguments.prototype, "length", { 12142 Object.defineProperty(Arguments.prototype, "length", {
12138 get: Arguments.prototype.get$length, 12143 get: Arguments.prototype.get$length
12139 }); 12144 });
12140 Arguments.prototype.getName = function(i) { 12145 Arguments.prototype.getName = function(i) {
12141 return this.nodes.$index(i).label.name; 12146 return this.nodes.$index(i).label.name;
12142 } 12147 }
12143 Arguments.prototype.getIndexOfName = function(name) { 12148 Arguments.prototype.getIndexOfName = function(name) {
12144 for (var i = this.get$bareCount(); 12149 for (var i = this.get$bareCount();
12145 $notnull_bool(i < this.get$length()); i++) { 12150 $notnull_bool(i < this.get$length()); i++) {
12146 if ($notnull_bool(this.getName(i) == name)) { 12151 if ($notnull_bool(this.getName(i) == name)) {
12147 return i; 12152 return i;
12148 } 12153 }
(...skipping 6345 matching lines...) Expand 10 before | Expand all | Expand 10 after
18494 if ($notnull_bool($ne(newType, t))) needsNewType = true; 18499 if ($notnull_bool($ne(newType, t))) needsNewType = true;
18495 newTypeArgs.add(newType); 18500 newTypeArgs.add(newType);
18496 } 18501 }
18497 if ($notnull_bool(!$notnull_bool(needsNewType))) return this; 18502 if ($notnull_bool(!$notnull_bool(needsNewType))) return this;
18498 return this.genericType.getOrMakeConcreteType((newTypeArgs && newTypeArgs.is$L ist$Type())); 18503 return this.genericType.getOrMakeConcreteType((newTypeArgs && newTypeArgs.is$L ist$Type()));
18499 } 18504 }
18500 ConcreteType.prototype.getOrMakeConcreteType = function(typeArgs) { 18505 ConcreteType.prototype.getOrMakeConcreteType = function(typeArgs) {
18501 return this.genericType.getOrMakeConcreteType(typeArgs); 18506 return this.genericType.getOrMakeConcreteType(typeArgs);
18502 } 18507 }
18503 ConcreteType.prototype.get$parent = function() { 18508 ConcreteType.prototype.get$parent = function() {
18504 return this.genericType.parent; 18509 return this.genericType.get$parent();
18505 } 18510 }
18506 ConcreteType.prototype.get$interfaces = function() { 18511 ConcreteType.prototype.get$interfaces = function() {
18507 if ($notnull_bool(this._interfaces == null && this.genericType.interfaces != n ull)) { 18512 if ($notnull_bool(this._interfaces == null && this.genericType.interfaces != n ull)) {
18508 this._interfaces = []; 18513 this._interfaces = [];
18509 var $list = this.genericType.interfaces; 18514 var $list = this.genericType.interfaces;
18510 for (var $i = 0;$i < $list.length; $i++) { 18515 for (var $i = 0;$i < $list.length; $i++) {
18511 var i = $list.$index($i); 18516 var i = $list.$index($i);
18512 this._interfaces.add(i.resolveTypeParams(this)); 18517 this._interfaces.add(i.resolveTypeParams(this));
18513 } 18518 }
18514 } 18519 }
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
18605 lang_Type.call(this, name); 18610 lang_Type.call(this, name);
18606 // Initializers done 18611 // Initializers done
18607 this.setDefinition(definition); 18612 this.setDefinition(definition);
18608 } 18613 }
18609 $inherits(DefinedType, lang_Type); 18614 $inherits(DefinedType, lang_Type);
18610 DefinedType.prototype.is$DefinedType = function(){return this;}; 18615 DefinedType.prototype.is$DefinedType = function(){return this;};
18611 DefinedType.prototype.get$definition = function() { return this.definition; }; 18616 DefinedType.prototype.get$definition = function() { return this.definition; };
18612 DefinedType.prototype.set$definition = function(value) { return this.definition = value; }; 18617 DefinedType.prototype.set$definition = function(value) { return this.definition = value; };
18613 DefinedType.prototype.get$library = function() { return this.library; }; 18618 DefinedType.prototype.get$library = function() { return this.library; };
18614 DefinedType.prototype.get$isClass = function() { return this.isClass; }; 18619 DefinedType.prototype.get$isClass = function() { return this.isClass; };
18615 DefinedType.prototype.get$parent = function() { return this.parent; }; 18620 DefinedType.prototype.get$parent = function() {
18616 DefinedType.prototype.set$parent = function(value) { return this.parent = value; }; 18621 return this._parent;
18622 }
18623 DefinedType.prototype.set$parent = function(p) {
18624 return this._parent = p;
18625 }
18617 DefinedType.prototype.get$interfaces = function() { return this.interfaces; }; 18626 DefinedType.prototype.get$interfaces = function() { return this.interfaces; };
18618 DefinedType.prototype.set$interfaces = function(value) { return this.interfaces = value; }; 18627 DefinedType.prototype.set$interfaces = function(value) { return this.interfaces = value; };
18619 DefinedType.prototype.get$typeParameters = function() { return this.typeParamete rs; }; 18628 DefinedType.prototype.get$typeParameters = function() { return this.typeParamete rs; };
18620 DefinedType.prototype.set$typeParameters = function(value) { return this.typePar ameters = value; }; 18629 DefinedType.prototype.set$typeParameters = function(value) { return this.typePar ameters = value; };
18621 DefinedType.prototype.get$constructors = function() { return this.constructors; }; 18630 DefinedType.prototype.get$constructors = function() { return this.constructors; };
18622 DefinedType.prototype.set$constructors = function(value) { return this.construct ors = value; }; 18631 DefinedType.prototype.set$constructors = function(value) { return this.construct ors = value; };
18623 DefinedType.prototype.get$members = function() { return this.members; }; 18632 DefinedType.prototype.get$members = function() { return this.members; };
18624 DefinedType.prototype.set$members = function(value) { return this.members = valu e; }; 18633 DefinedType.prototype.set$members = function(value) { return this.members = valu e; };
18625 DefinedType.prototype.get$factories = function() { return this.factories; }; 18634 DefinedType.prototype.get$factories = function() { return this.factories; };
18626 DefinedType.prototype.set$factories = function(value) { return this.factories = value; }; 18635 DefinedType.prototype.set$factories = function(value) { return this.factories = value; };
18627 DefinedType.prototype.get$isUsed = function() { return this.isUsed; }; 18636 DefinedType.prototype.get$isUsed = function() { return this.isUsed; };
18628 DefinedType.prototype.set$isUsed = function(value) { return this.isUsed = value; }; 18637 DefinedType.prototype.set$isUsed = function(value) { return this.isUsed = value; };
18629 DefinedType.prototype.get$isNativeType = function() { return this.isNativeType; }; 18638 DefinedType.prototype.get$isNativeType = function() { return this.isNativeType; };
18630 DefinedType.prototype.set$isNativeType = function(value) { return this.isNativeT ype = value; }; 18639 DefinedType.prototype.set$isNativeType = function(value) { return this.isNativeT ype = value; };
18631 DefinedType.prototype.setDefinition = function(def) { 18640 DefinedType.prototype.setDefinition = function(def) {
18632 $assert(this.definition == null, "definition == null", "type.dart", 558, 12); 18641 $assert(this.definition == null, "definition == null", "type.dart", 563, 12);
18633 this.definition = def; 18642 this.definition = def;
18634 if ($notnull_bool((this.definition instanceof TypeDefinition) && this.definiti on.get$nativeType() != null)) { 18643 if ($notnull_bool((this.definition instanceof TypeDefinition) && this.definiti on.get$nativeType() != null)) {
18635 this.isNativeType = true; 18644 this.isNativeType = true;
18636 } 18645 }
18637 if ($notnull_bool(this.definition != null && this.definition.get$typeParameter s() != null)) { 18646 if ($notnull_bool(this.definition != null && this.definition.get$typeParameter s() != null)) {
18638 this._concreteTypes = $map([]); 18647 this._concreteTypes = $map([]);
18639 this.typeParameters = []; 18648 this.typeParameters = [];
18640 var $list = this.definition.get$typeParameters(); 18649 var $list = this.definition.get$typeParameters();
18641 for (var $i = 0;$i < $list.length; $i++) { 18650 for (var $i = 0;$i < $list.length; $i++) {
18642 var tp = $list.$index($i); 18651 var tp = $list.$index($i);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
18703 if ($notnull_bool(this.isUsed)) return; 18712 if ($notnull_bool(this.isUsed)) return;
18704 this.isUsed = true; 18713 this.isUsed = true;
18705 if ($notnull_bool(this._lazyGenMethods != null)) { 18714 if ($notnull_bool(this._lazyGenMethods != null)) {
18706 var $list = orderValuesByKeys(this._lazyGenMethods); 18715 var $list = orderValuesByKeys(this._lazyGenMethods);
18707 for (var $i = 0;$i < $list.length; $i++) { 18716 for (var $i = 0;$i < $list.length; $i++) {
18708 var method = $list.$index($i); 18717 var method = $list.$index($i);
18709 world.gen.genMethod((method && method.is$Member())); 18718 world.gen.genMethod((method && method.is$Member()));
18710 } 18719 }
18711 this._lazyGenMethods = null; 18720 this._lazyGenMethods = null;
18712 } 18721 }
18713 if ($notnull_bool(this.parent != null)) this.parent.markUsed(); 18722 if ($notnull_bool(this.get$parent() != null)) this.get$parent().markUsed();
18714 } 18723 }
18715 DefinedType.prototype.genMethod = function(method) { 18724 DefinedType.prototype.genMethod = function(method) {
18716 if ($notnull_bool(this.isUsed)) { 18725 if ($notnull_bool(this.isUsed)) {
18717 world.gen.genMethod(method); 18726 world.gen.genMethod(method);
18718 } 18727 }
18719 else if ($notnull_bool(this.isClass)) { 18728 else if ($notnull_bool(this.isClass)) {
18720 if ($notnull_bool(this._lazyGenMethods == null)) this._lazyGenMethods = $map ([]); 18729 if ($notnull_bool(this._lazyGenMethods == null)) this._lazyGenMethods = $map ([]);
18721 this._lazyGenMethods.$setindex(method.name, method); 18730 this._lazyGenMethods.$setindex(method.name, method);
18722 } 18731 }
18723 } 18732 }
18724 DefinedType.prototype._resolveInterfaces = function(types) { 18733 DefinedType.prototype._resolveInterfaces = function(types) {
18725 if ($notnull_bool(types == null)) return []; 18734 if ($notnull_bool(types == null)) return [];
18726 var interfaces = []; 18735 var interfaces = [];
18727 for (var $i = 0;$i < types.length; $i++) { 18736 for (var $i = 0;$i < types.length; $i++) {
18728 var type = types.$index($i); 18737 var type = types.$index($i);
18729 var resolvedInterface = this.resolveType((type && type.is$TypeReference()), true); 18738 var resolvedInterface = this.resolveType((type && type.is$TypeReference()), true);
18730 if ($notnull_bool(resolvedInterface.get$isClosed() && !$notnull_bool((this.l ibrary.get$isCore() || this.library.get$isCoreImpl())))) { 18739 if ($notnull_bool(resolvedInterface.get$isClosed() && !$notnull_bool((this.l ibrary.get$isCore() || this.library.get$isCoreImpl())))) {
18731 world.error(('can not implement "' + resolvedInterface.get$name() + '": ') + 'only native implementation allowed', type.get$span()); 18740 world.error(('can not implement "' + resolvedInterface.get$name() + '": ') + 'only native implementation allowed', type.get$span());
18732 } 18741 }
18733 resolvedInterface.addDirectSubtype(this); 18742 resolvedInterface.addDirectSubtype(this);
18734 interfaces.add(resolvedInterface); 18743 interfaces.add(resolvedInterface);
18735 } 18744 }
18736 return interfaces; 18745 return interfaces;
18737 } 18746 }
18738 DefinedType.prototype.addDirectSubtype = function(type) { 18747 DefinedType.prototype.addDirectSubtype = function(type) {
18739 $assert(this._subtypes == null, "_subtypes == null", "type.dart", 674, 12); 18748 $assert(this._subtypes == null, "_subtypes == null", "type.dart", 679, 12);
18740 this.directSubtypes.add(type); 18749 this.directSubtypes.add(type);
18741 } 18750 }
18742 DefinedType.prototype.get$subtypes = function() { 18751 DefinedType.prototype.get$subtypes = function() {
18743 var $0; 18752 var $0;
18744 if ($notnull_bool(this._subtypes == null)) { 18753 if ($notnull_bool(this._subtypes == null)) {
18745 this._subtypes = new HashSetImplementation$Type(); 18754 this._subtypes = new HashSetImplementation$Type();
18746 var $list = this.directSubtypes; 18755 var $list = this.directSubtypes;
18747 for (var $i = this.directSubtypes.iterator(); $i.hasNext(); ) { 18756 for (var $i = this.directSubtypes.iterator(); $i.hasNext(); ) {
18748 var st = $i.next(); 18757 var st = $i.next();
18749 this._subtypes.add(st); 18758 this._subtypes.add(st);
18750 this._subtypes.addAll(st.get$subtypes()); 18759 this._subtypes.addAll(st.get$subtypes());
18751 } 18760 }
18752 } 18761 }
18753 return this._subtypes; 18762 return this._subtypes;
18754 } 18763 }
18755 DefinedType.prototype._cycleInClassExtends = function() { 18764 DefinedType.prototype._cycleInClassExtends = function() {
18756 var seen = new HashSetImplementation(); 18765 var seen = new HashSetImplementation();
18757 seen.add(this); 18766 seen.add(this);
18758 var ancestor = this.parent; 18767 var ancestor = this.get$parent();
18759 while ($notnull_bool($ne(ancestor, null))) { 18768 while ($notnull_bool($ne(ancestor, null))) {
18760 if ($notnull_bool(ancestor === this)) { 18769 if ($notnull_bool(ancestor === this)) {
18761 return true; 18770 return true;
18762 } 18771 }
18763 if ($notnull_bool(seen.contains(ancestor))) { 18772 if ($notnull_bool(seen.contains(ancestor))) {
18764 return false; 18773 return false;
18765 } 18774 }
18766 seen.add(ancestor); 18775 seen.add(ancestor);
18767 ancestor = ancestor.get$parent(); 18776 ancestor = ancestor.get$parent();
18768 } 18777 }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
18801 if ($notnull_bool((this.definition instanceof TypeDefinition))) { 18810 if ($notnull_bool((this.definition instanceof TypeDefinition))) {
18802 var typeDef = (($0 = this.definition) && $0.is$TypeDefinition()); 18811 var typeDef = (($0 = this.definition) && $0.is$TypeDefinition());
18803 if ($notnull_bool(this.isClass)) { 18812 if ($notnull_bool(this.isClass)) {
18804 if ($notnull_bool(typeDef.extendsTypes != null && typeDef.extendsTypes.len gth > 0)) { 18813 if ($notnull_bool(typeDef.extendsTypes != null && typeDef.extendsTypes.len gth > 0)) {
18805 if ($notnull_bool(typeDef.extendsTypes.length > 1)) { 18814 if ($notnull_bool(typeDef.extendsTypes.length > 1)) {
18806 world.error('more than one base class', typeDef.extendsTypes.$index(1) .get$span()); 18815 world.error('more than one base class', typeDef.extendsTypes.$index(1) .get$span());
18807 } 18816 }
18808 var extendsTypeRef = typeDef.extendsTypes.$index(0); 18817 var extendsTypeRef = typeDef.extendsTypes.$index(0);
18809 if ($notnull_bool((extendsTypeRef instanceof GenericTypeReference))) { 18818 if ($notnull_bool((extendsTypeRef instanceof GenericTypeReference))) {
18810 var g = (extendsTypeRef && extendsTypeRef.is$GenericTypeReference()); 18819 var g = (extendsTypeRef && extendsTypeRef.is$GenericTypeReference());
18811 this.parent = this.resolveType(g.baseType, true); 18820 this.set$parent(this.resolveType(g.baseType, true));
18812 } 18821 }
18813 this.parent = this.resolveType((extendsTypeRef && extendsTypeRef.is$Type Reference()), true); 18822 this.set$parent(this.resolveType((extendsTypeRef && extendsTypeRef.is$Ty peReference()), true));
18814 if ($notnull_bool(!$notnull_bool(this.parent.get$isClass()))) { 18823 if ($notnull_bool(!$notnull_bool(this.get$parent().get$isClass()))) {
18815 world.error('class may not extend an interface - use implements', type Def.extendsTypes.$index(0).get$span()); 18824 world.error('class may not extend an interface - use implements', type Def.extendsTypes.$index(0).get$span());
18816 } 18825 }
18817 this.parent.addDirectSubtype(this); 18826 this.get$parent().addDirectSubtype(this);
18818 if ($notnull_bool(this._cycleInClassExtends())) { 18827 if ($notnull_bool(this._cycleInClassExtends())) {
18819 world.error(('class "' + this.name + '" has a cycle in its inheritance chain'), extendsTypeRef.get$span()); 18828 world.error(('class "' + this.name + '" has a cycle in its inheritance chain'), extendsTypeRef.get$span());
18820 } 18829 }
18821 } 18830 }
18822 else { 18831 else {
18823 if ($notnull_bool(!$notnull_bool(this.get$isObject()))) { 18832 if ($notnull_bool(!$notnull_bool(this.get$isObject()))) {
18824 this.parent = world.objectType; 18833 this.set$parent(world.objectType);
18825 } 18834 }
18826 } 18835 }
18827 this.interfaces = this._resolveInterfaces(typeDef.implementsTypes); 18836 this.interfaces = this._resolveInterfaces(typeDef.implementsTypes);
18828 if ($notnull_bool(typeDef.factoryType != null)) { 18837 if ($notnull_bool(typeDef.factoryType != null)) {
18829 world.error('factory not allowed on classes', typeDef.factoryType.span); 18838 world.error('factory not allowed on classes', typeDef.factoryType.span);
18830 } 18839 }
18831 } 18840 }
18832 else { 18841 else {
18833 if ($notnull_bool(typeDef.implementsTypes != null && typeDef.implementsTyp es.length > 0)) { 18842 if ($notnull_bool(typeDef.implementsTypes != null && typeDef.implementsTyp es.length > 0)) {
18834 world.error('implements not allowed on interfaces (use extends)', typeDe f.implementsTypes.$index(0).get$span()); 18843 world.error('implements not allowed on interfaces (use extends)', typeDe f.implementsTypes.$index(0).get$span());
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
18998 if ($notnull_bool(this.get$isTop())) { 19007 if ($notnull_bool(this.get$isTop())) {
18999 var libType = this.library.findTypeByName(memberName); 19008 var libType = this.library.findTypeByName(memberName);
19000 if ($notnull_bool($ne(libType, null))) { 19009 if ($notnull_bool($ne(libType, null))) {
19001 return libType.get$typeMember(); 19010 return libType.get$typeMember();
19002 } 19011 }
19003 } 19012 }
19004 return this.getMemberInParents(memberName); 19013 return this.getMemberInParents(memberName);
19005 } 19014 }
19006 DefinedType.prototype.getMemberInParents = function(memberName) { 19015 DefinedType.prototype.getMemberInParents = function(memberName) {
19007 if ($notnull_bool(this.isClass)) { 19016 if ($notnull_bool(this.isClass)) {
19008 if ($notnull_bool(this.parent != null)) { 19017 if ($notnull_bool(this.get$parent() != null)) {
19009 return this.parent.getMember(memberName); 19018 return this.get$parent().getMember(memberName);
19010 } 19019 }
19011 else if ($notnull_bool(this.get$isObject())) { 19020 else if ($notnull_bool(this.get$isObject())) {
19012 if ($notnull_bool(memberName == '\$ne')) { 19021 if ($notnull_bool(memberName == '\$ne')) {
19013 var ret = this._createNotEqualMember(); 19022 var ret = this._createNotEqualMember();
19014 this.members.$setindex(memberName, ret); 19023 this.members.$setindex(memberName, ret);
19015 return ret; 19024 return ret;
19016 } 19025 }
19017 return null; 19026 return null;
19018 } 19027 }
19019 } 19028 }
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
19157 } 19166 }
19158 else { 19167 else {
19159 world.internalError('unknown type reference', node.span); 19168 world.internalError('unknown type reference', node.span);
19160 } 19169 }
19161 return node.type; 19170 return node.type;
19162 } 19171 }
19163 DefinedType.prototype.resolveTypeParams = function(inType) { 19172 DefinedType.prototype.resolveTypeParams = function(inType) {
19164 return this; 19173 return this;
19165 } 19174 }
19166 DefinedType.prototype.getOrMakeConcreteType = function(typeArgs) { 19175 DefinedType.prototype.getOrMakeConcreteType = function(typeArgs) {
19167 $assert(this.get$isGeneric(), "isGeneric", "type.dart", 1156, 12); 19176 $assert(this.get$isGeneric(), "isGeneric", "type.dart", 1161, 12);
19168 var names = [this.name]; 19177 var names = [this.name];
19169 var typeMap = $map([]); 19178 var typeMap = $map([]);
19170 for (var i = 0; 19179 for (var i = 0;
19171 $notnull_bool(i < typeArgs.length); i++) { 19180 $notnull_bool(i < typeArgs.length); i++) {
19172 var paramName = this.typeParameters.$index(i).get$name(); 19181 var paramName = this.typeParameters.$index(i).get$name();
19173 typeMap.$setindex(paramName, typeArgs.$index(i)); 19182 typeMap.$setindex(paramName, typeArgs.$index(i));
19174 names.add(typeArgs.$index(i).get$name()); 19183 names.add(typeArgs.$index(i).get$name());
19175 } 19184 }
19176 var concreteName = Strings.join((names && names.is$List$String()), '\$'); 19185 var concreteName = Strings.join((names && names.is$List$String()), '\$');
19177 var ret = this._concreteTypes.$index(concreteName); 19186 var ret = this._concreteTypes.$index(concreteName);
19178 if ($notnull_bool(ret == null)) { 19187 if ($notnull_bool(ret == null)) {
19179 ret = new ConcreteType($assert_String(concreteName), this, typeMap, typeArgs ); 19188 ret = new ConcreteType($assert_String(concreteName), this, typeMap, typeArgs );
19180 this._concreteTypes.$setindex(concreteName, ret); 19189 this._concreteTypes.$setindex(concreteName, ret);
19181 } 19190 }
19182 return ret; 19191 return ret;
19183 } 19192 }
19184 DefinedType.prototype.getCallStub = function(args) { 19193 DefinedType.prototype.getCallStub = function(args) {
19185 $assert(this.get$isFunction(), "isFunction", "type.dart", 1176, 12); 19194 $assert(this.get$isFunction(), "isFunction", "type.dart", 1181, 12);
19186 var name = _getCallStubName('call', args); 19195 var name = _getCallStubName('call', args);
19187 if ($notnull_bool(this.varStubs == null)) this.varStubs = $map([]); 19196 if ($notnull_bool(this.varStubs == null)) this.varStubs = $map([]);
19188 var stub = this.varStubs.$index(name); 19197 var stub = this.varStubs.$index(name);
19189 if ($notnull_bool(stub == null)) { 19198 if ($notnull_bool(stub == null)) {
19190 stub = new VarFunctionStub($assert_String(name), args); 19199 stub = new VarFunctionStub($assert_String(name), args);
19191 this.varStubs.$setindex(name, stub); 19200 this.varStubs.$setindex(name, stub);
19192 } 19201 }
19193 return stub; 19202 return stub;
19194 } 19203 }
19195 // ********** Code for FixedCollection ************** 19204 // ********** Code for FixedCollection **************
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after
20077 case '--ignore-unrecognized-flags': 20086 case '--ignore-unrecognized-flags':
20078 20087
20079 ignoreUnrecognizedFlags = true; 20088 ignoreUnrecognizedFlags = true;
20080 continue loop; 20089 continue loop;
20081 20090
20082 case '--verbose': 20091 case '--verbose':
20083 20092
20084 this.showInfo = true; 20093 this.showInfo = true;
20085 continue loop; 20094 continue loop;
20086 20095
20096 case '--suppress_warnings':
20097
20098 this.showWarnings = false;
20099 continue loop;
20100
20087 case '--throw_on_errors': 20101 case '--throw_on_errors':
20088 20102
20089 this.throwOnErrors = true; 20103 this.throwOnErrors = true;
20090 continue loop; 20104 continue loop;
20091 20105
20092 case '--throw_on_warnings': 20106 case '--throw_on_warnings':
20093 20107
20094 this.throwOnWarnings = true; 20108 this.throwOnWarnings = true;
20095 continue loop; 20109 continue loop;
20096 20110
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
20583 INTERFACE, 20597 INTERFACE,
20584 LIBRARY, 20598 LIBRARY,
20585 NATIVE, 20599 NATIVE,
20586 NEGATE, 20600 NEGATE,
20587 OPERATOR, 20601 OPERATOR,
20588 SET, 20602 SET,
20589 SOURCE, 20603 SOURCE,
20590 STATIC, 20604 STATIC,
20591 TYPEDEF ]*/; 20605 TYPEDEF ]*/;
20592 RunEntry(function () {main();}, []); 20606 RunEntry(function () {main();}, []);
OLDNEW
« no previous file with comments | « no previous file | frog/gen.dart » ('j') | frog/gen.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698