| OLD | NEW |
| 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 11009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11020 if ($notnull_bool(this.get$isMethodScope()) && this._closedOver.contains(name)
) return true; | 11020 if ($notnull_bool(this.get$isMethodScope()) && this._closedOver.contains(name)
) return true; |
| 11021 for (var s = this.parent; | 11021 for (var s = this.parent; |
| 11022 $notnull_bool($ne(s, null)); s = s.get$parent()) { | 11022 $notnull_bool($ne(s, null)); s = s.get$parent()) { |
| 11023 if (s._vars.containsKey(name)) return true; | 11023 if (s._vars.containsKey(name)) return true; |
| 11024 if ($notnull_bool(s.get$isMethodScope()) && s._closedOver.contains(name)) re
turn true; | 11024 if ($notnull_bool(s.get$isMethodScope()) && s._closedOver.contains(name)) re
turn true; |
| 11025 } | 11025 } |
| 11026 var type = this.enclosingMethod.method.declaringType; | 11026 var type = this.enclosingMethod.method.declaringType; |
| 11027 if (type.get$library().lookup(name, null) != null) return true; | 11027 if (type.get$library().lookup(name, null) != null) return true; |
| 11028 return false; | 11028 return false; |
| 11029 } | 11029 } |
| 11030 BlockScope.prototype.create = function(name, type, span, isParameter) { | 11030 BlockScope.prototype.create = function(name, type, span, isFinal, isParameter) { |
| 11031 var jsName = world.toJsIdentifier(name); | 11031 var jsName = world.toJsIdentifier(name); |
| 11032 if (this._vars.containsKey(name)) { | 11032 if (this._vars.containsKey(name)) { |
| 11033 world.error(('duplicate name "' + name + '"'), span); | 11033 world.error(('duplicate name "' + name + '"'), span); |
| 11034 } | 11034 } |
| 11035 if (!$notnull_bool(isParameter)) { | 11035 if (!$notnull_bool(isParameter)) { |
| 11036 var index = 0; | 11036 var index = 0; |
| 11037 while ($notnull_bool(this._isDefinedInParent($assert_String(jsName)))) { | 11037 while ($notnull_bool(this._isDefinedInParent($assert_String(jsName)))) { |
| 11038 jsName = ('' + name + '' + index++ + ''); | 11038 jsName = ('' + name + '' + index++ + ''); |
| 11039 } | 11039 } |
| 11040 } | 11040 } |
| 11041 var ret = new Value(type, jsName, span, false); | 11041 var ret = new Value(type, jsName, span, false); |
| 11042 ret.isFinal = isFinal; |
| 11042 this._vars.$setindex(name, ret); | 11043 this._vars.$setindex(name, ret); |
| 11043 return (ret && ret.is$Value()); | 11044 return (ret && ret.is$Value()); |
| 11044 } | 11045 } |
| 11045 BlockScope.prototype.declareParameter = function(p) { | 11046 BlockScope.prototype.declareParameter = function(p) { |
| 11046 return this.create(p.name, p.type, p.definition.span, true); | 11047 return this.create(p.name, p.type, p.definition.span, false, true); |
| 11047 } | 11048 } |
| 11048 BlockScope.prototype.declare = function(id) { | 11049 BlockScope.prototype.declare = function(id) { |
| 11049 var type = this.enclosingMethod.method.resolveType(id.type, false); | 11050 var type = this.enclosingMethod.method.resolveType(id.type, false); |
| 11050 return this.create(id.name.name, (type && type.is$lang_Type()), id.span, false
); | 11051 return this.create(id.name.name, (type && type.is$lang_Type()), id.span, false
, false); |
| 11051 } | 11052 } |
| 11052 BlockScope.prototype.getRethrow = function() { | 11053 BlockScope.prototype.getRethrow = function() { |
| 11053 var scope = this; | 11054 var scope = this; |
| 11054 while (scope.rethrow == null && $notnull_bool($ne(scope.get$parent(), null)))
{ | 11055 while (scope.rethrow == null && $notnull_bool($ne(scope.get$parent(), null)))
{ |
| 11055 scope = scope.get$parent(); | 11056 scope = scope.get$parent(); |
| 11056 } | 11057 } |
| 11057 return scope.rethrow; | 11058 return scope.rethrow; |
| 11058 } | 11059 } |
| 11059 BlockScope.prototype.lookup$1 = function($0) { | 11060 BlockScope.prototype.lookup$1 = function($0) { |
| 11060 return this.lookup($assert_String($0)); | 11061 return this.lookup($assert_String($0)); |
| 11061 }; | 11062 }; |
| 11062 // ********** Code for MethodGenerator ************** | 11063 // ********** Code for MethodGenerator ************** |
| 11063 function MethodGenerator(method, enclosingMethod) { | 11064 function MethodGenerator(method, enclosingMethod) { |
| 11064 var $0; | 11065 var $0; |
| 11065 this.method = method; | 11066 this.method = method; |
| 11066 this.enclosingMethod = enclosingMethod; | 11067 this.enclosingMethod = enclosingMethod; |
| 11067 this.writer = new CodeWriter(); | 11068 this.writer = new CodeWriter(); |
| 11068 this.needsThis = false; | 11069 this.needsThis = false; |
| 11069 // Initializers done | 11070 // Initializers done |
| 11070 if (this.enclosingMethod != null) { | 11071 if (this.enclosingMethod != null) { |
| 11071 this._scope = new BlockScope(this, this.enclosingMethod._scope, false); | 11072 this._scope = new BlockScope(this, this.enclosingMethod._scope, false); |
| 11072 this.captures = new HashSetImplementation(); | 11073 this.captures = new HashSetImplementation(); |
| 11073 } | 11074 } |
| 11074 else { | 11075 else { |
| 11075 this._scope = new BlockScope(this, null, false); | 11076 this._scope = new BlockScope(this, null, false); |
| 11076 } | 11077 } |
| 11077 if (this.enclosingMethod != null && this.method.name != '') { | 11078 if (this.enclosingMethod != null && this.method.name != '') { |
| 11078 var m = (($0 = this.method) && $0.is$MethodMember()); | 11079 var m = (($0 = this.method) && $0.is$MethodMember()); |
| 11079 this._scope.create(m.name, m.get$functionType(), m.definition.span, false); | 11080 this._scope.create(m.name, m.get$functionType(), m.definition.span, true, fa
lse); |
| 11080 } | 11081 } |
| 11081 this._usedTemps = new HashSetImplementation(); | 11082 this._usedTemps = new HashSetImplementation(); |
| 11082 this._freeTemps = []; | 11083 this._freeTemps = []; |
| 11083 } | 11084 } |
| 11084 MethodGenerator.prototype.is$MethodGenerator = function(){return this;}; | 11085 MethodGenerator.prototype.is$MethodGenerator = function(){return this;}; |
| 11085 MethodGenerator.prototype.is$TreeVisitor = function(){return this;}; | 11086 MethodGenerator.prototype.is$TreeVisitor = function(){return this;}; |
| 11086 MethodGenerator.prototype.get$library = function() { | 11087 MethodGenerator.prototype.get$library = function() { |
| 11087 return this.method.get$library(); | 11088 return this.method.get$library(); |
| 11088 } | 11089 } |
| 11089 MethodGenerator.prototype.findMembers = function(name) { | 11090 MethodGenerator.prototype.findMembers = function(name) { |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11193 else if ($notnull_bool(this.method.get$isStatic())) { | 11194 else if ($notnull_bool(this.method.get$isStatic())) { |
| 11194 defWriter.enterBlock(('' + this.method.declaringType.get$jsname() + '.' + th
is.method.get$jsname() + ' = function' + _params + ' {')); | 11195 defWriter.enterBlock(('' + this.method.declaringType.get$jsname() + '.' + th
is.method.get$jsname() + ' = function' + _params + ' {')); |
| 11195 } | 11196 } |
| 11196 else { | 11197 else { |
| 11197 defWriter.enterBlock(('' + this.method.declaringType.get$jsname() + '.protot
ype.') + ('' + this.method.get$jsname() + ' = function' + _params + ' {')); | 11198 defWriter.enterBlock(('' + this.method.declaringType.get$jsname() + '.protot
ype.') + ('' + this.method.get$jsname() + ' = function' + _params + ' {')); |
| 11198 } | 11199 } |
| 11199 if ($notnull_bool(this.needsThis)) { | 11200 if ($notnull_bool(this.needsThis)) { |
| 11200 defWriter.writeln('var \$this = this; // closure support'); | 11201 defWriter.writeln('var \$this = this; // closure support'); |
| 11201 } | 11202 } |
| 11202 if (this._usedTemps.get$length() > 0 || this._freeTemps.length > 0) { | 11203 if (this._usedTemps.get$length() > 0 || this._freeTemps.length > 0) { |
| 11203 $assert(this._usedTemps.get$length() == 0, "_usedTemps.length == 0", "gen.da
rt", 705, 14); | 11204 $assert(this._usedTemps.get$length() == 0, "_usedTemps.length == 0", "gen.da
rt", 706, 14); |
| 11204 this._freeTemps.addAll(this._usedTemps); | 11205 this._freeTemps.addAll(this._usedTemps); |
| 11205 this._freeTemps.sort((function (x, y) { | 11206 this._freeTemps.sort((function (x, y) { |
| 11206 return x.compareTo$1(y); | 11207 return x.compareTo$1(y); |
| 11207 }) | 11208 }) |
| 11208 ); | 11209 ); |
| 11209 defWriter.writeln(('var ' + Strings.join(this._freeTemps, ", ") + ';')); | 11210 defWriter.writeln(('var ' + Strings.join(this._freeTemps, ", ") + ';')); |
| 11210 } | 11211 } |
| 11211 defWriter.writeln(this.writer.get$text()); | 11212 defWriter.writeln(this.writer.get$text()); |
| 11212 if ($notnull_bool($ne(names, null))) { | 11213 if ($notnull_bool($ne(names, null))) { |
| 11213 defWriter.exitBlock(('}).bind(null, ' + Strings.join((names && names.is$List
$String()), ", ") + ')')); | 11214 defWriter.exitBlock(('}).bind(null, ' + Strings.join((names && names.is$List
$String()), ", ") + ')')); |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11376 world.error('no initialization allowed on redirecting constructors', ini
t.get$span()); | 11377 world.error('no initialization allowed on redirecting constructors', ini
t.get$span()); |
| 11377 } | 11378 } |
| 11378 initializedFields = null; | 11379 initializedFields = null; |
| 11379 } | 11380 } |
| 11380 } | 11381 } |
| 11381 if ($notnull_bool($ne(initializedFields, null))) { | 11382 if ($notnull_bool($ne(initializedFields, null))) { |
| 11382 var $list = this.method.declaringType.get$members().getKeys(); | 11383 var $list = this.method.declaringType.get$members().getKeys(); |
| 11383 for (var $i = this.method.declaringType.get$members().getKeys().iterator$0()
; $i.hasNext$0(); ) { | 11384 for (var $i = this.method.declaringType.get$members().getKeys().iterator$0()
; $i.hasNext$0(); ) { |
| 11384 var name = $i.next$0(); | 11385 var name = $i.next$0(); |
| 11385 var member = this.method.declaringType.get$members().$index(name); | 11386 var member = this.method.declaringType.get$members().$index(name); |
| 11386 if ((member instanceof FieldMember) && $notnull_bool(member.isFinal) && !$
notnull_bool(member.get$isStatic()) && !$notnull_bool(initializedFields.contains
$1(name))) { | 11387 if ((member instanceof FieldMember) && $notnull_bool(member.get$isFinal())
&& !$notnull_bool(member.get$isStatic()) && !$notnull_bool(initializedFields.co
ntains$1(name))) { |
| 11387 world.error(('Field "' + name + '" is final and was not initialized'), t
his.method.get$definition().get$span()); | 11388 world.error(('Field "' + name + '" is final and was not initialized'), t
his.method.get$definition().get$span()); |
| 11388 } | 11389 } |
| 11389 } | 11390 } |
| 11390 } | 11391 } |
| 11391 this.visitStatementsInBlock((body && body.is$lang_Statement())); | 11392 this.visitStatementsInBlock((body && body.is$lang_Statement())); |
| 11392 } | 11393 } |
| 11393 MethodGenerator.prototype._writeInitializerCall = function(node) { | 11394 MethodGenerator.prototype._writeInitializerCall = function(node) { |
| 11394 var contructorName = ''; | 11395 var contructorName = ''; |
| 11395 var targetExp = node.target; | 11396 var targetExp = node.target; |
| 11396 if ((targetExp instanceof DotExpression)) { | 11397 if ((targetExp instanceof DotExpression)) { |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11513 var name = node.names.$index(i).get$name(); | 11514 var name = node.names.$index(i).get$name(); |
| 11514 var value = this.visitValue((($0 = node.values.$index(i)) && $0.is$lang_Expr
ession())); | 11515 var value = this.visitValue((($0 = node.values.$index(i)) && $0.is$lang_Expr
ession())); |
| 11515 if ($notnull_bool(isFinal)) { | 11516 if ($notnull_bool(isFinal)) { |
| 11516 if ($notnull_bool(value == null)) { | 11517 if ($notnull_bool(value == null)) { |
| 11517 world.error('no value specified for final variable', node.span); | 11518 world.error('no value specified for final variable', node.span); |
| 11518 } | 11519 } |
| 11519 else { | 11520 else { |
| 11520 if ($notnull_bool(thisType.get$isVar())) thisType = value.type; | 11521 if ($notnull_bool(thisType.get$isVar())) thisType = value.type; |
| 11521 } | 11522 } |
| 11522 } | 11523 } |
| 11523 var val = this._scope.create($assert_String(name), (thisType && thisType.is$
lang_Type()), node.names.$index(i).get$span(), false); | 11524 var val = this._scope.create($assert_String(name), (thisType && thisType.is$
lang_Type()), node.names.$index(i).get$span(), $assert_bool(isFinal), false); |
| 11524 if ($notnull_bool(value == null)) { | 11525 if ($notnull_bool(value == null)) { |
| 11525 if ($notnull_bool(this._scope.reentrant)) { | 11526 if ($notnull_bool(this._scope.reentrant)) { |
| 11526 this.writer.write(('' + val.code + ' = null')); | 11527 this.writer.write(('' + val.code + ' = null')); |
| 11527 } | 11528 } |
| 11528 else { | 11529 else { |
| 11529 this.writer.write(('' + val.code + '')); | 11530 this.writer.write(('' + val.code + '')); |
| 11530 } | 11531 } |
| 11531 } | 11532 } |
| 11532 else { | 11533 else { |
| 11533 value = value.convertTo$3(this, type, node.values.$index(i)); | 11534 value = value.convertTo$3(this, type, node.values.$index(i)); |
| 11534 this.writer.write(('' + val.code + ' = ' + value.code + '')); | 11535 this.writer.write(('' + val.code + ' = ' + value.code + '')); |
| 11535 } | 11536 } |
| 11536 } | 11537 } |
| 11537 this.writer.writeln(';'); | 11538 this.writer.writeln(';'); |
| 11538 return false; | 11539 return false; |
| 11539 } | 11540 } |
| 11540 MethodGenerator.prototype.visitFunctionDefinition = function(node) { | 11541 MethodGenerator.prototype.visitFunctionDefinition = function(node) { |
| 11541 var $0; | 11542 var $0; |
| 11542 var name = world.toJsIdentifier(node.name.name); | 11543 var name = world.toJsIdentifier(node.name.name); |
| 11543 var meth = this._makeLambdaMethod($assert_String(name), node); | 11544 var meth = this._makeLambdaMethod($assert_String(name), node); |
| 11544 var funcValue = this._scope.create($assert_String(name), (($0 = meth.get$funct
ionType()) && $0.is$lang_Type()), this.method.get$definition().get$span(), false
); | 11545 var funcValue = this._scope.create($assert_String(name), (($0 = meth.get$funct
ionType()) && $0.is$lang_Type()), this.method.get$definition().get$span(), true,
false); |
| 11545 meth.generator.writeDefinition$2(this.writer); | 11546 meth.generator.writeDefinition$2(this.writer); |
| 11546 return false; | 11547 return false; |
| 11547 } | 11548 } |
| 11548 MethodGenerator.prototype.visitReturnStatement = function(node) { | 11549 MethodGenerator.prototype.visitReturnStatement = function(node) { |
| 11549 if (node.value == null) { | 11550 if (node.value == null) { |
| 11550 this.writer.writeln('return;'); | 11551 this.writer.writeln('return;'); |
| 11551 } | 11552 } |
| 11552 else { | 11553 else { |
| 11553 if ($notnull_bool(this.method.get$isConstructor())) { | 11554 if ($notnull_bool(this.method.get$isConstructor())) { |
| 11554 world.error('return of value not allowed from constructor', node.span); | 11555 world.error('return of value not allowed from constructor', node.span); |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11659 this.writer.write($assert_String(sv.code)); | 11660 this.writer.write($assert_String(sv.code)); |
| 11660 needsComma = true; | 11661 needsComma = true; |
| 11661 } | 11662 } |
| 11662 this.writer.write(') '); | 11663 this.writer.write(') '); |
| 11663 this._pushBlock(true); | 11664 this._pushBlock(true); |
| 11664 node.body.visit(this); | 11665 node.body.visit(this); |
| 11665 this._popBlock(); | 11666 this._popBlock(); |
| 11666 this._popBlock(); | 11667 this._popBlock(); |
| 11667 return false; | 11668 return false; |
| 11668 } | 11669 } |
| 11670 MethodGenerator.prototype._isFinal = function(typeRef) { |
| 11671 if ((typeRef instanceof GenericTypeReference)) { |
| 11672 typeRef = typeRef.baseType; |
| 11673 } |
| 11674 return $notnull_bool($ne(typeRef, null)) && $notnull_bool(typeRef.get$isFinal(
)); |
| 11675 } |
| 11669 MethodGenerator.prototype.visitForInStatement = function(node) { | 11676 MethodGenerator.prototype.visitForInStatement = function(node) { |
| 11670 var $0; | 11677 var $0; |
| 11671 var itemType = this.method.resolveType(node.item.type, false); | 11678 var itemType = this.method.resolveType(node.item.type, false); |
| 11672 var itemName = node.item.name.name; | 11679 var itemName = node.item.name.name; |
| 11673 var list = node.list.visit(this); | 11680 var list = node.list.visit(this); |
| 11674 this._pushBlock(true); | 11681 this._pushBlock(true); |
| 11675 var item = this._scope.create($assert_String(itemName), (itemType && itemType.
is$lang_Type()), node.item.name.span, false); | 11682 var isFinal = this._isFinal(node.item.type); |
| 11683 var item = this._scope.create($assert_String(itemName), (itemType && itemType.
is$lang_Type()), node.item.name.span, isFinal, false); |
| 11676 var listVar = (list && list.is$Value()); | 11684 var listVar = (list && list.is$Value()); |
| 11677 if ($notnull_bool(list.needsTemp)) { | 11685 if ($notnull_bool(list.needsTemp)) { |
| 11678 listVar = this._scope.create('\$list', (($0 = list.type) && $0.is$lang_Type(
)), null, false); | 11686 listVar = this._scope.create('\$list', (($0 = list.type) && $0.is$lang_Type(
)), null, false, false); |
| 11679 this.writer.writeln(('var ' + listVar.code + ' = ' + list.code + ';')); | 11687 this.writer.writeln(('var ' + listVar.code + ' = ' + list.code + ';')); |
| 11680 } | 11688 } |
| 11681 if ($notnull_bool(list.type.get$isList())) { | 11689 if ($notnull_bool(list.type.get$isList())) { |
| 11682 var tmpi = this._scope.create('\$i', world.numType, null, false); | 11690 var tmpi = this._scope.create('\$i', world.numType, null, false, false); |
| 11683 this.writer.enterBlock(('for (var ' + tmpi.code + ' = 0;') + ('' + tmpi.code
+ ' < ' + listVar.code + '.length; ' + tmpi.code + '++) {')); | 11691 this.writer.enterBlock(('for (var ' + tmpi.code + ' = 0;') + ('' + tmpi.code
+ ' < ' + listVar.code + '.length; ' + tmpi.code + '++) {')); |
| 11684 var value = listVar.invoke(this, '\$index', node.list, new Arguments(null, [
tmpi]), false); | 11692 var value = listVar.invoke(this, '\$index', node.list, new Arguments(null, [
tmpi]), false); |
| 11685 this.writer.writeln(('var ' + item.code + ' = ' + value.code + ';')); | 11693 this.writer.writeln(('var ' + item.code + ' = ' + value.code + ';')); |
| 11686 } | 11694 } |
| 11687 else { | 11695 else { |
| 11688 this._pushBlock(false); | 11696 this._pushBlock(false); |
| 11689 var iterator = list.invoke$4(this, 'iterator', node.list, Arguments.get$EMPT
Y()); | 11697 var iterator = list.invoke$4(this, 'iterator', node.list, Arguments.get$EMPT
Y()); |
| 11690 var tmpi = this._scope.create('\$i', (($0 = iterator.type) && $0.is$lang_Typ
e()), null, false); | 11698 var tmpi = this._scope.create('\$i', (($0 = iterator.type) && $0.is$lang_Typ
e()), null, false, false); |
| 11691 var hasNext = tmpi.invoke$4(this, 'hasNext', node.list, Arguments.get$EMPTY(
)); | 11699 var hasNext = tmpi.invoke$4(this, 'hasNext', node.list, Arguments.get$EMPTY(
)); |
| 11692 var next = tmpi.invoke$4(this, 'next', node.list, Arguments.get$EMPTY()); | 11700 var next = tmpi.invoke$4(this, 'next', node.list, Arguments.get$EMPTY()); |
| 11693 this.writer.enterBlock(('for (var ' + tmpi.code + ' = ' + iterator.code + ';
' + hasNext.code + '; ) {')); | 11701 this.writer.enterBlock(('for (var ' + tmpi.code + ' = ' + iterator.code + ';
' + hasNext.code + '; ) {')); |
| 11694 this.writer.writeln(('var ' + item.code + ' = ' + next.code + ';')); | 11702 this.writer.writeln(('var ' + item.code + ' = ' + next.code + ';')); |
| 11695 } | 11703 } |
| 11696 this.visitStatementsInBlock(node.body); | 11704 this.visitStatementsInBlock(node.body); |
| 11697 this.writer.exitBlock('}'); | 11705 this.writer.exitBlock('}'); |
| 11698 this._popBlock(); | 11706 this._popBlock(); |
| 11699 return false; | 11707 return false; |
| 11700 } | 11708 } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 11731 this._genToDartException($assert_String(ex.code), node); | 11739 this._genToDartException($assert_String(ex.code), node); |
| 11732 if (!$notnull_bool(ex.type.get$isVarOrObject())) { | 11740 if (!$notnull_bool(ex.type.get$isVarOrObject())) { |
| 11733 var test = ex.instanceOf$3$isTrue$forceCheck(this, ex.type, catch_.get$exc
eption().get$span(), false, true); | 11741 var test = ex.instanceOf$3$isTrue$forceCheck(this, ex.type, catch_.get$exc
eption().get$span(), false, true); |
| 11734 this.writer.writeln(('if (' + test.code + ') throw ' + ex.code + ';')); | 11742 this.writer.writeln(('if (' + test.code + ') throw ' + ex.code + ';')); |
| 11735 } | 11743 } |
| 11736 this.visitStatementsInBlock((($0 = node.catches.$index(0).body) && $0.is$lan
g_Statement())); | 11744 this.visitStatementsInBlock((($0 = node.catches.$index(0).body) && $0.is$lan
g_Statement())); |
| 11737 this._popBlock(); | 11745 this._popBlock(); |
| 11738 } | 11746 } |
| 11739 else if (node.catches.length > 0) { | 11747 else if (node.catches.length > 0) { |
| 11740 this._pushBlock(false); | 11748 this._pushBlock(false); |
| 11741 var ex = this._scope.create('\$ex', world.varType, null, false); | 11749 var ex = this._scope.create('\$ex', world.varType, null, false, false); |
| 11742 this._scope.rethrow = (ex && ex.is$Value()); | 11750 this._scope.rethrow = (ex && ex.is$Value()); |
| 11743 this.writer.nextBlock(('} catch (' + ex.code + ') {')); | 11751 this.writer.nextBlock(('} catch (' + ex.code + ') {')); |
| 11744 var trace = null; | 11752 var trace = null; |
| 11745 if (node.catches.some((function (c) { | 11753 if (node.catches.some((function (c) { |
| 11746 return c.trace != null; | 11754 return c.trace != null; |
| 11747 }) | 11755 }) |
| 11748 )) { | 11756 )) { |
| 11749 trace = this._scope.create('\$trace', world.varType, null, false); | 11757 trace = this._scope.create('\$trace', world.varType, null, false, false); |
| 11750 this.writer.writeln(('var ' + trace.code + ' = \$stackTraceOf(' + ex.code
+ ');')); | 11758 this.writer.writeln(('var ' + trace.code + ' = \$stackTraceOf(' + ex.code
+ ');')); |
| 11751 world.gen.corejs.useStackTraceOf = true; | 11759 world.gen.corejs.useStackTraceOf = true; |
| 11752 } | 11760 } |
| 11753 this._genToDartException($assert_String(ex.code), node); | 11761 this._genToDartException($assert_String(ex.code), node); |
| 11754 var needsRethrow = true; | 11762 var needsRethrow = true; |
| 11755 for (var i = 0; | 11763 for (var i = 0; |
| 11756 i < node.catches.length; i++) { | 11764 i < node.catches.length; i++) { |
| 11757 var catch_ = node.catches.$index(i); | 11765 var catch_ = node.catches.$index(i); |
| 11758 this._pushBlock(false); | 11766 this._pushBlock(false); |
| 11759 var tmp = this._scope.declare((($0 = catch_.get$exception()) && $0.is$Decl
aredIdentifier())); | 11767 var tmp = this._scope.declare((($0 = catch_.get$exception()) && $0.is$Decl
aredIdentifier())); |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12059 right = captureOriginal((right && right.is$Value())); | 12067 right = captureOriginal((right && right.is$Value())); |
| 12060 y = right.invoke$4(this, TokenKind.binaryMethodName(kind), position, n
ew Arguments(null, [y])); | 12068 y = right.invoke$4(this, TokenKind.binaryMethodName(kind), position, n
ew Arguments(null, [y])); |
| 12061 } | 12069 } |
| 12062 return members._set$4(this, position, x, y); | 12070 return members._set$4(this, position, x, y); |
| 12063 } | 12071 } |
| 12064 else { | 12072 else { |
| 12065 x = members._get$3(this, position, x); | 12073 x = members._get$3(this, position, x); |
| 12066 } | 12074 } |
| 12067 } | 12075 } |
| 12068 } | 12076 } |
| 12077 if ($notnull_bool(x.get$isFinal())) { |
| 12078 world.error(('final variable "' + x.code + '" is not assignable'), position.
span); |
| 12079 } |
| 12069 y = y.convertTo$3(this, x.type, yn); | 12080 y = y.convertTo$3(this, x.type, yn); |
| 12070 if (kind == 0) { | 12081 if (kind == 0) { |
| 12071 x = captureOriginal((x && x.is$Value())); | 12082 x = captureOriginal((x && x.is$Value())); |
| 12072 return new Value(y.type, ('' + x.code + ' = ' + y.code + ''), position.span,
true); | 12083 return new Value(y.type, ('' + x.code + ' = ' + y.code + ''), position.span,
true); |
| 12073 } | 12084 } |
| 12074 else if ($notnull_bool(x.type.get$isNum()) && $notnull_bool(y.type.get$isNum()
) && (kind != 46/*TokenKind.TRUNCDIV*/)) { | 12085 else if ($notnull_bool(x.type.get$isNum()) && $notnull_bool(y.type.get$isNum()
) && (kind != 46/*TokenKind.TRUNCDIV*/)) { |
| 12075 x = captureOriginal((x && x.is$Value())); | 12086 x = captureOriginal((x && x.is$Value())); |
| 12076 var op = TokenKind.kindToString(kind); | 12087 var op = TokenKind.kindToString(kind); |
| 12077 return new Value(y.type, ('' + x.code + ' ' + op + '= ' + y.code + ''), posi
tion.span, true); | 12088 return new Value(y.type, ('' + x.code + ' ' + op + '= ' + y.code + ''), posi
tion.span, true); |
| 12078 } | 12089 } |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12199 var $0; | 12210 var $0; |
| 12200 var typeRef = node.type; | 12211 var typeRef = node.type; |
| 12201 var constructorName = ''; | 12212 var constructorName = ''; |
| 12202 if (node.name != null) { | 12213 if (node.name != null) { |
| 12203 constructorName = node.name.name; | 12214 constructorName = node.name.name; |
| 12204 } | 12215 } |
| 12205 if ($notnull_bool($eq(constructorName, '')) && !(typeRef instanceof GenericTyp
eReference) && $notnull_bool($ne(typeRef.names, null))) { | 12216 if ($notnull_bool($eq(constructorName, '')) && !(typeRef instanceof GenericTyp
eReference) && $notnull_bool($ne(typeRef.names, null))) { |
| 12206 var names = ListFactory.ListFactory$from$factory((($0 = typeRef.names) && $0
.is$Iterable())); | 12217 var names = ListFactory.ListFactory$from$factory((($0 = typeRef.names) && $0
.is$Iterable())); |
| 12207 constructorName = names.removeLast$0().get$name(); | 12218 constructorName = names.removeLast$0().get$name(); |
| 12208 if (names.length == 0) names = null; | 12219 if (names.length == 0) names = null; |
| 12209 typeRef = new NameTypeReference(typeRef.isFinal, typeRef.get$name(), names,
typeRef.get$span()); | 12220 typeRef = new NameTypeReference(typeRef.get$isFinal(), typeRef.get$name(), n
ames, typeRef.get$span()); |
| 12210 } | 12221 } |
| 12211 var type = this.method.resolveType((typeRef && typeRef.is$TypeReference()), tr
ue); | 12222 var type = this.method.resolveType((typeRef && typeRef.is$TypeReference()), tr
ue); |
| 12212 if ($notnull_bool(type.get$isTop())) { | 12223 if ($notnull_bool(type.get$isTop())) { |
| 12213 type = type.get$library().findTypeByName($assert_String(constructorName)); | 12224 type = type.get$library().findTypeByName($assert_String(constructorName)); |
| 12214 constructorName = ''; | 12225 constructorName = ''; |
| 12215 } | 12226 } |
| 12216 var m = type.getConstructor$1(constructorName); | 12227 var m = type.getConstructor$1(constructorName); |
| 12217 if ($notnull_bool(m == null)) { | 12228 if ($notnull_bool(m == null)) { |
| 12218 var name = type.get$jsname(); | 12229 var name = type.get$jsname(); |
| 12219 if ($notnull_bool(type.get$isVar())) { | 12230 if ($notnull_bool(type.get$isVar())) { |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12351 } | 12362 } |
| 12352 MethodGenerator.prototype.visitSuperExpression = function(node) { | 12363 MethodGenerator.prototype.visitSuperExpression = function(node) { |
| 12353 return this._makeSuperValue(node); | 12364 return this._makeSuperValue(node); |
| 12354 } | 12365 } |
| 12355 MethodGenerator.prototype.visitNullExpression = function(node) { | 12366 MethodGenerator.prototype.visitNullExpression = function(node) { |
| 12356 return EvaluatedValue.EvaluatedValue$factory(world.varType, null, 'null', null
); | 12367 return EvaluatedValue.EvaluatedValue$factory(world.varType, null, 'null', null
); |
| 12357 } | 12368 } |
| 12358 MethodGenerator.prototype.visitLiteralExpression = function(node) { | 12369 MethodGenerator.prototype.visitLiteralExpression = function(node) { |
| 12359 var $0; | 12370 var $0; |
| 12360 var type = node.type.type; | 12371 var type = node.type.type; |
| 12361 $assert($ne(type, null), "type != null", "gen.dart", 2106, 12); | 12372 $assert($ne(type, null), "type != null", "gen.dart", 2119, 12); |
| 12362 if (!!(($0 = node.value) && $0.is$List)) { | 12373 if (!!(($0 = node.value) && $0.is$List)) { |
| 12363 var items = []; | 12374 var items = []; |
| 12364 var $list = node.value; | 12375 var $list = node.value; |
| 12365 for (var $i = node.value.iterator$0(); $i.hasNext$0(); ) { | 12376 for (var $i = node.value.iterator$0(); $i.hasNext$0(); ) { |
| 12366 var item = $i.next$0(); | 12377 var item = $i.next$0(); |
| 12367 var val = this.visitValue((item && item.is$lang_Expression())); | 12378 var val = this.visitValue((item && item.is$lang_Expression())); |
| 12368 val.invoke$4(this, 'toString', item, Arguments.get$EMPTY()); | 12379 val.invoke$4(this, 'toString', item, Arguments.get$EMPTY()); |
| 12369 var code = val.code; | 12380 var code = val.code; |
| 12370 if ((item instanceof BinaryExpression) || (item instanceof ConditionalExpr
ession)) { | 12381 if ((item instanceof BinaryExpression) || (item instanceof ConditionalExpr
ession)) { |
| 12371 code = ('(' + code + ')'); | 12382 code = ('(' + code + ')'); |
| (...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13206 Member.call(this, name, declaringType); | 13217 Member.call(this, name, declaringType); |
| 13207 } | 13218 } |
| 13208 $inherits(FieldMember, Member); | 13219 $inherits(FieldMember, Member); |
| 13209 FieldMember.prototype.is$FieldMember = function(){return this;}; | 13220 FieldMember.prototype.is$FieldMember = function(){return this;}; |
| 13210 FieldMember.prototype.get$definition = function() { return this.definition; }; | 13221 FieldMember.prototype.get$definition = function() { return this.definition; }; |
| 13211 FieldMember.prototype.get$value = function() { return this.value; }; | 13222 FieldMember.prototype.get$value = function() { return this.value; }; |
| 13212 FieldMember.prototype.get$type = function() { return this.type; }; | 13223 FieldMember.prototype.get$type = function() { return this.type; }; |
| 13213 FieldMember.prototype.set$type = function(value) { return this.type = value; }; | 13224 FieldMember.prototype.set$type = function(value) { return this.type = value; }; |
| 13214 FieldMember.prototype.get$isStatic = function() { return this.isStatic; }; | 13225 FieldMember.prototype.get$isStatic = function() { return this.isStatic; }; |
| 13215 FieldMember.prototype.set$isStatic = function(value) { return this.isStatic = va
lue; }; | 13226 FieldMember.prototype.set$isStatic = function(value) { return this.isStatic = va
lue; }; |
| 13227 FieldMember.prototype.get$isFinal = function() { return this.isFinal; }; |
| 13228 FieldMember.prototype.set$isFinal = function(value) { return this.isFinal = valu
e; }; |
| 13216 FieldMember.prototype.get$isNative = function() { return this.isNative; }; | 13229 FieldMember.prototype.get$isNative = function() { return this.isNative; }; |
| 13217 FieldMember.prototype.set$isNative = function(value) { return this.isNative = va
lue; }; | 13230 FieldMember.prototype.set$isNative = function(value) { return this.isNative = va
lue; }; |
| 13218 FieldMember.prototype.override = function(other) { | 13231 FieldMember.prototype.override = function(other) { |
| 13219 if (!$notnull_bool(Member.prototype.override.call(this, other))) return false; | 13232 if (!$notnull_bool(Member.prototype.override.call(this, other))) return false; |
| 13220 if ($notnull_bool(other.get$isProperty())) { | 13233 if ($notnull_bool(other.get$isProperty())) { |
| 13221 return true; | 13234 return true; |
| 13222 } | 13235 } |
| 13223 else { | 13236 else { |
| 13224 world.error('field can not override anything but property', this.get$span(),
other.get$span()); | 13237 world.error('field can not override anything but property', this.get$span(),
other.get$span()); |
| 13225 return false; | 13238 return false; |
| (...skipping 4808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 18034 // Initializers done | 18047 // Initializers done |
| 18035 lang_Node.call(this, span); | 18048 lang_Node.call(this, span); |
| 18036 } | 18049 } |
| 18037 $inherits(TypeReference, lang_Node); | 18050 $inherits(TypeReference, lang_Node); |
| 18038 TypeReference.prototype.is$TypeReference = function(){return this;}; | 18051 TypeReference.prototype.is$TypeReference = function(){return this;}; |
| 18039 TypeReference.prototype.get$type = function() { return this.type; }; | 18052 TypeReference.prototype.get$type = function() { return this.type; }; |
| 18040 TypeReference.prototype.set$type = function(value) { return this.type = value; }
; | 18053 TypeReference.prototype.set$type = function(value) { return this.type = value; }
; |
| 18041 TypeReference.prototype.visit = function(visitor) { | 18054 TypeReference.prototype.visit = function(visitor) { |
| 18042 return visitor.visitTypeReference(this); | 18055 return visitor.visitTypeReference(this); |
| 18043 } | 18056 } |
| 18057 TypeReference.prototype.get$isFinal = function() { |
| 18058 return false; |
| 18059 } |
| 18044 TypeReference.prototype.visit$1 = function($0) { | 18060 TypeReference.prototype.visit$1 = function($0) { |
| 18045 return this.visit(($0 && $0.is$TreeVisitor())); | 18061 return this.visit(($0 && $0.is$TreeVisitor())); |
| 18046 }; | 18062 }; |
| 18047 // ********** Code for DirectiveDefinition ************** | 18063 // ********** Code for DirectiveDefinition ************** |
| 18048 function DirectiveDefinition(name, arguments, span) { | 18064 function DirectiveDefinition(name, arguments, span) { |
| 18049 this.name = name; | 18065 this.name = name; |
| 18050 this.arguments = arguments; | 18066 this.arguments = arguments; |
| 18051 // Initializers done | 18067 // Initializers done |
| 18052 Definition.call(this, span); | 18068 Definition.call(this, span); |
| 18053 } | 18069 } |
| (...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 18691 // ********** Code for NameTypeReference ************** | 18707 // ********** Code for NameTypeReference ************** |
| 18692 function NameTypeReference(isFinal, name, names, span) { | 18708 function NameTypeReference(isFinal, name, names, span) { |
| 18693 this.isFinal = isFinal; | 18709 this.isFinal = isFinal; |
| 18694 this.name = name; | 18710 this.name = name; |
| 18695 this.names = names; | 18711 this.names = names; |
| 18696 // Initializers done | 18712 // Initializers done |
| 18697 TypeReference.call(this, span); | 18713 TypeReference.call(this, span); |
| 18698 } | 18714 } |
| 18699 $inherits(NameTypeReference, TypeReference); | 18715 $inherits(NameTypeReference, TypeReference); |
| 18700 NameTypeReference.prototype.is$NameTypeReference = function(){return this;}; | 18716 NameTypeReference.prototype.is$NameTypeReference = function(){return this;}; |
| 18717 NameTypeReference.prototype.get$isFinal = function() { return this.isFinal; }; |
| 18718 NameTypeReference.prototype.set$isFinal = function(value) { return this.isFinal
= value; }; |
| 18701 NameTypeReference.prototype.get$name = function() { return this.name; }; | 18719 NameTypeReference.prototype.get$name = function() { return this.name; }; |
| 18702 NameTypeReference.prototype.set$name = function(value) { return this.name = valu
e; }; | 18720 NameTypeReference.prototype.set$name = function(value) { return this.name = valu
e; }; |
| 18703 NameTypeReference.prototype.visit = function(visitor) { | 18721 NameTypeReference.prototype.visit = function(visitor) { |
| 18704 return visitor.visitNameTypeReference(this); | 18722 return visitor.visitNameTypeReference(this); |
| 18705 } | 18723 } |
| 18706 NameTypeReference.prototype.visit$1 = function($0) { | 18724 NameTypeReference.prototype.visit$1 = function($0) { |
| 18707 return this.visit(($0 && $0.is$TreeVisitor())); | 18725 return this.visit(($0 && $0.is$TreeVisitor())); |
| 18708 }; | 18726 }; |
| 18709 // ********** Code for GenericTypeReference ************** | 18727 // ********** Code for GenericTypeReference ************** |
| 18710 function GenericTypeReference(baseType, typeArguments, depth, span) { | 18728 function GenericTypeReference(baseType, typeArguments, depth, span) { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 18724 }; | 18742 }; |
| 18725 // ********** Code for FunctionTypeReference ************** | 18743 // ********** Code for FunctionTypeReference ************** |
| 18726 function FunctionTypeReference(isFinal, func, span) { | 18744 function FunctionTypeReference(isFinal, func, span) { |
| 18727 this.isFinal = isFinal; | 18745 this.isFinal = isFinal; |
| 18728 this.func = func; | 18746 this.func = func; |
| 18729 // Initializers done | 18747 // Initializers done |
| 18730 TypeReference.call(this, span); | 18748 TypeReference.call(this, span); |
| 18731 } | 18749 } |
| 18732 $inherits(FunctionTypeReference, TypeReference); | 18750 $inherits(FunctionTypeReference, TypeReference); |
| 18733 FunctionTypeReference.prototype.is$FunctionTypeReference = function(){return thi
s;}; | 18751 FunctionTypeReference.prototype.is$FunctionTypeReference = function(){return thi
s;}; |
| 18752 FunctionTypeReference.prototype.get$isFinal = function() { return this.isFinal;
}; |
| 18753 FunctionTypeReference.prototype.set$isFinal = function(value) { return this.isFi
nal = value; }; |
| 18734 FunctionTypeReference.prototype.visit = function(visitor) { | 18754 FunctionTypeReference.prototype.visit = function(visitor) { |
| 18735 return visitor.visitFunctionTypeReference(this); | 18755 return visitor.visitFunctionTypeReference(this); |
| 18736 } | 18756 } |
| 18737 FunctionTypeReference.prototype.visit$1 = function($0) { | 18757 FunctionTypeReference.prototype.visit$1 = function($0) { |
| 18738 return this.visit(($0 && $0.is$TreeVisitor())); | 18758 return this.visit(($0 && $0.is$TreeVisitor())); |
| 18739 }; | 18759 }; |
| 18740 // ********** Code for ArgumentNode ************** | 18760 // ********** Code for ArgumentNode ************** |
| 18741 function ArgumentNode(label, value, span) { | 18761 function ArgumentNode(label, value, span) { |
| 18742 this.label = label; | 18762 this.label = label; |
| 18743 this.value = value; | 18763 this.value = value; |
| (...skipping 1458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 20202 this.value = value; | 20222 this.value = value; |
| 20203 this.length = length; | 20223 this.length = length; |
| 20204 // Initializers done | 20224 // Initializers done |
| 20205 } | 20225 } |
| 20206 $inherits(FixedIterator$E, FixedIterator); | 20226 $inherits(FixedIterator$E, FixedIterator); |
| 20207 FixedIterator$E.prototype.is$Iterator$T = function(){return this;}; | 20227 FixedIterator$E.prototype.is$Iterator$T = function(){return this;}; |
| 20208 // ********** Code for Value ************** | 20228 // ********** Code for Value ************** |
| 20209 function Value(type, code, span, needsTemp) { | 20229 function Value(type, code, span, needsTemp) { |
| 20210 this.isSuper = false | 20230 this.isSuper = false |
| 20211 this.isType = false | 20231 this.isType = false |
| 20232 this.isFinal = false |
| 20212 this.type = type; | 20233 this.type = type; |
| 20213 this.code = code; | 20234 this.code = code; |
| 20214 this.span = span; | 20235 this.span = span; |
| 20215 this.needsTemp = needsTemp; | 20236 this.needsTemp = needsTemp; |
| 20216 // Initializers done | 20237 // Initializers done |
| 20217 if (this.type == null) world.internalError('type passed as null', this.span); | 20238 if (this.type == null) world.internalError('type passed as null', this.span); |
| 20218 } | 20239 } |
| 20219 Value.prototype.is$Value = function(){return this;}; | 20240 Value.prototype.is$Value = function(){return this;}; |
| 20220 Value.prototype.get$type = function() { return this.type; }; | 20241 Value.prototype.get$type = function() { return this.type; }; |
| 20221 Value.prototype.set$type = function(value) { return this.type = value; }; | 20242 Value.prototype.set$type = function(value) { return this.type = value; }; |
| 20222 Value.prototype.get$span = function() { return this.span; }; | 20243 Value.prototype.get$span = function() { return this.span; }; |
| 20223 Value.prototype.set$span = function(value) { return this.span = value; }; | 20244 Value.prototype.set$span = function(value) { return this.span = value; }; |
| 20245 Value.prototype.get$isFinal = function() { return this.isFinal; }; |
| 20246 Value.prototype.set$isFinal = function(value) { return this.isFinal = value; }; |
| 20224 Value.prototype.get$_typeIsVarOrParameterType = function() { | 20247 Value.prototype.get$_typeIsVarOrParameterType = function() { |
| 20225 return $notnull_bool(this.type.get$isVar()) || (this.type instanceof Parameter
Type); | 20248 return $notnull_bool(this.type.get$isVar()) || (this.type instanceof Parameter
Type); |
| 20226 } | 20249 } |
| 20227 Value.prototype.get$isConst = function() { | 20250 Value.prototype.get$isConst = function() { |
| 20228 return false; | 20251 return false; |
| 20229 } | 20252 } |
| 20230 Value.prototype.get$canonicalCode = function() { | 20253 Value.prototype.get$canonicalCode = function() { |
| 20231 return null; | 20254 return null; |
| 20232 } | 20255 } |
| 20233 Value.prototype.get_ = function(context, name, node) { | 20256 Value.prototype.get_ = function(context, name, node) { |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 20495 for (var i = 0; | 20518 for (var i = 0; |
| 20496 i < args.get$length(); i++) { | 20519 i < args.get$length(); i++) { |
| 20497 argsCode.add$1(args.values.$index(i).code); | 20520 argsCode.add$1(args.values.$index(i).code); |
| 20498 } | 20521 } |
| 20499 pos = Strings.join((argsCode && argsCode.is$List$String()), ", "); | 20522 pos = Strings.join((argsCode && argsCode.is$List$String()), ", "); |
| 20500 } | 20523 } |
| 20501 var noSuchArgs = [new Value(world.stringType, ('"' + name + '"'), node.span, t
rue), new Value(world.listType, ('[' + pos + ']'), node.span, true)]; | 20524 var noSuchArgs = [new Value(world.stringType, ('"' + name + '"'), node.span, t
rue), new Value(world.listType, ('[' + pos + ']'), node.span, true)]; |
| 20502 return this._resolveMember(context, 'noSuchMethod', node, false).invoke$4(cont
ext, node, this, new Arguments(null, noSuchArgs)); | 20525 return this._resolveMember(context, 'noSuchMethod', node, false).invoke$4(cont
ext, node, this, new Arguments(null, noSuchArgs)); |
| 20503 } | 20526 } |
| 20504 Value.prototype.invokeSpecial = function(name, args, returnType) { | 20527 Value.prototype.invokeSpecial = function(name, args, returnType) { |
| 20505 $assert(name.startsWith('\$'), "name.startsWith('\\$')", "value.dart", 480, 12
); | 20528 $assert(name.startsWith('\$'), "name.startsWith('\\$')", "value.dart", 483, 12
); |
| 20506 $assert(!$notnull_bool(args.get$hasNames()), "!args.hasNames", "value.dart", 4
81, 12); | 20529 $assert(!$notnull_bool(args.get$hasNames()), "!args.hasNames", "value.dart", 4
84, 12); |
| 20507 var argsString = args.getCode(); | 20530 var argsString = args.getCode(); |
| 20508 if (name == '\$index' || name == '\$setindex') { | 20531 if (name == '\$index' || name == '\$setindex') { |
| 20509 return new Value(returnType, ('' + this.code + '.' + name + '(' + argsString
+ ')'), this.span, true); | 20532 return new Value(returnType, ('' + this.code + '.' + name + '(' + argsString
+ ')'), this.span, true); |
| 20510 } | 20533 } |
| 20511 else { | 20534 else { |
| 20512 if (argsString.length > 0) argsString = (', ' + argsString + ''); | 20535 if (argsString.length > 0) argsString = (', ' + argsString + ''); |
| 20513 world.gen.corejs.useOperator(name); | 20536 world.gen.corejs.useOperator(name); |
| 20514 return new Value(returnType, ('' + name + '(' + this.code + '' + argsString
+ ')'), this.span, true); | 20537 return new Value(returnType, ('' + name + '(' + this.code + '' + argsString
+ ')'), this.span, true); |
| 20515 } | 20538 } |
| 20516 } | 20539 } |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 20631 this.dependencies = dependencies; | 20654 this.dependencies = dependencies; |
| 20632 // Initializers done | 20655 // Initializers done |
| 20633 Value.call(this, type, code, span, !$notnull_bool(isConst)); | 20656 Value.call(this, type, code, span, !$notnull_bool(isConst)); |
| 20634 } | 20657 } |
| 20635 $inherits(GlobalValue, Value); | 20658 $inherits(GlobalValue, Value); |
| 20636 GlobalValue.prototype.is$GlobalValue = function(){return this;}; | 20659 GlobalValue.prototype.is$GlobalValue = function(){return this;}; |
| 20637 GlobalValue.prototype.is$Comparable = function(){return this;}; | 20660 GlobalValue.prototype.is$Comparable = function(){return this;}; |
| 20638 GlobalValue.GlobalValue$fromStatic$factory = function(field, exp, dependencies)
{ | 20661 GlobalValue.GlobalValue$fromStatic$factory = function(field, exp, dependencies)
{ |
| 20639 var code = ($notnull_bool(exp.get$isConst()) ? exp.get$canonicalCode() : exp.c
ode); | 20662 var code = ($notnull_bool(exp.get$isConst()) ? exp.get$canonicalCode() : exp.c
ode); |
| 20640 var codeWithComment = ('' + code + '/*' + field.declaringType.name + '.' + fie
ld.get$name() + '*/'); | 20663 var codeWithComment = ('' + code + '/*' + field.declaringType.name + '.' + fie
ld.get$name() + '*/'); |
| 20641 return new GlobalValue(exp.type, $assert_String(codeWithComment), field.isFina
l, field, null, exp, code, exp.span, dependencies.filter$1((function (d) { | 20664 return new GlobalValue(exp.type, $assert_String(codeWithComment), field.get$is
Final(), field, null, exp, code, exp.span, dependencies.filter$1((function (d) { |
| 20642 return (d instanceof GlobalValue); | 20665 return (d instanceof GlobalValue); |
| 20643 }) | 20666 }) |
| 20644 )); | 20667 )); |
| 20645 } | 20668 } |
| 20646 GlobalValue.GlobalValue$fromConst$factory = function(uniqueId, exp, dependencies
) { | 20669 GlobalValue.GlobalValue$fromConst$factory = function(uniqueId, exp, dependencies
) { |
| 20647 var name = ("const\$" + uniqueId + ""); | 20670 var name = ("const\$" + uniqueId + ""); |
| 20648 var codeWithComment = ("" + name + "/*" + exp.span.get$text() + "*/"); | 20671 var codeWithComment = ("" + name + "/*" + exp.span.get$text() + "*/"); |
| 20649 return new GlobalValue(exp.type, $assert_String(codeWithComment), true, null,
name, exp, name, exp.span, dependencies.filter$1((function (d) { | 20672 return new GlobalValue(exp.type, $assert_String(codeWithComment), true, null,
name, exp, name, exp.span, dependencies.filter$1((function (d) { |
| 20650 return (d instanceof GlobalValue); | 20673 return (d instanceof GlobalValue); |
| 20651 }) | 20674 }) |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 20695 }; | 20718 }; |
| 20696 // ********** Code for BareValue ************** | 20719 // ********** Code for BareValue ************** |
| 20697 function BareValue(home, outermost, span) { | 20720 function BareValue(home, outermost, span) { |
| 20698 this.home = home; | 20721 this.home = home; |
| 20699 // Initializers done | 20722 // Initializers done |
| 20700 Value.call(this, outermost.method.declaringType, null, span, false); | 20723 Value.call(this, outermost.method.declaringType, null, span, false); |
| 20701 this.isType = outermost.get$isStatic(); | 20724 this.isType = outermost.get$isStatic(); |
| 20702 } | 20725 } |
| 20703 $inherits(BareValue, Value); | 20726 $inherits(BareValue, Value); |
| 20704 BareValue.prototype._tryResolveMember = function(context, name) { | 20727 BareValue.prototype._tryResolveMember = function(context, name) { |
| 20705 $assert($eq(context, this.home), "context == home", "value.dart", 685, 12); | 20728 $assert($eq(context, this.home), "context == home", "value.dart", 688, 12); |
| 20706 var member = this.type.resolveMember(name); | 20729 var member = this.type.resolveMember(name); |
| 20707 if ($notnull_bool($ne(member, null))) { | 20730 if ($notnull_bool($ne(member, null))) { |
| 20708 $assert(this.code == null, "code == null", "value.dart", 690, 14); | 20731 $assert(this.code == null, "code == null", "value.dart", 693, 14); |
| 20709 if ($notnull_bool(this.isType)) { | 20732 if ($notnull_bool(this.isType)) { |
| 20710 this.code = this.type.get$jsname(); | 20733 this.code = this.type.get$jsname(); |
| 20711 } | 20734 } |
| 20712 else { | 20735 else { |
| 20713 this.code = this.home._makeThisCode(); | 20736 this.code = this.home._makeThisCode(); |
| 20714 } | 20737 } |
| 20715 return member; | 20738 return member; |
| 20716 } | 20739 } |
| 20717 member = this.home.get$library().lookup(name, this.span); | 20740 member = this.home.get$library().lookup(name, this.span); |
| 20718 if ($notnull_bool($ne(member, null))) { | 20741 if ($notnull_bool($ne(member, null))) { |
| (...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 21801 INTERFACE, | 21824 INTERFACE, |
| 21802 LIBRARY, | 21825 LIBRARY, |
| 21803 NATIVE, | 21826 NATIVE, |
| 21804 NEGATE, | 21827 NEGATE, |
| 21805 OPERATOR, | 21828 OPERATOR, |
| 21806 SET, | 21829 SET, |
| 21807 SOURCE, | 21830 SOURCE, |
| 21808 STATIC, | 21831 STATIC, |
| 21809 TYPEDEF ]*/; | 21832 TYPEDEF ]*/; |
| 21810 main(); | 21833 main(); |
| OLD | NEW |