| 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 function $throw(e) { | 4 function $throw(e) { |
| 5 // If e is not a value, we can use V8's captureStackTrace utility method. | 5 // If e is not a value, we can use V8's captureStackTrace utility method. |
| 6 // TODO(jmesserly): capture the stack trace on other JS engines. | 6 // TODO(jmesserly): capture the stack trace on other JS engines. |
| 7 if (e && (typeof e == 'object') && Error.captureStackTrace) { | 7 if (e && (typeof e == 'object') && Error.captureStackTrace) { |
| 8 // TODO(jmesserly): this will clobber the e.stack property | 8 // TODO(jmesserly): this will clobber the e.stack property |
| 9 Error.captureStackTrace(e, $throw); | 9 Error.captureStackTrace(e, $throw); |
| 10 } | 10 } |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 }, enumerable: false, configurable: true }); | 289 }, enumerable: false, configurable: true }); |
| 290 Object.defineProperty(Object.prototype, "removeLast$0", { value: function() { | 290 Object.defineProperty(Object.prototype, "removeLast$0", { value: function() { |
| 291 return this.noSuchMethod("removeLast", []); | 291 return this.noSuchMethod("removeLast", []); |
| 292 }, enumerable: false, configurable: true }); | 292 }, enumerable: false, configurable: true }); |
| 293 Object.defineProperty(Object.prototype, "replaceFirst$2", { value: function($0,
$1) { | 293 Object.defineProperty(Object.prototype, "replaceFirst$2", { value: function($0,
$1) { |
| 294 return this.noSuchMethod("replaceFirst", [$0, $1]); | 294 return this.noSuchMethod("replaceFirst", [$0, $1]); |
| 295 }, enumerable: false, configurable: true }); | 295 }, enumerable: false, configurable: true }); |
| 296 Object.defineProperty(Object.prototype, "resolve$0", { value: function() { | 296 Object.defineProperty(Object.prototype, "resolve$0", { value: function() { |
| 297 return this.noSuchMethod("resolve", []); | 297 return this.noSuchMethod("resolve", []); |
| 298 }, enumerable: false, configurable: true }); | 298 }, enumerable: false, configurable: true }); |
| 299 Object.defineProperty(Object.prototype, "resolveType$2", { value: function($0, $
1) { |
| 300 return this.noSuchMethod("resolveType", [$0, $1]); |
| 301 }, enumerable: false, configurable: true }); |
| 299 Object.defineProperty(Object.prototype, "resolveTypeParams$1", { value: function
($0) { | 302 Object.defineProperty(Object.prototype, "resolveTypeParams$1", { value: function
($0) { |
| 300 return this.noSuchMethod("resolveTypeParams", [$0]); | 303 return this.noSuchMethod("resolveTypeParams", [$0]); |
| 301 }, enumerable: false, configurable: true }); | 304 }, enumerable: false, configurable: true }); |
| 302 Object.defineProperty(Object.prototype, "setDefinition$1", { value: function($0)
{ | 305 Object.defineProperty(Object.prototype, "setDefinition$1", { value: function($0)
{ |
| 303 return this.noSuchMethod("setDefinition", [$0]); | 306 return this.noSuchMethod("setDefinition", [$0]); |
| 304 }, enumerable: false, configurable: true }); | 307 }, enumerable: false, configurable: true }); |
| 305 Object.defineProperty(Object.prototype, "set_$4", { value: function($0, $1, $2,
$3) { | 308 Object.defineProperty(Object.prototype, "set_$4", { value: function($0, $1, $2,
$3) { |
| 306 return this.noSuchMethod("set_", [$0, $1, $2, $3]); | 309 return this.noSuchMethod("set_", [$0, $1, $2, $3]); |
| 307 }, enumerable: false, configurable: true }); | 310 }, enumerable: false, configurable: true }); |
| 308 Object.defineProperty(Object.prototype, "some$1", { value: function($0) { | 311 Object.defineProperty(Object.prototype, "some$1", { value: function($0) { |
| (...skipping 1996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2305 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 2308 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 2306 var tp = $$list.$index($$i); | 2309 var tp = $$list.$index($$i); |
| 2307 if ($eq(tp.get$name(), name)) { | 2310 if ($eq(tp.get$name(), name)) { |
| 2308 typeRef.type = tp; | 2311 typeRef.type = tp; |
| 2309 } | 2312 } |
| 2310 } | 2313 } |
| 2311 } | 2314 } |
| 2312 if (typeRef.type != null) { | 2315 if (typeRef.type != null) { |
| 2313 return typeRef.type; | 2316 return typeRef.type; |
| 2314 } | 2317 } |
| 2315 return this.get$enclosingElement().resolveType(node, typeErrors); | 2318 return this.get$enclosingElement().resolveType$2(node, typeErrors); |
| 2316 } | 2319 } |
| 2317 else if ((node instanceof GenericTypeReference)) { | 2320 else if ((node instanceof GenericTypeReference)) { |
| 2318 var typeRef = node; | 2321 var typeRef = node; |
| 2319 var baseType = this.resolveType(typeRef.baseType, typeErrors); | 2322 var baseType = this.resolveType$2(typeRef.baseType, typeErrors); |
| 2320 if (!baseType.get$isGeneric()) { | 2323 if (!baseType.get$isGeneric()) { |
| 2321 $globals.world.error(("" + baseType.get$name() + " is not generic"), typeR
ef.span); | 2324 $globals.world.error(("" + baseType.get$name() + " is not generic"), typeR
ef.span); |
| 2322 return null; | 2325 return null; |
| 2323 } | 2326 } |
| 2324 if (typeRef.typeArguments.get$length() != baseType.get$typeParameters().get$
length()) { | 2327 if (typeRef.typeArguments.get$length() != baseType.get$typeParameters().get$
length()) { |
| 2325 $globals.world.error("wrong number of type arguments", typeRef.span); | 2328 $globals.world.error("wrong number of type arguments", typeRef.span); |
| 2326 return null; | 2329 return null; |
| 2327 } | 2330 } |
| 2328 var typeArgs = []; | 2331 var typeArgs = []; |
| 2329 for (var i = (0); | 2332 for (var i = (0); |
| 2330 i < typeRef.typeArguments.get$length(); i++) { | 2333 i < typeRef.typeArguments.get$length(); i++) { |
| 2331 typeArgs.add$1(this.resolveType(typeRef.typeArguments.$index(i), typeError
s)); | 2334 typeArgs.add$1(this.resolveType$2(typeRef.typeArguments.$index(i), typeErr
ors)); |
| 2332 } | 2335 } |
| 2333 typeRef.type = baseType.getOrMakeConcreteType$1(typeArgs); | 2336 typeRef.type = baseType.getOrMakeConcreteType$1(typeArgs); |
| 2334 } | 2337 } |
| 2335 else if ((node instanceof FunctionTypeReference)) { | 2338 else if ((node instanceof FunctionTypeReference)) { |
| 2336 var typeRef = node; | 2339 var typeRef = node; |
| 2337 var name = ""; | 2340 var name = ""; |
| 2338 if (typeRef.func.name != null) { | 2341 if (typeRef.func.name != null) { |
| 2339 name = typeRef.func.name.name; | 2342 name = typeRef.func.name.name; |
| 2340 } | 2343 } |
| 2341 typeRef.type = this.get$library().getOrAddFunctionType(this, name, typeRef.f
unc); | 2344 typeRef.type = this.get$library().getOrAddFunctionType(this, name, typeRef.f
unc); |
| 2342 } | 2345 } |
| 2343 else { | 2346 else { |
| 2344 $globals.world.internalError("unknown type reference", node.span); | 2347 $globals.world.internalError("unknown type reference", node.span); |
| 2345 } | 2348 } |
| 2346 return node.type; | 2349 return node.type; |
| 2347 } | 2350 } |
| 2348 Element.prototype.hashCode$0 = Element.prototype.hashCode; | 2351 Element.prototype.hashCode$0 = Element.prototype.hashCode; |
| 2349 Element.prototype.resolve$0 = Element.prototype.resolve; | 2352 Element.prototype.resolve$0 = Element.prototype.resolve; |
| 2353 Element.prototype.resolveType$2 = Element.prototype.resolveType; |
| 2350 // ********** Code for WorldGenerator ************** | 2354 // ********** Code for WorldGenerator ************** |
| 2351 function WorldGenerator(main, writer) { | 2355 function WorldGenerator(main, writer) { |
| 2352 this.main = main; | 2356 this.main = main; |
| 2353 this.hasStatics = false; | 2357 this.hasStatics = false; |
| 2354 this.corejs = new CoreJs(); | 2358 this.corejs = new CoreJs(); |
| 2355 this.globals = new HashMapImplementation(); | 2359 this.globals = new HashMapImplementation(); |
| 2356 this.writer = writer; | 2360 this.writer = writer; |
| 2357 } | 2361 } |
| 2358 WorldGenerator.prototype.run = function() { | 2362 WorldGenerator.prototype.run = function() { |
| 2359 var metaGen = new MethodGenerator(this.main, null); | 2363 var metaGen = new MethodGenerator(this.main, null); |
| (...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2986 var ret = new Value(type, jsName, span, false); | 2990 var ret = new Value(type, jsName, span, false); |
| 2987 ret.set$isFinal(isFinal); | 2991 ret.set$isFinal(isFinal); |
| 2988 this._vars.$setindex(name, ret); | 2992 this._vars.$setindex(name, ret); |
| 2989 if (name != jsName) this._jsNames.add(jsName); | 2993 if (name != jsName) this._jsNames.add(jsName); |
| 2990 return ret; | 2994 return ret; |
| 2991 } | 2995 } |
| 2992 BlockScope.prototype.declareParameter = function(p) { | 2996 BlockScope.prototype.declareParameter = function(p) { |
| 2993 return this.create(p.name, p.type, p.definition.span, false, true); | 2997 return this.create(p.name, p.type, p.definition.span, false, true); |
| 2994 } | 2998 } |
| 2995 BlockScope.prototype.declare = function(id) { | 2999 BlockScope.prototype.declare = function(id) { |
| 2996 var type = this.enclosingMethod.method.resolveType(id.type, false); | 3000 var type = this.enclosingMethod.method.resolveType$2(id.type, false); |
| 2997 return this.create(id.name.name, type, id.span, false, false); | 3001 return this.create(id.name.name, type, id.span, false, false); |
| 2998 } | 3002 } |
| 2999 BlockScope.prototype.getRethrow = function() { | 3003 BlockScope.prototype.getRethrow = function() { |
| 3000 var scope = this; | 3004 var scope = this; |
| 3001 while (scope.get$rethrow() == null && scope.get$parent() != null) { | 3005 while (scope.get$rethrow() == null && scope.get$parent() != null) { |
| 3002 scope = scope.get$parent(); | 3006 scope = scope.get$parent(); |
| 3003 } | 3007 } |
| 3004 return scope.get$rethrow(); | 3008 return scope.get$rethrow(); |
| 3005 } | 3009 } |
| 3006 // ********** Code for MethodGenerator ************** | 3010 // ********** Code for MethodGenerator ************** |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3467 var parser = new Parser(node.span.file, false, false, false, node.span.start); | 3471 var parser = new Parser(node.span.file, false, false, false, node.span.start); |
| 3468 this.visitStatementsInBlock(parser.block$0()); | 3472 this.visitStatementsInBlock(parser.block$0()); |
| 3469 return false; | 3473 return false; |
| 3470 } | 3474 } |
| 3471 MethodGenerator.prototype.visitVariableDefinition = function(node) { | 3475 MethodGenerator.prototype.visitVariableDefinition = function(node) { |
| 3472 var isFinal = false; | 3476 var isFinal = false; |
| 3473 if (node.modifiers != null && $eq(node.modifiers.$index((0)).get$kind(), (99))
) { | 3477 if (node.modifiers != null && $eq(node.modifiers.$index((0)).get$kind(), (99))
) { |
| 3474 isFinal = true; | 3478 isFinal = true; |
| 3475 } | 3479 } |
| 3476 this.writer.write("var "); | 3480 this.writer.write("var "); |
| 3477 var type = this.method.resolveType(node.type, false); | 3481 var type = this.method.resolveType$2(node.type, false); |
| 3478 for (var i = (0); | 3482 for (var i = (0); |
| 3479 i < node.names.get$length(); i++) { | 3483 i < node.names.get$length(); i++) { |
| 3480 var thisType = type; | 3484 var thisType = type; |
| 3481 if (i > (0)) { | 3485 if (i > (0)) { |
| 3482 this.writer.write(", "); | 3486 this.writer.write(", "); |
| 3483 } | 3487 } |
| 3484 var name = node.names.$index(i).get$name(); | 3488 var name = node.names.$index(i).get$name(); |
| 3485 var value = this.visitValue(node.values.$index(i)); | 3489 var value = this.visitValue(node.values.$index(i)); |
| 3486 if (isFinal) { | 3490 if (isFinal) { |
| 3487 if (value == null) { | 3491 if (value == null) { |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3635 this._popBlock(); | 3639 this._popBlock(); |
| 3636 return false; | 3640 return false; |
| 3637 } | 3641 } |
| 3638 MethodGenerator.prototype._isFinal = function(typeRef) { | 3642 MethodGenerator.prototype._isFinal = function(typeRef) { |
| 3639 if ((typeRef instanceof GenericTypeReference)) { | 3643 if ((typeRef instanceof GenericTypeReference)) { |
| 3640 typeRef = typeRef.get$baseType(); | 3644 typeRef = typeRef.get$baseType(); |
| 3641 } | 3645 } |
| 3642 return typeRef != null && typeRef.get$isFinal(); | 3646 return typeRef != null && typeRef.get$isFinal(); |
| 3643 } | 3647 } |
| 3644 MethodGenerator.prototype.visitForInStatement = function(node) { | 3648 MethodGenerator.prototype.visitForInStatement = function(node) { |
| 3645 var itemType = this.method.resolveType(node.item.type, false); | 3649 var itemType = this.method.resolveType$2(node.item.type, false); |
| 3646 var itemName = node.item.name.name; | 3650 var itemName = node.item.name.name; |
| 3647 var list = node.list.visit(this); | 3651 var list = node.list.visit(this); |
| 3648 this._pushBlock(true); | 3652 this._pushBlock(true); |
| 3649 var isFinal = this._isFinal(node.item.type); | 3653 var isFinal = this._isFinal(node.item.type); |
| 3650 var item = this._scope.create(itemName, itemType, node.item.name.span, isFinal
, false); | 3654 var item = this._scope.create(itemName, itemType, node.item.name.span, isFinal
, false); |
| 3651 if (list.get$needsTemp()) { | 3655 if (list.get$needsTemp()) { |
| 3652 var listVar = this._scope.create("$list", list.get$type(), null, false, fals
e); | 3656 var listVar = this._scope.create("$list", list.get$type(), null, false, fals
e); |
| 3653 this.writer.writeln(("var " + listVar.get$code() + " = " + list.get$code() +
";")); | 3657 this.writer.writeln(("var " + listVar.get$code() + " = " + list.get$code() +
";")); |
| 3654 list = listVar; | 3658 list = listVar; |
| 3655 } | 3659 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 3682 this.writer.writeln(("var " + trace.get$code() + " = " + result.get$code() + "
;")); | 3686 this.writer.writeln(("var " + trace.get$code() + " = " + result.get$code() + "
;")); |
| 3683 } | 3687 } |
| 3684 MethodGenerator.prototype.visitTryStatement = function(node) { | 3688 MethodGenerator.prototype.visitTryStatement = function(node) { |
| 3685 this.writer.enterBlock("try {"); | 3689 this.writer.enterBlock("try {"); |
| 3686 this._pushBlock(false); | 3690 this._pushBlock(false); |
| 3687 this.visitStatementsInBlock(node.body); | 3691 this.visitStatementsInBlock(node.body); |
| 3688 this._popBlock(); | 3692 this._popBlock(); |
| 3689 if (node.catches.get$length() == (1)) { | 3693 if (node.catches.get$length() == (1)) { |
| 3690 var catch_ = node.catches.$index((0)); | 3694 var catch_ = node.catches.$index((0)); |
| 3691 this._pushBlock(false); | 3695 this._pushBlock(false); |
| 3692 var exType = this.method.resolveType(catch_.get$exception().get$type(), fals
e); | 3696 var exType = this.method.resolveType$2(catch_.get$exception().get$type(), fa
lse); |
| 3693 var ex = this._scope.declare(catch_.get$exception()); | 3697 var ex = this._scope.declare(catch_.get$exception()); |
| 3694 this._scope.rethrow = ex; | 3698 this._scope.rethrow = ex; |
| 3695 this.writer.nextBlock(("} catch (" + ex.get$code() + ") {")); | 3699 this.writer.nextBlock(("} catch (" + ex.get$code() + ") {")); |
| 3696 if (catch_.get$trace() != null) { | 3700 if (catch_.get$trace() != null) { |
| 3697 var trace = this._scope.declare(catch_.get$trace()); | 3701 var trace = this._scope.declare(catch_.get$trace()); |
| 3698 this._genStackTraceOf(trace, ex); | 3702 this._genStackTraceOf(trace, ex); |
| 3699 } | 3703 } |
| 3700 this._genToDartException(ex); | 3704 this._genToDartException(ex); |
| 3701 if (!exType.get$isVarOrObject()) { | 3705 if (!exType.get$isVarOrObject()) { |
| 3702 var test = ex.instanceOf$3$isTrue$forceCheck(this, exType, catch_.get$exce
ption().get$span(), false, true); | 3706 var test = ex.instanceOf$3$isTrue$forceCheck(this, exType, catch_.get$exce
ption().get$span(), false, true); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 3717 )) { | 3721 )) { |
| 3718 trace = this._scope.create("$trace", $globals.world.varType, null, false,
false); | 3722 trace = this._scope.create("$trace", $globals.world.varType, null, false,
false); |
| 3719 this._genStackTraceOf(trace, ex); | 3723 this._genStackTraceOf(trace, ex); |
| 3720 } | 3724 } |
| 3721 this._genToDartException(ex); | 3725 this._genToDartException(ex); |
| 3722 var needsRethrow = true; | 3726 var needsRethrow = true; |
| 3723 for (var i = (0); | 3727 for (var i = (0); |
| 3724 i < node.catches.get$length(); i++) { | 3728 i < node.catches.get$length(); i++) { |
| 3725 var catch_ = node.catches.$index(i); | 3729 var catch_ = node.catches.$index(i); |
| 3726 this._pushBlock(false); | 3730 this._pushBlock(false); |
| 3727 var tmpType = this.method.resolveType(catch_.get$exception().get$type(), f
alse); | 3731 var tmpType = this.method.resolveType$2(catch_.get$exception().get$type(),
false); |
| 3728 var tmp = this._scope.declare(catch_.get$exception()); | 3732 var tmp = this._scope.declare(catch_.get$exception()); |
| 3729 if (!tmpType.get$isVarOrObject()) { | 3733 if (!tmpType.get$isVarOrObject()) { |
| 3730 var test = ex.instanceOf$3$isTrue$forceCheck(this, tmpType, catch_.get$e
xception().get$span(), true, true); | 3734 var test = ex.instanceOf$3$isTrue$forceCheck(this, tmpType, catch_.get$e
xception().get$span(), true, true); |
| 3731 if (i == (0)) { | 3735 if (i == (0)) { |
| 3732 this.writer.enterBlock(("if (" + test.get$code() + ") {")); | 3736 this.writer.enterBlock(("if (" + test.get$code() + ") {")); |
| 3733 } | 3737 } |
| 3734 else { | 3738 else { |
| 3735 this.writer.nextBlock(("} else if (" + test.get$code() + ") {")); | 3739 this.writer.nextBlock(("} else if (" + test.get$code() + ") {")); |
| 3736 } | 3740 } |
| 3737 } | 3741 } |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4143 var constructorName = ""; | 4147 var constructorName = ""; |
| 4144 if (node.name != null) { | 4148 if (node.name != null) { |
| 4145 constructorName = node.name.name; | 4149 constructorName = node.name.name; |
| 4146 } | 4150 } |
| 4147 if ($eq(constructorName, "") && !(typeRef instanceof GenericTypeReference) &&
typeRef.get$names() != null) { | 4151 if ($eq(constructorName, "") && !(typeRef instanceof GenericTypeReference) &&
typeRef.get$names() != null) { |
| 4148 var names = ListFactory.ListFactory$from$factory(typeRef.get$names()); | 4152 var names = ListFactory.ListFactory$from$factory(typeRef.get$names()); |
| 4149 constructorName = names.removeLast$0().get$name(); | 4153 constructorName = names.removeLast$0().get$name(); |
| 4150 if ($eq(names.get$length(), (0))) names = null; | 4154 if ($eq(names.get$length(), (0))) names = null; |
| 4151 typeRef = new NameTypeReference(typeRef.get$isFinal(), typeRef.get$name(), n
ames, typeRef.get$span()); | 4155 typeRef = new NameTypeReference(typeRef.get$isFinal(), typeRef.get$name(), n
ames, typeRef.get$span()); |
| 4152 } | 4156 } |
| 4153 var type = this.method.resolveType(typeRef, true); | 4157 var type = this.method.resolveType$2(typeRef, true); |
| 4154 if (type.get$isTop()) { | 4158 if (type.get$isTop()) { |
| 4155 type = type.get$library().findTypeByName$1(constructorName); | 4159 type = type.get$library().findTypeByName$1(constructorName); |
| 4156 constructorName = ""; | 4160 constructorName = ""; |
| 4157 } | 4161 } |
| 4158 if ((type instanceof ParameterType)) { | 4162 if ((type instanceof ParameterType)) { |
| 4159 $globals.world.error("cannot instantiate a type parameter", node.span); | 4163 $globals.world.error("cannot instantiate a type parameter", node.span); |
| 4160 return this._makeMissingValue(constructorName); | 4164 return this._makeMissingValue(constructorName); |
| 4161 } | 4165 } |
| 4162 var m = type.getConstructor$1(constructorName); | 4166 var m = type.getConstructor$1(constructorName); |
| 4163 if (m == null) { | 4167 if (m == null) { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 4181 } | 4185 } |
| 4182 } | 4186 } |
| 4183 var target = new Value.type$ctor(type, typeRef.get$span()); | 4187 var target = new Value.type$ctor(type, typeRef.get$span()); |
| 4184 return m.invoke$4(this, node, target, this._makeArgs(node.arguments)); | 4188 return m.invoke$4(this, node, target, this._makeArgs(node.arguments)); |
| 4185 } | 4189 } |
| 4186 MethodGenerator.prototype.visitListExpression = function(node) { | 4190 MethodGenerator.prototype.visitListExpression = function(node) { |
| 4187 var argValues = []; | 4191 var argValues = []; |
| 4188 var listType = $globals.world.listType; | 4192 var listType = $globals.world.listType; |
| 4189 var type = $globals.world.varType; | 4193 var type = $globals.world.varType; |
| 4190 if (node.itemType != null) { | 4194 if (node.itemType != null) { |
| 4191 type = this.method.resolveType(node.itemType, true); | 4195 type = this.method.resolveType$2(node.itemType, true); |
| 4192 if (node.isConst && ((type instanceof ParameterType) || type.get$hasTypePara
ms())) { | 4196 if (node.isConst && ((type instanceof ParameterType) || type.get$hasTypePara
ms())) { |
| 4193 $globals.world.error("type parameter cannot be used in const list literals
"); | 4197 $globals.world.error("type parameter cannot be used in const list literals
"); |
| 4194 } | 4198 } |
| 4195 listType = listType.getOrMakeConcreteType$1([type]); | 4199 listType = listType.getOrMakeConcreteType$1([type]); |
| 4196 } | 4200 } |
| 4197 var $$list = node.values; | 4201 var $$list = node.values; |
| 4198 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 4202 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 4199 var item = $$list.$index($$i); | 4203 var item = $$list.$index($$i); |
| 4200 var arg = this.visitTypedValue(item, type); | 4204 var arg = this.visitTypedValue(item, type); |
| 4201 argValues.add$1(arg); | 4205 argValues.add$1(arg); |
| 4202 if (node.isConst && !arg.get$isConst()) { | 4206 if (node.isConst && !arg.get$isConst()) { |
| 4203 $globals.world.error("const list can only contain const values", arg.get$s
pan()); | 4207 $globals.world.error("const list can only contain const values", arg.get$s
pan()); |
| 4204 } | 4208 } |
| 4205 } | 4209 } |
| 4206 $globals.world.listFactoryType.markUsed(); | 4210 $globals.world.listFactoryType.markUsed(); |
| 4207 var ret = new ListValue(argValues, node.isConst, listType, node.span); | 4211 var ret = new ListValue(argValues, node.isConst, listType, node.span); |
| 4208 if (ret.get$isConst()) return ret.getGlobalValue$0(); | 4212 if (ret.get$isConst()) return ret.getGlobalValue$0(); |
| 4209 return ret; | 4213 return ret; |
| 4210 } | 4214 } |
| 4211 MethodGenerator.prototype.visitMapExpression = function(node) { | 4215 MethodGenerator.prototype.visitMapExpression = function(node) { |
| 4212 if (node.items.get$length() == (0) && !node.isConst) { | 4216 if (node.items.get$length() == (0) && !node.isConst) { |
| 4213 return $globals.world.mapType.getConstructor("").invoke$4(this, node, new Va
lue.type$ctor($globals.world.mapType, node.span), Arguments.get$EMPTY()); | 4217 return $globals.world.mapType.getConstructor("").invoke$4(this, node, new Va
lue.type$ctor($globals.world.mapType, node.span), Arguments.get$EMPTY()); |
| 4214 } | 4218 } |
| 4215 var values = []; | 4219 var values = []; |
| 4216 var valueType = $globals.world.varType, keyType = $globals.world.stringType; | 4220 var valueType = $globals.world.varType, keyType = $globals.world.stringType; |
| 4217 var mapType = $globals.world.mapType; | 4221 var mapType = $globals.world.mapType; |
| 4218 if (node.valueType != null) { | 4222 if (node.valueType != null) { |
| 4219 if (node.keyType != null) { | 4223 if (node.keyType != null) { |
| 4220 keyType = this.method.resolveType(node.keyType, true); | 4224 keyType = this.method.resolveType$2(node.keyType, true); |
| 4221 if (!keyType.get$isString()) { | 4225 if (!keyType.get$isString()) { |
| 4222 $globals.world.error("the key type of a map literal must be \"String\"",
keyType.get$span()); | 4226 $globals.world.error("the key type of a map literal must be \"String\"",
keyType.get$span()); |
| 4223 } | 4227 } |
| 4224 if (node.isConst && ((keyType instanceof ParameterType) || keyType.get$has
TypeParams())) { | 4228 if (node.isConst && ((keyType instanceof ParameterType) || keyType.get$has
TypeParams())) { |
| 4225 $globals.world.error("type parameter cannot be used in const map literal
s"); | 4229 $globals.world.error("type parameter cannot be used in const map literal
s"); |
| 4226 } | 4230 } |
| 4227 } | 4231 } |
| 4228 valueType = this.method.resolveType(node.valueType, true); | 4232 valueType = this.method.resolveType$2(node.valueType, true); |
| 4229 if (node.isConst && ((valueType instanceof ParameterType) || valueType.get$h
asTypeParams())) { | 4233 if (node.isConst && ((valueType instanceof ParameterType) || valueType.get$h
asTypeParams())) { |
| 4230 $globals.world.error("type parameter cannot be used in const map literals"
); | 4234 $globals.world.error("type parameter cannot be used in const map literals"
); |
| 4231 } | 4235 } |
| 4232 mapType = mapType.getOrMakeConcreteType$1([keyType, valueType]); | 4236 mapType = mapType.getOrMakeConcreteType$1([keyType, valueType]); |
| 4233 } | 4237 } |
| 4234 for (var i = (0); | 4238 for (var i = (0); |
| 4235 i < node.items.get$length(); i += (2)) { | 4239 i < node.items.get$length(); i += (2)) { |
| 4236 var key = this.visitTypedValue(node.items.$index(i), keyType); | 4240 var key = this.visitTypedValue(node.items.$index(i), keyType); |
| 4237 if (node.isConst && !key.get$isConst()) { | 4241 if (node.isConst && !key.get$isConst()) { |
| 4238 $globals.world.error("const map can only contain const keys", key.get$span
()); | 4242 $globals.world.error("const map can only contain const keys", key.get$span
()); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 4250 } | 4254 } |
| 4251 MethodGenerator.prototype.visitConditionalExpression = function(node) { | 4255 MethodGenerator.prototype.visitConditionalExpression = function(node) { |
| 4252 var test = this.visitBool(node.test); | 4256 var test = this.visitBool(node.test); |
| 4253 var trueBranch = this.visitValue(node.trueBranch); | 4257 var trueBranch = this.visitValue(node.trueBranch); |
| 4254 var falseBranch = this.visitValue(node.falseBranch); | 4258 var falseBranch = this.visitValue(node.falseBranch); |
| 4255 var code = ("" + test.get$code() + " ? " + trueBranch.get$code() + " : " + fal
seBranch.get$code()); | 4259 var code = ("" + test.get$code() + " ? " + trueBranch.get$code() + " : " + fal
seBranch.get$code()); |
| 4256 return new Value(Type.union(trueBranch.get$type(), falseBranch.get$type()), co
de, node.span, true); | 4260 return new Value(Type.union(trueBranch.get$type(), falseBranch.get$type()), co
de, node.span, true); |
| 4257 } | 4261 } |
| 4258 MethodGenerator.prototype.visitIsExpression = function(node) { | 4262 MethodGenerator.prototype.visitIsExpression = function(node) { |
| 4259 var value = this.visitValue(node.x); | 4263 var value = this.visitValue(node.x); |
| 4260 var type = this.method.resolveType(node.type, false); | 4264 var type = this.method.resolveType$2(node.type, false); |
| 4261 return value.instanceOf$4(this, type, node.span, node.isTrue); | 4265 return value.instanceOf$4(this, type, node.span, node.isTrue); |
| 4262 } | 4266 } |
| 4263 MethodGenerator.prototype.visitParenExpression = function(node) { | 4267 MethodGenerator.prototype.visitParenExpression = function(node) { |
| 4264 var body = this.visitValue(node.body); | 4268 var body = this.visitValue(node.body); |
| 4265 if (body.get$isConst()) return body; | 4269 if (body.get$isConst()) return body; |
| 4266 return new Value(body.get$type(), ("(" + body.get$code() + ")"), node.span, tr
ue); | 4270 return new Value(body.get$type(), ("(" + body.get$code() + ")"), node.span, tr
ue); |
| 4267 } | 4271 } |
| 4268 MethodGenerator.prototype.visitDotExpression = function(node) { | 4272 MethodGenerator.prototype.visitDotExpression = function(node) { |
| 4269 var target = node.self.visit(this); | 4273 var target = node.self.visit(this); |
| 4270 return target.get_$3(this, node.name.name, node.name); | 4274 return target.get_$3(this, node.name.name, node.name); |
| (...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4844 Library.prototype.hashCode = function() { | 4848 Library.prototype.hashCode = function() { |
| 4845 return this.baseSource.filename.hashCode(); | 4849 return this.baseSource.filename.hashCode(); |
| 4846 } | 4850 } |
| 4847 Library.prototype.$eq = function(other) { | 4851 Library.prototype.$eq = function(other) { |
| 4848 return (other instanceof Library) && $eq(other.get$baseSource().get$filename()
, this.baseSource.filename); | 4852 return (other instanceof Library) && $eq(other.get$baseSource().get$filename()
, this.baseSource.filename); |
| 4849 } | 4853 } |
| 4850 Library.prototype.findTypeByName$1 = Library.prototype.findTypeByName; | 4854 Library.prototype.findTypeByName$1 = Library.prototype.findTypeByName; |
| 4851 Library.prototype.hashCode$0 = Library.prototype.hashCode; | 4855 Library.prototype.hashCode$0 = Library.prototype.hashCode; |
| 4852 Library.prototype.postResolveChecks$0 = Library.prototype.postResolveChecks; | 4856 Library.prototype.postResolveChecks$0 = Library.prototype.postResolveChecks; |
| 4853 Library.prototype.resolve$0 = Library.prototype.resolve; | 4857 Library.prototype.resolve$0 = Library.prototype.resolve; |
| 4858 Library.prototype.resolveType$2 = Library.prototype.resolveType; |
| 4854 Library.prototype.toString$0 = Library.prototype.toString; | 4859 Library.prototype.toString$0 = Library.prototype.toString; |
| 4855 Library.prototype.visitSources$0 = Library.prototype.visitSources; | 4860 Library.prototype.visitSources$0 = Library.prototype.visitSources; |
| 4856 // ********** Code for _LibraryVisitor ************** | 4861 // ********** Code for _LibraryVisitor ************** |
| 4857 function _LibraryVisitor(library) { | 4862 function _LibraryVisitor(library) { |
| 4858 this.library = library; | 4863 this.library = library; |
| 4859 this.isTop = true; | 4864 this.isTop = true; |
| 4860 this.seenSource = false; | 4865 this.seenSource = false; |
| 4861 this.seenResource = false; | 4866 this.seenResource = false; |
| 4862 this.seenImport = false; | 4867 this.seenImport = false; |
| 4863 this.currentType = this.library.topType; | 4868 this.currentType = this.library.topType; |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5061 Parameter.prototype.get$isInitializer = function() { return this.isInitializer;
}; | 5066 Parameter.prototype.get$isInitializer = function() { return this.isInitializer;
}; |
| 5062 Parameter.prototype.set$isInitializer = function(value) { return this.isInitiali
zer = value; }; | 5067 Parameter.prototype.set$isInitializer = function(value) { return this.isInitiali
zer = value; }; |
| 5063 Parameter.prototype.get$value = function() { return this.value; }; | 5068 Parameter.prototype.get$value = function() { return this.value; }; |
| 5064 Parameter.prototype.set$value = function(value) { return this.value = value; }; | 5069 Parameter.prototype.set$value = function(value) { return this.value = value; }; |
| 5065 Parameter.prototype.resolve = function() { | 5070 Parameter.prototype.resolve = function() { |
| 5066 this.name = this.definition.name.name; | 5071 this.name = this.definition.name.name; |
| 5067 if (this.name.startsWith("this.")) { | 5072 if (this.name.startsWith("this.")) { |
| 5068 this.name = this.name.substring((5)); | 5073 this.name = this.name.substring((5)); |
| 5069 this.isInitializer = true; | 5074 this.isInitializer = true; |
| 5070 } | 5075 } |
| 5071 this.type = this.method.resolveType(this.definition.type, false); | 5076 this.type = this.method.resolveType$2(this.definition.type, false); |
| 5072 if (this.definition.value != null) { | 5077 if (this.definition.value != null) { |
| 5073 if (!this.get$hasDefaultValue()) return; | 5078 if (!this.get$hasDefaultValue()) return; |
| 5074 if (this.method.name == ":call") { | 5079 if (this.method.name == ":call") { |
| 5075 if (this.method.get$definition().get$body() == null && !this.method.get$is
Native()) { | 5080 if (this.method.get$definition().get$body() == null && !this.method.get$is
Native()) { |
| 5076 $globals.world.error("default value not allowed on function type", this.
definition.span); | 5081 $globals.world.error("default value not allowed on function type", this.
definition.span); |
| 5077 } | 5082 } |
| 5078 } | 5083 } |
| 5079 else if (this.method.get$isAbstract()) { | 5084 else if (this.method.get$isAbstract()) { |
| 5080 $globals.world.error("default value not allowed on abstract methods", this
.definition.span); | 5085 $globals.world.error("default value not allowed on abstract methods", this
.definition.span); |
| 5081 } | 5086 } |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5535 ConcreteMember.prototype.get$definition = function() { | 5540 ConcreteMember.prototype.get$definition = function() { |
| 5536 return this.baseMember.get$definition(); | 5541 return this.baseMember.get$definition(); |
| 5537 } | 5542 } |
| 5538 ConcreteMember.prototype.get$initDelegate = function() { | 5543 ConcreteMember.prototype.get$initDelegate = function() { |
| 5539 return this.baseMember.get$initDelegate(); | 5544 return this.baseMember.get$initDelegate(); |
| 5540 } | 5545 } |
| 5541 ConcreteMember.prototype.set$initDelegate = function(ctor) { | 5546 ConcreteMember.prototype.set$initDelegate = function(ctor) { |
| 5542 this.baseMember.set$initDelegate(ctor); | 5547 this.baseMember.set$initDelegate(ctor); |
| 5543 } | 5548 } |
| 5544 ConcreteMember.prototype.resolveType = function(node, isRequired) { | 5549 ConcreteMember.prototype.resolveType = function(node, isRequired) { |
| 5545 var type = this.baseMember.resolveType(node, isRequired); | 5550 var type = this.baseMember.resolveType$2(node, isRequired); |
| 5546 return type.resolveTypeParams$1(this.declaringType); | 5551 return type.resolveTypeParams$1(this.declaringType); |
| 5547 } | 5552 } |
| 5548 ConcreteMember.prototype.computeValue = function() { | 5553 ConcreteMember.prototype.computeValue = function() { |
| 5549 return this.baseMember.computeValue(); | 5554 return this.baseMember.computeValue(); |
| 5550 } | 5555 } |
| 5551 ConcreteMember.prototype.override = function(other) { | 5556 ConcreteMember.prototype.override = function(other) { |
| 5552 return this.baseMember.override(other); | 5557 return this.baseMember.override(other); |
| 5553 } | 5558 } |
| 5554 ConcreteMember.prototype._get = function(context, node, target, isDynamic) { | 5559 ConcreteMember.prototype._get = function(context, node, target, isDynamic) { |
| 5555 var ret = this.baseMember._get(context, node, target, isDynamic); | 5560 var ret = this.baseMember._get(context, node, target, isDynamic); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 5586 ConcreteMember.prototype._set$5 = ConcreteMember.prototype._set; | 5591 ConcreteMember.prototype._set$5 = ConcreteMember.prototype._set; |
| 5587 ConcreteMember.prototype.canInvoke$2 = ConcreteMember.prototype.canInvoke; | 5592 ConcreteMember.prototype.canInvoke$2 = ConcreteMember.prototype.canInvoke; |
| 5588 ConcreteMember.prototype.computeValue$0 = ConcreteMember.prototype.computeValue; | 5593 ConcreteMember.prototype.computeValue$0 = ConcreteMember.prototype.computeValue; |
| 5589 ConcreteMember.prototype.invoke$4 = function($0, $1, $2, $3) { | 5594 ConcreteMember.prototype.invoke$4 = function($0, $1, $2, $3) { |
| 5590 return this.invoke($0, $1, $2, $3, false); | 5595 return this.invoke($0, $1, $2, $3, false); |
| 5591 }; | 5596 }; |
| 5592 ConcreteMember.prototype.invoke$4$isDynamic = ConcreteMember.prototype.invoke; | 5597 ConcreteMember.prototype.invoke$4$isDynamic = ConcreteMember.prototype.invoke; |
| 5593 ConcreteMember.prototype.invoke$5 = ConcreteMember.prototype.invoke; | 5598 ConcreteMember.prototype.invoke$5 = ConcreteMember.prototype.invoke; |
| 5594 ConcreteMember.prototype.provideFieldSyntax$0 = ConcreteMember.prototype.provide
FieldSyntax; | 5599 ConcreteMember.prototype.provideFieldSyntax$0 = ConcreteMember.prototype.provide
FieldSyntax; |
| 5595 ConcreteMember.prototype.providePropertySyntax$0 = ConcreteMember.prototype.prov
idePropertySyntax; | 5600 ConcreteMember.prototype.providePropertySyntax$0 = ConcreteMember.prototype.prov
idePropertySyntax; |
| 5601 ConcreteMember.prototype.resolveType$2 = ConcreteMember.prototype.resolveType; |
| 5596 // ********** Code for MethodMember ************** | 5602 // ********** Code for MethodMember ************** |
| 5597 $inherits(MethodMember, Member); | 5603 $inherits(MethodMember, Member); |
| 5598 function MethodMember(name, declaringType, definition) { | 5604 function MethodMember(name, declaringType, definition) { |
| 5599 this.isLambda = false; | 5605 this.isLambda = false; |
| 5600 this._provideOptionalParamInfo = false; | 5606 this._provideOptionalParamInfo = false; |
| 5601 this.isFactory = false; | 5607 this.isFactory = false; |
| 5602 this.definition = definition; | 5608 this.definition = definition; |
| 5603 this.isConst = false; | 5609 this.isConst = false; |
| 5604 this.isAbstract = false; | 5610 this.isAbstract = false; |
| 5605 this.isStatic = false; | 5611 this.isStatic = false; |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6056 } | 6062 } |
| 6057 else { | 6063 else { |
| 6058 if (this.definition.body == null && !this.get$isConstructor() && !this.get$i
sNative()) { | 6064 if (this.definition.body == null && !this.get$isConstructor() && !this.get$i
sNative()) { |
| 6059 $globals.world.error("method needs a body", this.get$span()); | 6065 $globals.world.error("method needs a body", this.get$span()); |
| 6060 } | 6066 } |
| 6061 } | 6067 } |
| 6062 if (this.get$isConstructor() && !this.isFactory) { | 6068 if (this.get$isConstructor() && !this.isFactory) { |
| 6063 this.returnType = this.declaringType; | 6069 this.returnType = this.declaringType; |
| 6064 } | 6070 } |
| 6065 else { | 6071 else { |
| 6066 this.returnType = this.resolveType(this.definition.returnType, false); | 6072 this.returnType = this.resolveType(this.definition.returnType, false, true); |
| 6067 } | 6073 } |
| 6068 this.parameters = []; | 6074 this.parameters = []; |
| 6069 var $$list = this.definition.formals; | 6075 var $$list = this.definition.formals; |
| 6070 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 6076 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 6071 var formal = $$list.$index($$i); | 6077 var formal = $$list.$index($$i); |
| 6072 var param = new Parameter(formal, this); | 6078 var param = new Parameter(formal, this); |
| 6073 param.resolve$0(); | 6079 param.resolve$0(); |
| 6074 this.parameters.add(param); | 6080 this.parameters.add(param); |
| 6075 } | 6081 } |
| 6076 if (!this.isLambda) { | 6082 if (!this.isLambda) { |
| 6077 this.get$library()._addMember(this); | 6083 this.get$library()._addMember(this); |
| 6078 } | 6084 } |
| 6079 } | 6085 } |
| 6080 MethodMember.prototype.resolveType = function(node, typeErrors) { | 6086 MethodMember.prototype.resolveType = function(node, typeErrors, allowVoid) { |
| 6081 var t = Element.prototype.resolveType.call(this, node, typeErrors); | 6087 var t = Element.prototype.resolveType.call(this, node, typeErrors); |
| 6082 if (this.isStatic && !this.isFactory && (t instanceof ParameterType)) { | 6088 if (this.isStatic && !this.isFactory && (t instanceof ParameterType)) { |
| 6083 $globals.world.error("using type parameter in static context.", node.span); | 6089 $globals.world.error("using type parameter in static context.", node.span); |
| 6084 } | 6090 } |
| 6091 if (!allowVoid && t.get$isVoid()) { |
| 6092 $globals.world.error("\"void\" only allowed as return type", node.span); |
| 6093 } |
| 6085 return t; | 6094 return t; |
| 6086 } | 6095 } |
| 6087 MethodMember.prototype._evalConstConstructor$2 = MethodMember.prototype._evalCon
stConstructor; | 6096 MethodMember.prototype._evalConstConstructor$2 = MethodMember.prototype._evalCon
stConstructor; |
| 6088 MethodMember.prototype._get$3 = function($0, $1, $2) { | 6097 MethodMember.prototype._get$3 = function($0, $1, $2) { |
| 6089 return this._get($0, $1, $2, false); | 6098 return this._get($0, $1, $2, false); |
| 6090 }; | 6099 }; |
| 6091 MethodMember.prototype._get$3$isDynamic = MethodMember.prototype._get; | 6100 MethodMember.prototype._get$3$isDynamic = MethodMember.prototype._get; |
| 6092 MethodMember.prototype._get$4 = MethodMember.prototype._get; | 6101 MethodMember.prototype._get$4 = MethodMember.prototype._get; |
| 6093 MethodMember.prototype._set$4 = function($0, $1, $2, $3) { | 6102 MethodMember.prototype._set$4 = function($0, $1, $2, $3) { |
| 6094 return this._set($0, $1, $2, $3, false); | 6103 return this._set($0, $1, $2, $3, false); |
| 6095 }; | 6104 }; |
| 6096 MethodMember.prototype._set$4$isDynamic = MethodMember.prototype._set; | 6105 MethodMember.prototype._set$4$isDynamic = MethodMember.prototype._set; |
| 6097 MethodMember.prototype._set$5 = MethodMember.prototype._set; | 6106 MethodMember.prototype._set$5 = MethodMember.prototype._set; |
| 6098 MethodMember.prototype.canInvoke$2 = MethodMember.prototype.canInvoke; | 6107 MethodMember.prototype.canInvoke$2 = MethodMember.prototype.canInvoke; |
| 6099 MethodMember.prototype.invoke$4 = function($0, $1, $2, $3) { | 6108 MethodMember.prototype.invoke$4 = function($0, $1, $2, $3) { |
| 6100 return this.invoke($0, $1, $2, $3, false); | 6109 return this.invoke($0, $1, $2, $3, false); |
| 6101 }; | 6110 }; |
| 6102 MethodMember.prototype.invoke$4$isDynamic = MethodMember.prototype.invoke; | 6111 MethodMember.prototype.invoke$4$isDynamic = MethodMember.prototype.invoke; |
| 6103 MethodMember.prototype.invoke$5 = MethodMember.prototype.invoke; | 6112 MethodMember.prototype.invoke$5 = MethodMember.prototype.invoke; |
| 6104 MethodMember.prototype.namesInOrder$1 = MethodMember.prototype.namesInOrder; | 6113 MethodMember.prototype.namesInOrder$1 = MethodMember.prototype.namesInOrder; |
| 6105 MethodMember.prototype.provideFieldSyntax$0 = MethodMember.prototype.provideFiel
dSyntax; | 6114 MethodMember.prototype.provideFieldSyntax$0 = MethodMember.prototype.provideFiel
dSyntax; |
| 6106 MethodMember.prototype.providePropertySyntax$0 = MethodMember.prototype.provideP
ropertySyntax; | 6115 MethodMember.prototype.providePropertySyntax$0 = MethodMember.prototype.provideP
ropertySyntax; |
| 6107 MethodMember.prototype.resolve$0 = MethodMember.prototype.resolve; | 6116 MethodMember.prototype.resolve$0 = MethodMember.prototype.resolve; |
| 6117 MethodMember.prototype.resolveType$2 = function($0, $1) { |
| 6118 return this.resolveType($0, $1, false); |
| 6119 }; |
| 6108 // ********** Code for MemberSet ************** | 6120 // ********** Code for MemberSet ************** |
| 6109 function MemberSet(member, isVar) { | 6121 function MemberSet(member, isVar) { |
| 6110 this.jsname = member.get$jsname(); | 6122 this.jsname = member.get$jsname(); |
| 6111 this.name = member.name; | 6123 this.name = member.name; |
| 6112 this.isVar = isVar; | 6124 this.isVar = isVar; |
| 6113 this.members = [member]; | 6125 this.members = [member]; |
| 6114 } | 6126 } |
| 6115 MemberSet.prototype.get$name = function() { return this.name; }; | 6127 MemberSet.prototype.get$name = function() { return this.name; }; |
| 6116 MemberSet.prototype.get$members = function() { return this.members; }; | 6128 MemberSet.prototype.get$members = function() { return this.members; }; |
| 6117 MemberSet.prototype.get$jsname = function() { return this.jsname; }; | 6129 MemberSet.prototype.get$jsname = function() { return this.jsname; }; |
| (...skipping 3378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9496 if (kind == (3) || kind == (1)) { | 9508 if (kind == (3) || kind == (1)) { |
| 9497 this._afterParens.$setindex(saved, this._peekToken); | 9509 this._afterParens.$setindex(saved, this._peekToken); |
| 9498 return; | 9510 return; |
| 9499 } | 9511 } |
| 9500 else if (kind == (2)) { | 9512 else if (kind == (2)) { |
| 9501 this._lookaheadAfterParens(tokens); | 9513 this._lookaheadAfterParens(tokens); |
| 9502 } | 9514 } |
| 9503 } | 9515 } |
| 9504 } | 9516 } |
| 9505 Parser.prototype._typeAsIdentifier = function(type) { | 9517 Parser.prototype._typeAsIdentifier = function(type) { |
| 9518 if ($eq(type.get$name().get$name(), "void")) { |
| 9519 this._errorExpected(("identifer, but found \"" + type.get$name().get$name()
+ "\"")); |
| 9520 } |
| 9506 return type.get$name(); | 9521 return type.get$name(); |
| 9507 } | 9522 } |
| 9508 Parser.prototype._specialIdentifier = function(includeOperators) { | 9523 Parser.prototype._specialIdentifier = function(includeOperators) { |
| 9509 var start = this._peekToken.start; | 9524 var start = this._peekToken.start; |
| 9510 var name; | 9525 var name; |
| 9511 switch (this._peek()) { | 9526 switch (this._peek()) { |
| 9512 case (15): | 9527 case (15): |
| 9513 | 9528 |
| 9514 this._eat((15)); | 9529 this._eat((15)); |
| 9515 this._lang_error("rest no longer supported", this._previousToken.get$span(
)); | 9530 this._lang_error("rest no longer supported", this._previousToken.get$span(
)); |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9884 } | 9899 } |
| 9885 Parser.prototype._makeFunction = function(expr, formals, body) { | 9900 Parser.prototype._makeFunction = function(expr, formals, body) { |
| 9886 var name, type; | 9901 var name, type; |
| 9887 if ((expr instanceof VarExpression)) { | 9902 if ((expr instanceof VarExpression)) { |
| 9888 name = expr.get$name(); | 9903 name = expr.get$name(); |
| 9889 type = null; | 9904 type = null; |
| 9890 } | 9905 } |
| 9891 else if ((expr instanceof DeclaredIdentifier)) { | 9906 else if ((expr instanceof DeclaredIdentifier)) { |
| 9892 name = expr.get$name(); | 9907 name = expr.get$name(); |
| 9893 type = expr.get$type(); | 9908 type = expr.get$type(); |
| 9909 if (name == null) { |
| 9910 this._lang_error("expected name and type", expr.get$span()); |
| 9911 } |
| 9894 } | 9912 } |
| 9895 else { | 9913 else { |
| 9896 this._lang_error("bad function body", expr.get$span()); | 9914 this._lang_error("bad function body", expr.get$span()); |
| 9897 } | 9915 } |
| 9898 var span = new SourceSpan(expr.get$span().get$file(), expr.get$span().get$star
t(), body.get$span().get$end()); | 9916 var span = new SourceSpan(expr.get$span().get$file(), expr.get$span().get$star
t(), body.get$span().get$end()); |
| 9899 var func = new FunctionDefinition(null, type, name, formals, null, null, body,
span); | 9917 var func = new FunctionDefinition(null, type, name, formals, null, null, body,
span); |
| 9900 return new LambdaExpression(func, func.get$span()); | 9918 return new LambdaExpression(func, func.get$span()); |
| 9901 } | 9919 } |
| 9902 Parser.prototype._makeDeclaredIdentifier = function(e) { | 9920 Parser.prototype._makeDeclaredIdentifier = function(e) { |
| 9903 if ((e instanceof VarExpression)) { | 9921 if ((e instanceof VarExpression)) { |
| (...skipping 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11112 $globals.world.internalError("no concrete types of type parameters yet", this.
get$span()); | 11130 $globals.world.internalError("no concrete types of type parameters yet", this.
get$span()); |
| 11113 } | 11131 } |
| 11114 ParameterType.prototype.resolveTypeParams = function(inType) { | 11132 ParameterType.prototype.resolveTypeParams = function(inType) { |
| 11115 return inType.typeArguments.$index(this.name); | 11133 return inType.typeArguments.$index(this.name); |
| 11116 } | 11134 } |
| 11117 ParameterType.prototype.addDirectSubtype = function(type) { | 11135 ParameterType.prototype.addDirectSubtype = function(type) { |
| 11118 $globals.world.internalError("no subtypes of type parameters yet", this.get$sp
an()); | 11136 $globals.world.internalError("no subtypes of type parameters yet", this.get$sp
an()); |
| 11119 } | 11137 } |
| 11120 ParameterType.prototype.resolve = function() { | 11138 ParameterType.prototype.resolve = function() { |
| 11121 if (this.typeParameter.extendsType != null) { | 11139 if (this.typeParameter.extendsType != null) { |
| 11122 this.extendsType = this.get$enclosingElement().resolveType(this.typeParamete
r.extendsType, true); | 11140 this.extendsType = this.get$enclosingElement().resolveType$2(this.typeParame
ter.extendsType, true); |
| 11123 } | 11141 } |
| 11124 else { | 11142 else { |
| 11125 this.extendsType = $globals.world.objectType; | 11143 this.extendsType = $globals.world.objectType; |
| 11126 } | 11144 } |
| 11127 } | 11145 } |
| 11128 ParameterType.prototype.addDirectSubtype$1 = ParameterType.prototype.addDirectSu
btype; | 11146 ParameterType.prototype.addDirectSubtype$1 = ParameterType.prototype.addDirectSu
btype; |
| 11129 ParameterType.prototype.getConstructor$1 = ParameterType.prototype.getConstructo
r; | 11147 ParameterType.prototype.getConstructor$1 = ParameterType.prototype.getConstructo
r; |
| 11130 ParameterType.prototype.getOrMakeConcreteType$1 = ParameterType.prototype.getOrM
akeConcreteType; | 11148 ParameterType.prototype.getOrMakeConcreteType$1 = ParameterType.prototype.getOrM
akeConcreteType; |
| 11131 ParameterType.prototype.isSubtypeOf$1 = ParameterType.prototype.isSubtypeOf; | 11149 ParameterType.prototype.isSubtypeOf$1 = ParameterType.prototype.isSubtypeOf; |
| 11132 ParameterType.prototype.resolve$0 = ParameterType.prototype.resolve; | 11150 ParameterType.prototype.resolve$0 = ParameterType.prototype.resolve; |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11234 NonNullableType.prototype.get$isNative = function() { | 11252 NonNullableType.prototype.get$isNative = function() { |
| 11235 return this.type.get$isNative(); | 11253 return this.type.get$isNative(); |
| 11236 } | 11254 } |
| 11237 NonNullableType.prototype.addDirectSubtype$1 = NonNullableType.prototype.addDire
ctSubtype; | 11255 NonNullableType.prototype.addDirectSubtype$1 = NonNullableType.prototype.addDire
ctSubtype; |
| 11238 NonNullableType.prototype.getConstructor$1 = NonNullableType.prototype.getConstr
uctor; | 11256 NonNullableType.prototype.getConstructor$1 = NonNullableType.prototype.getConstr
uctor; |
| 11239 NonNullableType.prototype.getFactory$2 = NonNullableType.prototype.getFactory; | 11257 NonNullableType.prototype.getFactory$2 = NonNullableType.prototype.getFactory; |
| 11240 NonNullableType.prototype.getMember$1 = NonNullableType.prototype.getMember; | 11258 NonNullableType.prototype.getMember$1 = NonNullableType.prototype.getMember; |
| 11241 NonNullableType.prototype.getOrMakeConcreteType$1 = NonNullableType.prototype.ge
tOrMakeConcreteType; | 11259 NonNullableType.prototype.getOrMakeConcreteType$1 = NonNullableType.prototype.ge
tOrMakeConcreteType; |
| 11242 NonNullableType.prototype.isSubtypeOf$1 = NonNullableType.prototype.isSubtypeOf; | 11260 NonNullableType.prototype.isSubtypeOf$1 = NonNullableType.prototype.isSubtypeOf; |
| 11243 NonNullableType.prototype.markUsed$0 = NonNullableType.prototype.markUsed; | 11261 NonNullableType.prototype.markUsed$0 = NonNullableType.prototype.markUsed; |
| 11262 NonNullableType.prototype.resolveType$2 = NonNullableType.prototype.resolveType; |
| 11244 NonNullableType.prototype.resolveTypeParams$1 = NonNullableType.prototype.resolv
eTypeParams; | 11263 NonNullableType.prototype.resolveTypeParams$1 = NonNullableType.prototype.resolv
eTypeParams; |
| 11245 // ********** Code for ConcreteType ************** | 11264 // ********** Code for ConcreteType ************** |
| 11246 $inherits(ConcreteType, Type); | 11265 $inherits(ConcreteType, Type); |
| 11247 function ConcreteType(name, genericType, typeArguments, typeArgsInOrder) { | 11266 function ConcreteType(name, genericType, typeArguments, typeArgsInOrder) { |
| 11248 this.isUsed = false; | 11267 this.isUsed = false; |
| 11249 this.constructors = new HashMapImplementation(); | 11268 this.constructors = new HashMapImplementation(); |
| 11250 this.genericType = genericType; | 11269 this.genericType = genericType; |
| 11251 this.factories = new FactoryMap(); | 11270 this.factories = new FactoryMap(); |
| 11252 this.members = new HashMapImplementation(); | 11271 this.members = new HashMapImplementation(); |
| 11253 this.typeArguments = typeArguments; | 11272 this.typeArguments = typeArguments; |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11402 } | 11421 } |
| 11403 ConcreteType.prototype.addDirectSubtype = function(type) { | 11422 ConcreteType.prototype.addDirectSubtype = function(type) { |
| 11404 this.genericType.addDirectSubtype(type); | 11423 this.genericType.addDirectSubtype(type); |
| 11405 } | 11424 } |
| 11406 ConcreteType.prototype.addDirectSubtype$1 = ConcreteType.prototype.addDirectSubt
ype; | 11425 ConcreteType.prototype.addDirectSubtype$1 = ConcreteType.prototype.addDirectSubt
ype; |
| 11407 ConcreteType.prototype.getConstructor$1 = ConcreteType.prototype.getConstructor; | 11426 ConcreteType.prototype.getConstructor$1 = ConcreteType.prototype.getConstructor; |
| 11408 ConcreteType.prototype.getFactory$2 = ConcreteType.prototype.getFactory; | 11427 ConcreteType.prototype.getFactory$2 = ConcreteType.prototype.getFactory; |
| 11409 ConcreteType.prototype.getMember$1 = ConcreteType.prototype.getMember; | 11428 ConcreteType.prototype.getMember$1 = ConcreteType.prototype.getMember; |
| 11410 ConcreteType.prototype.getOrMakeConcreteType$1 = ConcreteType.prototype.getOrMak
eConcreteType; | 11429 ConcreteType.prototype.getOrMakeConcreteType$1 = ConcreteType.prototype.getOrMak
eConcreteType; |
| 11411 ConcreteType.prototype.markUsed$0 = ConcreteType.prototype.markUsed; | 11430 ConcreteType.prototype.markUsed$0 = ConcreteType.prototype.markUsed; |
| 11431 ConcreteType.prototype.resolveType$2 = ConcreteType.prototype.resolveType; |
| 11412 ConcreteType.prototype.resolveTypeParams$1 = ConcreteType.prototype.resolveTypeP
arams; | 11432 ConcreteType.prototype.resolveTypeParams$1 = ConcreteType.prototype.resolveTypeP
arams; |
| 11413 // ********** Code for DefinedType ************** | 11433 // ********** Code for DefinedType ************** |
| 11414 $inherits(DefinedType, Type); | 11434 $inherits(DefinedType, Type); |
| 11415 function DefinedType(name, library, definition, isClass) { | 11435 function DefinedType(name, library, definition, isClass) { |
| 11416 this.isUsed = false; | 11436 this.isUsed = false; |
| 11417 this.directSubtypes = new HashSetImplementation(); | 11437 this.directSubtypes = new HashSetImplementation(); |
| 11418 this.isNative = false; | 11438 this.isNative = false; |
| 11419 this.library = library; | 11439 this.library = library; |
| 11420 this.isClass = isClass; | 11440 this.isClass = isClass; |
| 11421 this.constructors = new HashMapImplementation(); | 11441 this.constructors = new HashMapImplementation(); |
| (...skipping 2611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14033 $globals._RED_COLOR = "\x1b[31m"; | 14053 $globals._RED_COLOR = "\x1b[31m"; |
| 14034 } | 14054 } |
| 14035 var const$0000 = Object.create(EmptyQueueException.prototype, {}); | 14055 var const$0000 = Object.create(EmptyQueueException.prototype, {}); |
| 14036 var const$0001 = Object.create(_DeletedKeySentinel.prototype, {}); | 14056 var const$0001 = Object.create(_DeletedKeySentinel.prototype, {}); |
| 14037 var const$0005 = Object.create(NoMoreElementsException.prototype, {}); | 14057 var const$0005 = Object.create(NoMoreElementsException.prototype, {}); |
| 14038 var const$0007 = Object.create(IllegalAccessException.prototype, {}); | 14058 var const$0007 = Object.create(IllegalAccessException.prototype, {}); |
| 14039 var const$0008 = ImmutableList.ImmutableList$from$factory([]); | 14059 var const$0008 = ImmutableList.ImmutableList$from$factory([]); |
| 14040 var $globals = {}; | 14060 var $globals = {}; |
| 14041 $static_init(); | 14061 $static_init(); |
| 14042 main(); | 14062 main(); |
| OLD | NEW |