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

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') | tools/testing/architecture.py » ('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 this.writer.writeln($notnull_bool(property.setter == null) ? '' : ',');
10644 } 10645 }
10645 if ($notnull_bool(property.setter != null)) { 10646 if ($notnull_bool(property.setter != null)) {
10646 this.writer.writeln(('set: ' + property.declaringType.get$jsname() + '.pro totype.' + property.setter.get$jsname() + '')); 10647 this.writer.writeln(('set: ' + property.declaringType.get$jsname() + '.pro totype.' + property.setter.get$jsname() + ''));
10647 } 10648 }
10648 this.writer.exitBlock('});'); 10649 this.writer.exitBlock('});');
10649 } 10650 }
10650 } 10651 }
10651 WorldGenerator.prototype._writeMethod = function(method) { 10652 WorldGenerator.prototype._writeMethod = function(method) {
10652 if ($notnull_bool(method.generator != null)) { 10653 if ($notnull_bool(method.generator != null)) {
10653 method.generator.writeDefinition(this.writer, null); 10654 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())) { 10921 else if ($notnull_bool(this.method.get$isStatic())) {
10921 defWriter.enterBlock(('' + this.method.declaringType.get$jsname() + '.' + th is.method.get$jsname() + ' = function' + _params + ' {')); 10922 defWriter.enterBlock(('' + this.method.declaringType.get$jsname() + '.' + th is.method.get$jsname() + ' = function' + _params + ' {'));
10922 } 10923 }
10923 else { 10924 else {
10924 defWriter.enterBlock(('' + this.method.declaringType.get$jsname() + '.protot ype.') + ('' + this.method.get$jsname() + ' = function' + _params + ' {')); 10925 defWriter.enterBlock(('' + this.method.declaringType.get$jsname() + '.protot ype.') + ('' + this.method.get$jsname() + ' = function' + _params + ' {'));
10925 } 10926 }
10926 if ($notnull_bool(this.needsThis)) { 10927 if ($notnull_bool(this.needsThis)) {
10927 defWriter.writeln('var \$this = this; // closure support'); 10928 defWriter.writeln('var \$this = this; // closure support');
10928 } 10929 }
10929 if ($notnull_bool(this._usedTemps.get$length() > 0 || this._freeTemps.length > 0)) { 10930 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); 10931 $assert(this._usedTemps.get$length() == 0, "_usedTemps.length == 0", "gen.da rt", 697, 14);
10931 this._freeTemps.addAll(this._usedTemps); 10932 this._freeTemps.addAll(this._usedTemps);
10932 this._freeTemps.sort((function (x, y) { 10933 this._freeTemps.sort((function (x, y) {
10933 return x.compareTo(y); 10934 return x.compareTo(y);
10934 }) 10935 })
10935 ); 10936 );
10936 defWriter.writeln(('var ' + Strings.join(this._freeTemps, ", ") + ';')); 10937 defWriter.writeln(('var ' + Strings.join(this._freeTemps, ", ") + ';'));
10937 } 10938 }
10938 defWriter.writeln(this.writer.get$text()); 10939 defWriter.writeln(this.writer.get$text());
10939 if ($notnull_bool($ne(names, null))) { 10940 if ($notnull_bool($ne(names, null))) {
10940 defWriter.exitBlock(('}).bind(null, ' + Strings.join((names && names.is$List $String()), ", ") + ')')); 10941 defWriter.exitBlock(('}).bind(null, ' + Strings.join((names && names.is$List $String()), ", ") + ')'));
(...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after
12058 } 12059 }
12059 MethodGenerator.prototype.visitSuperExpression = function(node) { 12060 MethodGenerator.prototype.visitSuperExpression = function(node) {
12060 return this._makeSuperValue(node); 12061 return this._makeSuperValue(node);
12061 } 12062 }
12062 MethodGenerator.prototype.visitNullExpression = function(node) { 12063 MethodGenerator.prototype.visitNullExpression = function(node) {
12063 return EvaluatedValue.EvaluatedValue$factory(null, null, 'null', null); 12064 return EvaluatedValue.EvaluatedValue$factory(null, null, 'null', null);
12064 } 12065 }
12065 MethodGenerator.prototype.visitLiteralExpression = function(node) { 12066 MethodGenerator.prototype.visitLiteralExpression = function(node) {
12066 var $0; 12067 var $0;
12067 var type = node.type.type; 12068 var type = node.type.type;
12068 $assert($ne(type, null), "type != null", "gen.dart", 2072, 12); 12069 $assert($ne(type, null), "type != null", "gen.dart", 2075, 12);
12069 if ($notnull_bool(!!(($0 = node.value) && $0.is$List))) { 12070 if ($notnull_bool(!!(($0 = node.value) && $0.is$List))) {
12070 var items = []; 12071 var items = [];
12071 var $list = node.value; 12072 var $list = node.value;
12072 for (var $i = node.value.iterator(); $i.hasNext(); ) { 12073 for (var $i = node.value.iterator(); $i.hasNext(); ) {
12073 var item = $i.next(); 12074 var item = $i.next();
12074 var val = this.visitValue((item && item.is$lang_Expression())); 12075 var val = this.visitValue((item && item.is$lang_Expression()));
12075 val.invoke$4(this, 'toString', item, Arguments.get$EMPTY()); 12076 val.invoke$4(this, 'toString', item, Arguments.get$EMPTY());
12076 var code = val.code; 12077 var code = val.code;
12077 if ($notnull_bool((item instanceof BinaryExpression) || (item instanceof C onditionalExpression))) { 12078 if ($notnull_bool((item instanceof BinaryExpression) || (item instanceof C onditionalExpression))) {
12078 code = ('(' + code + ')'); 12079 code = ('(' + code + ')');
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
12128 Arguments.prototype.get$nameCount = function() { 12129 Arguments.prototype.get$nameCount = function() {
12129 return this.get$length() - this.get$bareCount(); 12130 return this.get$length() - this.get$bareCount();
12130 } 12131 }
12131 Arguments.prototype.get$hasNames = function() { 12132 Arguments.prototype.get$hasNames = function() {
12132 return this.get$bareCount() < this.get$length(); 12133 return this.get$bareCount() < this.get$length();
12133 } 12134 }
12134 Arguments.prototype.get$length = function() { 12135 Arguments.prototype.get$length = function() {
12135 return this.values.length; 12136 return this.values.length;
12136 } 12137 }
12137 Object.defineProperty(Arguments.prototype, "length", { 12138 Object.defineProperty(Arguments.prototype, "length", {
12138 get: Arguments.prototype.get$length, 12139 get: Arguments.prototype.get$length
12139 }); 12140 });
12140 Arguments.prototype.getName = function(i) { 12141 Arguments.prototype.getName = function(i) {
12141 return this.nodes.$index(i).label.name; 12142 return this.nodes.$index(i).label.name;
12142 } 12143 }
12143 Arguments.prototype.getIndexOfName = function(name) { 12144 Arguments.prototype.getIndexOfName = function(name) {
12144 for (var i = this.get$bareCount(); 12145 for (var i = this.get$bareCount();
12145 $notnull_bool(i < this.get$length()); i++) { 12146 $notnull_bool(i < this.get$length()); i++) {
12146 if ($notnull_bool(this.getName(i) == name)) { 12147 if ($notnull_bool(this.getName(i) == name)) {
12147 return i; 12148 return i;
12148 } 12149 }
(...skipping 6345 matching lines...) Expand 10 before | Expand all | Expand 10 after
18494 if ($notnull_bool($ne(newType, t))) needsNewType = true; 18495 if ($notnull_bool($ne(newType, t))) needsNewType = true;
18495 newTypeArgs.add(newType); 18496 newTypeArgs.add(newType);
18496 } 18497 }
18497 if ($notnull_bool(!$notnull_bool(needsNewType))) return this; 18498 if ($notnull_bool(!$notnull_bool(needsNewType))) return this;
18498 return this.genericType.getOrMakeConcreteType((newTypeArgs && newTypeArgs.is$L ist$Type())); 18499 return this.genericType.getOrMakeConcreteType((newTypeArgs && newTypeArgs.is$L ist$Type()));
18499 } 18500 }
18500 ConcreteType.prototype.getOrMakeConcreteType = function(typeArgs) { 18501 ConcreteType.prototype.getOrMakeConcreteType = function(typeArgs) {
18501 return this.genericType.getOrMakeConcreteType(typeArgs); 18502 return this.genericType.getOrMakeConcreteType(typeArgs);
18502 } 18503 }
18503 ConcreteType.prototype.get$parent = function() { 18504 ConcreteType.prototype.get$parent = function() {
18504 return this.genericType.parent; 18505 return this.genericType.get$parent();
18505 } 18506 }
18506 ConcreteType.prototype.get$interfaces = function() { 18507 ConcreteType.prototype.get$interfaces = function() {
18507 if ($notnull_bool(this._interfaces == null && this.genericType.interfaces != n ull)) { 18508 if ($notnull_bool(this._interfaces == null && this.genericType.interfaces != n ull)) {
18508 this._interfaces = []; 18509 this._interfaces = [];
18509 var $list = this.genericType.interfaces; 18510 var $list = this.genericType.interfaces;
18510 for (var $i = 0;$i < $list.length; $i++) { 18511 for (var $i = 0;$i < $list.length; $i++) {
18511 var i = $list.$index($i); 18512 var i = $list.$index($i);
18512 this._interfaces.add(i.resolveTypeParams(this)); 18513 this._interfaces.add(i.resolveTypeParams(this));
18513 } 18514 }
18514 } 18515 }
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
18605 lang_Type.call(this, name); 18606 lang_Type.call(this, name);
18606 // Initializers done 18607 // Initializers done
18607 this.setDefinition(definition); 18608 this.setDefinition(definition);
18608 } 18609 }
18609 $inherits(DefinedType, lang_Type); 18610 $inherits(DefinedType, lang_Type);
18610 DefinedType.prototype.is$DefinedType = function(){return this;}; 18611 DefinedType.prototype.is$DefinedType = function(){return this;};
18611 DefinedType.prototype.get$definition = function() { return this.definition; }; 18612 DefinedType.prototype.get$definition = function() { return this.definition; };
18612 DefinedType.prototype.set$definition = function(value) { return this.definition = value; }; 18613 DefinedType.prototype.set$definition = function(value) { return this.definition = value; };
18613 DefinedType.prototype.get$library = function() { return this.library; }; 18614 DefinedType.prototype.get$library = function() { return this.library; };
18614 DefinedType.prototype.get$isClass = function() { return this.isClass; }; 18615 DefinedType.prototype.get$isClass = function() { return this.isClass; };
18615 DefinedType.prototype.get$parent = function() { return this.parent; }; 18616 DefinedType.prototype.get$parent = function() {
18616 DefinedType.prototype.set$parent = function(value) { return this.parent = value; }; 18617 return this._parent;
18618 }
18619 DefinedType.prototype.set$parent = function(p) {
18620 return this._parent = p;
18621 }
18617 DefinedType.prototype.get$interfaces = function() { return this.interfaces; }; 18622 DefinedType.prototype.get$interfaces = function() { return this.interfaces; };
18618 DefinedType.prototype.set$interfaces = function(value) { return this.interfaces = value; }; 18623 DefinedType.prototype.set$interfaces = function(value) { return this.interfaces = value; };
18619 DefinedType.prototype.get$typeParameters = function() { return this.typeParamete rs; }; 18624 DefinedType.prototype.get$typeParameters = function() { return this.typeParamete rs; };
18620 DefinedType.prototype.set$typeParameters = function(value) { return this.typePar ameters = value; }; 18625 DefinedType.prototype.set$typeParameters = function(value) { return this.typePar ameters = value; };
18621 DefinedType.prototype.get$constructors = function() { return this.constructors; }; 18626 DefinedType.prototype.get$constructors = function() { return this.constructors; };
18622 DefinedType.prototype.set$constructors = function(value) { return this.construct ors = value; }; 18627 DefinedType.prototype.set$constructors = function(value) { return this.construct ors = value; };
18623 DefinedType.prototype.get$members = function() { return this.members; }; 18628 DefinedType.prototype.get$members = function() { return this.members; };
18624 DefinedType.prototype.set$members = function(value) { return this.members = valu e; }; 18629 DefinedType.prototype.set$members = function(value) { return this.members = valu e; };
18625 DefinedType.prototype.get$factories = function() { return this.factories; }; 18630 DefinedType.prototype.get$factories = function() { return this.factories; };
18626 DefinedType.prototype.set$factories = function(value) { return this.factories = value; }; 18631 DefinedType.prototype.set$factories = function(value) { return this.factories = value; };
18627 DefinedType.prototype.get$isUsed = function() { return this.isUsed; }; 18632 DefinedType.prototype.get$isUsed = function() { return this.isUsed; };
18628 DefinedType.prototype.set$isUsed = function(value) { return this.isUsed = value; }; 18633 DefinedType.prototype.set$isUsed = function(value) { return this.isUsed = value; };
18629 DefinedType.prototype.get$isNativeType = function() { return this.isNativeType; }; 18634 DefinedType.prototype.get$isNativeType = function() { return this.isNativeType; };
18630 DefinedType.prototype.set$isNativeType = function(value) { return this.isNativeT ype = value; }; 18635 DefinedType.prototype.set$isNativeType = function(value) { return this.isNativeT ype = value; };
18631 DefinedType.prototype.setDefinition = function(def) { 18636 DefinedType.prototype.setDefinition = function(def) {
18632 $assert(this.definition == null, "definition == null", "type.dart", 558, 12); 18637 $assert(this.definition == null, "definition == null", "type.dart", 563, 12);
18633 this.definition = def; 18638 this.definition = def;
18634 if ($notnull_bool((this.definition instanceof TypeDefinition) && this.definiti on.get$nativeType() != null)) { 18639 if ($notnull_bool((this.definition instanceof TypeDefinition) && this.definiti on.get$nativeType() != null)) {
18635 this.isNativeType = true; 18640 this.isNativeType = true;
18636 } 18641 }
18637 if ($notnull_bool(this.definition != null && this.definition.get$typeParameter s() != null)) { 18642 if ($notnull_bool(this.definition != null && this.definition.get$typeParameter s() != null)) {
18638 this._concreteTypes = $map([]); 18643 this._concreteTypes = $map([]);
18639 this.typeParameters = []; 18644 this.typeParameters = [];
18640 var $list = this.definition.get$typeParameters(); 18645 var $list = this.definition.get$typeParameters();
18641 for (var $i = 0;$i < $list.length; $i++) { 18646 for (var $i = 0;$i < $list.length; $i++) {
18642 var tp = $list.$index($i); 18647 var tp = $list.$index($i);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
18703 if ($notnull_bool(this.isUsed)) return; 18708 if ($notnull_bool(this.isUsed)) return;
18704 this.isUsed = true; 18709 this.isUsed = true;
18705 if ($notnull_bool(this._lazyGenMethods != null)) { 18710 if ($notnull_bool(this._lazyGenMethods != null)) {
18706 var $list = orderValuesByKeys(this._lazyGenMethods); 18711 var $list = orderValuesByKeys(this._lazyGenMethods);
18707 for (var $i = 0;$i < $list.length; $i++) { 18712 for (var $i = 0;$i < $list.length; $i++) {
18708 var method = $list.$index($i); 18713 var method = $list.$index($i);
18709 world.gen.genMethod((method && method.is$Member())); 18714 world.gen.genMethod((method && method.is$Member()));
18710 } 18715 }
18711 this._lazyGenMethods = null; 18716 this._lazyGenMethods = null;
18712 } 18717 }
18713 if ($notnull_bool(this.parent != null)) this.parent.markUsed(); 18718 if ($notnull_bool(this.get$parent() != null)) this.get$parent().markUsed();
18714 } 18719 }
18715 DefinedType.prototype.genMethod = function(method) { 18720 DefinedType.prototype.genMethod = function(method) {
18716 if ($notnull_bool(this.isUsed)) { 18721 if ($notnull_bool(this.isUsed)) {
18717 world.gen.genMethod(method); 18722 world.gen.genMethod(method);
18718 } 18723 }
18719 else if ($notnull_bool(this.isClass)) { 18724 else if ($notnull_bool(this.isClass)) {
18720 if ($notnull_bool(this._lazyGenMethods == null)) this._lazyGenMethods = $map ([]); 18725 if ($notnull_bool(this._lazyGenMethods == null)) this._lazyGenMethods = $map ([]);
18721 this._lazyGenMethods.$setindex(method.name, method); 18726 this._lazyGenMethods.$setindex(method.name, method);
18722 } 18727 }
18723 } 18728 }
18724 DefinedType.prototype._resolveInterfaces = function(types) { 18729 DefinedType.prototype._resolveInterfaces = function(types) {
18725 if ($notnull_bool(types == null)) return []; 18730 if ($notnull_bool(types == null)) return [];
18726 var interfaces = []; 18731 var interfaces = [];
18727 for (var $i = 0;$i < types.length; $i++) { 18732 for (var $i = 0;$i < types.length; $i++) {
18728 var type = types.$index($i); 18733 var type = types.$index($i);
18729 var resolvedInterface = this.resolveType((type && type.is$TypeReference()), true); 18734 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())))) { 18735 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()); 18736 world.error(('can not implement "' + resolvedInterface.get$name() + '": ') + 'only native implementation allowed', type.get$span());
18732 } 18737 }
18733 resolvedInterface.addDirectSubtype(this); 18738 resolvedInterface.addDirectSubtype(this);
18734 interfaces.add(resolvedInterface); 18739 interfaces.add(resolvedInterface);
18735 } 18740 }
18736 return interfaces; 18741 return interfaces;
18737 } 18742 }
18738 DefinedType.prototype.addDirectSubtype = function(type) { 18743 DefinedType.prototype.addDirectSubtype = function(type) {
18739 $assert(this._subtypes == null, "_subtypes == null", "type.dart", 674, 12); 18744 $assert(this._subtypes == null, "_subtypes == null", "type.dart", 679, 12);
18740 this.directSubtypes.add(type); 18745 this.directSubtypes.add(type);
18741 } 18746 }
18742 DefinedType.prototype.get$subtypes = function() { 18747 DefinedType.prototype.get$subtypes = function() {
18743 var $0; 18748 var $0;
18744 if ($notnull_bool(this._subtypes == null)) { 18749 if ($notnull_bool(this._subtypes == null)) {
18745 this._subtypes = new HashSetImplementation$Type(); 18750 this._subtypes = new HashSetImplementation$Type();
18746 var $list = this.directSubtypes; 18751 var $list = this.directSubtypes;
18747 for (var $i = this.directSubtypes.iterator(); $i.hasNext(); ) { 18752 for (var $i = this.directSubtypes.iterator(); $i.hasNext(); ) {
18748 var st = $i.next(); 18753 var st = $i.next();
18749 this._subtypes.add(st); 18754 this._subtypes.add(st);
18750 this._subtypes.addAll(st.get$subtypes()); 18755 this._subtypes.addAll(st.get$subtypes());
18751 } 18756 }
18752 } 18757 }
18753 return this._subtypes; 18758 return this._subtypes;
18754 } 18759 }
18755 DefinedType.prototype._cycleInClassExtends = function() { 18760 DefinedType.prototype._cycleInClassExtends = function() {
18756 var seen = new HashSetImplementation(); 18761 var seen = new HashSetImplementation();
18757 seen.add(this); 18762 seen.add(this);
18758 var ancestor = this.parent; 18763 var ancestor = this.get$parent();
18759 while ($notnull_bool($ne(ancestor, null))) { 18764 while ($notnull_bool($ne(ancestor, null))) {
18760 if ($notnull_bool(ancestor === this)) { 18765 if ($notnull_bool(ancestor === this)) {
18761 return true; 18766 return true;
18762 } 18767 }
18763 if ($notnull_bool(seen.contains(ancestor))) { 18768 if ($notnull_bool(seen.contains(ancestor))) {
18764 return false; 18769 return false;
18765 } 18770 }
18766 seen.add(ancestor); 18771 seen.add(ancestor);
18767 ancestor = ancestor.get$parent(); 18772 ancestor = ancestor.get$parent();
18768 } 18773 }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
18801 if ($notnull_bool((this.definition instanceof TypeDefinition))) { 18806 if ($notnull_bool((this.definition instanceof TypeDefinition))) {
18802 var typeDef = (($0 = this.definition) && $0.is$TypeDefinition()); 18807 var typeDef = (($0 = this.definition) && $0.is$TypeDefinition());
18803 if ($notnull_bool(this.isClass)) { 18808 if ($notnull_bool(this.isClass)) {
18804 if ($notnull_bool(typeDef.extendsTypes != null && typeDef.extendsTypes.len gth > 0)) { 18809 if ($notnull_bool(typeDef.extendsTypes != null && typeDef.extendsTypes.len gth > 0)) {
18805 if ($notnull_bool(typeDef.extendsTypes.length > 1)) { 18810 if ($notnull_bool(typeDef.extendsTypes.length > 1)) {
18806 world.error('more than one base class', typeDef.extendsTypes.$index(1) .get$span()); 18811 world.error('more than one base class', typeDef.extendsTypes.$index(1) .get$span());
18807 } 18812 }
18808 var extendsTypeRef = typeDef.extendsTypes.$index(0); 18813 var extendsTypeRef = typeDef.extendsTypes.$index(0);
18809 if ($notnull_bool((extendsTypeRef instanceof GenericTypeReference))) { 18814 if ($notnull_bool((extendsTypeRef instanceof GenericTypeReference))) {
18810 var g = (extendsTypeRef && extendsTypeRef.is$GenericTypeReference()); 18815 var g = (extendsTypeRef && extendsTypeRef.is$GenericTypeReference());
18811 this.parent = this.resolveType(g.baseType, true); 18816 this.set$parent(this.resolveType(g.baseType, true));
18812 } 18817 }
18813 this.parent = this.resolveType((extendsTypeRef && extendsTypeRef.is$Type Reference()), true); 18818 this.set$parent(this.resolveType((extendsTypeRef && extendsTypeRef.is$Ty peReference()), true));
18814 if ($notnull_bool(!$notnull_bool(this.parent.get$isClass()))) { 18819 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()); 18820 world.error('class may not extend an interface - use implements', type Def.extendsTypes.$index(0).get$span());
18816 } 18821 }
18817 this.parent.addDirectSubtype(this); 18822 this.get$parent().addDirectSubtype(this);
18818 if ($notnull_bool(this._cycleInClassExtends())) { 18823 if ($notnull_bool(this._cycleInClassExtends())) {
18819 world.error(('class "' + this.name + '" has a cycle in its inheritance chain'), extendsTypeRef.get$span()); 18824 world.error(('class "' + this.name + '" has a cycle in its inheritance chain'), extendsTypeRef.get$span());
18820 } 18825 }
18821 } 18826 }
18822 else { 18827 else {
18823 if ($notnull_bool(!$notnull_bool(this.get$isObject()))) { 18828 if ($notnull_bool(!$notnull_bool(this.get$isObject()))) {
18824 this.parent = world.objectType; 18829 this.set$parent(world.objectType);
18825 } 18830 }
18826 } 18831 }
18827 this.interfaces = this._resolveInterfaces(typeDef.implementsTypes); 18832 this.interfaces = this._resolveInterfaces(typeDef.implementsTypes);
18828 if ($notnull_bool(typeDef.factoryType != null)) { 18833 if ($notnull_bool(typeDef.factoryType != null)) {
18829 world.error('factory not allowed on classes', typeDef.factoryType.span); 18834 world.error('factory not allowed on classes', typeDef.factoryType.span);
18830 } 18835 }
18831 } 18836 }
18832 else { 18837 else {
18833 if ($notnull_bool(typeDef.implementsTypes != null && typeDef.implementsTyp es.length > 0)) { 18838 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()); 18839 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())) { 19003 if ($notnull_bool(this.get$isTop())) {
18999 var libType = this.library.findTypeByName(memberName); 19004 var libType = this.library.findTypeByName(memberName);
19000 if ($notnull_bool($ne(libType, null))) { 19005 if ($notnull_bool($ne(libType, null))) {
19001 return libType.get$typeMember(); 19006 return libType.get$typeMember();
19002 } 19007 }
19003 } 19008 }
19004 return this.getMemberInParents(memberName); 19009 return this.getMemberInParents(memberName);
19005 } 19010 }
19006 DefinedType.prototype.getMemberInParents = function(memberName) { 19011 DefinedType.prototype.getMemberInParents = function(memberName) {
19007 if ($notnull_bool(this.isClass)) { 19012 if ($notnull_bool(this.isClass)) {
19008 if ($notnull_bool(this.parent != null)) { 19013 if ($notnull_bool(this.get$parent() != null)) {
19009 return this.parent.getMember(memberName); 19014 return this.get$parent().getMember(memberName);
19010 } 19015 }
19011 else if ($notnull_bool(this.get$isObject())) { 19016 else if ($notnull_bool(this.get$isObject())) {
19012 if ($notnull_bool(memberName == '\$ne')) { 19017 if ($notnull_bool(memberName == '\$ne')) {
19013 var ret = this._createNotEqualMember(); 19018 var ret = this._createNotEqualMember();
19014 this.members.$setindex(memberName, ret); 19019 this.members.$setindex(memberName, ret);
19015 return ret; 19020 return ret;
19016 } 19021 }
19017 return null; 19022 return null;
19018 } 19023 }
19019 } 19024 }
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
19157 } 19162 }
19158 else { 19163 else {
19159 world.internalError('unknown type reference', node.span); 19164 world.internalError('unknown type reference', node.span);
19160 } 19165 }
19161 return node.type; 19166 return node.type;
19162 } 19167 }
19163 DefinedType.prototype.resolveTypeParams = function(inType) { 19168 DefinedType.prototype.resolveTypeParams = function(inType) {
19164 return this; 19169 return this;
19165 } 19170 }
19166 DefinedType.prototype.getOrMakeConcreteType = function(typeArgs) { 19171 DefinedType.prototype.getOrMakeConcreteType = function(typeArgs) {
19167 $assert(this.get$isGeneric(), "isGeneric", "type.dart", 1156, 12); 19172 $assert(this.get$isGeneric(), "isGeneric", "type.dart", 1161, 12);
19168 var names = [this.name]; 19173 var names = [this.name];
19169 var typeMap = $map([]); 19174 var typeMap = $map([]);
19170 for (var i = 0; 19175 for (var i = 0;
19171 $notnull_bool(i < typeArgs.length); i++) { 19176 $notnull_bool(i < typeArgs.length); i++) {
19172 var paramName = this.typeParameters.$index(i).get$name(); 19177 var paramName = this.typeParameters.$index(i).get$name();
19173 typeMap.$setindex(paramName, typeArgs.$index(i)); 19178 typeMap.$setindex(paramName, typeArgs.$index(i));
19174 names.add(typeArgs.$index(i).get$name()); 19179 names.add(typeArgs.$index(i).get$name());
19175 } 19180 }
19176 var concreteName = Strings.join((names && names.is$List$String()), '\$'); 19181 var concreteName = Strings.join((names && names.is$List$String()), '\$');
19177 var ret = this._concreteTypes.$index(concreteName); 19182 var ret = this._concreteTypes.$index(concreteName);
19178 if ($notnull_bool(ret == null)) { 19183 if ($notnull_bool(ret == null)) {
19179 ret = new ConcreteType($assert_String(concreteName), this, typeMap, typeArgs ); 19184 ret = new ConcreteType($assert_String(concreteName), this, typeMap, typeArgs );
19180 this._concreteTypes.$setindex(concreteName, ret); 19185 this._concreteTypes.$setindex(concreteName, ret);
19181 } 19186 }
19182 return ret; 19187 return ret;
19183 } 19188 }
19184 DefinedType.prototype.getCallStub = function(args) { 19189 DefinedType.prototype.getCallStub = function(args) {
19185 $assert(this.get$isFunction(), "isFunction", "type.dart", 1176, 12); 19190 $assert(this.get$isFunction(), "isFunction", "type.dart", 1181, 12);
19186 var name = _getCallStubName('call', args); 19191 var name = _getCallStubName('call', args);
19187 if ($notnull_bool(this.varStubs == null)) this.varStubs = $map([]); 19192 if ($notnull_bool(this.varStubs == null)) this.varStubs = $map([]);
19188 var stub = this.varStubs.$index(name); 19193 var stub = this.varStubs.$index(name);
19189 if ($notnull_bool(stub == null)) { 19194 if ($notnull_bool(stub == null)) {
19190 stub = new VarFunctionStub($assert_String(name), args); 19195 stub = new VarFunctionStub($assert_String(name), args);
19191 this.varStubs.$setindex(name, stub); 19196 this.varStubs.$setindex(name, stub);
19192 } 19197 }
19193 return stub; 19198 return stub;
19194 } 19199 }
19195 // ********** Code for FixedCollection ************** 19200 // ********** Code for FixedCollection **************
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after
20077 case '--ignore-unrecognized-flags': 20082 case '--ignore-unrecognized-flags':
20078 20083
20079 ignoreUnrecognizedFlags = true; 20084 ignoreUnrecognizedFlags = true;
20080 continue loop; 20085 continue loop;
20081 20086
20082 case '--verbose': 20087 case '--verbose':
20083 20088
20084 this.showInfo = true; 20089 this.showInfo = true;
20085 continue loop; 20090 continue loop;
20086 20091
20092 case '--suppress_warnings':
20093
20094 this.showWarnings = false;
20095 continue loop;
20096
20087 case '--throw_on_errors': 20097 case '--throw_on_errors':
20088 20098
20089 this.throwOnErrors = true; 20099 this.throwOnErrors = true;
20090 continue loop; 20100 continue loop;
20091 20101
20092 case '--throw_on_warnings': 20102 case '--throw_on_warnings':
20093 20103
20094 this.throwOnWarnings = true; 20104 this.throwOnWarnings = true;
20095 continue loop; 20105 continue loop;
20096 20106
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
20297 world.gen.corejs.useVarMethod = true; 20307 world.gen.corejs.useVarMethod = true;
20298 } 20308 }
20299 } 20309 }
20300 VarMethodSet._addVarStub = function(type, stub) { 20310 VarMethodSet._addVarStub = function(type, stub) {
20301 if ($notnull_bool(type.varStubs == null)) type.varStubs = $map([]); 20311 if ($notnull_bool(type.varStubs == null)) type.varStubs = $map([]);
20302 type.varStubs.$setindex(stub.name, stub); 20312 type.varStubs.$setindex(stub.name, stub);
20303 } 20313 }
20304 VarMethodSet.prototype.generate = function(code) { 20314 VarMethodSet.prototype.generate = function(code) {
20305 if ($notnull_bool(this._fallbackStubs.length == 0)) return; 20315 if ($notnull_bool(this._fallbackStubs.length == 0)) return;
20306 code.enterBlock(('\$varMethod("' + this.name + '", {')); 20316 code.enterBlock(('\$varMethod("' + this.name + '", {'));
20317 var lastOne = this._fallbackStubs.$index(this._fallbackStubs.length - 1);
20307 var $list = this._fallbackStubs; 20318 var $list = this._fallbackStubs;
20308 for (var $i = 0;$i < $list.length; $i++) { 20319 for (var $i = 0;$i < $list.length; $i++) {
20309 var stub = $list.$index($i); 20320 var stub = $list.$index($i);
20310 code.write(('"' + stub.get$typeName() + '": ')); 20321 code.write(('"' + stub.get$typeName() + '": '));
20311 stub.generateBody(code); 20322 stub.generateBody(code);
20312 code.writeln(','); 20323 code.writeln($notnull_bool($eq(stub, lastOne)) ? '' : ',');
20313 } 20324 }
20314 code.exitBlock('});'); 20325 code.exitBlock('});');
20315 } 20326 }
20316 VarMethodSet.prototype.invoke$4 = function($0, $1, $2, $3) { 20327 VarMethodSet.prototype.invoke$4 = function($0, $1, $2, $3) {
20317 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments())); 20328 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()));
20318 } 20329 }
20319 ; 20330 ;
20320 // ********** Code for top level ************** 20331 // ********** Code for top level **************
20321 function map(source, mapper) { 20332 function map(source, mapper) {
20322 var $0; 20333 var $0;
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
20583 INTERFACE, 20594 INTERFACE,
20584 LIBRARY, 20595 LIBRARY,
20585 NATIVE, 20596 NATIVE,
20586 NEGATE, 20597 NEGATE,
20587 OPERATOR, 20598 OPERATOR,
20588 SET, 20599 SET,
20589 SOURCE, 20600 SOURCE,
20590 STATIC, 20601 STATIC,
20591 TYPEDEF ]*/; 20602 TYPEDEF ]*/;
20592 RunEntry(function () {main();}, []); 20603 RunEntry(function () {main();}, []);
OLDNEW
« no previous file with comments | « no previous file | frog/gen.dart » ('j') | tools/testing/architecture.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698